|
1 | 1 | # Mithril Aggregator
|
2 | 2 |
|
3 |
| -**This is a work in progress** :hammer_and_wrench: |
| 3 | +## Documentation |
| 4 | +:rocket: The documentation is available at [`Mithril Aggregator Node`](https://mithril.network/doc/manual/developer-docs/nodes/mithril-aggregator) |
4 | 5 |
|
5 |
| -This is a first version of the Mithril Aggregagator |
6 |
| - |
7 |
| ---- |
8 |
| - |
9 |
| -## Pre-requisites |
10 |
| - |
11 |
| -**Install Rust** |
12 |
| - |
13 |
| -- Install a [correctly configured](https://www.rust-lang.org/learn/get-started) Rust toolchain (latest stable version). |
14 |
| -- Install OpenSSL development libraries, for example on Ubuntu/Debian/Mint run `apt install libssl-dev` |
15 |
| -- Ensure `libsqlite3` is installed on your system and check its version is at least `3.40`. Run `sqlite3 --version` to check your version. |
16 |
| - |
17 |
| -## Mithril test networks |
18 |
| - |
19 |
| -The Mithril test networks are: |
20 |
| - |
21 |
| -- `preview`: Test network with magic id `2`, implemented on the IOG hosted Mithril Aggregator |
22 |
| -- `preprod`: Test network with magic id `1`, not implemented yet on the IOG hosted Mithril Aggregator |
23 |
| -- `testnet`: Legacy test network with magic id `1097911063`, used to be on the IOG hosted Mithril Aggregator, now deprecated |
24 |
| - |
25 |
| -In this documentation, we use the generic `**YOUR_CARDANO_NETWORK**` identifier, but you need to replace it with the identifier of the network that runs on your Cardano node |
26 |
| - |
27 |
| -## Download source code |
28 |
| - |
29 |
| -```bash |
30 |
| -# Download sources from github |
31 |
| -git clone https://github.com/input-output-hk/mithril |
32 |
| - |
33 |
| -# Go to sources directory |
34 |
| -cd mithril-aggregator |
35 |
| -``` |
36 |
| - |
37 |
| -## Development test and build |
38 |
| - |
39 |
| -```bash |
40 |
| -# Test |
41 |
| -make test |
42 |
| - |
43 |
| -# Help |
44 |
| -make help |
45 |
| - |
46 |
| -# Doc |
47 |
| -make doc |
48 |
| - |
49 |
| -# Run in debug with default configuration |
50 |
| -make debug |
51 |
| -``` |
52 |
| - |
53 |
| -## Release build and run binary 'serve' command |
54 |
| - |
55 |
| -Build and run in release with default configuration |
56 |
| - |
57 |
| -```bash |
58 |
| -make run |
59 |
| -``` |
60 |
| - |
61 |
| -Or, build only in release |
62 |
| - |
63 |
| -```bash |
64 |
| -make build |
65 |
| -``` |
66 |
| - |
67 |
| -Display the help menu |
68 |
| - |
69 |
| -```bash |
70 |
| -./mithril-aggregator --help |
71 |
| -``` |
72 |
| - |
73 |
| -You should see |
74 |
| - |
75 |
| -```bash |
76 |
| -mithril-aggregator |
77 |
| -Node args |
78 |
| - |
79 |
| -USAGE: |
80 |
| - mithril-aggregator [OPTIONS] <SUBCOMMAND> |
81 |
| - |
82 |
| -OPTIONS: |
83 |
| - --db-directory <DB_DIRECTORY> |
84 |
| - Directory to snapshot [default: /db] |
85 |
| - |
86 |
| - -h, --help |
87 |
| - Print help information |
88 |
| - |
89 |
| - -r, --run-mode <RUN_MODE> |
90 |
| - Run Mode [default: dev] |
91 |
| - |
92 |
| - --server-ip <SERVER_IP> |
93 |
| - Server listening IP [default: 0.0.0.0] |
94 |
| - |
95 |
| - --server-port <SERVER_PORT> |
96 |
| - Server listening port [default: 8080] |
97 |
| - |
98 |
| - --snapshot-directory <SNAPSHOT_DIRECTORY> |
99 |
| - Directory to store snapshot Defaults to work folder [default: .] |
100 |
| - |
101 |
| - -v, --verbose |
102 |
| - Verbosity level |
103 |
| - |
104 |
| -SUBCOMMANDS: |
105 |
| - genesis Aggregator runs in Genesis tools mode |
106 |
| - help Print this message or the help of the given subcommand(s) |
107 |
| - serve Aggregator runs in Serve mode |
108 |
| -``` |
109 |
| - |
110 |
| -Run 'serve' command in release with default configuration |
111 |
| - |
112 |
| -```bash |
113 |
| -./mithril-aggregator serve |
114 |
| -``` |
115 |
| - |
116 |
| -Run 'serve' command in release with a specific mode |
117 |
| - |
118 |
| -```bash |
119 |
| -./mithril-aggregator serve -r preview |
120 |
| -``` |
121 |
| - |
122 |
| -Run 'serve' command in release with a custom configuration via env vars |
123 |
| - |
124 |
| -```bash |
125 |
| -GENESIS_VERIFICATION_KEY=$(wget -q -O - **YOUR_GENESIS_VERIFICATION_KEY**) RUN_INTERVAL=60000 NETWORK=**YOUR_CARDANO_NETWORK** ./mithril-aggregator serve |
126 |
| -``` |
127 |
| - |
128 |
| -## Release build and run binary 'genesis' command |
129 |
| - |
130 |
| -Build in release with default configuration |
131 |
| - |
132 |
| -```bash |
133 |
| -make build |
134 |
| -``` |
135 |
| - |
136 |
| -Display the help menu |
137 |
| - |
138 |
| -```bash |
139 |
| -./mithril-aggregator genesis --help |
140 |
| -``` |
141 |
| - |
142 |
| -You should see |
143 |
| - |
144 |
| -```bash |
145 |
| -mithril-aggregator-genesis |
146 |
| -Aggregator runs in Genesis tools mode |
147 |
| - |
148 |
| -USAGE: |
149 |
| - mithril-aggregator genesis <SUBCOMMAND> |
150 |
| - |
151 |
| -OPTIONS: |
152 |
| - -h, --help Print help information |
153 |
| - |
154 |
| -SUBCOMMANDS: |
155 |
| - bootstrap Bootstrap a genesis certificate Test only usage |
156 |
| - export Export payload to sign with genesis secret key |
157 |
| - help Print this message or the help of the given subcommand(s) |
158 |
| - import Import payload signed with genesis secret key and create & import a genesis certificate |
159 |
| -``` |
160 |
| - |
161 |
| -Run 'genesis bootstrap' command in release with default configuration, **only in test mode**. |
162 |
| -This allows the Mithril Aggregator node to bootstrap a `Genesis Certificate`. After this operation, the Mithril Aggregator will be able to produce new snapshots and certificates. |
163 |
| - |
164 |
| -```bash |
165 |
| -./mithril-aggregator genesis bootstrap |
166 |
| -``` |
167 |
| - |
168 |
| -Or with a specific `Genesis Secret Key`, **only in test mode**. |
169 |
| - |
170 |
| -```bash |
171 |
| -./mithril-aggregator genesis bootstrap --genesis-secret-key **YOUR_SECRET_KEY* |
172 |
| -``` |
173 |
| - |
174 |
| -Run 'genesis export' command in release with default configuration. |
175 |
| -This allows the Mithril Aggregator node to export the `Genesis Payload` that needs to be signed (and later reimported) of the `Genesis Certificate`. The signature of the `Genesis Payload` must be done manually with the owner of the `Genesis Secret Key`. |
176 |
| - |
177 |
| -```bash |
178 |
| -./mithril-aggregator genesis export |
179 |
| -``` |
180 |
| - |
181 |
| -Or with a custom export path (to override the default value `./mithril-genesis-payload.txt`) |
182 |
| - |
183 |
| -```bash |
184 |
| -./mithril-aggregator genesis export --target-path **YOUR_TARGET_PATH** |
185 |
| -``` |
186 |
| - |
187 |
| -Run 'genesis import' command in release with default configuration. |
188 |
| -This allows the Mithril Aggregator node to import the signed payload of the `Genesis Certificate` and create it in the store. After this operation, the Mithril Aggregator will be able to produce new snapshots and certificates. |
189 |
| - |
190 |
| -```bash |
191 |
| -./mithril-aggregator genesis import |
192 |
| -``` |
193 |
| - |
194 |
| -Or with a custom export path (to override the default value `./mithril-genesis-signed-payload.txt`) |
195 |
| - |
196 |
| -```bash |
197 |
| -./mithril-aggregator genesis import --signed-payload-path **YOUR_SIGNED_PAYLOAD_PATH** |
198 |
| -``` |
199 |
| - |
200 |
| -Run 'genesis import' command in release with a custom configuration via env vars |
201 |
| - |
202 |
| -```bash |
203 |
| -GENESIS_VERIFICATION_KEY=$(wget -q -O - **YOUR_GENESIS_VERIFICATION_KEY**) RUN_INTERVAL=60000 NETWORK=**YOUR_CARDANO_NETWORK** ./mithril-aggregator genesis import |
204 |
| -``` |
205 |
| - |
206 |
| -``` |
207 |
| -
|
208 |
| -## Build and run Docker container |
209 |
| -
|
210 |
| -```bash |
211 |
| -# Build Docker image |
212 |
| -make docker-build |
213 |
| -
|
214 |
| -# Run Docker container |
215 |
| -make docker-run |
216 |
| -``` |
217 |
| - |
218 |
| -## Interact with the Mithril Aggregator |
219 |
| - |
220 |
| -```bash |
221 |
| -# Interact with the aggregator through the OpenAPI UI |
222 |
| -open -u https://input-output-hk.github.io/mithril/openapi-ui/ |
223 |
| -``` |
| 6 | +:mag: The architecture of the node is explained [here](https://mithril.network/doc/mithril/mithril-network/aggregator) |
0 commit comments