Concordium - Networks
Author | Concordium development team |
---|---|
Discussions-To | https://github.com/ChainAgnostic/namespaces/pull/83 |
Status | Draft |
Type | Standard |
Created | 2023-04-01 |
Table of Contents
CAIP-2
For context, see the CAIP-2 specification.
This CAIP defines an identification schema for Concordium networks.
The Concordium networks are identified by the ccd
namespace prefix, followed by a truncated hash of the given network’s genesis block.
Rationale
Concordium has one mainnet and potentially several testnets. These networks are uniquely identified by a hash of their genesis blocks.
Syntax
Concordium’s network ID is a hash of its genesis block in hexadecimal encoding, truncated to the first 32 characters.
Resolution Mechanics
A hash of the genesis block can be obtained using the gRPC interface of a Concordium node (see Concordium gRPC). The GetConsensusInfo command provides data which includes the hash of that network’s genesis block, which can be truncated to serve as the network identifier.
The request using a CLI tool concordium-client looks as follows:
concordium-client raw GetConsensusInfo
Example response for the testnet
node:
{
"bestBlock": "fa03132dbd8e5d0a2871c47a50bfbd532f3ef4c598098e64eed5a07a169f2574",
"bestBlockHeight": 3541516,
"blockArriveLatencyEMA": 0.1463579781506756,
"blockArriveLatencyEMSD": 5.644804435079067e-2,
"blockArrivePeriodEMA": 10.773324091402692,
"blockArrivePeriodEMSD": 10.96881296245654,
"blockLastArrivedTime": "2023-08-07T16:05:09.799512996Z",
"blockLastReceivedTime": "2023-08-07T16:05:09.791343727Z",
"blockReceiveLatencyEMA": 0.13744546306746866,
"blockReceiveLatencyEMSD": 5.6358647255823326e-2,
"blockReceivePeriodEMA": 10.773406674300828,
"blockReceivePeriodEMSD": 10.96849563757842,
"blocksReceivedCount": 229906,
"blocksVerifiedCount": 229906,
"currentEraGenesisBlock": "7687b54a59fa29d40c69278a01ddd33a40a8fdd6775a3a01343b3576205db1e1",
"currentEraGenesisTime": "2022-11-22T11:05:19.5Z",
"epochDuration": 3600000,
"finalizationCount": 206332,
"finalizationPeriodEMA": 11.586703983078877,
"finalizationPeriodEMSD": 11.25944943176555,
"genesisBlock": "4221332d34e1694168c2a0c0b3fd0f273809612cb13d000d5c2e00e85f50f796",
"genesisIndex": 2,
"genesisTime": "2022-06-13T10:00:00Z",
"lastFinalizedBlock": "fa03132dbd8e5d0a2871c47a50bfbd532f3ef4c598098e64eed5a07a169f2574",
"lastFinalizedBlockHeight": 3541516,
"lastFinalizedTime": "2023-08-07T16:05:10.728847984Z",
"protocolVersion": 5,
"slotDuration": 250,
"transactionsPerBlockEMA": 2.739314019392612e-2,
"transactionsPerBlockEMSD": 0.16322608879784517
}
Truncating the value of the genesisBlock
attribute to the first 32 characters gives 4221332d34e1694168c2a0c0b3fd0f27
Backwards Compatibility
Not applicable
Test Cases
This is a list of manually composed examples:
# Concordium mainnet
ccd:9dd9ca4d19e9393877d2c44b70f89acb
# Current Concordium testnet
ccd:4221332d34e1694168c2a0c0b3fd0f27
References
- Concordium Developer Documentation
- Concordium gRPC - Interacting with a Concordium node: Description of the Concordium gRPC API.
Copyright
Copyright and related rights waived via CC0.
Citation
Please cite this document as:
Concordium development team, "namespaces/ccd-caip2: Concordium - Networks [DRAFT]," Chain Agnostic Namespaces, ccd-caip2, April 2023 / . [Online serial]. Available: https://github.com/ChainAgnostic/namespaces/ccd-caip2.md