Comment on page
Using the random beacon on-chain
Follow this tutorial to learn how to write a smart contract that consumes randomness from Cryptosat's Random Beacon contract.
- 2.Go to the compiler tab, as shown below:
- 4.Deploy your new contract that consumes our Random Beacon contract:
- 1.Click the Deploy & run transactions tab
- 2.In the Environment drop-down menu, choose "Injected Provider - MetaMask". Don't forget to approve in the pop-up.
- 3.Next to the Deploy button, enter the address of the random beacon:
- Velas Mainnet:
- Velas Testnet:
In this example, we'll use the Testnet address:
After you deploy your contract, you can interact with it.
Click on the
requestRandomWordbutton to request Space Random Beacon.
Your request has now been queued and will be submitted to the satellite. The request can take several hours to return to complete.
Once the random number is generated, you can view it by clicking on the