96 lines
3.2 KiB
Markdown
96 lines
3.2 KiB
Markdown
# laconic-network-bootstrap
|
|
|
|
A set of scripts to drive the mainnet-laconic stack stack orchestrator commands.
|
|
|
|
## Background
|
|
|
|
The mainnet-laconic stack implements a scheme for deploying multi-node networks where each node runs an instance of the stack.
|
|
The configuration of these nodes is done via a "network directory" created on each node, and by arranging to copy a genesis
|
|
transaction file from each node to a coordinating node that generates a chain genesis file. This file in turn is copied
|
|
to the remaining nodes before stack startup. In addition, the IP addresses of all peer nodes need to be configured in
|
|
each node. This scheme is implemented with the following stack orchestrator commands:
|
|
|
|
```
|
|
$ laconic-so --stack mainnet-laconic deploy setup --network-dir <network_dir> --initialize-network --chain-id <chain_id> --node-moniker <node_name>
|
|
|
|
$ laconic-so --stack mainnet-laconic deploy setup --network-dir <network_dir> --join-network --key-name <key_name>
|
|
|
|
$ laconic-so --stack mainnet-laconic deploy setup --network-dir <network_dir> --create-network --gentx-files <gentx_files>
|
|
|
|
$ laconic-so --stack mainnet-laconic deploy init --map-ports-to-host any-same --output <spec_file_name> --config "LACONIC_HOSTED_ENDPOINT=http://$<node_dns_name>:9473"
|
|
|
|
$ laconic-so --stack mainnet-laconic deploy create --deployment-dir <deployment_dir> --spec-file <spec_file_name> --network-dir <network_dir> --initial-peers <peers>
|
|
```
|
|
|
|
The scripts in this repository provide a convenient wrapper around these commands for the testnet use case
|
|
where there can be some level of coordination and common ownership between the nodes.
|
|
|
|
## Machine setup
|
|
|
|
The scripts assume a set of machines with dns host names assigned with the pattern <machine-name-prefix>-<node-number>.<machine-domain>, e.g.
|
|
testnet-a-1.testnets.servesthe.world
|
|
Testnet machines must be setup with stack orchestrator and docker installed.
|
|
The local machine (where the scripts are run) needs to be configured with `ssh-agent` and the relevant key added, such that ssh commands to connect to the testnet machines succeed without user interaction.
|
|
|
|
## Testnet deployment steps
|
|
|
|
```
|
|
$ cd scripts
|
|
```
|
|
|
|
In the example commands below we assume the machine-name-prefix "testnet-a".
|
|
|
|
### network.cfg
|
|
|
|
The scripts load a set of configuration variables from a file named `network.cfg`. An example file is provided, edit to suit:
|
|
```
|
|
$ cat network.cfg
|
|
machine_domain=testnets.servesthe.world
|
|
node_count=4
|
|
ssh_user=laconic
|
|
```
|
|
|
|
### Pull stack images
|
|
|
|
Run the 00-pull-stack-images.sh script to pull stack container images from a container registry:
|
|
|
|
```
|
|
$ ./01-pull-stack-images.sh testnet-a <image-registry-user> <image-registry-token>
|
|
```
|
|
|
|
### Initialize network directories
|
|
|
|
```
|
|
$ ./02-init-network-dirs.sh testnet-a
|
|
```
|
|
|
|
### Merge genesis files
|
|
|
|
```
|
|
$ ./03-merge-genesis-txns.sh testnet-a
|
|
```
|
|
|
|
Copy the peer list this script displays for use in the next step.
|
|
|
|
### Create deployments
|
|
|
|
```
|
|
$ ./04-create-deployments.sh testnet-a <peers-list>
|
|
```
|
|
|
|
### Start stacks
|
|
|
|
```
|
|
$ ./deployment-command testnet-a start
|
|
```
|
|
|
|
### Check testnet status
|
|
|
|
```
|
|
$ ./deployment-command testnet-a status
|
|
$ ./deployment-command testnet-a logs
|
|
```
|
|
|
|
The laconic console should be available on all nodes at http://<node-host-name>
|
|
|