Skip to content

dsrvlabs/rand-da

Repository files navigation

Rand

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.

Get started

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.

Start rand chain

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

Get Random number

It can be got random number via HTTP call and cli query.

HTTP call

$ curl localhost:<api port>/rand/rand/rand

Result:

{
  "random": "4122963114195942713"
}

cli query

$ randd q rand rand

Result:

random: "204311977178568350"

About

Chain RAND with DA Rollup.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages