Setup a development node
In this section we will show you how to get a Porta node up and running for local development.
This guild will take you through the process of starting a local Porta node so you can start developing. We will cover the installation of the prerequisites and the launching of a node.
This node is supported for Ubuntu 18.04 and above. It has been tested on 20.04.
Use a terminal shell to execute the following commands:
sudo apt update
# May prompt for location information
sudo apt install -y cmake pkg-config libssl-dev git build-essential clang libclang-dev curl
Rust Developer Environment
curl https://sh.rustup.rs -sSf | sh
Finally, configure the Rust toolchain:
rustup default stable
rustup update nightly
rustup update stable
rustup target add wasm32-unknown-unknown --toolchain nightly
Use Rust's native
cargocommand to build and launch the template node:
cargo run --release -- --dev --tmp
cargo runcommand will perform an initial build. Use the following command to build the node without launching it:
cargo build --release
Once the project has been built, the following command can be used to explore all parameters and subcommands:
cargo runcommand will launch a temporary node and its state will be discarded after you terminate the process. After the project has been built, there are other ways to launch the node.
This command will start the single-node development chain with a persistent state:
Purge the development chain's state:
./target/release/porta-node purge-chain --dev
Start the development chain with detailed logging:
RUST_LOG=debug RUST_BACKTRACE=1 ./target/release/porta-node -lruntime=debug --dev
A blockchain node is an application that allows users to participate in a blockchain network.