Introduction to Crypto Nodes
What Are Crypto Nodes?
Crypto nodes are crucial components of blockchain networks, serving as the backbone for decentralized applications and transactions. These nodes verify and validate transactions, ensuring the integrity Shardeum Node Setup and security of the network. In this article, we will focus on setting up a Shardeum node, which is a specific type of crypto node used for the Shardeum blockchain.
Why Run a Shardeum Node?
Running a Shardeum node offers several benefits, including:
- Validation : By running a node, you contribute to the validation process, helping to secure the network and ensure its integrity.
- Staking : You can participate in staking, earning rewards for validating transactions and maintaining the network.
- Decentralization : By running a node, you help decentralize the network, reducing reliance on centralized authorities.
- Customization : You can customize your node setup to suit your needs, whether for personal use or as part of a larger network.
Hardware Requirements
Before setting up a Shardeum node, you need to ensure your hardware meets the minimum requirements. Here are the key specifications:
Component | Minimum Requirement |
---|---|
CPU | Quad-core processor |
RAM | 16 GB DDR4 RAM |
Storage | 500 GB SSD |
Internet | Stable internet connection |
Software Requirements
To run a Shardeum node, you will need to install specific software. Here are the key tools you’ll need:
For Linux
-
Git :
-
sudo apt update
-
sudo apt install -y git
-
-
Build Tools :
-
sudo apt install -y binutils-dev libcurl4-openssl-dev zlib1g-dev libdw-dev libiberty-dev cmake gcc g++ python docker.io protobuf-compiler libssl-dev pkg-config clang llvm
-
-
Cargo :
-
cargo build --release
-
For Mac OS
-
Developer Tools :
- Ensure developer tools are installed.
- Use
brew
to install extra tools:brew install cmake protobuf clang llvm
-
Cargo :
-
cargo build --release
-
Setting Up Your Node
Using nearup
The nearup
tool is exclusively used to launch Shardeum testnet and localnet nodes. It is not used for mainnet nodes. Here are the steps to set up your node using nearup
:
Compiling and Running a Node without Docker
-
Compile neard Locally :
- If Rust isn’t already installed, follow these instructions.
- For Mac OS, make sure you have developer tools installed and then use
brew
to install extra tools. - For Linux, install the dependencies listed above.
- Compile
neard
locally and pointnearup
to the compiled binaries.
-
Run the Node :
- Execute the following command to run a testnet node:
nearup run testnet --binary-path path/to/nearcore/target/release
- To run a localnet node instead, replace
testnet
withlocalnet
in the command above.
- Execute the following command to run a testnet node:
-
Validator ID :
- You might be asked for a validator ID; if you do not want to validate, simply press enter. For validation, please follow the Validator Bootcamp instructions.
-
Account ID :
- Enter your account ID (leave empty if not going to be a validator).
-
Logs :
- To check logs, call:
nearup logs
ornearup logs --follow
.
- To check logs, call:
Running a Node on the Cloud
-
Create a New Instance :
- Follow the hardware requirements to create a new instance on your preferred cloud provider.
-
Add Firewall Rules :
- Add firewall rules to allow traffic to port 24567 from all IPs (0.0.0.0/0).
-
SSH into the Machine :
- SSH into the machine using the external IP address provided by your cloud provider. For example, on AWS, you might use:
aws ec2 ssh -i "your-key.pem" ec2-user@your-instance-public-dns-name
- Cloud providers may offer custom commands to help with connecting to instances. For example, GCP offers:
gcloud compute ssh --zone=your-zone your-instance-name
- SSH into the machine using the external IP address provided by your cloud provider. For example, on AWS, you might use:
-
Start the Node :
- Once connected, start the node using the
nearup
command as described above.
- Once connected, start the node using the
Starting a Node from Backup
Using data backups allows you to sync your node quickly by using public tar backup files. There are two types of backups available for both testnet and mainnet:
- Regular Backups : These are the most commonly used backups.
- Archival Backups : These are used for historical purposes and are less frequently updated.
Starting Node Using neard Backup Data
-
Initialize the Node :
- Execute the following command to initialize the node using backup data:
./neard init --chain-id <chain-id> --download-genesis
- Execute the following command to initialize the node using backup data:
-
Download Backup Data :
- Create a directory for the node data:
mkdir ~/.near/data
- Download the latest snapshots from Node Data Snapshots:
wget -c <link-above> -O - | tar -xC ~/.near/data
- Create a directory for the node data:
-
Run the Node :
- Start the node using the compiled binaries:
./neard run
- Start the node using the compiled binaries:
Starting Node Using nearup Backup Data
-
Download Backup Data :
- Download the latest snapshots from Node Data Snapshots.
-
Run the Node :
- Execute the following command to start the node using nearup backup data:
nearup run testnet --binary-path path/to/nearcore/target/release --data-path path/to/data
- Execute the following command to start the node using nearup backup data:
Cloud Service Providers
AWS Setup Guide
AWS provides a robust platform for setting up a Shardeum validator. Here are the detailed instructions:
-
Create an EC2 Instance :
- Follow the hardware requirements to create an EC2 instance.
-
Add Firewall Rules :
- Add firewall rules to allow traffic to port 24567 from all IPs (0.0.0.0/0).
-
SSH into the Machine :
- SSH into the machine using the external IP address provided by AWS.
-
Start the Node :
- Once connected, start the node using the nearup command as described above.
DigitalOcean Setup Guide
DigitalOcean provides a straightforward way to set up a Shardeum validator. Here are the detailed instructions:
-
Create a Droplet :
- Follow the hardware requirements to create a Droplet.
-
Add Firewall Rules :
- Add firewall rules to allow traffic to port 24567 from all IPs (0.0.0.0/0).
-
SSH into the Machine :
- SSH into the machine using the external IP address provided by DigitalOcean.
-
Start the Node :
- Once connected, start the node using the nearup command as described above.
Contabo Setup Guide
Contabo provides a flexible platform for setting up a Shardeum validator. Here are the detailed instructions:
-
Create a VPS :
- Follow the hardware requirements to create a VPS.
-
Add Firewall Rules :
- Add firewall rules to allow traffic to port 24567 from all IPs (0.0.0.0/0).
-
SSH into the Machine :
- SSH into the machine using the external IP address provided by Contabo.
-
Start the Node :
- Once connected, start the node using the nearup command as described above.
Google Cloud Platform Setup Guide
Google Cloud Platform provides a scalable platform for setting up a Shardeum validator. Here are the detailed instructions:
-
Create an Instance :
- Follow the hardware requirements to create an instance.
-
Add Firewall Rules :
- Add firewall rules to allow traffic to port 24567 from all IPs (0.0.0.0/0).
-
SSH into the Machine :
- SSH into the machine using the external IP address provided by GCP.
-
Start the Node :
- Once connected, start the node using the nearup command as described above.
Troubleshooting Common Issues
Port 24567 Not Accessible
- Solution : Ensure that port 24567 is open and forwarded to the machine where the node is running. If you’re running localnet, you don’t need to open port 24567.
Node Not Syncing
- Solution : Check the logs for any errors. Ensure that the node has access to the necessary data and that the chain ID is correct.
Validator ID Not Recognized
- Solution : If you’re asked for a validator ID and it’s not recognized, ensure that you’ve followed the Validator Bootcamp instructions correctly.
Conclusion
Running a Shardeum node is a significant step towards contributing to the decentralization of the blockchain network. By following these steps, you can set up your node on various cloud service providers and ensure its smooth operation. Remember to troubleshoot common issues and keep your node updated with the latest software and data backups. With this ultimate setup guide, you’re well on your way to becoming a part of the Shardeum community and helping to secure the network.