Admin

The data models produced by the tools in the Admin category relate to scraping the chain, producing the Unchained Index, and querying the configuration of the system. Additional data related to sharing the indexes via IPFS and pinning the same are also produced by tools in this category.

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

Status

The chifra config tool reports on the state (and size) of the various TrueBlocks local binary caches. TrueBlocks produces nine difference caches: abis, blocks, monitors, names, objs, recons, slurps, traces, transactions. In general practice, these caches may take up a few GB of hard drive space, however, for very popular smart contract the size of the caches may grow rather large. Keep an eye on it.

The status data model is a complex beast. It contains various information including a list of registered chains, information about many of the internal binary caches maintained by chifra as well as current status information about the system including version information for both chifra and the node it’s running against.

The following commands produce and manage Statuses:

Statuses consist of the following fields:

FieldDescriptionType
cachePaththe path to the local binary cachesstring
cachesa collection of information concerning the binary cachesCacheItem[]
chainthe current chainstring
chainConfigthe path to the chain configuration folderstring
clientVersionthe version string as reported by the rpcProviderstring
chainIdthe path to config filesstring
hasEsKeytrue if an Etherscan key is presentbool
hasPinKeytrue if a Pinata API key is presentbool
indexPaththe path to the local binary indexesstring
isApitrue if the server is running in API modebool
isArchivetrue if the rpcProvider is an archive nodebool
isTestingtrue if the server is running in test modebool
isTracingtrue if the rpcProvider provides Parity tracesbool
isScrapingtrue if the scraper is runningbool
networkIdthe network id as reported by the rpcProviderstring
progressthe progress string of the systemstring
rootConfigthe path to the root configuration folderstring
rpcProviderthe current rpcProviderstring
versionthe TrueBlocks version stringstring
chainsa list of available chains in the config fileChain[]

Manifest

The Manifest details the portions of the index of appearances which are called ChunkRecords. Each record in the Manifest details the block range represented by the chunk as well as the IPFS hash of the index chunk along with the associated IPFS hash for the Bloom filter of the chunk. The manifest itself is also pushed to IPFS and the IPFS of the hash of the manifest is published periodically to the Unchained Index smart contract.

The following commands produce and manage Manifests:

Manifests consist of the following fields:

FieldDescriptionType
versionthe version string hashed into the chunk datastring
chainthe chain to which this manifest belongsstring
specificationIPFS cid of the specificationipfshash
chunksa list of the IPFS hashes of all of the chunks in the unchained indexChunkRecord[]

ChunkRecord

The TrueBlocks index scraper periodically creates a chunked portion of the index so that it can be more easily stored in a content-addresable data store such as IPFS. We call these periodically-created chunks ChunkRecords. The format of said item is described here. A pinned chunk is effectively a relational table relating all of the addresses appearing in the chunk with a list of appearances appearing in the chunk.

The following commands produce and manage ChunkRecords:

ChunkRecords consist of the following fields:

FieldDescriptionType
rangethe block range (inclusive) covered by this chunkblkrange
bloomHashthe IPFS hash of the bloom filter at that rangeipfshash
indexHashthe IPFS hash of the index chunk at that rangeipfshash
bloomSizethe size of the bloom filter in bytesint64
indexSizethe size of the index portion in bytesint64

ChunkIndex

The indexchunk data model represents internal information about each Unchained Index index chunk. It is used mostly interenally to study the characteristics of the Unchained Index.

The following commands produce and manage ChunkIndexes:

ChunkIndexes consist of the following fields:

FieldDescriptionType
rangethe block range (inclusive) covered by this chunkblkrange
magican internal use only magic number to indicate file formatstring
hashthe hash of the specification under which this chunk was generatedhash
nAddressesthe number of addresses in this chunkuint64
nAppearancesthe number of appearances in this chunkuint64
sizethe size of the chunk in bytesuint64

ChunkBloom

The blooms data model represents the bloom filter files that front the Unchained Index index portions. The information here is mostly for internal use only as it includes the size and number of the bloom filters present as well as the number of addresses inserted into the bloom. This information is used to study the characteristics of the Unchained Index.

The following commands produce and manage ChunkBlooms:

ChunkBlooms consist of the following fields:

FieldDescriptionType
rangethe block range (inclusive) covered by this chunkblkrange
magican internal use only magic number to indicate file formatstring
hashthe hash of the specification under which this chunk was generatedhash
nBloomsthe number of individual bloom filters in this bloom fileuint64
nInsertedthe number of addresses inserted into the bloom fileuint64
sizethe size on disc in bytes of this bloom fileuint64
byteWidththe width of the bloom filteruint64

ChunkAddress

The addresses data model is produced by chifra chunks and represents the records found in the addresses table of each Unchained Index chunk. The offset and count fields represent the location and number of records in the appearances table to which the address table is related.

