Retrieve all blocks, transactions, events

Blocks pagination

Get finalized timestamp

As the API is eventually consistant before starting pagination we need to limit the pagination range by the finalized timestamp (timestamp that guarantees that there is not missed objects before it).

query{
    blockchain{
        finalized_timestamp
    }
}

What is сhain_order?

Because Acki Nacki blockchain dynamically splits and merges it is not possible to follow one chain seqno to sequentially retrieve all the blocks.

We added a unique index for blocks to paginate them across all the threads: chain_order

chain_order = block-timestamp-in-seconds + 
                placeholder-for-future-purposes +
                thread_id + height

Each value should be converted to hex string and prefixed with <string size -1>.

For example:

chain_order=7698320d000670000000000000000000000000000000000000000000000000000000000000000000061d4b1c0, where

7698320d0 (8-length of timestamp, timestamp value = 1770201296 or Wednesday, 4 February 2026 10:34:56

00 - placeholder value for future usage with value 0 and length=1-1=0

6700000000000000000000000000000000000000000000000000000000000000000000 - thread `00000000000000000000000000000000000000000000000000000000000000000000 , length 68-1=67

61d4b1c0 - height=30716352, length 7-1=6

Paginate by blocks within timestamp range

Pagination parameters:

after,before - specify chain_order/cursor field here

Here we continue pagination within timestamp range and ask for the next 3 blocks after the last cursor in the previous query. We see that the next page exists so we can continue paginating within the same timestamp range.

Result:

You can see cursor field in each edge object is same as cursor (because chain_order plays the role of cursor), which can be passed over to the next query for pagination. Get the latest cursor for the page in PageInfo.endCursor field.

Query all transactions/calls/internal transfers/events within block

circle-info

Calls in Acki Nacki are incoming messages attached to the transaction in transaction.in_message object with msg_type=0

Internal transfers are incoming(in_message) and outgoing messages (out_messages) of the transaction with msg_type=1

Events are outgoing messages (out_messages) of transaction with msg_type=2

  1. Get the required block's chain_order. For example chain_order = "7698320d000670000000000000000000000000000000000000000000000000000000000000000000061d4b1c0"

  2. Calculate chain_order for the block with height = height+1. You can write your own code or use this JS script as an example - that parses chain_order, adds 1 to height and encodes it back.

  1. Paginate all transactions for the block with chain_order = "7698320d000670000000000000000000000000000000000000000000000000000000000000000000061d4b1c0"

The result:

Last updated