Storj-NodeJS bindings package
npm install @super-protocol/uplink-nodejs
$ node -v
`
please ensure node-gyp* dependencies is already installed.
`
$ npm install -g node-gyp
`
* Make sure your PATH includes the $GOPATH/bin directory, so that your commands can be easily used Refer: Install the Go Tools:
`
$ export PATH=$PATH:$GOPATH/bin
`
$3
* download the source project
`
$ git clone https://github.com/storj-thirdparty/uplink-nodejs.git
`
* after changing the source code, build it
`
$ npm run preinstall
`
$3
The source project includes testing script to test it locally.
* need to build and release the binaries to root directory of the project
`
$ npm install
`
creat secret.txt* in root directory of project and input api key getting from access panel whiling creating Access Grant in storj.io
In /test/testcase.js, change the satelliteURL* with the information getting from access panel whiling creating Access Grant in storj.io
* run the test
`
$ npm test
`
Usage
* Install the storj-nodejs Node.js package
`
$ npm install uplink-nodejs
`
* Set Environment variable
* MacOS
* Set DYLD_LIBRARY_PATH environment variable
`
$ export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$PWD/node_modules/uplink-nodejs/
`
OR
Copy libuplinkc.* files from $PROJECTROOT/node_modules/uplink-nodejs/ to /usr/local/lib
* Linux
* Set LD_LIBRARY_PATH environment variable
`
$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/node_modules/uplink-nodejs/
`
OR
Copy libuplinkc.* files from $PROJECTROOT/node_modules/uplink-nodejs/ to /usr/lib
* Windows
Set Path environment variable to libuplinkc.* which is $PROJECTROOT/node_modules/uplink-nodejs
* In node application, import the package and call functions
`
const storj = require("uplink-nodejs");
const libUplink = new storj.Uplink();
``