Custom networks
Connecting to a network other than mainnet, testnet, preprod, or preview? The [chain] block
gives Oura the parameters it needs to make sense of that network.
Context
Oura requires certain information about the chain it is reading from. In a way, this is similar to the json config files required to run the Cardano node. These values are used for procedures such as encoding bech32 addresses, computing wall-clock time for blocks, etc.
Since mainnet, testnet, preprod and preview are well-known, heavily used networks, Oura hardcodes these values as part of the binary release so that the user is spared from having to manually specify them. On the other hand, custom networks require the user to configure these values manually for Oura to establish a connection.
Feature
By adding a [chain] section in the daemon configuration file, users can provide the information required by Oura to connect to a custom network.
The [chain] section has the following properties:
| Name | DataType | Description |
|---|---|---|
| type | string | types of network (mainnet, testnet, preprod, preview, custom) |
| magic | integer | the network number |
| byron_epoch_length | integer | the length (in seconds) of a Byron epoch in this network |
| byron_slot_length | integer | the length (in seconds) of a Byron slot in this network |
| byron_known_slot | integer | the slot of a Byron block known to exist in this network |
| byron_known_hash | string | the hash of the known Byron block |
| byron_known_time | integer | the unix timestamp of the known Byron block |
| shelley_epoch_length | integer | the length (in seconds) of a Shelley epoch in this network |
| shelley_slot_length | integer | the length (in seconds) of a Shelley slot in this network |
| shelley_known_slot | integer | the slot of a Shelley block known to exist in this network |
| shelley_known_hash | String | the hash of the known Shelley block |
| shelley_known_time | integer | the unix timestamp of the known Shelley block |
Examples
Chain information for mainnet
This example shows the values for mainnet. Since these are hardcoded in Oura’s release you’d
never enter them by hand, but they’re a good illustration of what a [chain] section looks
like.
[chain]type = "custom"magic = 764824073byron_epoch_length = 432000byron_slot_length = 20byron_known_slot = 0byron_known_time = 1506203091byron_known_hash = "f0f7892b5c333cffc4b3c4344de48af4cc63f55e44936196f365a9ef2244134f"shelley_epoch_length = 432000shelley_slot_length = 1shelley_known_slot = 4492800shelley_known_hash = "aa83acbf5904c0edfe4d79b3689d3d00fcfc553cf360fd2229b98d464c28e9de"shelley_known_time = 1596059091