Skip to content

Commit e219aeb

Browse files
authored
Merge pull request #1021 from input-output-hk/jpraynaud/1018-implement-mithril-relay-infra
Implement Mithril Relay in infra
2 parents 76c6930 + 6b19d5a commit e219aeb

File tree

6 files changed

+249
-1
lines changed

6 files changed

+249
-1
lines changed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Unverified Mithril Signer node running on top of its own Cardano node
2+
3+
version: "3.9"
4+
5+
services:
6+
cardano-node-signer:
7+
image: cardano-node/${CARDANO_IMAGE_ID}-modified
8+
container_name: cardano-node-signer-${SIGNER_ID}
9+
restart: always
10+
build:
11+
context: .
12+
dockerfile: Dockerfile.cardano
13+
args:
14+
CARDANO_IMAGE_ID: ${CARDANO_IMAGE_ID}
15+
user: ${CURRENT_UID}
16+
profiles:
17+
- cardano
18+
- all
19+
logging:
20+
driver: "${LOGGING_DRIVER}"
21+
volumes:
22+
- ./cardano-configurations/network/${NETWORK}:/config
23+
- ../data/${NETWORK}/mithril-signer-${SIGNER_ID}/cardano/db/passive:/db
24+
- ../data/${NETWORK}/mithril-signer-${SIGNER_ID}/cardano/ipc:/ipc
25+
environment:
26+
- CARDANO_SOCKET_PATH=/ipc/node.socket
27+
- CARDANO_NODE_SOCKET_PATH=/ipc/node.socket
28+
command:
29+
[
30+
"run",
31+
"--config",
32+
"/config/cardano-node/config.json",
33+
"--topology",
34+
"/config/cardano-node/topology.json",
35+
"--database-path",
36+
"/db"
37+
]
38+
39+
mithril-signer:
40+
image: ghcr.io/input-output-hk/mithril-signer:${MITHRIL_IMAGE_ID}
41+
container_name: mithril-signer-${SIGNER_ID}
42+
restart: always
43+
user: ${CURRENT_UID}
44+
profiles:
45+
- mithril
46+
- all
47+
environment:
48+
- RUST_BACKTRACE=1
49+
- AGGREGATOR_ENDPOINT=http://${AGGREGATOR_CREDENTIALS}mithril-aggregator:8080/aggregator
50+
- NETWORK=${NETWORK}
51+
- PARTY_ID=${PARTY_ID}
52+
- RUN_INTERVAL=120000
53+
- DB_DIRECTORY=/mithril-signer-${SIGNER_ID}/cardano/db
54+
- DATA_STORES_DIRECTORY=/mithril-signer-${SIGNER_ID}/mithril/stores
55+
- STORE_RETENTION_LIMIT=5
56+
- CARDANO_NODE_SOCKET_PATH=/ipc/node.socket
57+
- CARDANO_CLI_PATH=/app/bin/cardano-cli
58+
- ERA_READER_ADAPTER_TYPE=${ERA_READER_ADAPTER_TYPE}
59+
- ERA_READER_ADAPTER_PARAMS=${ERA_READER_ADAPTER_PARAMS}
60+
volumes:
61+
- ../data/${NETWORK}/mithril-signer-${SIGNER_ID}/mithril:/mithril-signer-${SIGNER_ID}/mithril
62+
- ../data/${NETWORK}/mithril-signer-${SIGNER_ID}/cardano/db/passive:/mithril-signer-${SIGNER_ID}/cardano/db
63+
- ../data/${NETWORK}/mithril-signer-${SIGNER_ID}/cardano/ipc:/ipc
64+
depends_on:
65+
cardano-node-signer:
66+
condition: service_started
67+
logging:
68+
driver: "${LOGGING_DRIVER}"
69+
70+
networks:
71+
default:
72+
external:
73+
name: mithril_network

mithril-infra/assets/docker/docker-compose-signer-unverified.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@ services:
3636
"/db"
3737
]
3838

