In the hybrid Commit-RevealĀ² protocol, nodes are participants that generate and reveal secrets to securely contribute to random number generation. Regular nodes handle off-chain commitments, reveals, and final secret disclosures, while the leader node coordinates the process and interacts with the blockchain.
This hybrid model reduces on-chain operations, ensuring efficiency while maintaining security and transparency through proofs and verifiable smart contract interactions. Regular nodes also manage deposits and adhere to protocol rules to uphold fairness and correctness.
(Connect your testnet wallet and send a transaction by clicking on "requestTokens")
Faucet will send you:
libp2p-communication
fc35ab415b0f6294113fb84f847061561f23403e
Make sure your wallet has enough balance to operate the node effectively. You may need some TON for gas fees and other transactions.
First, create a .env
file in your project directory. This file will contain the necessary environment variables to connect to the network and run the node.
Here are the variables you'll need to set:
LEADER_IP=13.49.228.201 # IP address of the leader node LEADER_PORT=61280 # Port for the leader node LEADER_PEER_ID=12D3KooWG5QNHzBv2BghpZ4ZGDa9pHWKzEHi6bEsE5kMCsnR2XSZ # Peer ID of the leader node LEADER_EOA=0x1723C153e86D589ce1c7478295bba783a2df9dd7 # Ethereum address (EOA) of the leader node PEER_ID=regularNode # Your node's peer ID (this can be any unique name) EOA_PRIVATE_KEY=your_private_key # Your Ethereum private key for signing transactions PORT=61281 # Port for your regular node NODE_TYPE=regular # Node type, should be set to "regular" CHAIN_ID=111551119090 # Chain ID for the network ETH_RPC_URL=https://rpc.thanos-sepolia.tokamak.network # URL for Ethereum RPC CONTRACT_ADDRESS=0x7d12f3421E6ae1D2668Ed10C25873aF3B1b7449f # Address of the smart contract SUBGRAPH_URL=https://graph-node.thanos-sepolia.tokamak.network/subgraphs/name/commitreveal22 # Subgraph URL for data queries
13.49.228.201
61280
12D3KooWG5QNHzBv2BghpZ4ZGDa9pHWKzEHi6bEsE5kMCsnR2XSZ
0x1723C153e86D589ce1c7478295bba783a2df9dd7
These details are required for connecting your regular node to the leader node.
Once you have set the necessary environment variables, you can run the node in two ways:
You can run the node directly using the go command:
go cmd/main.go
Alternatively, you can use Docker to run the node. To do so, update the container name and ports in the docker-compose.yml
file:
ports: - "61280:61280" # Adjust this as per your choice
Then, build and start the container:
docker-compose up --build