How to Launch NEAR Betanet and Testnet Nodes with Nearup

Jan 11, 2022 | Blockchain

Welcome to the world of NEAR Protocol, where launching nodes is like setting up your very own digital garden! In this guide, we’ll walk through how to launch NEAR Betanet and Testnet nodes using Nearup, ensuring you’re well-equipped to grow your blockchain expertise. Whether you’re preparing for deployment or just curious to experiment, we’ve got you covered!

1. Prepare Your Environment

Before diving into the installation, ensure you have Python 3 and pip3 installed on your system. If you’re on Ubuntu, you can easily do this with the following commands:

sudo apt update
sudo apt install python3 python3-pip python3-dev

Don’t forget to upgrade pip if you encounter permission errors. Run:

pip3 install --upgrade pip

2. Installing Nearup

Now that we’re set up, let’s install Nearup. Make sure to use the –user flag:

pip3 install --user nearup

After the installation, check if Nearup is in your path:

which nearup

If the command returns nothing, add Nearup to your $PATH by modifying your ~/.profile or ~/.bashrc. You can do so with these commands:

USER_BASE_BIN=$(python3 -m site --user-base)/bin
export PATH=$USER_BASE_BIN:$PATH

3. Upgrading Nearup

If you’ve previously installed Nearup and want the latest features, upgrading is simple:

pip3 install --user --upgrade nearup

4. Getting Started

Let’s get into the fun part—running your nodes!

Using the Official Binary

The safest bet for server operations is using the official binary:

nearup run betanet --interactive

Change betanet for testnet if you wish to explore different networks.

Using a Locally Compiled Binary

If security is paramount for you, or if you’re developing something special, compile nearcore first:

nearup run betanet --binary-path /path/to/nearcore/target/debug

Spawn a Local Network

To create a mini-network on your machine, compile nearcore, then run:

nearup run localnet --binary-path /path/to/nearcore/target/debug

This will spawn four nodes validating in one shard, giving you a feel of a live ecosystem! Access a node’s status at:

http://localhost:3030/status

5. Operating Your Nodes

Stopping Nodes

Need a break? You can stop a running node or all nodes with:

nearup stop

Additional Options

For more help, try:

nearup run betanet --help

6. Running with Docker

If you prefer Docker, here’s how to spin up Nearup containers!

Building the Docker Image

docker build . -t nearupnearprotocol

Pulling the Docker Image

If building seems daunting, you can always pull the latest version from Docker Hub:

docker pull nearupnearprotocol

Running Nearup with Docker

To run the Nearup image without losing data, you need to mount your ~/.near folder:

docker run -v $HOME/.near:/root/.near -p 3030:3030 --name nearup nearupnearprotocol run betanet

Running in Detached Mode

For a non-blocking approach, add -d:

docker run -v $HOME/.near:/root/.near -p 3030:3030 -d --name nearup nearupnearprotocol run betanet

Checking Container Status

You can verify if your container is active by running:

docker ps

Execute Nearup Commands in Container

To issue commands like logs or stop, use:

docker exec nearup nearup logs

Stopping the Docker Container

Wrap it up with:

docker kill nearup

7. Development

If you’re aiming to contribute, build a development image:

docker build . -t nearupnearprotocol:dev

Troubleshooting

If you encounter issues, consider the following troubleshooting steps:

  • Check if Python and pip are properly installed.
  • Ensure your PATH is correctly set to include Nearup.
  • Verify your network connection for installation errors.
  • Consult the help command for specific usage errors: nearup run betanet –help.

For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

Conclusion

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Now you’re set to launch NEAR nodes like a pro. Happy coding!

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox