do you have a block explorer?
To get back to this question, CredaCash does not currently have a block explorer, but it is possible to access information about the blockchain from its database. This gets into the internals of the CredaCash software, which might be of interest to some.
ccnode.exe stores all of its data in an sqlite database. This database file is located at %LOCALAPPDATA%\CredaCash\CCNode-1\CCdata.db under Windows, and at $HOME/.CredaCash/CCNode-1/CCdata.db under Linux.
To examine this data under Windows, you can download the file sqlite-tools-win32-x86-<version>.zip from
https://www.sqlite.org/download.html , extract the contents and then run "sqlite3 %LOCALAPPDATA%\CredaCash\CCNode-1\CCdata.db". You can do this while ccnode.exe is running or stopped. The database is in Write Ahead Log (WAL) format, so querying this data will have essentially no effect on ccnode even if it is running, HOWEVER, DO NOT WRITE TO THIS DATABASE. In other words, you can use commands like .schema and select, but do not use insert, update, alter and other commands that add or change data.
The tables in this database are:
Parameters = various values by Key and Subkey. The Key values can be found in the source file ccnode\src\dbparamkeys.h
Blockchain = blocks in raw binary format (explained below)
Serialnums = a list of all spent serial numbers and hash keys
Commit_Tree = the Merkle tree of all transaction output commitments
Commit_Roots = the root value of the Merkle tree after each block that contains outputs
Tx_Outputs = index of all transaction outputs, including address, commitment, asset id (usually encrypted), and amount (usually encrypted)
This table stores only indelible data, which is data guaranteed by the CredaCash blockchain protocol to be immutable. Temporary/mutable data is stored in memory, not on disk.
The information we've been posting here about the mint is stored under Key=7 of the Parameters table, with Subkey set to the block level, and Value set to the total number of mint transactions submitted to the network and seen by this node at each block level. Here are the queries:
The average block interval (seconds per block) over the last hour:
select (1.*max(Timestamp)-min(Timestamp))/(max(Level)-min(Level)) from Commit_Roots where Timestamp > strftime('%s','now') - 3600;
The number of mint transactions per minute seen by this node over the last 210 blocks (approx 1 hour at 17 seconds/block):
select total(Value)*60/(max(Timestamp)-min(Timestamp)) from Parameters, Commit_Roots where Key=7 and Level = Subkey and Subkey>(select max(Subkey-210) from Parameters where Key=7);
The mint transactions per minute a miner needs to submit to earn an average of two mining rewards over the last hour:
select avg(Value)/30. from Parameters where Key=7 and Subkey>(select max(Subkey-210) from Parameters where Key=7);
The blockchain is stored in a raw binary format, which consists of a series of messages in the format:
size, 4 bytes (total size, including this size field, the tag field and the data)
tag, 4 bytes (currently used tags are: block 0xCC010001; mint tx 0xCC040001; pay tx 0xCC060001)
data, variable size binary data
Most fields, including the size and tag, are stored little-endian.
A block consists of a binary header with zero or more binary transactions appended. The block header is:
signature, 64 bytes
prior_block_oid, 16 bytes
block_level, 4 bytes
block_timestamp, 4 bytes
block_witness_id, 1 byte
The transactions are in size/tag/data format. The easiest way to extract the data in a transaction is to convert it to JSON format using the "tx-from-wire" command in cctx64.dll. This can be done from python by calling the function DoJsonCmd located in the cclib.py library, specifically: DoJsonCmd('{"tx-from-wire":{<blockhain_parameters>}}', buf=<binarytx>). Looking at the source code (without actually trying it), the blockchain parameters that have to be included in json format to reconstruct the full transaction are "source-chain", "maximum-input-exponent", "minimum-output-exponent", "maximum-output-exponent" and "merkle-root". These parameters are all properties of the blockchain.
That's a brief dive into the CredaCash internals that can be used to extract information from the blockchain. Eventually, we will have a block explorer. If there are any questions, please let us know. Thank you.