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.

Installing Prerequisites

This node is supported for Ubuntu 18.04 and above. It has been tested on 20.04.

Install dependencies

Use a terminal shell to execute the following commands:
1
sudo apt update
2
# May prompt for location information
3
sudo apt install -y cmake pkg-config libssl-dev git build-essential clang libclang-dev curl
Copied!
Rust Developer Environment
This project usesrustupto help manage the Rust toolchain. First, install and configure rustup:
1
# Install
2
curl https://sh.rustup.rs -sSf | sh
3
# Configure
4
source ~/.cargo/env
Copied!
Finally, configure the Rust toolchain:
1
rustup default stable
2
rustup update nightly
3
rustup update stable
4
rustup target add wasm32-unknown-unknown --toolchain nightly
Copied!

Run in Dev mode with a temporary state

Use Rust's native cargo command to build and launch the template node:
1
cargo run --release -- --dev --tmp
Copied!

Build

The cargo run command will perform an initial build. Use the following command to build the node without launching it:
1
cargo build --release
Copied!

Embedded Docs

Once the project has been built, the following command can be used to explore all parameters and subcommands:
1
./target/release/porta-node -h
Copied!

Run

The provided cargo run command 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.

Single-Node Development Chain

This command will start the single-node development chain with a persistent state:
1
./target/release/porta-node --dev
Copied!
Purge the development chain's state:
1
./target/release/porta-node purge-chain --dev
Copied!
Start the development chain with detailed logging:
1
RUST_LOG=debug RUST_BACKTRACE=1 ./target/release/porta-node -lruntime=debug --dev
Copied!

Node

A blockchain node is an application that allows users to participate in a blockchain network.
After the node has been built, refer to the embedded documentation to learn more about the capabilities and configuration parameters that it exposes:
1
./target/release/porta-node --help
Copied!
Last modified 3mo ago