The blocklog
contract is one of the core contracts on each IOTA Smart Contracts chain.
The blocklog
contract keeps track of the blocks of requests processed by the chain, providing views to get request
status, receipts, block, and event details.
To avoid having a monotonically increasing state size, only the latest N
blocks (and their events and receipts) are stored. This parameter can be configured
when deploying the chain.
Views
getBlockInfo
Returns information about the block with index blockIndex
.
Parameters
Name | Type | Optional | Description |
---|
blockIndex | u32 | Yes | The block index. Default: the latest block |
Returns
Name | Type | Description |
---|
blockIndex | u32 | The block Index |
blockInfo | *BlockInfo | The information about the block |
getRequestIDsForBlock
Returns a list with all request IDs in the block with block index n
.
Parameters
Name | Type | Optional | Description |
---|
blockIndex | u32 | Yes | The block index. The default value is the latest block |
Returns
Name | Type | Description |
---|
blockIndex | u32 | The block Index |
requestIDsInBlock | [[u8; 32]] | The ISC Request IDs |
getRequestReceipt
Returns the receipt for the request with the given ID.
Parameters
Name | Type | Optional | Description |
---|
requestID | [u8; 32] | No | The request ID |
Returns
getRequestReceiptsForBlock
Returns all the receipts in the block with index blockIndex
.
Parameters
Name | Type | Optional | Description |
---|
blockIndex | u32 | Yes | The block index. Defaults to the latest block |
Response
isRequestProcessed
Returns whether the request with ID u
has been processed.
Parameters
Name | Type | Optional | Description |
---|
requestID | [u8; 32] | No | The request ID |
Returns
Name | Type | Description |
---|
isProcessed | bool | Whether the request was processed or not |
getEventsForRequest
Returns the list of events triggered during the execution of the request with ID requestID
.
Parameters
Name | Type | Optional | Description |
---|
requestID | [u8; 32] | No | The request ID |
Returns
Name | Type | Description |
---|
events | [Event] | List of events |
getEventsForBlock
Returns the list of events triggered during the execution of all requests in the block with index blockIndex
.
Parameters
Name | Type | Optional | Description |
---|
blockIndex | u32 | Yes | The block index. Defaults to the latest block |
Returns
Name | Type | Description |
---|
blockIndex | u32 | The block index |
events | [Event] | List of events |