Skip to content

Commit

Permalink
chore: default bootnode in chainspec (#123)
Browse files Browse the repository at this point in the history
Co-authored-by: DxFFFFFF <[email protected]>
  • Loading branch information
GabrielMartinezRodriguez and deblanco authored Sep 25, 2023
1 parent 2f528b5 commit 8f9f3fc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
4 changes: 3 additions & 1 deletion chain-specs/betanet.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
"name": "Betanet",
"id": "betanet",
"chainType": "Live",
"bootNodes": [],
"bootNodes": [
"/dns4/s0.betanet.stble.io/tcp/30333/p2p/12D3KooWPaen1igo2WYUFCt3EAg4AWjWoMYgmr4tCa2Yb1WfgoDB"
],
"telemetryEndpoints": null,
"protocolId": null,
"properties": null,
Expand Down
20 changes: 10 additions & 10 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Docker Based Development

1. [Introduction](#introduction)
2. [Alphanet](#alphanet)
1. [Build](#build-alphanet)
2. [Run](#build-alphanet)
2. [Running the image](#running-the-image)
1. [Build](#build)
2. [Run](#run)
3. [Example](#example)
3. [Test](#test)
1. [Build](#build-testing-image)
Expand All @@ -13,20 +13,20 @@

Optionally, You can build and run the stability node within Docker directly. it is also possible to run tests in a docker.

## Alphanet
## Running the image

### Build Alphanet
### Build

To build the Docker container, run the following command in the root of the project
To build the Docker container, run the following command at the root of the project.

```
$ docker build -f ./docker/client/Dockerfile -t stability .
```

### Run Alphanet
### Run

```
docker run -d -p 30333:30333 -p 9933:9933 -p 9944:9944 -p 9615:9615 stability
docker run -d -p 30333:30333 -p 9933:9933 -p 9944:9944 -p 9615:9615 -e CHAIN="/stability/chain-specs/betanet.json" stability
```

Optional environment variables:
Expand All @@ -35,14 +35,14 @@ Optional environment variables:
- CHAIN and CHAIN_NAME: If you want to use a pre-defined chain spec, you can use the CHAIN_NAME environment variable to specify the name of the chain spec to use. If you want to use a custom chain spec, you can use the CHAIN environment variable to specify the path to the chain spec file to use. If both are specified, CHAIN will be used. By default, the node will use the `dev` chain spec.
- NODE_KEY: This environment variable allows specifying the node key to use. If not specified, the node will generate a random node key. This applies to the P2P key, not the account key.
- BOOTNODES: This environment variable allows specifying the bootnodes to use, separated by commas. If not specified, the node will use the default bootnodes for the chain spec.
- DEFAULT_BOOTNODE: This environment variable allows specifying the default bootnode to use. If not specified, the node will use the default bootnode of Stability network.
- MODE: This environment variable allows the node to run in different pruning modes. Possible values are "full_node" or "archive". The default value is "full_node".

To set an environment variable in the docker run, use the flag -e NAME=VALUE

### Example

```
docker run -d -p 30333:30333 -p 9933:9933 -p 9944:9944 -p 9615:9615 -e SEED=account -e BOOTNODES=/ip4/... stability
docker run -d -p 30333:30333 -p 9933:9933 -p 9944:9944 -p 9615:9615 -e SEED=account -e CHAIN="/stability/chain-specs/betanet.json" -e MODE=archive -e BOOTNODES=/ip4/... stability
```

## Test
Expand Down
4 changes: 1 addition & 3 deletions docker/client/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ if [ -n "$NODE_KEY" ]; then
START_COMMAND="$START_COMMAND --node-key $NODE_KEY"
fi

if [ "$DEFAULT_BOOTNODE" = "yes" ]; then
START_COMMAND="$START_COMMAND --bootnodes /ip4/3.21.88.38/tcp/30333/p2p/12D3KooWPaen1igo2WYUFCt3EAg4AWjWoMYgmr4tCa2Yb1WfgoDB"
elif [ -n "$BOOTNODES" ]; then
if [ -n "$BOOTNODES" ]; then
START_COMMAND="$START_COMMAND --bootnodes $BOOTNODES"
fi

Expand Down

0 comments on commit 8f9f3fc

Please sign in to comment.