Skip to content

Commit

Permalink
docs(advanced): adjusted intersect options
Browse files Browse the repository at this point in the history
  • Loading branch information
paulobressan committed Aug 14, 2023
1 parent 19d0175 commit e28b0df
Showing 1 changed file with 11 additions and 31 deletions.
42 changes: 11 additions & 31 deletions docs/pages/v2/advanced/intersect_options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,57 +6,37 @@ Advanced options for instructing Oura from which point in the chain to start rea

When running in daemon mode, Oura provides 4 different strategies for finding the intersection point within the chain sync process.

- `Origin`: Oura will start reading from the beginning of the chain.
- `Tip`: Oura will start reading from the current tip of the chain.
- `Point`: Oura will start reading from a particular point (slot, hash) in the chain. If the point is not found, the process will be terminated with a non-zero exit code.
- `Fallbacks`: Oura will start reading the first valid point within a set of alternative positions. If point is not valid, the process will fallback into the next available point in the list of options. If none of the points are valid, the process will be terminated with a non-zero exit code.
- `Origin`: Oura will start reading from the beginning of the chain.
- `Point`: Oura will start reading from a particular point [slot, hash] in the chain.
- `Breadcrumbs`: Oura will start reading from a some points [[slot, hash],[slot, hash]] in the chain.

The default strategy use by Oura is `Tip`, unless an alternative option is specified via configuration.

You can also define a finalizing point by providing a block hash at which oura will stop reading from the the chain and exit gracefully.

## Configuration

To modify the default behaviour used by the daemon mode, a section named `[source.intersect]` needs to be added in the `daemon.toml` file.
To modify the default behaviour used by the daemon mode, a section named `[intersect]` needs to be added in the `daemon.toml` file.

```toml
[source.intersect]
[intersect]
type = <Type>
value = <Value>
```

- `type`: Defines which strategy to use. Valid values are `Origin`, `Tip`, `Point`, `Fallbacks`. Default value is `Tip`.
- `type`: Defines which strategy to use. Valid values are `Origin`, `Tip`, `Point`, `Breadcrumbs`. Default value is `Tip`.
- `value`: Either a point or an array of points to be used as argument for the selected strategy.

If you'd like it to only sync an specific section of the chain, you can also instruct oura to stop syncing when it reaches an specific block hash by defining a `[source.finalize]` config:

```toml
[source.finalize]
until_hash = <BlockHash>
```

Note that unlike the intersect point, no slot is provided for the finalizer.

## Examples

The following example show how to configure Oura to use a set of fallback intersection point. The chain sync process will attempt to first intersect at slot `4449598`. If not found, it will continue with slot `43159` and finally with slot `0`.
The following example show how to configure Oura to use a intersection point.

```toml
[source.intersect]
type = "Fallbacks"
[intersect]
type = "Point"
value = [
[4449598, "2c9ba2611c5d636ecdb3077fde754413c9d6141c6288109922790e53bbb938b5"],
[43159, "f5d398d6f71a9578521b05c43a668b06b6103f94fcf8d844d4c0aa906704b7a6"],
[0, "f0f7892b5c333cffc4b3c4344de48af4cc63f55e44936196f365a9ef2244134f"],
4493860,
"ce7f821d2140419fea1a7900cf71b0c0a0e94afbb1f814a6717cff071c3b6afc",
]
```

This configuration will sync the whole Byron era only:

```toml
[source.intersect]
type = "Origin"

[source.finalize]
until_hash = "aa83acbf5904c0edfe4d79b3689d3d00fcfc553cf360fd2229b98d464c28e9de"
```

0 comments on commit e28b0df

Please sign in to comment.