requestRandomNumberWithTraceId
msg.sender.
You call the roll.codes coordinator that we deploy and maintain for your network. You do not deploy your own coordinator to use this interface.
Parameters
traceId: optional tracing ID that is echoed inRandomNumberRequestedandRandomNumberDelivered
Usage note
Send the exact fee returned byrequestFee() in msg.value.
requestFee
msg.value must equal requestFee() when you create a request.
deliverSignedRandomNumber
getRequest
status is None, Pending, or Fulfilled.
Consumer callback interface
- authorize the coordinator as the caller
- look up request state by
requestId - reject duplicate settlement
- settle the outcome without unnecessary complexity
Events you are likely to index
RandomNumberRequestedRandomNumberDelivered
Same-round randomness semantics
Requests delivered from the same drand round receive the same baserandomNumber. If your app needs a distinct per-request value inside the same round, derive it locally from requestId and randomNumber.
Related pages
Integration pattern
See a minimal consumer that uses this interface correctly.
Callback security
Apply the required caller and request-state checks in your callback.
Troubleshooting
Fix fee mismatches and callback failures with the reference beside you.