Cannot install node.js bindings

CXX(target) Release/obj.target/storjnodejs/libUplink.o
…/libUplink.cc:3:10: fatal error: uplink_definitions.h: No such file or directory
#include “uplink_definitions.h”
^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
storjnodejs.target.mk:115: recipe for target ‘Release/obj.target/storjnodejs/libUplink.o’ failed

I am facing that error while installing node.js bindings, any of you might know the reason and how to resolve it?

Hi @hanani8 - where are you running the build from? Are you installing from npm or git?

1 Like

Hello @hanani8,
Welcome to the forum!

I tried to install it and have no errors, only warnings
Used this version: https://github.com/storj/uplink-nodejs
Versions:

$ npm version
{ npm: '6.14.5',
  ares: '1.14.0',
  brotli: '1.0.7',
  cldr: '34.0',
  http_parser: '2.9.3',
  icu: '63.1',
  modules: '64',
  napi: '5',
  nghttp2: '1.39.2',
  node: '10.19.0',
  openssl: '1.1.1d',
  tz: '2018e',
  unicode: '11.0',
  uv: '1.24.1',
  v8: '6.8.275.32-node.55',
  zlib: '1.2.11' }

My GO

$ go version
go version go1.13.8 linux/amd64

npm, primarily. I started looking at installing it via git as well, based on an answer to some other query in the forum.

So, since, I have spent just one day or so exploring the product(Tinkered with uplink as well as gateway, both of them are working quite well), and being very short on time, I would like to clear out some things so that I can understand if tardigrade will be of any help to me.
I am working on a document-management system. Data security and access control is of high importance. Based on the documentation, I understand that tardigrade is well-equipped to handle this(correct me, if I am wrong).

Now, the task in front of me is I have a node.js application up and running, where documents right now are being stored in s3. I would like to move away from that to tardigrade. I was wondering, whether, right now, if that move can be made?

I was able to install the bindings btw, and tinkered around with it. Looks cool, for now. If someone from the dev team can answer the above query of mine, it would be great,

Hello - can you tell me a little more about your application and how it’s working with S3 today? I may be able to help, but if not get you in contact with someone who can.

Cool.
So, it is a document management system, built in node.js, and s3 is being used as a document storage. We are using pre-signed URLs to grant access to view and download documents to users, based on their creds in jwt tokens.

This product is for a industry which is highly regulated, and users are very weary about the confidentiality of their data. Even, the application makers shouldn’t be able to view the data.

So these are the constraints we are working with.

Moreover, it is good to presume the prospective users would not be tech-savvy, and would like everything to be done right from the application.

Is this an application or a browser-based app? The access management features for secure file sharing on the Tardigrade Platform are also worth exploring. You can abstract the complexity of access restrictions and encryption fairly easily.

It is a browser based application.

I am tinkering with the access management and rest. Right now, I am trying to generate access key with limited capabilities, seems to be working fine,except when I am navigating to “http://127.0.0.1:7777/minio/liberty”, it’s popping up “uplink: kvmetainfo: unable to find encryption base for: liberty/”" "

Hi @hanani8, are you able to share the code of the Tardigrade-based Node app that you’re experimenting with currently? If so, it would help us better diagnose the problem. Right now it’s hard to tell if it could be a problem with how the access was generated or something to do with the bindings. If you would rather not share publicly, you can also send the code in a support ticket and we can try to help you from there.
To your earlier question, yes Tardigrade would be a great alternative to S3 for an app that values data security and access control. We also might be able to determine how to better support your particular use case if you want to email more details of your project to partnerships@tardigrade.io.

2 Likes

@nat Sure, I will send a mail to partnerships@tardigrade.io.

The code for Node app I am working with:

const fs = require("fs");

//include the Node.js-Storj bindings module
var storj = require("./libUplinkNode.js");
// object for all the function for uplink
var libUplink = storj.storj_nodejs;
//
const BUFFER_SIZE = 80000;
//
const RETRY_MAX = 5;

// demo Storj (V3) configuration

var storjConfig = {
    apiKey    :
"13Yqdce2jc5NEvo6s9BRMdCyQ6mF6rUFsyrD7Vys7ASv2x5GMtADhrBsvD7NTmKw12ugqjx38VjztwTaK2kzGSEBXB7H1vm1PLdENcE",
    satelliteURL   : "us-central-1.tardigrade.io:7777",
    encryptionPassphrase  : "liberty or death",
    bucketName   : "liberty",
    uploadPath   : "CTS",
};

// file names to be uploaded or downloaded as
var localFullFileName = {
    src : "/home/hanani8/Desktop/cheesecake.jpg",
    dest: "/home/hanani8/Desktop/gunjan.jpg",
};

var objectsize =0;
console.log("Getting Access\nSatellite Address : ",storjConfig.satelliteURL,"\nAPI key : ",storjConfig.apiKey,"\nEncryption Passphrase : ",storjConfig.encryptionPassphrase);
var lO_AccessResult = libUplink.request_access_with_passphrasec(storjConfig.satelliteURL,storjConfig.apiKey,storjConfig.encryptionPassphrase);

