Retrives attributes of the blocks produced within a user-specified time range

get_blocks_for_time_range(min_timestamp, max_timestamp, max_attempts = 3L)

Arguments

min_timestamp

(numeric or character): a Unix timestamp (including milliseconds), which defines the beginning of the period of interest (inclusive). Defaults to 0.

max_timestamp

(numeric or character): a Unix timestamp (including milliseconds), which defines the end of the period of interest (inclusive).

max_attempts

(integer, positive): specifies the maximum number of additional attempts to call a URL if the first attempt fails (i.e. its call status is different from 200). Additional attempts are implemented with an exponential backoff. Defaults to 3.

Value

A tibble with the following columns:

  • block_number (character);

  • timestamp (POSIXct): date and time when the block was produced;

  • hash (character): hash ID of the block;

  • parent_hash (character): hash ID of the parent block;

  • tx_trie_root (character): trie root ID of the transaction that produced the block;

  • confirmed (boolean): indicator of whether the block is confirmed;

  • revert (boolean): indicator of the whether the block-producing transaction was reverted;

  • size (integer): block size (in bytes);

  • witness_address (character): base58check-formatted address of the account that produced the block;

  • witness_name (character): common name of the account that produced the block;

  • tx_count(integer): number of transactions associated with the block;

  • net_usage (integer): total bandwidth consumed by the block's transactions;

  • energy_usage (integer): total energy used by the block's transactions.

Examples

r <- get_blocks_for_time_range( min_timestamp = "1551715200000", max_timestamp = "1551715210000" )
#>
#> - Fetching data... Elapsed time: 00:00:00
print(r)
#> # A tibble: 4 x 13 #> block_number timestamp hash parent_hash tx_trie_root confirmed #> <chr> <dttm> <chr> <chr> <chr> <lgl> #> 1 7203852 2019-03-04 16:00:09 000000… 00000000006d… 2Y3SaM5CxAEM… TRUE #> 2 7203851 2019-03-04 16:00:06 000000… 00000000006d… 26NX5Uzsxx1e… TRUE #> 3 7203850 2019-03-04 16:00:03 000000… 00000000006d… NxDUDAevrHRd… TRUE #> 4 7203849 2019-03-04 16:00:00 000000… 00000000006d… pHh6LPiqHtwg… TRUE #> # … with 7 more variables: revert <lgl>, size <int>, witness_address <chr>, #> # witness_name <chr>, tx_count <int>, net_usage <int>, energy_usage <int>