-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use local testnet for integration tests and examples
- Loading branch information
Showing
23 changed files
with
169 additions
and
35 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
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,87 @@ | ||
# This compose file defines a single validator node test network, | ||
# along with a faucet that connects to it over json-rpc. | ||
# In addition, it offers the following facilities: | ||
# * JSON-RPC endpoint at http://127.0.0.1:8080. | ||
# * chain_id of 4 / TESTING | ||
# * The faucet can be accessed at 127.0.0.1:8000 | ||
|
||
# Additional information: | ||
# * If you use this compose for different Diem Networks, you will need remove the db volume first. | ||
# * If you would like to use the current Diem version within this repository, execute the | ||
# `build.sh` in `docker/validator` and change the image tag below to diem_e2e:latest | ||
# * Validator images can be found at https://hub.docker.com/r/devnet/validator/tags | ||
# * Faucet images can be found at https://hub.docker.com/r/devnet/faucet/tags | ||
|
||
# Monitoring: | ||
# If you want to install the monitoring components for your validator-testnet | ||
# you can symlink the ../monitoring folder into this directory. | ||
# Note that you will need to rename the monitoring docker-compose.yaml file to avoid duplication. | ||
# e.g. rename it to docker-compose.mon.yaml | ||
# You will also need to configure the network in the monitoring compose file, | ||
# so that the container can join the same network and talk to each other. | ||
# To start both validator and monitoring, run `docker-compose -f docker-compose.yaml -f docker-compose.mon.yaml up -d` | ||
|
||
version: "3.8" | ||
services: | ||
validator: | ||
# Note this image currently does not support this, will update to the appropriate minimum | ||
# version shortly | ||
image: "diem/validator:${IMAGE_TAG:-devnet}" | ||
networks: | ||
shared: | ||
volumes: | ||
- type: volume | ||
source: diem-shared | ||
target: /opt/diem/var | ||
- type: bind | ||
source: ./validator_node_template.yaml | ||
target: /opt/diem/var/validator_node_template.yaml | ||
command: ["/opt/diem/bin/diem-node", "--test", "--config", "/opt/diem/var"] | ||
ports: | ||
- "8080:8080" | ||
expose: | ||
- 9101 | ||
|
||
faucet: | ||
image: "diem/faucet:${IMAGE_TAG:-devnet}" | ||
depends_on: | ||
- validator | ||
networks: | ||
shared: | ||
volumes: | ||
- type: volume | ||
source: diem-shared | ||
target: /opt/diem/var | ||
command: > | ||
/bin/bash -c " | ||
for i in {1..10} | ||
do | ||
if [[ -s /opt/diem/var/mint.key ]] | ||
then | ||
/opt/diem/bin/diem-faucet \ | ||
--address 0.0.0.0 \ | ||
--port 8000 \ | ||
--chain-id TESTING \ | ||
--mint-key-file-path /opt/diem/var/mint.key \ | ||
--server-url http://validator:8080/v1 | ||
exit $$? | ||
else | ||
echo 'Validator has not populated mint.key yet. Is it running?' | ||
sleep 1 | ||
fi | ||
done | ||
exit 1 | ||
" | ||
ports: | ||
- "8000:8000" | ||
|
||
networks: | ||
shared: | ||
name: "diem-docker-compose-shared" | ||
ipam: | ||
config: | ||
- subnet: 172.16.1.0/24 | ||
|
||
volumes: | ||
diem-shared: | ||
name: diem-shared |
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,32 @@ | ||
consensus: | ||
# The following slow consensus down when there are no active transactions to process | ||
round_initial_timeout_ms: 20000 | ||
mempool_poll_count: 333 | ||
|
||
# The rest of this config is copy paste of config/src/config/test_data/validator.yaml | ||
validator_network: | ||
listen_address: "/ip4/0.0.0.0/tcp/6180" | ||
identity: | ||
type: "from_storage" | ||
key_name: "validator_network" | ||
peer_id_name: "owner_account" | ||
backend: | ||
type: "vault" | ||
server: "https://127.0.0.1:8200" | ||
ca_certificate: "/full/path/to/certificate" | ||
token: | ||
from_disk: "/full/path/to/token" | ||
|
||
full_node_networks: | ||
- listen_address: "/ip4/0.0.0.0/tcp/7180" | ||
identity: | ||
type: "from_storage" | ||
key_name: "fullnode_network" | ||
peer_id_name: "owner_account" | ||
backend: | ||
type: "vault" | ||
server: "https://127.0.0.1:8200" | ||
token: | ||
from_disk: "/full/path/to/token" | ||
network_id: | ||
private: "vfn" |
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
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
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
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
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
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
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
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
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
Oops, something went wrong.