if(lO_AccessResult.error.message == ""){
    console.log("Access : Granted !!");
    console.log("Opening Storj Project...");
    var lO_ProjectResult = libUplink.open_projectc(lO_AccessResult.access);
    if(lO_ProjectResult.error.message == ""){
        console.log("Desired Storj Project: OPENED!");
        console.log("Fetching Information About Bucket : ",storjConfig.bucketName);
        
        var lO_BucketResult = libUplink.stat_bucketc(lO_ProjectResult.project,storjConfig.bucketName);
        if(lO_BucketResult.error.message != ""){
            console.log("\nFAILed to get bucket information !\n","error code : ",lO_BucketResult.error.code,"\t error message : ",lO_BucketResult.error.message);
        }else{
            console.log("\nBucket Information : \n Bucket Name : ",lO_BucketResult.bucket.name,"\n Bucket Created : ",getDateTime(lO_BucketResult.bucket.created));
        }

        console.log("Creating Bucket : ",storjConfig.bucketName);
        var lO_createBucketResult = libUplink.create_bucketc(lO_ProjectResult.project,storjConfig.bucketName);
        
        if(lO_createBucketResult.error.message == ""){
            console.log("\nBucket created successfully !\n","Bucket Name : ",lO_createBucketResult.bucket.name,"\t Created : ",getDateTime(lO_createBucketResult.bucket.created));
        }else{
             console.log("\nFAILed to create bucket !\n","error code : ",lO_createBucketResult.error.code,"\t error message : ",lO_createBucketResult.error.message);
        }
        
         console.log("Creating restrict access....");
        var lO_Permission = new storj.Permission();
        lO_Permission.allow_delete = true
        lO_Permission.allow_list = true
        lO_Permission.allow_download = true
        lO_Permission.allow_upload = true
        var lO_SharePrefix = storj.SharePrefix;
        var lO_SharePrefixListArray = [];
        lO_SharePrefix.bucket = "liberty";
        lO_SharePrefix.prefix ="CTS";
        lO_SharePrefixListArray.push(lO_SharePrefix);
        var lO_AccessShareResult = libUplink.access_sharec(lO_AccessResult.access,lO_Permission,lO_SharePrefixListArray,lO_SharePrefixListArray.length);
        console.log(lO_Permission);
        console.log(lO_AccessShareResult);
        console.log(lO_AccessShareResult.access);
        if(lO_AccessShareResult.error.message==""){
            console.log("Created share access !!");
            console.log("Creating Share Access Key...");
            var lO_StringResult = libUplink.access_serializec(lO_AccessShareResult.access);
            console.log(lO_StringResult);
            if(lO_StringResult.error.message==""){
                var lO_AccessResultSharedObject= libUplink.parse_accessc(lO_StringResult.string);
                console.log(lO_AccessResultSharedObject);
                console.log("Parsing Access created");
                console.log("Opening Project Using Shared Access..."    );
                var lO_RestrictedProjectResult = libUplink.open_projectc(lO_AccessResultSharedObject.access);
                if(lO_RestrictedProjectResult.error.message==""){
                    console.log("Opened Project using share key ");
                }else{
                    console.log("FAILed to open project \n Error Code : ",lO_RestrictedProjectResult.error.code,"\t Error Message : ",lO_RestrictedProjectResult.error.message);
                }
		
        var lO_ProjectError = libUplink.close_projectc(lO_ProjectResult.project);
        console.log("\nClosing Project !");
        if(lO_ProjectError.error.message == ""){
            console.log("Closed desired project!\n");
        }else{
            console.log("\nFAILed to close desired project!\n","Error Code : ",lO_ProjectError.error.code,"\t Error Message : ",lO_ProjectError.error.message);
        }
    }else{
       console.error("\nFAILed to open desired project!\n","Error Code : ",lO_ProjectResult.error.code,"\t Error Message : ",lO_ProjectResult.error.message);
    }

}else{
    console.error("\nFAILed to get access !\n","Error Code : ",lO_AccessResult.error.code,"\t Error Message : ",lO_AccessResult.error.message);
}

function getDateTime(unix_timestamp) {
    var dateTime = new Date(unix_timestamp * 1000);
 //
 var year   = dateTime.getFullYear();
    var months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
    var month  = months[dateTime.getMonth()];
    var date   = "0" + dateTime.getDate();
 //
 // Hours part from the timestamp
    var hours = "0" + dateTime.getHours();
    // Minutes part from the timestamp
    var minutes = "0" + dateTime.getMinutes();
    // Seconds part from the timestamp
    var seconds = "0" + dateTime.getSeconds();

    // Will display date time in YYYY-Mon-DD HH:MM:SS format
    var formattedDateTime = year + '-' + month + '-' + date.substr(-2) + ' ' + hours.substr(-2) + ':' + minutes.substr(-2) + ':' + seconds.substr(-2);
    //
    return formattedDateTime
}

@hanani8 - can you share the console output for the app when it fails?

Thanks.

Hi @hanani8 , so since you’re assigning:

  lO_SharePrefix.bucket = "liberty";
  lO_SharePrefix.prefix = "CTS";

the reason you’re getting the error uplink: kvmetainfo: unable to find encryption base for: liberty/ when visiting http://127.0.0.1:7777/minio/liberty is because the access is restricted to use liberty/CTS and that URL requests the bucket root. The encryption base is not found since the access does not have permissions for the liberty path.

1 Like