carp
carp copied to clipboard
Support arbitrary genesis block
Currently, we store a parsed version of the genesis blocks inside https://github.com/dcSpark/oura-postgres-sink/tree/main/genesis
This is okay for v1, but it makes this project hard to reuse for other networks that may spin up in Cardano in the future. Ideally, we would instead take a genesis file and parse the information from there.
Notably, you can find the full genesis blocks in the cardano-node repo
There are a few tricky things with this:
- The genesis blocks contain the initial distribution of funds as avvm and non-avvm balances, but these need to be converted into addresses. You can find code for converting these two formats here
- Other networks that use Cardano in the future may skip Byron entirely and start with a different kind of genesis block (so the code wouldn't be compatible anyway)
- Our current Oura config only supports "testnet" and "mainnet" as strings. I think Oura has a secret feature to replace these with custom parameters you can parse from genesis though