Setting up the required tools on the local machine
To make the development process as smooth and as efficient as possible, we recommend confirming that all the tools mentioned below are installed and configured properly on your local machine.
- Rust development environment
- An Integrated Development Environment (IDE) software
- Ontology's WASM contract testing private node
Let us look at the installation process for the above mentioned tools one by one.
Non-windows platforms can use the following shell command to install rustup.
curl https://sh.rustup.rs -sSf | sh
Install the Rust compiler using this shell command.
rustup install nightly
Set the default compiler version to nightly by-
rustup default nightly
rustup target add wasm32-unknown-unknown
Later when we write our Rust code, we will be compiling it and converting it to bytecode using the
cargotool. But, the file that
cargogenerates is relatively large in size. Therefore, to compress the bytecode file, as well as to check and optimize it for deploying on the blockchain, we will be using the ontio-wasm-build tool.
ontio-wasm-buildcan be installed using the following shell command-
cargo install --git=https://github.com/ontio/ontio-wasm-build
Since we will be using rust, there are certain IDEs that work well. The following IDEs can be used-
A private node can be set up on the local machine and run using Ontology's CLI.
In order to realize this, we must first download and configure the implementation of Ontology's core software.
After download and installing Ontology, we don't have to build it from the source code and can directly proceed with the development process.