39+
mithril-relay:
40+
image: ubuntu/squid:latest
41+
container_name: mithril-relay-${SIGNER_ID}
42+
profiles:
43+
- mithril
44+
- all
45+
volumes:
46+
- ./squid/squid.conf:/etc/squid/squid.conf:ro
47+
3948
mithril-signer:
4049
image: ghcr.io/input-output-hk/mithril-signer:${MITHRIL_IMAGE_ID}
4150
container_name: mithril-signer-${SIGNER_ID}
@@ -57,6 +66,7 @@ services:
5766
- CARDANO_CLI_PATH=/app/bin/cardano-cli
5867
- ERA_READER_ADAPTER_TYPE=${ERA_READER_ADAPTER_TYPE}
5968
- ERA_READER_ADAPTER_PARAMS=${ERA_READER_ADAPTER_PARAMS}
69+
- RELAY_ENDPOINT=http://mithril-relay-${SIGNER_ID}:3128
6070
volumes:
6171
- ../data/${NETWORK}/mithril-signer-${SIGNER_ID}/mithril:/mithril-signer-${SIGNER_ID}/mithril
6272
- ../data/${NETWORK}/mithril-signer-${SIGNER_ID}/cardano/db/passive:/mithril-signer-${SIGNER_ID}/cardano/db
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
# Verified Mithril Signer node running on top of its own Cardano node
2+
3+
version: "3.9"
4+
5+
services:
6+
cardano-node-signer-relay:
7+
image: cardano-node/${CARDANO_IMAGE_ID}-modified
8+
container_name: cardano-node-relay-signer-${SIGNER_ID}
9+
restart: always
10+
build:
11+
context: .
12+
dockerfile: Dockerfile.cardano
13+
args:
14+
CARDANO_IMAGE_ID: ${CARDANO_IMAGE_ID}
15+
user: ${CURRENT_UID}
16+
profiles:
17+
- cardano
18+
- all
19+
logging:
20+
driver: "${LOGGING_DRIVER}"
21+
volumes:
22+
- ./cardano-configurations/network/${NETWORK}:/config
23+
- ../data/${NETWORK}/mithril-signer-${SIGNER_ID}/cardano/db/relay:/db
24+
- ../data/${NETWORK}/mithril-signer-${SIGNER_ID}/cardano/ipc:/ipc
25+
- ../data/${NETWORK}/mithril-signer-${SIGNER_ID}/cardano/pool:/pool
26+
- ../data/${NETWORK}/mithril-signer-${SIGNER_ID}/cardano/www:/www
27+
ports:
28+
- "${SIGNER_CARDANO_RELAY_PORT}:${SIGNER_CARDANO_RELAY_PORT}"
29+
environment:
30+
- CARDANO_SOCKET_PATH=/ipc/node.socket
31+
- CARDANO_NODE_SOCKET_PATH=/ipc/node.socket
32+
command:
33+
[
34+
"run",
35+
"--config",
36+
"/config/cardano-node/config.json",
37+
"--topology",
38+
"/pool/topology-relay.json",
39+
"--database-path",
40+
"/db",
41+
"--port",
42+
"${SIGNER_CARDANO_RELAY_PORT}"
43+
]
44+
45+
cardano-node-signer-block-producer:
46+
image: cardano-node/${CARDANO_IMAGE_ID}-modified
47+
container_name: cardano-node-block-producer-signer-${SIGNER_ID}
48+
restart: always
49+
build:
50+
context: .
51+
dockerfile: Dockerfile.cardano
52+
args:
53+
CARDANO_IMAGE_ID: ${CARDANO_IMAGE_ID}
54+
user: ${CURRENT_UID}
55+
profiles:
56+
- cardano
57+
- all
58+
logging:
59+
driver: "${LOGGING_DRIVER}"
60+
volumes:
61+
- ./cardano-configurations/network/${NETWORK}:/config
62+
- ../data/${NETWORK}/mithril-signer-${SIGNER_ID}/cardano/db/block-producer:/db
63+
- ../data/${NETWORK}/mithril-signer-${SIGNER_ID}/cardano/ipc:/ipc
64+
- ../data/${NETWORK}/mithril-signer-${SIGNER_ID}/cardano/pool:/pool
65+
- ../data/${NETWORK}/mithril-signer-${SIGNER_ID}/cardano/www:/www
66+
ports:
67+
- "${SIGNER_CARDANO_BLOCK_PRODUCER_PORT}:${SIGNER_CARDANO_BLOCK_PRODUCER_PORT}"
68+
environment:
69+
- CARDANO_SOCKET_PATH=/ipc/node.socket
70+
- CARDANO_NODE_SOCKET_PATH=/ipc/node.socket
71+
command:
72+
[
73+
"run",
74+
"--config",
75+
"/config/cardano-node/config.json",
76+
"--topology",
77+
"/pool/topology-block-producer.json",
78+
"--database-path",
79+
"/db",
80+
"--port",
81+
"${SIGNER_CARDANO_BLOCK_PRODUCER_PORT}",
82+
"--shelley-kes-key",
83+
"/pool/kes.skey",
84+
"--shelley-vrf-key",
85+
"/pool/vrf.skey",
86+
"--shelley-operational-certificate",
87+
"/pool/opcert.cert"
88+
]
89+
90+
mithril-signer:
91+
image: ghcr.io/input-output-hk/mithril-signer:${MITHRIL_IMAGE_ID}
92+
container_name: mithril-signer-${SIGNER_ID}
93+
restart: always
94+
user: ${CURRENT_UID}
95+
profiles:
96+
- mithril
97+
- all
98+
environment:
99+
- RUST_BACKTRACE=1
100+
- AGGREGATOR_ENDPOINT=http://${AGGREGATOR_CREDENTIALS}mithril-aggregator:8080/aggregator
101+
- NETWORK=${NETWORK}
102+
- KES_SECRET_KEY_PATH=/mithril-signer-${SIGNER_ID}/cardano/pool/kes.skey
103+
- OPERATIONAL_CERTIFICATE_PATH=/mithril-signer-${SIGNER_ID}/cardano/pool/opcert.cert
104+
- RUN_INTERVAL=120000
105+
- DB_DIRECTORY=/mithril-signer-${SIGNER_ID}/cardano/db
106+
- DATA_STORES_DIRECTORY=/mithril-signer-${SIGNER_ID}/mithril/stores
107+
- STORE_RETENTION_LIMIT=5
108+
- CARDANO_NODE_SOCKET_PATH=/ipc/node.socket
109+
- CARDANO_CLI_PATH=/app/bin/cardano-cli
110+
- ERA_READER_ADAPTER_TYPE=${ERA_READER_ADAPTER_TYPE}
111+
- ERA_READER_ADAPTER_PARAMS=${ERA_READER_ADAPTER_PARAMS}
112+
volumes:
113+
- ../data/${NETWORK}/mithril-signer-${SIGNER_ID}/mithril:/mithril-signer-${SIGNER_ID}/mithril
114+
- ../data/${NETWORK}/mithril-signer-${SIGNER_ID}/cardano/db/block-producer:/mithril-signer-${SIGNER_ID}/cardano/db
115+
- ../data/${NETWORK}/mithril-signer-${SIGNER_ID}/cardano/pool:/mithril-signer-${SIGNER_ID}/cardano/pool
116+
- ../data/${NETWORK}/mithril-signer-${SIGNER_ID}/cardano/ipc:/ipc
117+
- ./cardano-configurations/network/${NETWORK}:/config
118+
depends_on:
119+
cardano-node-signer-block-producer:
120+
condition: service_started
121+
cardano-node-signer-relay:
122+
condition: service_started
123+
logging:
124+
driver: "${LOGGING_DRIVER}"
125+
126+
mithril-signer-www:
127+
image: nginx:latest
128+
container_name: mithril-signer-www-${SIGNER_ID}
129+
restart: always
130+
profiles:
131+
- mithril
132+
- all
133+
volumes:
134+
- ../data/${NETWORK}/mithril-signer-${SIGNER_ID}/cardano/www:/usr/share/nginx/html
135+
ports:
136+
- "${SIGNER_WWW_PORT}:8080"
137+
logging:
138+
driver: "${LOGGING_DRIVER}"
139+
labels:
140+
- 'traefik.enable=true'
141+
- 'traefik.http.routers.mithril-signer-${SIGNER_ID}.rule=Host(`${SIGNER_HOST}`)'
142+
- 'traefik.http.routers.mithril-signer-${SIGNER_ID}.tls=true'
143+
- 'traefik.http.routers.mithril-signer-${SIGNER_ID}.tls.certresolver=lets-encrypt'
144+
145+
networks:
146+
default:
147+
external:
148+
name: mithril_network

