Other

The following commands provide useful miscellaneous tools:

  • chifra explore a quick way to open a blockchain explorer,
  • ethslurp an older tool that lets you call data from Etherscan. (This has issues of centralization and data quality, see explanation in its section).

Note: some of these tools, such as ethslurp, require an Etherscan key. Follow these instructions to add a key to your config.

Each data structure is created by one or more tools which are detailed below.

Abi

An ABI describes an Application Binary Interface – in other words, the Function and Event signatures for a given smart contract. Along with Names the use of ABIs goes a very long way towards making your Ethereum data much more understandable.

Similar to names of addresses, ABI files are not available on-chain which means they must be acquired somewhere. Unfortunately, the Ethereum community has not yet understand that Etherscan is not a good place to store this very important information. For this reason, TrueBlocks uses Etherscan to acquire ABI files and therefor one needs to get an Etherscan API key to use this function.

The following commands produce and manage Abis:

Abis consist of the following fields:

FieldDescriptionType
addressthe address for the ABIaddress
functionsthe functions for this addressFunction[]

Notes

See the chifra abis command line for information about getting an Etherscan key.

Function

ABI files are derived from the Solidity source code of a smart contract by extracting the canonical function and event signatures in a JSON structure. The function signatures are hashed (using keccak) into four-byte encodings for functions and 32-byte encodings for events. Because the blockchain only deals with byte data, TrueBlocks needs a way to decode the bytes back into the human-readable function and event signatures. We call this process --articulate. Most TrueBlocks commands provide an --articulate option. See the commands themselves for more information.

The following commands produce and manage Functions:

Functions consist of the following fields:

FieldDescriptionType
namethe name of the interfacestring
typethe type of the interface, either ’event’ or ‘function’string
signaturethe canonical signature of the interfacestring
encodingthe signature encoded with keccakstring
inputsthe input parameters to the function, if anyParameter[]
outputsthe output parameters to the function, if anyParameter[]

Parameter

Parameters are a constituent part of a Function or Event. The parameters of a function are each individual value passed into the function. Along with the function’s name, the parameters types (once canonicalized) are used to create a function’s four byte signature (or an event’s 32-byte signature). Parameters are important to TrueBlocks because we use them as part of the ABI decoding and the --articulate process to conver the blockchain’s bytes into human-readable text.

The following commands produce and manage Parameters:

Parameters consist of the following fields:

FieldDescriptionType
typethe type of this parameterstring
namethe name of this parameterstring
strDefaultthe default value of this parameter, if anystring
indexedtrue if this parameter is indexedbool
internalTypefor composite types, the internal type of the parameterstring
componentsfor composite types, the parameters making up the compositeParameter[]

Slurp

THIS SHOULD BE ETHERSCAN DATA RELATED, BUT IT’S NOT TIED IN, SO IT DOESN’T DO ANYTHING The traceFilter is an internal data structure used to query using the chifra traces --filter command. Its use may, in the future, be expanded for other use cases. Note that all fields are optional, but not all may be empty at the same time.

The following commands produce and manage Slurps:

Slurps consist of the following fields:

FieldDescriptionType
hashthe hash of the transactionhash
blockHashthe hash of the block containing this transactionhash
blockNumberthe number of the blockblknum
transactionIndexthe zero-indexed position of the transaction in the blockblknum
noncesequence number of the transactions sent by the senderuint64
timestampthe Unix timestamp of the objecttimestamp
datethe timestamp as a date (calculated)datetime
fromaddress from which the transaction was sentaddress
toaddress to which the transaction was sentaddress
valuethe amount of wei sent with this transactionswei
gasthe maximum number of gas allowed for this transactiongas
gasPricethe number of wei per unit of gas the sender is willing to spendgas
inputbyte data either containing a message or funcational data for a smart contracts. See the –articulatebytes
hasTokentrue if the transaction is token related, false otherwisebool
articulatedTxif present, the function that was called in the transactionFunction
compressedTxtruncated, more readable version of the articulationstring
isErrortrue if the transaction ended in error, false otherwisebool

SlurpCount

The slurpCount carries information about the counts returned by remote APIs.

The following commands produce and manage SlurpCounts:

SlurpCounts consist of the following fields:

FieldDescriptionType
addressthe address used to query the APIaddress
countthe number of records known by the API for this addressuint64

Base types

This documentation mentions the following basic data types.

TypeDescriptionNotes
addressan ‘0x’-prefixed 20-byte hex stringlowercase
blknuman alias for a uint64
booleither true, false, 1, or 0
bytesan arbitrarily long string of bytes
datetimea JSON formatted dateas a string
gasan unsigned big numberas a string
hashan ‘0x’-prefixed 32-byte hex stringlowercase
stringa normal character string
timestampa 64-bit unsigned integerUnix timestamp
uint64a 64-bit unsigned integer
weian unsigned big numberas a string

Copyright (c) 2024, TrueBlocks, LLC. All rights reserved. Generated with goMaker.

Edit this page on GitHub