-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:txpipe/oura
- Loading branch information
Showing
30 changed files
with
282 additions
and
793 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,52 @@ | ||
# Custom networks | ||
|
||
Instructions on how to configure Oura for connecting to a custom network (aka: other than mainnet / testnet). | ||
Instructions on how to configure Oura for connecting to a custom network (aka: other than mainnet / preprod / preview). | ||
|
||
## 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. | ||
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` and `testnet` 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. | ||
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 propoerties: | ||
|
||
| Name | DataType | Description | | ||
| :------------------- | :------- | :--------------------------------------------------------- | | ||
| 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 | | ||
| address_hrp | string | the human readable part for addresses of this network | | ||
| adahandle_policy | string | the minting policy for AdaHandle on this network. | | ||
|
||
| 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 Testnet | ||
### Chain information for mainnet | ||
|
||
This example configuration shows the values for Testnet. Since testnet values are hardcoded as part of Oura's release, users are not required to input these exact values anywhere, but it serves as a good example of what the configuration looks like. | ||
This example configuration shows the values for mainnet. Since testnet values are hardcoded as part of Oura's release, users are not required to input these exact values anywhere, but it serves as a good example of what the configuration looks like. | ||
|
||
```toml | ||
```toml | ||
[chain] | ||
type = "custom" | ||
magic = 764824073 | ||
byron_epoch_length = 432000 | ||
byron_slot_length = 20 | ||
byron_known_slot = 0 | ||
byron_known_hash = "8f8602837f7c6f8b8867dd1cbc1842cf51a27eaed2c70ef48325d00f8efb320f" | ||
byron_known_time = 1564010416 | ||
byron_known_time = 1506203091 | ||
byron_known_hash = "f0f7892b5c333cffc4b3c4344de48af4cc63f55e44936196f365a9ef2244134f" | ||
shelley_epoch_length = 432000 | ||
shelley_slot_length = 1 | ||
shelley_known_slot = 1598400 | ||
shelley_known_hash = "02b1c561715da9e540411123a6135ee319b02f60b9a11a603d3305556c04329f" | ||
shelley_known_time = 1595967616 | ||
address_hrp = "addr_test" | ||
adahandle_policy = "8d18d786e92776c824607fd8e193ec535c79dc61ea2405ddf3b09fe3" | ||
shelley_known_slot = 4492800 | ||
shelley_known_hash = "aa83acbf5904c0edfe4d79b3689d3d00fcfc553cf360fd2229b98d464c28e9de" | ||
shelley_known_time = 1596059091 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Finalize Options | ||
|
||
Advanced options for instructing Oura to stop on a chain point. If you'd like it to only sync a specific section of the chain, you can also instruct oura to stop syncing when it reaches a specific block hash by defining a `[finalize]` config. | ||
|
||
## Configuration | ||
|
||
To modify the default behavior the daemon mode uses, a section named `[finalize]` needs to be added to the `daemon.toml` file. | ||
|
||
```toml | ||
[finalize] | ||
until_hash = <BlockHash> | ||
max_block_slot = <SlotNumber> | ||
``` | ||
|
||
## Examples | ||
|
||
The following example show how to configure Oura to stop sync on Byron era | ||
|
||
```toml | ||
[finalize] | ||
until_hash = "aa83acbf5904c0edfe4d79b3689d3d00fcfc553cf360fd2229b98d464c28e9de" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Deno filter | ||
|
||
The `deno` filter will allow JS code to be implemented as a stage within the pipeline. | ||
|
||
Therefore it will be possible to manipulate the block data dynamically and according to the specific rules of your business. | ||
|
||
## Configuration | ||
|
||
Adding the following section to the daemon config file will enable the filter as part of the pipeline: | ||
|
||
```toml | ||
[[filters]] | ||
type = "Deno" | ||
main_module = "JS file Path" | ||
use_async = true | ||
``` | ||
|
||
The file should export a function that takes the event data as a parameter, for example | ||
|
||
```js | ||
export async function mapEvent(event) { | ||
const event2 = { ...event, extraProp: "123abc" }; | ||
return event2; | ||
} | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# DSL filter | ||
|
||
Coming Soon! |
Oops, something went wrong.