Skip to content

Commit 2d1c5b1

Browse files
committed
feat: test PeerNetworkInterface in omnibus
1 parent 2281311 commit 2d1c5b1

File tree

6 files changed

+124
-0
lines changed

6 files changed

+124
-0
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/genesis_bootstrapper/build.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,16 @@ async fn main() -> Result<()> {
6262
"https://book.world.dev.cardano.org/environments/mainnet/shelley-genesis.json",
6363
"mainnet-shelley-genesis.json",
6464
),
65+
download(
66+
&client,
67+
"https://book.world.dev.cardano.org/environments/preview/byron-genesis.json",
68+
"preview-byron-genesis.json",
69+
),
70+
download(
71+
&client,
72+
"https://book.world.dev.cardano.org/environments/preview/shelley-genesis.json",
73+
"preview-shelley-genesis.json",
74+
),
6575
download(
6676
&client,
6777
"https://raw.githubusercontent.com/Hornan7/SanchoNet-Tutorials/refs/heads/main/genesis/byron-genesis.json",

modules/genesis_bootstrapper/src/genesis_bootstrapper.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ const DEFAULT_NETWORK_NAME: &str = "mainnet";
3232
const MAINNET_BYRON_GENESIS: &[u8] = include_bytes!("../downloads/mainnet-byron-genesis.json");
3333
const MAINNET_SHELLEY_GENESIS: &[u8] = include_bytes!("../downloads/mainnet-shelley-genesis.json");
3434
const MAINNET_SHELLEY_START_EPOCH: u64 = 208;
35+
const PREVIEW_BYRON_GENESIS: &[u8] = include_bytes!("../downloads/preview-byron-genesis.json");
36+
const PREVIEW_SHELLEY_GENESIS: &[u8] = include_bytes!("../downloads/preview-shelley-genesis.json");
37+
const PREVIEW_SHELLEY_START_EPOCH: u64 = 0;
3538
const SANCHONET_BYRON_GENESIS: &[u8] = include_bytes!("../downloads/sanchonet-byron-genesis.json");
3639
const SANCHONET_SHELLEY_GENESIS: &[u8] =
3740
include_bytes!("../downloads/sanchonet-shelley-genesis.json");
@@ -101,6 +104,11 @@ impl GenesisBootstrapper {
101104
MAINNET_SHELLEY_GENESIS,
102105
MAINNET_SHELLEY_START_EPOCH,
103106
),
107+
"preview" => (
108+
PREVIEW_BYRON_GENESIS,
109+
PREVIEW_SHELLEY_GENESIS,
110+
PREVIEW_SHELLEY_START_EPOCH,
111+
),
104112
"sanchonet" => (
105113
SANCHONET_BYRON_GENESIS,
106114
SANCHONET_SHELLEY_GENESIS,

processes/omnibus/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ acropolis_common = { path = "../../common" }
1212
acropolis_module_genesis_bootstrapper = { path = "../../modules/genesis_bootstrapper" }
1313
acropolis_module_mithril_snapshot_fetcher = { path = "../../modules/mithril_snapshot_fetcher" }
1414
acropolis_module_upstream_chain_fetcher = { path = "../../modules/upstream_chain_fetcher" }
15+
acropolis_module_peer_network_interface = { path = "../../modules/peer_network_interface" }
1516
acropolis_module_block_unpacker = { path = "../../modules/block_unpacker" }
1617
acropolis_module_tx_unpacker = { path = "../../modules/tx_unpacker" }
1718
acropolis_module_utxo_state = { path = "../../modules/utxo_state" }
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# Top-level configuration for Acropolis omnibus process
2+
3+
[module.genesis-bootstrapper]
4+
network-name = "preview" # "sanchonet", "mainnet"
5+
6+
#[module.mithril-snapshot-fetcher]
7+
#Turned off with SanchoNet
8+
#aggregator-url = "https://aggregator.release-mainnet.api.mithril.network/aggregator"
9+
#genesis-key = "5b3139312c36362c3134302c3138352c3133382c31312c3233372c3230372c3235302c3134342c32372c322c3138382c33302c31322c38312c3135352c3230342c31302c3137392c37352c32332c3133382c3139362c3231372c352c31342c32302c35372c37392c33392c3137365d"
10+
#download = false
11+
12+
[module.rest-blockfrost]
13+
14+
[module.peer-network-interface]
15+
sync-point = "origin" #"cache" # "origin", "tip", "snapshot"
16+
node-addresses = [
17+
"localhost:3001",
18+
"localhost:3002",
19+
"localhost:3003",
20+
]
21+
magic-number = 2
22+
23+
[module.block-unpacker]
24+
25+
[module.tx-unpacker]
26+
publish-utxo-deltas-topic = "cardano.utxo.deltas"
27+
publish-withdrawals-topic = "cardano.withdrawals"
28+
publish-certificates-topic = "cardano.certificates"
29+
publish-governance-topic = "cardano.governance"
30+
publish-block-txs-topic = "cardano.block.txs"
31+
32+
[module.utxo-state]
33+
store = "memory" # "memory", "dashmap", "fjall", "fjall-async", "sled", "sled-async", "fake"
34+
address-delta-topic = "cardano.address.delta"
35+
36+
[module.spo-state]
37+
# Enables /pools/{pool_id}/history endpoint, enables to query active_stakes
38+
store-epochs-history = false
39+
# Enable /pools/retired
40+
store-retired-pools = false
41+
# Enables /pools/{pool_id} endpoint
42+
store-registration = false
43+
# # Enables /pools/{pool_id}/updates endpoint
44+
store-updates = false
45+
# Enables /pools/{pool_id}/delegators endpoint (Requires store-stake-addresses to be enabled)
46+
store-delegators = false
47+
# Enables /pools/{pool_id}/votes endpoint
48+
store-votes = false
49+
# Store stake_addresses
50+
store-stake-addresses = false
51+
52+
[module.drep-state]
53+
54+
[module.governance-state]
55+
56+
[module.parameters-state]
57+
store-history = false
58+
network-name = "sanchonet" # "sanchonet", "mainnet"
59+
60+
[module.stake-delta-filter]
61+
cache-mode = "write" # "predefined", "read", "write", "write-if-absent"
62+
write-full-cache = "false"
63+
64+
[module.epochs-state]
65+
# Enables /epochs/{number} endpoint (for historical epochs)
66+
store-history = false
67+
# Enables /pools/{pool_id}/blocks endpoint
68+
store-block-hashes = false
69+
70+
71+
[module.accounts-state]
72+
73+
[module.clock]
74+
75+
[module.rest-server]
76+
address = "127.0.0.1"
77+
port = 4340
78+
79+
[module.spy]
80+
# Enable for message spying
81+
#topic = "cardano.drep.state"
82+
83+
[startup]
84+
topic = "cardano.sequence.start"
85+
86+
[message-bus.external]
87+
class = "rabbit-mq"
88+
url = "amqp://127.0.0.1:5672/%2f"
89+
exchange = "caryatid"
90+
91+
[message-bus.internal]
92+
class = "in-memory"
93+
workers = 50
94+
dispatch-queue-size = 1000
95+
worker-queue-size = 100
96+
bulk-block-capacity = 50
97+
bulk-resume-capacity = 75
98+
99+
# Message routing
100+
[[message-router.route]] # Everything is internal only
101+
pattern = "#"
102+
bus = "internal"

processes/omnibus/src/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ use acropolis_module_governance_state::GovernanceState;
2222
use acropolis_module_historical_accounts_state::HistoricalAccountsState;
2323
use acropolis_module_mithril_snapshot_fetcher::MithrilSnapshotFetcher;
2424
use acropolis_module_parameters_state::ParametersState;
25+
use acropolis_module_peer_network_interface::PeerNetworkInterface;
2526
use acropolis_module_rest_blockfrost::BlockfrostREST;
2627
use acropolis_module_spdd_state::SPDDState;
2728
use acropolis_module_spo_state::SPOState;
@@ -102,6 +103,7 @@ pub async fn main() -> Result<()> {
102103
MithrilSnapshotFetcher::register(&mut process);
103104
UpstreamChainFetcher::register(&mut process);
104105
BlockUnpacker::register(&mut process);
106+
PeerNetworkInterface::register(&mut process);
105107
TxUnpacker::register(&mut process);
106108
UTXOState::register(&mut process);
107109
SPOState::register(&mut process);

0 commit comments

Comments
 (0)