Setting up the system
Developing decentralized application on top of shardus usually require a set of these packages in shardus sdk described here. Before going ahead with the development, developers may need to configure their system describe as follow.
- Node.js (16.11.1)
- npm (8.0.0)
- Python3.9 (or latest)
It is generally recommend to use
nvm for node version management for anyone serious about nodejs development. Otherwise developers may need to install specific node version mannually.
nvm tool allow you have switch quickly between different node versions.
nvm check here.
After installing nvm on the machine, developers may then able to switch to specific
nvm version by doing
nvm install 16.11.1 and
nvm use 16.11.1.
Installing python on unix machine are fairly straight forward.
This step is optional if your machine have python3 already configured
For example to install python3.9 on arch linux:
sudo pacman -Sy python3.9
sudo apt-get install python3.9
The exact command would differs from one linux system to another depending on what package management tools is being setup on the machine.
For windows users this would include downloading python binaries for windows and installing it. Same goes for mac systems.
It is known issue that node-gyp would cause problem without the lastest python version configured.
If you have multiple python version on your machine and require to point npm to use specific python version, run this command:
npm config set python /path/to/python3.9
This step is optional if your machine have rust toolchain already configured
When installation of shardus core, npm compile rust libraries on the fly. Though in future we would make this go away by shipping
@shardus/core with rust binaries eliminating rust having to be installed on developers machines'.
But until then, install rust by following instruction from here. Once you have
rustup setup on your machine do -
rustup install stable
rustup default stable
For other systems see this