Providing Randomness

Providing randomness to applications can be a great way to supply a necessary piece of infrastructure for StarkNet. Furthermore randomness providers can receive fees for each randomness request they resolve.
We will be deploying the software that calculates random numbers to the cloud using a render background worker. While the software can run locally, deploying to a cloud environment will help maintain a consistent uptime of the software.
For this tutorial you will need to
  • A Render Account
  • A deployed wallet with the private key in hand
  1. 1.
    At the render dashboard select Background Worker
  2. 2.
3. Fill in the following fields (the others should be left as is)
Field
Value
Start Command
cargo run --example client --release
4. Leave the Starter Option selected under Plans
5. Selected the advanced button and then add the following environment variable
Field
Value
NETWORK
pick mainnet or goerli
ORACLE_ADDRESS
refer to deployed contracts and select an address for the chosen network
VRF_SECRET
a secret number you generate
6. Then add two secret files
File Name
Value
wallet-address.txt
A list of wallet addresses that your VRF client will use
wallet-secret.txt
A list of wallet secrets that correspond to the wallet addresses specified in the other file