Rust implementation of the Albatross protocol
See the codeNimiq is a frictionless payment protocol for the web.
This repository contains the Rust implementation of the Nimiq Proof-of-Stake protocol based on the Albatross consensus algorithm. It is designed to deliver high performance without sacrificing security. The Mainnet is now fully operational and ready for live transactions. It has been rigorously tested and is ready for production use.
For the Testnet use and more detailed information on how to connect and use the network, please refer to the Testnet section.
| PoS Node Type | Memory | CPU | Storage | Network | Syncing Time |
|---|---|---|---|---|---|
| History (check additional instructions) | Minimum 16GB RAM (higher recommended) | Minimum 4 vCPUs, 8 recommended | Minimum 1TB of storage (2TB when enabling indexing); storage usage starts at a few gigabytes and grows linearly with blockchain size over time | High-speed, reliable internet connection; Good I/O performance (SSDs required) | Sync time increases over the life of the blockchain |
| Full | Minimum 16GB RAM | 4 vCPUs recommended | Minimum Minimum 60GB of storage | High-speed, reliable internet connection; Good I/O performance (SSDs recommended) | Sync time grows linearly but slowly |
| Light | Minimum 4GB RAM | 64-bit recommended | Works with minimal storage | Moderate-speed internet connection (1 Mbps or higher) | Syncs in a few seconds |
Nimiq has also two specific node types with specialized roles in maintaining the network security and performing more advanced tasks.
clangcmakelibssl-dev (in Debian/Ubuntu) or openssl-devel (in Fedora/Red Hat)pkg-configWe currently do not make any guarantees about the minimum supported Rust version to consumers, but we currently test two versions older than the current Rust stable.
cargo:git clone https://github.com/nimiq/core-rs-albatross
cd core-rs-albatross
cargo build --release
$HOME/.cargo/bin) with:cargo install --path client/
Alternatively, you can install it directly from git:
cargo install --git https://github.com/nimiq/core-rs-albatross.git
You need a configuration file to customize your node according to your specific requirements. Follow one of the methods below to create and edit your configuration file.
Option A The configuration file is generated automatically and in a specific location.
cargo run --release --bin nimiq-client
This generates a sample file and places it in a folder ./nimiq.
cp $HOME/.nimiq/client.example.toml $HOME/.nimiq/client.toml
cargo run --release --bin nimiq-client
By default, the client will look for the config file in $HOME/.nimiq/client.toml.
Option B Download the example file and manually place it.
cargo run --release --bin nimiq-client -- -c path/to/client.toml
Now your client is launched and running.
Port Configuration Assuming you didn't change the default listening port, ensure that your system allows network traffic through port 8443/tcp. Open this port in your firewall to allow the node to connect to the network.
For the first start of your history node, you must set the environment variable NIMIQ_OVERRIDE_MAINNET_CONFIG to point to a configuration file. This file can be downloaded from one of the following sources:
Nimiq IPFS gateway link: https://ipfs.nimiq.io/ipfs/QmWcRRRw4FaKRrznMFt6KemAM35uo9QknMkDaeBzTod33R
Via torrent:
magnet:?xt=urn:btih:566cec0c350fca917cf5abb00c7dbe8c70884306&dn=nimiq-genesis-main-albatross.toml&tr=https%3A%2F%2Ftorrents.nimiq.io%2Fannounce
After downloading the file, run NIMIQ_OVERRIDE_MAINNET_CONFIG=/path/to/nimiq-genesis-main-albatross.toml cargo run --release --bin nimiq-client with the actual path to the file.
This process is required only for the first start of the history node. For later restarts, neither the environment variable nor the file are needed. You can even delete the file after the initial setup.
You can also choose to run a validator. Check our guide with the full step-by-step description:
data folder in the main directory with mkdir ~/data.docker pull ghcr.io/nimiq/core-rs-albatross:latest.client.toml file in ~/data with cp ./lib/src/config/config_file/client.example.toml ~/data/client.toml.data folder: cp /path/to/nimiq-genesis-main-albatross.toml ~/data.NIMIQ_OVERRIDE_MAINNET_CONFIG environment variable:
docker run -v $(pwd)/data:/home/nimiq/.nimiq -p 8443:8443 -p 8648:8648 -p 9100:9100 -e NIMIQ_OVERRIDE_MAINNET_CONFIG=/home/nimiq/.nimiq/nimiq-genesis-main-albatross.toml --name nimiq-rpc --rm ghcr.io/nimiq/core-rs-albatross:latest
docker run -v $(pwd)/data:/home/nimiq/.nimiq -p 8443:8443 -p 8648:8648 -p 9100:9100 --name nimiq-rpc --rm ghcr.io/nimiq/core-rs-albatross:latest
Overview of Exposed Ports
| Port | Description |
|---|---|
| 8443 | Incoming network connections port |
| 8648 | RPC port |
| 9100 | Metrics port |
The Testnet network is publicly available for testing and experimentation. Its main purpose is to invite everyone to exercise and test the Nimiq Proof-of-Stake functionality and we invite people to file and report any issues through our GitHub repository.
You can use the Testnet by setting the consensus.network in your configuration file set to test-albatross. Additionally uncomment the network.seed_nodes for the Testnet and comment the Mainnet ones.
There are two ways of getting funds:
curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -d "address=NQXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX" https://faucet.pos.nimiq-testnet.com/tapit
To ensure the software you are running is authentic and has not been tampered with, refer to the documentation. It provides details on reproducing Nimiq software and verifying software signatures.
If you'd like to contribute to the development of Nimiq please follow our Code of Conduct and Contributing Guidelines. Small note: When editing the README, please conform to the standard-readme specification.
This project is licensed under the Apache License 2.0.
(top 30 of 35)
Rust
95.4%
TypeScript
2.3%
Python
1.3%
Rust implementation of the Albatross protocol
See the codeNimiq is a frictionless payment protocol for the web.
This repository contains the Rust implementation of the Nimiq Proof-of-Stake protocol based on the Albatross consensus algorithm. It is designed to deliver high performance without sacrificing security. The Mainnet is now fully operational and ready for live transactions. It has been rigorously tested and is ready for production use.
For the Testnet use and more detailed information on how to connect and use the network, please refer to the Testnet section.
| PoS Node Type | Memory | CPU | Storage | Network | Syncing Time |
|---|---|---|---|---|---|
| History (check additional instructions) | Minimum 16GB RAM (higher recommended) | Minimum 4 vCPUs, 8 recommended | Minimum 1TB of storage (2TB when enabling indexing); storage usage starts at a few gigabytes and grows linearly with blockchain size over time | High-speed, reliable internet connection; Good I/O performance (SSDs required) | Sync time increases over the life of the blockchain |
| Full | Minimum 16GB RAM | 4 vCPUs recommended | Minimum Minimum 60GB of storage | High-speed, reliable internet connection; Good I/O performance (SSDs recommended) | Sync time grows linearly but slowly |
| Light | Minimum 4GB RAM | 64-bit recommended | Works with minimal storage | Moderate-speed internet connection (1 Mbps or higher) | Syncs in a few seconds |
Nimiq has also two specific node types with specialized roles in maintaining the network security and performing more advanced tasks.
clangcmakelibssl-dev (in Debian/Ubuntu) or openssl-devel (in Fedora/Red Hat)pkg-configWe currently do not make any guarantees about the minimum supported Rust version to consumers, but we currently test two versions older than the current Rust stable.
cargo:git clone https://github.com/nimiq/core-rs-albatross
cd core-rs-albatross
cargo build --release
$HOME/.cargo/bin) with:cargo install --path client/
Alternatively, you can install it directly from git:
cargo install --git https://github.com/nimiq/core-rs-albatross.git
You need a configuration file to customize your node according to your specific requirements. Follow one of the methods below to create and edit your configuration file.
Option A The configuration file is generated automatically and in a specific location.
cargo run --release --bin nimiq-client
This generates a sample file and places it in a folder ./nimiq.
cp $HOME/.nimiq/client.example.toml $HOME/.nimiq/client.toml
cargo run --release --bin nimiq-client
By default, the client will look for the config file in $HOME/.nimiq/client.toml.
Option B Download the example file and manually place it.
cargo run --release --bin nimiq-client -- -c path/to/client.toml
Now your client is launched and running.
Port Configuration Assuming you didn't change the default listening port, ensure that your system allows network traffic through port 8443/tcp. Open this port in your firewall to allow the node to connect to the network.
For the first start of your history node, you must set the environment variable NIMIQ_OVERRIDE_MAINNET_CONFIG to point to a configuration file. This file can be downloaded from one of the following sources:
Nimiq IPFS gateway link: https://ipfs.nimiq.io/ipfs/QmWcRRRw4FaKRrznMFt6KemAM35uo9QknMkDaeBzTod33R
Via torrent:
magnet:?xt=urn:btih:566cec0c350fca917cf5abb00c7dbe8c70884306&dn=nimiq-genesis-main-albatross.toml&tr=https%3A%2F%2Ftorrents.nimiq.io%2Fannounce
After downloading the file, run NIMIQ_OVERRIDE_MAINNET_CONFIG=/path/to/nimiq-genesis-main-albatross.toml cargo run --release --bin nimiq-client with the actual path to the file.
This process is required only for the first start of the history node. For later restarts, neither the environment variable nor the file are needed. You can even delete the file after the initial setup.
You can also choose to run a validator. Check our guide with the full step-by-step description:
data folder in the main directory with mkdir ~/data.docker pull ghcr.io/nimiq/core-rs-albatross:latest.client.toml file in ~/data with cp ./lib/src/config/config_file/client.example.toml ~/data/client.toml.data folder: cp /path/to/nimiq-genesis-main-albatross.toml ~/data.NIMIQ_OVERRIDE_MAINNET_CONFIG environment variable:
docker run -v $(pwd)/data:/home/nimiq/.nimiq -p 8443:8443 -p 8648:8648 -p 9100:9100 -e NIMIQ_OVERRIDE_MAINNET_CONFIG=/home/nimiq/.nimiq/nimiq-genesis-main-albatross.toml --name nimiq-rpc --rm ghcr.io/nimiq/core-rs-albatross:latest
docker run -v $(pwd)/data:/home/nimiq/.nimiq -p 8443:8443 -p 8648:8648 -p 9100:9100 --name nimiq-rpc --rm ghcr.io/nimiq/core-rs-albatross:latest
Overview of Exposed Ports
| Port | Description |
|---|---|
| 8443 | Incoming network connections port |
| 8648 | RPC port |
| 9100 | Metrics port |
The Testnet network is publicly available for testing and experimentation. Its main purpose is to invite everyone to exercise and test the Nimiq Proof-of-Stake functionality and we invite people to file and report any issues through our GitHub repository.
You can use the Testnet by setting the consensus.network in your configuration file set to test-albatross. Additionally uncomment the network.seed_nodes for the Testnet and comment the Mainnet ones.
There are two ways of getting funds:
curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -d "address=NQXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX" https://faucet.pos.nimiq-testnet.com/tapit
To ensure the software you are running is authentic and has not been tampered with, refer to the documentation. It provides details on reproducing Nimiq software and verifying software signatures.
If you'd like to contribute to the development of Nimiq please follow our Code of Conduct and Contributing Guidelines. Small note: When editing the README, please conform to the standard-readme specification.
This project is licensed under the Apache License 2.0.
(top 30 of 35)
Rust
95.4%
TypeScript
2.3%
Python
1.3%