Skip to content

Installation from github

yaaccount edited this page May 16, 2019 · 4 revisions

If the packages are not yet available from npm, or if you want to make some changes either in the library or the sdk, you can try to checkout both library and sdk from github, build them 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 java-xpx-catapult-sdk

$ mkdir ~/proximax && cd ~/proximax

$ git clone git@github.com:proximax-storage/js-xpx-catapult-library.git

$ cd js-xpx-catapult-library

$ npm install

$ npm run build

Install tsjs-xpx-catapult-sdk

$ cd ~/proximax

$ git clone git@github.com:proximax-storage/tsjs-xpx-catapult-sdk.git

$ cd tsjs-xpx-catapult-sdk

now you have to edit package.json and replace line

"js-xpx-catapult-library": "^0.1.0",

with

"js-xpx-catapult-library": "file:../js-xpx-catapult-library",

then

$ 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-catapult-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-catapult-sdk");
var account = sdk.Account.generateNewAccount(sdk.NetworkType.PRIVATE_TEST);
console.log(account);

And try to run it

$ node index.js

Clone this wiki locally