Skip to content

Commit 78c830d

Browse files
committed
feat: replace latest master with 10.4.1
Also runs a mix of in-memory and LMDB based nodes
1 parent 9ec5007 commit 78c830d

File tree

6 files changed

+76
-18
lines changed

6 files changed

+76
-18
lines changed

.github/workflows/cardano-node.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
required: true
1313
default: cardano_node_latest
1414
type: string
15-
15+
push:
1616
schedule:
1717
# run every 6 hours
1818
- cron: '5 1,7,13,19 * * *'

compose/cardano-node.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,24 @@ verify_environment_variables() {
5757
fi
5858
}
5959

60+
# Updates specific node's configuration depending on environment variables
61+
# Those environment variables can be set in the service definition in the
62+
# docker-compose file like:
63+
#
64+
# ```
65+
# p2:
66+
# <<: *base
67+
# container_name: p2
68+
# hostname: p2.example
69+
# volumes:
70+
# - p2:/opt/cardano-node/data
71+
# ports:
72+
# - "3002:3001"
73+
# environment:
74+
# <<: *env
75+
# POOL_ID: "2"
76+
# PEER_SHARING: "false"
77+
# ```
6078
config_config_json() {
6179
# .AlonzoGenesisHash, .ByronGenesisHash, .ConwayGenesisHash, .ShelleyGenesisHash
6280
jq "del(.AlonzoGenesisHash, .ByronGenesisHash, .ConwayGenesisHash, .ShelleyGenesisHash)" "${CONFIG_JSON}" | write_file "${CONFIG_JSON}"
@@ -91,6 +109,17 @@ config_config_json() {
91109
else
92110
jq ".PeerSharing = false" "${CONFIG_JSON}" | write_file "${CONFIG_JSON}"
93111
fi
112+
113+
# configure UTxO-HD
114+
# see https://ouroboros-consensus.cardano.intersectmbo.org/docs/for-developers/utxo-hd/migrating
115+
if [ "${UTXO_HD_WITH_LMDB,,}" = "true" ]; then
116+
jq '.LedgerDB = { Backend: "V1LMDB"}' "${CONFIG_JSON}" | write_file "${CONFIG_JSON}"
117+
fi
118+
119+
if [ "${UTXO_HD_WITH_MEM,,}" = "true" ]; then
120+
jq '.LedgerDB = { Backend: "V2InMemory"}' "${CONFIG_JSON}" | write_file "${CONFIG_JSON}"
121+
fi
122+
94123
}
95124

96125
config_topology_json() {
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Description
2+
3+
A 5 pools testnet using cardano-node version 10.4.1 testing consistency between nodes runnning UTxO-HD with LMDB and in-memory: We run 3 nodes with in-memory DB and 2 node with LMDB and check they are still consistent.
4+
5+
## Cardano-Node
6+
7+
- **Version**: 10.4.1
8+
- **Branch**: -
9+
- **Source/Compiled**: Compiled
10+
11+
## Testnet
12+
13+
- **Pools**: 3

compose/testnets/cardano_node_latest/docker-compose.yaml renamed to compose/testnets/cardano_node_10.4.1/docker-compose.yaml

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ x-base: &base
55
restart: on-failure
66
build:
77
context: "../../"
8-
dockerfile: "Dockerfile.source"
8+
dockerfile: "Dockerfile.compiled"
99
args:
10-
CARDANO_NODE_REF: "master"
10+
CARDANO_NODE_VERSION: "10.4.1"
1111

1212
x-env: &env
1313
POOL_ID: "0" # Placeholder required for override
14+
UTXO_HD_WITH_MEM: "true"
1415

1516
services:
1617
tracer:
@@ -41,6 +42,7 @@ services:
4142
environment:
4243
<<: *env
4344
POOL_ID: "1"
45+
UTXO_HD_WITH_LMDB: "true"
4446

4547
p2:
4648
<<: *base
@@ -54,7 +56,6 @@ services:
5456
environment:
5557
<<: *env
5658
POOL_ID: "2"
57-
PEER_SHARING: "false"
5859

5960
p3:
6061
<<: *base
@@ -69,13 +70,41 @@ services:
6970
<<: *env
7071
POOL_ID: "3"
7172

73+
p4:
74+
<<: *base
75+
container_name: p4
76+
hostname: p4.example
77+
volumes:
78+
- p4:/opt/cardano-node/data
79+
- tracer:/opt/cardano-tracer
80+
ports:
81+
- "3004:3001"
82+
environment:
83+
<<: *env
84+
POOL_ID: "4"
85+
UTXO_HD_WITH_LMDB: "true"
86+
87+
88+
p5:
89+
<<: *base
90+
container_name: p5
91+
hostname: p5.example
92+
volumes:
93+
- p5:/opt/cardano-node/data
94+
- tracer:/opt/cardano-tracer
95+
ports:
96+
- "3005:3001"
97+
environment:
98+
<<: *env
99+
POOL_ID: "5"
100+
72101
s1:
73102
image: ${registry}${testnet}_sidecar:latest
74103
restart: on-failure
75104
container_name: s1
76105
hostname: s1.example
77106
environment:
78-
POOLS: "3"
107+
POOLS: "5"
79108

80109
volumes:
81110
tracer:
File renamed without changes.

compose/testnets/cardano_node_latest/README.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)