# Near Stake Wars 3 **Published by:** [cyberG|DVS](https://paragraph.com/@cyberg/) **Published on:** 2022-09-07 **URL:** https://paragraph.com/@cyberg/near-stake-wars-3 ## Content Near Validator guideCreating a walletGo to and create wallet. Mandatory!!! Do not forget to save the seed phrase. Replace the moniker with your nicknameMONIKER=<MONIKER> POOL=$MONIKER.factory.shardnet.near ACCOUNT_ID=$MONIKER.shardnet.near Installing nodeInstall node through a script Install a new branch version You can find last version by this linkexempl 68bfa84ed1455f891032434d37ccad696e91e4f5 checkuot=<new_version> wget https: //raw.githubusercontent.com/Vgk88/near_script/main/near.sh && chmod +x near_install_node.sh && bash near_install_node.sh Update clisudo npm install -g near-cli Check logsjournalctl -u neared -f -o cat When it loads you will see the following logs Сheck the synchronizationcurl -s http ://127.0.0.1:3030/status | jq .sync_info If the synchronization shows false, then you can proceed to the next sectionActivation of nodenear login # Enter the address in the browser https ://wallet.shardnet.near.org/login/**** Confirm all requestsNext, when you pass, you will receive a 403 Not Found error. After that, go to the terminal and enter your ACCOUNT_ID It should look like thisCreating a validatorNow create validator keysnear generate-key $ACCOUNT_ID Make some changes in the created filesed -i 's/private_key/secret_key/' ~/.near-credentials/shardnet/$ACCOUNT_ID.json sed -i s/$ACCOUNT_ID/$POOL/ ~/.near-credentials/shardnet/$ACCOUNT_ID.json Copy the key to another directory and rename itcp ~/.near-credentials/shardnet/$ACCOUNT_ID.json ~/.near/validator_key.json Restart the nodeThat's not all, in order to create a validator, we need to perform some more actions In this script we need to replace public_key with your public keynear call factory.shardnet.near create_staking_pool '{"staking_pool_id": "$MONIKER", "owner_id": "$ACCOUNT_ID", "stake_public_key": "<public key>", "reward_fee_fraction": {"numerator": 5, "denominator": 100}, "code_hash":"DD428g9eqLL8fWUxv8QSpVFzyHi1Qd16P8ephYCTmMSZ"}' --accountId="$ACCOUNT_ID" --amount=30 --gas=3000000000000000 You also need to throw the appropriate amount so that the validator is in the valid setnear call $MONIKER deposit_and_stake --amount <amount> --accountId $ACCOUNT_ID --gas=300000000000000 Other commands that may be needed Unstake and Unstake Allnear call <staking_pool_id> unstake '{"amount": "<amount yoctoNEAR>"}' --accountId <accountId> --gas=300000000000000 near call <staking_pool_id> unstake_all --accountId <accountId> --gas=300000000000000 Withdraw or Withdraw the entire amount.near call <staking_pool_id> withdraw '{"amount": "<amount yoctoNEAR>"}' --accountId <accountId> --gas=300000000000000 near call <staking_pool_id> withdraw_all --accountId <accountId> --gas=300000000000000 Available for withdrawal. You can withdraw funds from the contract only if it is unlocked.near view <staking_pool_id> is_account_unstaked_balance_available '{"account_id": "<accountId>"}' View stake balance.near view <staking_pool_id> get_account_staked_balance '{"account_id": "<accountId>"}' Spreading the balancenear view <staking_pool_id> get_account_unstaked_balance '{"account_id": "<accountId>"}' We create a pingInstall such a scriptwget -P ~/ https ://raw.githubusercontent.com/MaxMavaIll/near_guide/main/ping.sh && chmod +x ~/ping.sh mkdir -p $HOME/logs Install crontab if you do not have it installed and open the editor where we will make changesapt install crontab crontab -e If you have not used it before, you will be given a choice of which editor to use (I will use nano) Now we insert the following phrase at the end of the list0 */2 * * * bash /root/ping.sh To see the logs of these commands, you need to runnano ~/logs/all.log ## Publication Information - [cyberG|DVS](https://paragraph.com/@cyberg/): Publication homepage - [All Posts](https://paragraph.com/@cyberg/): More posts from this publication - [RSS Feed](https://api.paragraph.com/blogs/rss/@cyberg): Subscribe to updates - [Twitter](https://twitter.com/vadyhodler777): Follow on Twitter