Data models summarize the parameters that define important Chainweb node elements.
The information in the data models is the same as the information covered in the endpoint documentation.
It's duplicated here as a quick reference.
Cut model
Parameter
Type
Description
origin
object
Defines a peer information object that consists of an id string and an address object. The origin parameter is required to use the PUT /cut endpoint. For more information, see the Peer information data model.
height (required)
integer >= 0
Defines the cut height. The cut height is the sum of the height of all blocks of the cut. You should avoid using this value in any applications or tools because its semantics might change.
weight (required)
string
Defines the cut weight. The cut weight is the sum of the weights from all of the blocks included in the cut. The weight string consists of 43 characters from the a-zA-Z0-9_- character set.
hashes (required)
object
Defines an object that maps chain identifiers to their respective block hash and block height. The block hash property is a required string value with characters from the a-zA-Z0-9_- character set. The block height property is a required integer value >= 0. The hashes object includes the height and hash properties for each chain, as illustrated for chains 0 and 1 in the truncated JSON example.
Records the time the block was created. This timestamp is in microseconds since the start of the UNIX epoch.
parent (required)
string
Records the parent block hash. The block hash is a Base64Url-encoded string—without padding—that consists of 43 characters from the a-zA-Z0-9_- character set.
height (required)
integer >= 0
Identifies the block height for the block. The height of a block is the number of its predecessors in the block chain.
hash (required)
string
Block hash is a Base64Url-encoded string—without padding—that consists of 43 characters from the a-zA-Z0-9_- character set.
chainId (required)
integer >= 0
Specifies the Chainweb chain identifier. In Kadena, Chainweb chains are named by numbers starting from 0. Valid values depend on the current graph at the respective block height of the Chainweb version.
weight (required)
string
Specifies the block weight for the block. Block weight is a Base64Url-encoded string—without padding—that consists of 43 characters from the a-zA-Z0-9_- character set. The weight of a block is the sum of the difficulties of the block and of all of its ancestors. The difficulty of a block is the maximum difficulty divided by the target. The string is a 256-bit little endian encoding of the numerical value.
featureFlags (required)
integer
Specifies a reserved value that must be 0.
epochStart (required)
integer >= 0
Specifies a timestamp in microseconds since the start of the UNIX epoch.
adjacents (required)
object
Records the block hashes of the adjacent parents of the block. This is represented as an associative array that maps the adjacent chain ids to the respective block hash. Each block hash is a Base64Url-encoded string—without padding—that consists of 43 characters from the a-zA-Z0-9_- character set.
payloadHash (required)
string
Specifies the block payload hash. The payload hash is a Base64Url-encoded string—without padding—that consists of 43 characters from the a-zA-Z0-9_- character set.
chainwebVersion (required)
enum
Specifies the Chainweb network version identifier for the Kadena network. The valid values are "test-singleton", "development", "mainnet01", and "testnet04".
target (required)
string
Specifies the proof-of-work target for the block. The proof-of-work target for a block is a Base64Url-encoded string—without padding—that consists of 43 characters from the a-zA-Z0-9_- character set. The string is a 256-bit little endian encoding of the numerical value.
nonce (required)
string
Specifies the proof-of-work nonce for the block. This value is computed by the miner such that the block hash is smaller than the target.
Array of Base64Url encoded strings without padding that represent signed Pact transactions in JSON format.
minerData (required)
string
Miner information is a Base64Url-encoded string—without padding—that consists of 43 characters from the a-zA-Z0-9_- character set. This information is included as part of the payload in the JSON object.
transactionsHash (required)
string
The transaction hash is a SHA256 hash. The hash is a Base64Url-encoded string—without padding—that consists of 43 characters from the a-zA-Z0-9_- character set.
outputsHash (required)
string
The output hash is a SHA256 hash. The hash is a Base64Url-encoded string—without padding—that consists of 43 characters from the a-zA-Z0-9_- character set.
payloadHash (required)
string
The block payload hash is a Base64Url-encoded string—without padding—that consists of 43 characters from the a-zA-Z0-9_- character set.
Array with pairs of strings that represent transactions and their outputs. Signed Pact transactions and their outputs are both Base64Url-encoded strings—without padding—that represent signed Pact transactions in JSON format.
minerData (required)
string
Miner information is a Base64Url-encoded string—without padding—that consists of characters from the a-zA-Z0-9_- character set. This information is included as part of the payload JSON object.
transactionsHash (required)
string
The transaction hash is a SHA256 hash. The hash is a Base64Url-encoded string—without padding—that consists of 43 characters from the a-zA-Z0-9_- character set.
outputsHash (required)
string
The output hash is a SHA256 hash. The hash is a Base64Url-encoded string—without padding—that consists of 43 characters from the a-zA-Z0-9_- character set.
payloadHash (required)
string
The block payload hash is a Base64Url-encoded string—without padding—that consists of 43 characters from the a-zA-Z0-9_- character set.
coinbase (required)
string
Coinbase output is a Base64Url-encoded string—without padding—that consists of characters from the a-zA-Z0-9_- character set. This information is included as part of the payload output JSON object.
The id is a Base64Url-encoded string—without padding—that consists of characters from the a-zA-Z0-9_- character set. This string represents the SHA256 fingerprint of the SSL certificate of the node. The field can be null only if the node uses an official CA-signed certificate.
address (required)
object
The address contains a hostname and port number. The hostname is a required string value in the form of a domain name, IPv4 IP address, or IPv6 IP address. The hostname must be a domain name only if the node uses a valid CA-signed SSL certificate. The port is a required integer value [1 .. 65535] that hosts the peer node.
Note that it is generally easier to query the peer information for a node using a GET query for the peer database.
To get the Base64Url-encoded SHA256 fingerprint peer id for peers with self-signed certificates, run a command like this for the specified chainweb-node NODE:
The update event stream model describes the server-sent events that notify miners when new mining work becomes available.
The stream is terminated by the server in regular intervals and it is up to the client to request a new stream.
Each event consists of a single line.
Events are separated by empty lines.
Parameter
Type
Description
events
Array
Each event consists of the string value "event:New Cut".