-
Notifications
You must be signed in to change notification settings - Fork 8
Installation from github
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.
- git
- node + npm installed
- i.e. https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-18-04
- I prefer installation using nvm - you can install more node versions and switch between them easily
$ 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
$ nvm install 10
$ node -v
v10.51.3
$ npm -v
6.4.1
$ cd ~/proximax
$ git clone [email protected]:proximax-storage/tsjs-xpx-chain-sdk.git
$ cd tsjs-xpx-chain-sdk
$ npm install
$ npm run build
$ 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
If you do some changes in the sdk locally, don't forget to run
$ npm run build
inside the sdk, then restart your project.