Chainlink VRF
Chainlink VRF can be added as a plugin to any network. Once a network is running, please select "Plugins" and install Chainlink VRF.
Summary
The Bloctopus VRF Plugin streamlines the integration of Chainlink's Verifiable Random Function into your smart contract development process. Whether you're building something like a lottery that relies on randomness, or any dApp needing unpredictable values, this plugin lets you use Chainlink's services exactly as you would on mainnet—no mocks required.
Check out the official Chainlink VRF v2.5 documentation for more technical details.
Key Capabilities
Shared Subscription Model Manage multiple consuming contracts through one LINK-funded subscription.
Flexible Subscription Handling Easily connect to your existing Chainlink subscription or spin up a new one.
Multi-Chain Ready Compatible with major chains including Ethereum, Arbitrum, Avalanche, BNB Chain, and Polygon.
Getting Started
Step 1: Plugin Installation
- Sign in to your Bloctopus account.
- Go to the Plugins tab of any existing network (or create a new network if none are running).
- Search for "Chainlink VRF" and click Install.
Step 2: Confirm Installation
Wait a few minutes for the plugin to be Installed. Click its card to open a details page with all the information you need to use Chainlink VRF and perform further operations with the running Chainlink nodes.
Details page: This page should display:
- The Chainlink node Operator UI, where you can view node settings, VRF job runs, keys, and manage or run jobs as needed.
- Contract addresses:
- Coordinator Address: Use this address to interact with the main VRF Coordinator contract—create subscriptions, register consumers, and request random values.
- Batch Coordinator Address: Use this address for batch operations, such as managing multiple requests or subscriptions in a single transaction. This is useful for advanced workflows or optimizing gas usage when dealing with many consumers or requests at once.
Using the Plugin
- Call
createSubscription()
on the VRF Coordinator Contract inside your sandbox. - Fund the subscription by calling
transferAndCall()
using LINK. - Follow the provided script for an automated setup.
Make sure your account has enough LINK. Use the faucet if needed.
Technical Notes:
- LINK amounts must be specified in Juel (1 LINK = 1e18 Juel).
- The
data
parameter fortransferAndCall()
must include your Subscription ID, encoded using ABI format.
Final Steps
- Deploy your consumer contract.
- Register it with the VRF Coordinator on your newly created Subscription.
- Request random values as you would on the mainnet.