The following commands produce and manage ChunkAddress:

ChunkAddress consist of the following fields:

FieldDescriptionType
addressthe address in this recordaddress
rangethe block range of the chunk from which this address record was takenblkrange
offsetthe offset into the appearance table of the first record for this addressuint64
countthe number of records in teh appearance table for this addressuint64

IpfsPin

ipfsPin represents the date, CID and metadata filename of a single IPFS pinned file.

The following commands produce and manage IpfsPins:

IpfsPins consist of the following fields:

FieldDescriptionType
cidthe CID of the fileipfshash
datePinnedthe date the CID was first createdstring
statusthe status of the file (one of [allpinned
sizethe size of the file in bytesint64
fileNamethe metadata name of the pinned filestring

ChunkStats

The stats data model is produced by chifra chunks and brings together various statistical information such as average number of addresses in an Unchained Index chunk among other information.

The following commands produce and manage ChunkStats:

ChunkStats consist of the following fields:

FieldDescriptionType
rangethe block range (inclusive) covered by this chunkblkrange
rangeEndthe date of the last block in this rangedatetime
nAddrsthe number of addresses in the chunkuint64
nAppsthe number of appearances in the chunkuint64
nBlocksthe number of blocks in the chunkuint64
nBloomsthe number of bloom filters in the chunk’s bloomuint64
recWidthe record width of a single bloom filteruint64
bloomSzthe size of the bloom filters on disc in bytesuint64
chunkSzthe size of the chunks on disc in bytesuint64
addrsPerBlockthe average number of addresses per blockdouble
appsPerBlockthe average number of appearances per blockdouble
appsPerAddrthe average number of appearances per addressdouble
ratiothe ratio of appearances to addressesdouble

MonitorClean

MonitorClean is a report on removing duplicates from monitors.

The following commands produce and manage MonitorCleans:

MonitorCleans consist of the following fields:

FieldDescriptionType
addressthe address being cleanedaddress
sizeThenthe number of appearances in the monitor prior to cleaningint64
sizeNowthe number of appearances in the monitor after cleaningint64
dupsthe number of duplicates removedint64

CacheItem

The cacheItem data model is used to display various caches displayed from the chifra config tool.

The following commands produce and manage CacheItems:

CacheItems consist of the following fields:

FieldDescriptionType
typethe type of the cachestring
itemsthe individual items in the cache (if –verbose)Any
lastCachedthe date of the most recent item added to the cachestring
nFilesthe number of items in the cacheuint64
nFoldersthe number of folders holding that many itemsuint64
paththe path to the top of the given cachestring
sizeInBytesthe size of the cache in bytesint64

ReportCheck

ChunkCheck reports on the results of tests conducted under chifra chunks –check

The following commands produce and manage ReportChecks:

ReportChecks consist of the following fields:

FieldDescriptionType
resultthe result of the checkstring
visitedCntthe number of visited items in the cacheuint32
checkedCntthe number of checksuint32
skippedCntthe number of skipped checksuint32
passedCntthe number of passed checksuint32
failedCntthe number of failed checksuint32
msgStringsan array of messages explaining failed checks[]string
reasonthe reason for the teststring

ChunkPinReport

Reports on the result of the command chifra chunks manifest --pin [--deep].

The following commands produce and manage ChunkPinReports:

ChunkPinReports consist of the following fields:

FieldDescriptionType
versionthe version string hashed into the chunk datastring
chainthe chain to which this manifest belongsstring
timestampHashIPFS cid of file containing timestampsipfshash
specHashIPFS cid of the specificationipfshash
manifestHashIPFS cid of file containing CIDs for the various chunksipfshash

Chain

The chain data model represents the configured chain data found in the trueBlocks.toml configuration file.

The following commands produce and manage Chains:

Chains consist of the following fields:

FieldDescriptionType
chainthe common name of the chainstring
chainIdthe chain id as reported by the RPCuint64
symbolthe symbol of the base currency on the chainstring
rpcProvidera valid RPC provider for the chainstring
remoteExplorera remote explorer for the chain such as Etherscanstring
localExplorerthe local explorer for the chain (typically TrueBlocks Explorer)string
ipfsGatewayan IPFS gateway for pinning the index if enabledstring

Base types

This documentation mentions the following basic data types.

TypeDescriptionNotes
[]stringan array of strings
addressan ‘0x’-prefixed 20-byte hex stringlowercase
blkrangea pair of nine-digit block numberszero padded
booleither true, false, 1, or 0
datetimea JSON formatted dateas a string
doublea double precision float64 bits
hashan ‘0x’-prefixed 32-byte hex stringlowercase
int64a 64-bit signed integer
ipfshasha multi-hash produced by IPFSmixed-case
stringa normal character string
uint32a 32-bit unsigned integer
uint64a 64-bit unsigned integer

Edit this page on GitHub