2022-09-12 20:01:14 +00:00
|
|
|
# Deploy
|
2023-07-19 23:22:49 +00:00
|
|
|
|
2022-09-12 20:01:14 +00:00
|
|
|
## Run with Docker Compose
|
2023-07-19 23:22:49 +00:00
|
|
|
|
2022-09-12 20:01:14 +00:00
|
|
|
Running the Serai infrastructure is easy with Docker.
|
|
|
|
|
2023-07-19 23:22:49 +00:00
|
|
|
We utilize compose profiles to easily orchestrate various pieces of the
|
|
|
|
infrastructure.
|
2022-09-12 20:01:14 +00:00
|
|
|
|
|
|
|
**Example:** `docker compose --profile cluster-coins-sm up`
|
|
|
|
|
2023-07-19 23:22:49 +00:00
|
|
|
All commands are assumed to be ran from `/deploy`, not the root folder.
|
2022-09-12 20:01:14 +00:00
|
|
|
|
|
|
|
### Profiles:
|
|
|
|
|
2023-07-19 23:22:49 +00:00
|
|
|
* `bitcoin` - Bitcoin node
|
|
|
|
* `monero` - Monero node
|
|
|
|
* `ethereum` - Ethereum node
|
|
|
|
* `coins` - Nodes for all external networks (BTC, ETH, XMR)
|
|
|
|
|
2023-07-20 00:13:16 +00:00
|
|
|
* `message-queue` - The message queue service.
|
|
|
|
* `processor` - Serai processor for one external network.
|
2023-11-13 04:55:15 +00:00
|
|
|
* `coordinator` - Serai coordinator for the entire Serai stack.
|
2023-07-20 00:13:16 +00:00
|
|
|
|
2023-07-19 23:22:49 +00:00
|
|
|
* `serai` - Serai node
|
2023-08-06 17:42:16 +00:00
|
|
|
* `cluster-sm` - "Alice", "Bob", "Charlie", and "Dave" Serai nodes, all as
|
|
|
|
validators (enough to achieve BFT with one faulty node)
|
|
|
|
* `cluster-lg` - `cluster-sm` with non-validators "Eve" and "Ferdie"
|
2023-07-19 23:22:49 +00:00
|
|
|
|
|
|
|
You can supply one or more profiles to the docker compose command to orchestrate
|
|
|
|
the desired components.
|
2022-09-12 20:01:14 +00:00
|
|
|
|
2023-07-19 23:22:49 +00:00
|
|
|
**Example:** `docker compose --profile coins --profile serai up`
|
2022-09-12 20:01:14 +00:00
|
|
|
|
|
|
|
## Orchestration Approach
|
2023-07-19 23:22:49 +00:00
|
|
|
|
2022-09-12 20:01:14 +00:00
|
|
|
### Builds
|
2023-07-19 23:22:49 +00:00
|
|
|
|
|
|
|
The Serai infrastructure is locally compiled. This may take several minutes.
|
|
|
|
|
|
|
|
Images for external networks download binaries, before verifying their checksums
|
|
|
|
and signatures.
|
2022-09-12 20:01:14 +00:00
|
|
|
|
|
|
|
**Stage 1 -- Builder**
|
|
|
|
* Configure environment.
|
|
|
|
* Get the binary.
|
|
|
|
* Verify binary using GPG.
|
2023-07-19 23:22:49 +00:00
|
|
|
* Decompress binary to prepare image.
|
2022-09-12 20:01:14 +00:00
|
|
|
|
|
|
|
**Stage 2 -- Image**
|
|
|
|
* Copy needed files from builder.
|
|
|
|
* Move executables to bin folder.
|
|
|
|
* Copy scripts folder.
|
|
|
|
* Expose necessary ports.
|
|
|
|
* Map necessary volumes.
|
|
|
|
|
|
|
|
### Entrypoint
|
|
|
|
|
2023-07-19 23:22:49 +00:00
|
|
|
The Serai node and external networks' nodes are each started from an entrypoint
|
2023-07-27 18:19:03 +00:00
|
|
|
script inside the `/scripts `folder.
|
2023-07-19 23:22:49 +00:00
|
|
|
|
|
|
|
To update the scripts on the image you must rebuild the updated images using the
|
|
|
|
`--build` flag after `up` in `docker compose`.
|
2022-09-12 20:01:14 +00:00
|
|
|
|
|
|
|
**Example:** `docker compose --profile bitcoin up --build`
|