Prerequisites for Building a Network¶
Introduction¶
Deploying a network through Tanssi is a fairly straightforward step, where the only requirement is to have a valid chain specification to upload.
Even though Tanssi provides chain specifications for the available templates, it could be necessary to generate a new one to match any changes the use case might need to be implemented in the runtime.
The following sections of this article will cover the minimal required software and its installation process to get a suitable development environment to compile a Substrate node and generate the chain specification.
Installing Rust¶
Rust is a modern, portable, and performant programming language that is the base of the Substrate blockchain development framework.
To compile the Tanssi network, the rust compiler, rustc
, and the package manager, cargo
, must be installed on the system.
In accordance with the instructions described in the official Rust documentation, for any system running Linux or MacOS, the following command will do:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
When the installation process is completed, running the following command verifies that the newly installed compiler works correctly by showing the version number:
rustc --version
rustc --version
There are other methods to install Rust, such as using a package manager. Other options can be found on the Rust official site.
Installing Git¶
Git is recommended to clone the code repository of Tanssi, where the node templates can be found. Git is likely shipped within the default OS installation configuration or included in other tools, such as Xcode in MacOS.
If Git is not present on the system, the following command will install it using a package manager:
apt-get install git
brew install git
To check the correct installation of Git, running the following command in a terminal should display the Git version:
git --version
git --version
Building a Tanssi Template¶
To build a Substrate node, such as the templates included in the Tanssi repository, it is necessary to install additional development components in the system:
apt-get install -y build-essential protobuf-compiler clang libssl-dev pkg-config
brew install protobuf openssl
With these essential tools installed, the development environment should be ready to work with Substrate and build the node with the following commands:
- Clone the Tanssi code hosted on GitHub
git clone https://github.com/moondance-labs/tanssi
- Step into the project folder
cd tanssi
- Build the Tanssi network template
cargo build -p container-chain-frontier-node --release
cargo build -p container-chain-simple-node --release
Having a healthy development environment will be necessary to build a customized runtime and to finally generate the chain specification file that will be used to deploy your Tanssi network.
| Created: August 7, 2023