Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework configuration tutorial with docker
- Loading branch information
Ilya Bogdanov
committed
Feb 26, 2018
1 parent
a3a1e39
commit fa7a3f8
Showing
7 changed files
with
114 additions
and
238 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM rust:1.23.0 | ||
|
||
WORKDIR /usr/src | ||
RUN git clone https://github.com/exonum/exonum \ | ||
&& cd exonum/services/configuration \ | ||
&& cargo install --example configuration \ | ||
&& cd /usr/src \ | ||
&& rm -rf exonum | ||
WORKDIR /exonum/configuration | ||
COPY launch.sh . | ||
|
||
ENTRYPOINT ["./launch.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Usage: | ||
# example-start.sh <number of nodes> | ||
|
||
node_count=$1 | ||
port_start=8000 | ||
port_end=$((port_start + (2 * node_count) - 1)) | ||
|
||
docker run -p ${port_start}-${port_end}:${port_start}-${port_end} vitvakatu/exonum-configuration-example:latest $node_count |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
node_count=$1 | ||
|
||
configuration generate-testnet --start 5400 $node_count --output_dir . | ||
|
||
for i in $(seq 0 $((node_count - 1))) | ||
do | ||
port=$((8000 + i)) | ||
private_port=$((port + node_count)) | ||
configuration run --node-config validators/$i.toml --db-path db/$i --public-api-address 0.0.0.0:${port} --private-api-address 0.0.0.0:${private_port} & | ||
echo "new node with ports: $port (public) and $private_port (private)" | ||
done | ||
|
||
echo "$node_count nodes configured and launched" | ||
|
||
while : | ||
do | ||
sleep 300 | ||
done |
9 changes: 0 additions & 9 deletions
9
services/configuration/testnet/supervisord/etc/conf.d/configuration_service.conf
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
services/configuration/testnet/supervisord/etc/supervisord.conf
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.