rand is a blockchain built using Cosmos SDK and Tendermint and created with Ignite CLI. RAND is a blockchain built using Roll kit Cosmos SDK and Tendermint RAND provide a random number for various dAPPs that need random number like gacha game, lottery and so on. The random number generated by Block time, Validators hash, App hash.
Install go
Now, use the following command to install Ignite CLI:
curl https://get.ignite.com/cli! | bash
Ready to get started
ignite chain serve
serve
command installs dependencies, builds, initializes, and starts your blockchain in development.
Run a Celestia light node
- You must have a Celestia Data Availability layer Light Node to get started. Install and get started.
VALIDATOR_NAME=validator
CHAIN_ID=rand-test-1
KEY_NAME=rand-key
CHAINFLAG="--chain-id ${CHAIN_ID}"
TOKEN_AMOUNT="10000000000000000000000000urand"
STAKING_AMOUNT="1000000000urand"
NAMESPACE_ID=$(openssl rand -hex 8)
DA_BLOCK_HEIGHT=$(curl https://rpc-blockspacerace.pops.one/block | jq -r '.result.block.header.height')
randd tendermint unsafe-reset-all
randd init $VALIDATOR_NAME --chain-id $CHAIN_ID
randd keys add $KEY_NAME --keyring-backend test
randd add-genesis-account $KEY_NAME $TOKEN_AMOUNT --keyring-backend test
randd gentx $KEY_NAME $STAKING_AMOUNT --chain-id $CHAIN_ID --keyring-backend test
randd collect-gentxs
randd start --rollkit.aggregator true --rollkit.da_layer celestia --rollkit.da_config='{"base_url":"http://localhost:26659","timeout":60000000000,"fee":6000,"gas_limit":6000000}' --rollkit.namespace_id $NAMESPACE_ID --rollkit.da_start_height $DA_BLOCK_HEIGHT
It can be got random number via HTTP call and cli query.
$ curl localhost:<api port>/rand/rand/rand
Result:
{
"random": "4122963114195942713"
}
$ randd q rand rand
Result:
random: "204311977178568350"