mithril-infra/assets/docker/docker-compose-signer-verified.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,15 @@ services:
8787
"/pool/opcert.cert"
8888
]
8989

90+
mithril-relay:
91+
image: ubuntu/squid:latest
92+
container_name: mithril-relay-${SIGNER_ID}
93+
profiles:
94+
- mithril
95+
- all
96+
volumes:
97+
- ./squid/squid.conf:/etc/squid/squid.conf:ro
98+
9099
mithril-signer:
91100
image: ghcr.io/input-output-hk/mithril-signer:${MITHRIL_IMAGE_ID}
92101
container_name: mithril-signer-${SIGNER_ID}
@@ -109,6 +118,7 @@ services:
109118
- CARDANO_CLI_PATH=/app/bin/cardano-cli
110119
- ERA_READER_ADAPTER_TYPE=${ERA_READER_ADAPTER_TYPE}
111120
- ERA_READER_ADAPTER_PARAMS=${ERA_READER_ADAPTER_PARAMS}
121+
- RELAY_ENDPOINT=http://mithril-relay-${SIGNER_ID}:3128
112122
volumes:
113123
- ../data/${NETWORK}/mithril-signer-${SIGNER_ID}/mithril:/mithril-signer-${SIGNER_ID}/mithril
114124
- ../data/${NETWORK}/mithril-signer-${SIGNER_ID}/cardano/db/block-producer:/mithril-signer-${SIGNER_ID}/cardano/db
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Warning: This is a custom configuration for Mithril test infrastructure only, do not use in production
2+
3+
# Listening port (port 3128 is recommended)
4+
http_port 3128
5+
6+
# Allowed traffic
7+
http_access allow all

mithril-infra/assets/infra.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.0
1+
0.1.1

0 commit comments

Comments
 (0)