CallbackConsumer
Git Source (opens in a new tab)
Inherits: BaseConsumer
Allows creating one-time requests for off-chain container compute, delivered via callback
Inherits BaseConsumer
to inherit functions to receive container compute responses
Functions
constructor
Initialize new CallbackConsumer
constructor(address coordinator) BaseConsumer(coordinator);
Parameters
Name | Type | Description |
---|---|---|
coordinator | address | coordinator address |
_requestCompute
Creates a one-time request for off-chain container compute via callback
Under the hood, creates a new subscription at the Infernet coordinator, with period == 0
and
frequency == 1
, effectively initializing a subscription valid immediately and only for 1 interval
function _requestCompute(
string memory containerId,
bytes memory inputs,
uint48 maxGasPrice,
uint32 maxGasLimit,
uint16 redundancy
) internal returns (uint32);
Parameters
Name | Type | Description |
---|---|---|
containerId | string | compute container identifier(s) used by off-chain Infernet node |
inputs | bytes | optional container inputs |
maxGasPrice | uint48 | max gas price in wei paid by Infernet node when fulfilling callback |
maxGasLimit | uint32 | max gas limit in wei used by Infernet node in callback tx |
redundancy | uint16 | number of unique responding Infernet nodes |
Returns
Name | Type | Description |
---|---|---|
<none> | uint32 | subscription ID of newly-created one-time subscription |