Getting Started
Last updated
Last updated
Create a Subscription
Fund the Subscription
Build and Deploy the Consumer Contract
Add Consumer to your Subscription
Request Randomness from the Consumer
Process the Randomness Result in your Consumer Contract
Note:
Randcast requests are paid via Subscription; you should fund your Subscription in advance to avoid service interruptions.
A Consumer Contract is part of your DApp and is used to request and "consume" the randomness from Randcast; any subsequent logic on how to utilize the randomness result can be defined in the callback function within your Consumer Contract.
Randcast SDK provides a base implementation of the Consumer Contract, which you can extend to implement your custom logic, like in this simple example.
In this tutorial, we will demonstrate three ways to integrate Randcast into your DApp.
Pros:
Zero local development environment setup
Minimum command-line experience required
Intuitive to less experienced developers
Cons:
Less flexible
Hard to debug for complex DApps
Less verbose output
Pros:
More verbose output
More flexible
Easy to debug
Cons:
Requires local development environment setup using Docker
Requires command-line experience
Requires basic Solidity development experience
Pros:
Most verbose output
Most flexible
Full programmatic access, easy to automate
Cons:
Requires local development environment setup
Requires advanced Solidity development experience
Requires experience in Foundry