NEAR Documentation
  • Concepts
  • Develop
  • Tools
  • Tutorials
  • Community
  • Tokens
  • Stake
  • Integrate
  • GitHub

›Validator

Quickstart

  • Orientation

Validator

  • Choosing Hardware
  • Running the Node
  • Understanding Keys
  • Node Maintenance
  • Validator Economics
  • Deploy on MainNet

FAQ

  • Staking FAQ
Edit

Deploy a Validator Node on MainNet

Step-by-Step guide

Overall, the process is similar to TestNet and BetaNet:

  1. Create your MainNet wallet
  2. Deploy your MainNet staking pool
  3. Build and run your MainNet validator node

1. Create your MainNet Wallet

  • Go to wallet.near.org and create an account.

2. Deploy your MainNet staking pool

You can instantly deploy the staking pool with near-cli, using the command near call:

near call poolv1.near create_staking_pool '{"staking_pool_id":"<POOL_ID>", "owner_id":"<OWNER_ID>", "stake_public_key":"<VALIDATOR_KEY>", "reward_fee_fraction": {"numerator": <X>, "denominator": <Y>}}' --account_id <OWNER_ID> --amount 30 --gas 300000000000000

The command will invoke the staking-pool-factory from NEAR Core Contracts, passing the following parameters:

  • poolv1.near is the staking pool factory
  • POOL_ID is the name of your validator (and the staking pool associated with it)
  • OWNER_ID is the wallet that controls the pool, see the owner-only methods for more information
  • VALIDATOR_KEY is the validator node public key, from the file ~/.near/validator_key.json
  • {"numerator": <X>, "denominator": <Y>} set the validator fees. x=10 and y=100 equals to 10%
  • --amount 30 attaches 30 $NEAR to the transaction to pay the contract storage
  • --gas 300000000000000 specifies the amount of gas for the transaction (optional)
Heads Up:

If your POOL_ID is "buildlinks", the staking pool factory will deploy a contract called "buildlinks.poolv1.near", and your node will appear in the Explorer as "buildlinks.poolv1.near"

3. Build and run your MainNet validator node

  • Clone the nearcore repository:
git clone https://github.com/near/nearcore.git
  • Create an environment variable that finds the most recent stable release:
export NEAR_RELEASE_VERSION=$(curl -s https://github.com/near/nearcore/releases/latest | tr '/" ' '\n' | grep "[0-9]\.[0-9]*\.[0-9]" | head -n 1)
  • Go to the root directory and checkout the branch:
cd nearcore
git checkout $NEAR_RELEASE_VERSION
  • Build the binary using the --release switch:
cargo build -p neard --release
  • configure the chain-id and account-id:
target/release/neard init --chain-id="mainnet" --account-id=<YOUR_STAKING_POOL_ID>
  • After the build process is done, check that the configuration file located at /HOME_DIR/.near/config.json is the same as this one.

  • Now, start your node with the following command:

target/release/neard run

Got a question? Ask it on StackOverflow!

Last updated on 2/10/2021 by Josh
← Validator EconomicsStaking FAQ →
  • Step-by-Step guide
    • 1. Create your MainNet Wallet
    • 2. Deploy your MainNet staking pool
    • 3. Build and run your MainNet validator node
  • Wallet
  • Explorer
  • Examples
  • Forum
  • Twitter
  • GitHub
  • Discord
  • Telegram
  • WeChat
  • YouTube

Developers

  • Overview
  • Technology
  • GitHub
  • Bounties
  • Grants

Community

  • Forum
  • Events
  • Contributor Program
  • Guild Program
  • Startup Accelerator
  • Bounties
  • Tokens

About

  • Team
  • Careers
  • Backers
  • Press Kit
  • Brand Guidelines
  • Privacy Policy

2020 NEAR Protocol|All rights reserved|hello@near.org|Privacy Policy