ARPA Network
  • ARPA Network
  • Becoming a node & get rewarded
    • Native Staking
      • Introduction to Staking v0.1
    • Eigenlayer Integration
  • Randcast
    • Getting Started
      • Use Web GUI
        • Subscription Management Portal
        • Remix
      • Use Randcast CLI
      • Use Solidity Development Tools
    • Using the SDK
      • Adapter
      • BasicRandcastConsumerBase
      • GeneralRandcastConsumerBase
      • Randcast Utilities
      • Consumer Contract Examples
        • Example - Get Random Number
        • Example - Roll a Dice
        • Example - Shuffle an Array
        • Example - Draw a Lottery
        • Example - Pick a Property
        • Example - Pick a Rarity
        • Example - Pick a Winner
        • Example - Advanced Request
    • Supported Networks & Parameters
  • GitHub Repositories
Powered by GitBook
On this page
  • To integrate Randcast into your DApp:
  • 1. Use Web GUI
  • 2. Use Randcast CLI
  • 3. Use Solidity Development Tools (e.g. Foundry)
  1. Randcast

Getting Started

PreviousRandcastNextUse Web GUI

Last updated 1 year ago

To integrate Randcast into your DApp:

  1. Create a Subscription

  2. Fund the Subscription

  3. Build and Deploy the Consumer Contract

  4. Add Consumer to your Subscription

  5. Request Randomness from the Consumer

  6. 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.


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

provides , which you can extend to implement your custom logic, like in .

1.

2.

3. (e.g. )

Requires experience in

Randcast SDK
a base implementation of the Consumer Contract
this simple example
Use Web GUI
Use Randcast CLI
Use Solidity Development Tools
Foundry
Foundry
Step-by-step Randcast Tutorial