Skip to main content

Near RPC

Run the node using SystemD

1. Server Requirements

ComponentRequirements
CPU8-Core (16-Thread) Intel i7/Xeon or equivalent with AVX support
Storage1 TB NVMe SSD is recommended
Ram20GB DDR4
OSUbuntu 22.04

CPU must support AVX, check by

lscpu | grep -oh avx
If result returns nothing, that means CPU does not support AVX.

Get Rust

curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh
source $HOME/.cargo/env
# Add the wasm toolchain
rustup target add wasm32-unknown-unknown

Install neccessaries

apt update
apt install -y git binutils-dev libcurl4-openssl-dev zlib1g-dev libdw-dev libiberty-dev cmake gcc g++ python2 docker.io protobuf-compiler libssl-dev pkg-config clang llvm cargo awscli

Install Nearcore binaries

git clone https://github.com/near/nearcore
cd nearcore
git fetch origin --tags
git checkout tags/1.36.4 -b mynode
make release

Initiate node

./target/release/neard --home ~/.near init --chain-id mainnet --download-genesis --download-config

Replace config.json

rm ~/.near/config.json
wget https://s3-us-west-1.amazonaws.com/build.nearprotocol.com/nearcore-deploy/mainnet/config.json -P ~/.near/

Create service

sudo tee /etc/systemd/system/neard.service > /dev/null << EOF
[Unit]
Description=Near Daemon
After=network-online.target
[Service]
User=$USER
ExecStart=$(which neard) --home $HOME/.near run
Restart=always
RestartSec=3
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable neard

Download snap

aws s3 --no-sign-request cp s3://near-protocol-public/backups/mainnet/rpc/latest .
LATEST=$(cat latest)
aws s3 --no-sign-request cp --no-sign-request --recursive s3://near-protocol-public/backups/mainnet/rpc/$LATEST ~/.near/data

Start service and Check logs

sudo systemctl start neard && sudo journalctl -u neard -f --no-hostname -o cat

Thank to support VNBnode.

Visit us at: