Skip to content

Support dynamically specified networks - #187

Open
SebastienGllmt wants to merge 14 commits into
mainfrom
custom-networks
Open

Support dynamically specified networks#187
SebastienGllmt wants to merge 14 commits into
mainfrom
custom-networks

Conversation

@SebastienGllmt

@SebastienGllmt SebastienGllmt commented Apr 29, 2024

Copy link
Copy Markdown
Contributor

Currently Carp only supports a fixed set of networks (preprod, preview, sanchonet, mainnet)

However, to be able to test easily on local networks, we need to support the ability to connect to a custom network whose genesis files and contents are provided after compile-time.

Missing features:

  • utility functions to parse required information from genesis & network configs for a network
  • properly populate CardanoNet config

ecioppettini pushed a commit to dcSpark/dcspark-core that referenced this pull request Aug 27, 2024
* NetworkConfiguration JSON

Related to dcSpark/carp#187

* remove json test

* Bump CML to 6.0.0
Comment thread indexer/configs/custom.yml Outdated
Comment on lines +14 to +35
custom_config:
chain_info:
network_id: 1
protocol_magic: 42
relay:
- "localhost"
- 3001
from:
BlockHeader:
slot_nb: 1
hash: "ba8066f73eb9cf4ad9adf38051c54d3a51d92cb98561cffc1f202b1b97739cd5"
genesis_parent: "0ded594a3411f6d3236228abc1e2ef8c2a21e09d859ea23bfc2182f92853cba8"
genesis:
BlockHeader:
slot_nb: 0
hash: "7a32184d9e0068b0fa75fd0ecaad798f9bc573d4921c519b12968e26ff0747a3"
shelley_era_config:
first_slot: 0
start_epoch: 0
known_time: 1722355346
slot_length: 1
epoch_length_seconds: 500

@SebastienGllmt SebastienGllmt Sep 14, 2024

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not convinced about this approach. How would you convert the yaci-devkit to this data type dynamically?

Especially because the genesis config can contain stuff that we actually have to insert into the database (ex: for Shelley, the Shelley config can contain some default pools and registrations for the Shelley era that Carp would have to know about)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can do the config file dynamically with the env variable, wouldn't that be enough?

Comment thread indexer/src/engine.rs Outdated

let mut perf_aggregator = PerfAggregator::new();

// TODO: fetch from DB

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO

Comment thread indexer/src/sinks/cardano.rs Outdated
)
.await?
}
Some(prev_era) if era > prev_era => {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC I never added proper rollback support since it was tricky to figure out how to handle rollbacks that undo a era transition

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants