Tan Docs
  • 📚INTRODUCTION
  • 📖BASIC KNOWLEDGE
    • 🌐⛓️What is Blockchain
    • EVM
    • 💻Node
  • WELCOME TO TAN NETWORK
    • 💡About TAN
    • 🪙TAN (Native Coin of Tan)
    • 🫂Community
  • 🚀GETTING STARTED
    • 👨‍💻Developer Guide
      • 💻Nodes And Validators
        • ⬇️Install TAN-Chain
        • 👨‍🏫Full Node Instructions
        • 🔏How to Stake TAN?
        • Become a Validator🤝
        • 🔓How to Unstake TAN?
      • RPC
      • TAN Testnet
      • TAN explorers
      • 📃Deploy Smart Contracts
        • TEP-20
          • Using Remix ide
          • Using Truffle
          • Using Hardhat
        • TEP-721
          • Using Remix ide
          • Using Truffle
          • Using Hardhat
        • TEP-1155
          • Using Remix ide
          • Using Truffle
          • Using Hardhat
    • 🦊Add TAN to Metamask
    • 🪙Get Testnet Funds
    • Core Concepts
      • Genesis File
      • Consensus
      • Proof of Stake(Pos)
      • ⚙️TAN Consensus(BPoS)
        • 💰Validators Reward
        • Burn Subsidy
        • Ecosystem Incetives
      • Scalability
  • Governance
    • TAN Improvement Proposal
  • ❓FAQ's
Powered by GitBook
On this page
  • Staking TAN to Become a Validator
  • How to Stake TAN
  • Conclusion
  1. GETTING STARTED
  2. Developer Guide
  3. Nodes And Validators

🔏How to Stake TAN?

PreviousFull Node InstructionsNextBecome a Validator🤝

Last updated 4 months ago

Learn how to stake TAN and set up a validator node on the TAN blockchain network to participate in transaction validation and network security.

Staking TAN to Become a Validator

Validator nodes are essential components of the TAN blockchain network. They validate transactions and propose new blocks, contributing directly to the consensus mechanism. Becoming a validator requires a commitment to maintaining high uptime and adhering to network protocols.

How to Stake TAN

Prerequisite: Before proceeding with the staking contracts, ensure you have a fully synchronized full node running in the current blockchain state of TAN.

Step 1: Clone the Repository from .

Step 2: Open cloned repository in terminal and install dependencies navigate to the cloned staking-contracts directory from the main branch and run npm i to install dependencies.

Step 3: Execute the following command to copy the example environment file to .env:

cp .env.example .env   

Step 4 : Use the following command to open and edit the .env file using the Nano text editor :

nano .env

Step 5: Replace the existing content in your .env file with the following configuration details:

JSONRPC_URL= <Use Tan RPC URL>
PRIVATE_KEYS= <Your private key of wallet which was initially generated at the time of key pair>
STAKING_CONTRACT_ADDRESS= 0x0000000000000000000000000000000000001001
BLS_PUBLIC_KEY= <Your BLS_Public_key which was initially generated at the time of key pair>

Save the updated .env file after replacing the placeholders with your actual configuration details.

Step 6: Retrieve Private Key for Staking.

Change directory to the location where your private key file (validator.key) is stored.

cd <yourkeygeneratedDirectory>/consensus

Use the following command to display the content of the validator.key file, which contains your private key:

cat validator.key

Copy the private key displayed in your terminal. This private key is needed for configuring your staking setup in the .env file.

Step 7: You must have 20000 TAN in your wallet.

Execute the following curl command in your terminal to check the balance of your wallet address:

curl --location 'https://devnet-rpc1.tanledger.com' \
--header 'Content-Type: application/json' \
--data '{"method":"eth_getBalance","params":["<YOUR WALLET ADDRESS>", "latest"],"id":1,"jsonrpc":"2.0"}'

Replace <YOUR WALLET ADDRESS> with your actual wallet address where you want to check the balance. Ensure your wallet contains at least 20000 TAN. If the balance is insufficient, please add TAN to your wallet.

Step 8: Build the Project Using npm

Execute the following command to build the project using npm:

npm run build

Step 9: Run the Stake Command:

Execute the following command to initiate the stake process using npm:

npm run stake

You should receive a confirmation message indicating that you have staked TAN successfully.

Conclusion

In this guide, you've learned how to set up and stake TAN tokens to become a validator on the TAN blockchain network. By following these steps, you've configured your environment, managed your wallet, and interacted with staking contracts to contribute to network security and transaction validation. Staking TAN tokens not only helps secure the network but also allows you to participate actively in the decentralized consensus process. Ensure to monitor your validator node and manage rewards effectively to maximize your participation in the TAN ecosystem.

🚀
👨‍💻
💻
GitHub