Skip to main content

Running a NEAR RPC Node

Requirements ๐Ÿ“„โ€‹

Before you start, ensure that your machine meets the following minimum requirements:

CPU: 8-Core (16-Thread) Intel i7/Xeon or equivalent with AVX support
RAM: 20GB DDR4
Storage: 1TB SSD - NVMe SSD recommended
OS: MacOS / Linux
tip

Installing NEAR will also require a current installation of Rust, Git, as well as many common dev tools (python, docker, awscli, & protobuf-compiler).

Install ๐Ÿ“ฅโ€‹

Get nearcoreโ€‹

Clone the NEAR nearcore repo to your machine and switch to it.

git clone https://github.com/near/nearcore
cd nearcore
git fetch origin --tags

Get the latest release.

git checkout tags/<RELEASE TAG HERE> -b mynode

Compile the latest stable releaseโ€‹

Ensure you're in the correct folder (/nearcore/) & run the following command:

make release
caution

make release will cause the nearcore to compile. Compilation is a time-intensive process and can take ~30 minutes or longer on recommmended hardware.

Configure the release folderโ€‹

With one command you can create the required directory structure -- generating a config.json, node_key.json, and downloading a genesis.json for your respective chain-id choice.

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

Start your Node! ๐Ÿš€โ€‹

Run the following command to initiate your node!


# Get a data backup
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 the Node!
./target/release/neard --home ~/.near run

Configure your Provider ๐Ÿ”งโ€‹

After you've gotten things together with your node. You can set things in motion with a provider. Use the following template(s) to set up your provider config file:

endpoints:
- api-interface: jsonrpc
chain-id: NEAR
network-address:
address: "127.0.0.1:port"
disable-tls: true
node-urls:
- url: https://endpoint/mainnet/erpc

metrics-listen-address: ":port"

NEAR ipRPC ๐Ÿช™โ€‹

Want to reach more developers and get more rewards as a node runner? NEAR offers Incentivized Public RPC (ipRPC) endpoints to developers in its ecosystem. By signing up here, you can be first in line to being one of our premier providers contributing to decentralized public goods. Sign up now!

Setup your Provider on Lava Network ๐ŸŒ‹โ€‹

Once youโ€™ve been accepted - to set up your provider on the Lava Network, you can refer to the provider setup documentation available elsewhere in our docs. This should provide you with the necessary information to configure and operate your provider node on the Lava Network.