Skip to content

Installation from github

yaaccount edited this page Oct 14, 2019 · 4 revisions

If the packages are not yet available from npm, or if you want to make some changes in the sdk, you can try to checkout the sdk from github, build it locally and develop against that.

Prerequisities:

Install nvm

$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash (this setups some environment variables, you have to restart your terminal to apply changes)

$ nvm --version

0.34.0

Install node 10

$ nvm install 10

$ node -v

v10.51.3

$ npm -v

6.4.1

Dependencies

Install tsjs-xpx-chain-sdk

$ cd ~/proximax

$ git clone [email protected]:proximax-storage/tsjs-xpx-chain-sdk.git

$ cd tsjs-xpx-chain-sdk

$ npm install

$ npm run build

Setup your project

$ cd ~/proximax

$ mkdir myproject && cd myproject

$ npm init

(fill in your project info)

$ npm install --save file:../tsjs-xpx-chain-sdk/

Now you should be able to use the sdk in your project, i.e. for javascript - create index.js file

var sdk = require("tsjs-xpx-chain-sdk");
var account = sdk.Account.generateNewAccount(sdk.NetworkType.PRIVATE_TEST);
console.log(account);

And try to run it

$ node index.js

Note

If you do some changes in the sdk locally, don't forget to run

$ npm run build

inside the sdk, then restart your project.