Skip to content

Instantly share code, notes, and snippets.

@BravoNatalie
Last active July 4, 2021 10:37
Show Gist options
  • Save BravoNatalie/a800bd292c07ed6887f70f4e9a6dc592 to your computer and use it in GitHub Desktop.
Save BravoNatalie/a800bd292c07ed6887f70f4e9a6dc592 to your computer and use it in GitHub Desktop.
ConsenSys Quorum Besu - Docker compose
---
version: '3.6'
x-besu-bootnode-def:
&besu-bootnode-def
restart: "on-failure"
image: hyperledger/besu:${BESU_VERSION:-latest}
environment:
- LOG4J_CONFIGURATION_FILE=/config/log-config.xml
entrypoint:
- /bin/bash
- -c
- |
/opt/besu/bin/besu public-key export --to=/tmp/bootnode_pubkey;
/opt/besu/bin/besu \
--config-file=/config/config.toml \
--p2p-host=$$(hostname -i) \
--genesis-file=/config/genesis.json \
--node-private-key-file=/opt/besu/keys/key \
--min-gas-price=0 \
--rpc-http-api=EEA,WEB3,ETH,NET,PRIV,PERM,${BESU_CONS_API:-IBFT} \
--rpc-ws-api=EEA,WEB3,ETH,NET,PRIV,PERM,${BESU_CONS_API:-IBFT} ;
x-besu-def:
&besu-def
restart: "on-failure"
image: hyperledger/besu:${BESU_VERSION:-latest}
environment:
- LOG4J_CONFIGURATION_FILE=/config/log-config.xml
entrypoint:
- /bin/bash
- -c
- |
while [ ! -f "/opt/besu/public-keys/bootnode_pubkey" ]; do sleep 5; done ;
/opt/besu/bin/besu \
--config-file=/config/config.toml \
--p2p-host=$$(hostname -i) \
--genesis-file=/config/genesis.json \
--node-private-key-file=/opt/besu/keys/key \
--min-gas-price=0 \
--rpc-http-api=EEA,WEB3,ETH,NET,PRIV,PERM,${BESU_CONS_API:-IBFT} \
--rpc-ws-api=EEA,WEB3,ETH,NET,PRIV,PERM,${BESU_CONS_API:-IBFT} ;
x-besu-tx-def:
&besu-tx-def
restart: "on-failure"
image: hyperledger/besu:${BESU_VERSION:-latest}
environment:
- LOG4J_CONFIGURATION_FILE=/config/log-config.xml
entrypoint:
- /bin/bash
- -c
- |
for i in $$(seq 1 100)
do
set -e
if [ "I'm up!" == "$$(wget --timeout 10 -qO- --proxy off 172.16.239.2$${NODE_ID}:9000/upcheck)" ];
then break
else
echo "Waiting for Tessera..."
sleep 10
fi
done
while [ ! -f "/opt/besu/public-keys/bootnode_pubkey" ]; do sleep 5; done ;
/opt/besu/bin/besu \
--config-file=/config/config.toml \
--p2p-host=$$(hostname -i) \
--genesis-file=/config/genesis.json \
--node-private-key-file=/opt/besu/keys/key \
--min-gas-price=0 \
--rpc-http-api=EEA,WEB3,ETH,NET,PRIV,PERM,${BESU_CONS_API:-IBFT} \
--rpc-ws-api=EEA,WEB3,ETH,NET,PRIV,PERM,${BESU_CONS_API:-IBFT} ;
x-tessera-def:
&tessera-def
image: quorumengineering/tessera:${QUORUM_TESSERA_VERSION:-21.1.1}
expose:
- 9000
- 9080
- 9101
restart: "no"
healthcheck:
test: ["CMD", "wget", "--spider", "--proxy", "off", "http://localhost:9000/upcheck"]
interval: 3s
timeout: 3s
retries: 20
start_period: 5s
entrypoint:
- /bin/sh
- -c
- |
mkdir -p /var/log/tessera/;
mkdir -p /data/tm/;
cp /config/keys/tm.* /data/tm/ ;
cat <<EOF > /data/tm/tessera-config-09.json
{
"mode": "orion",
"useWhiteList": false,
"jdbc": {
"username": "sa",
"password": "",
"url": "jdbc:h2:./data/tm/db;MODE=Oracle;TRACE_LEVEL_SYSTEM_OUT=0",
"autoCreateTables": true
},
"serverConfigs":[
{
"app":"ThirdParty",
"enabled": true,
"serverAddress": "http://$$(hostname -i):9080",
"communicationType" : "REST"
},
{
"app":"Q2T",
"enabled": true,
"serverAddress": "http://$$(hostname -i):9101",
"sslConfig": {
"tls": "OFF"
},
"communicationType" : "REST"
},
{
"app":"P2P",
"enabled": true,
"serverAddress": "http://$$(hostname -i):9000",
"sslConfig": {
"tls": "OFF"
},
"communicationType" : "REST"
}
],
"peer": [
{
"url": "http://member1tessera:9000"
},
{
"url": "http://member2tessera:9000"
},
{
"url": "http://member3tessera:9000"
}
],
"keys": {
"passwords": [],
"keyData": [
{
"config": $$(cat /data/tm/tm.key),
"publicKey": "$$(cat /data/tm/tm.pub)"
}
]
},
"alwaysSendTo": []
}
EOF
cat /data/tm/tessera-config-09.json
java -Xms128M -Xmx128M -jar /tessera/tessera-app.jar -configfile /data/tm/tessera-config-09.json &> /var/log/tessera/tessera-$$HOSTNAME.log | tee -a /var/log/tessera/tessera-$$HOSTNAME.log
x-redis-def:
&redis-def
image: redis:alpine
x-elasticsearch-def:
&elasticsearch-def
build: ./elasticsearch
environment:
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- "http.host=0.0.0.0"
- "transport.host=127.0.0.1"
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
cap_add:
- IPC_LOCK
x-kibana-def:
&kibana-def
image: docker.elastic.co/kibana/kibana:7.9.3
environment:
ELASTICSEARCH_HOSTS: "http://elasticsearch:9200"
XPACK_MONITORING_ENABLED: "true"
XPACK_MONITORING_COLLECTION_ENABLED: "true"
SERVER_NAME: "localhost"
depends_on:
- elasticsearch
links:
- elasticsearch
ports:
- 5601:5601/tcp
x-logstash-def:
&logstash-def
build: ./logstash
environment:
- ES_HOST=http://elasticsearch:9200
- REDIS_HOST=redis
- REDIS_PORT=6379
depends_on:
- redis
- elasticsearch
links:
- redis
- elasticsearch
x-filebeat-def:
&filebeat-def
build: ./filebeat
environment:
- ENV_NAME=dev
- IP_ADDRESS=127.0.0.1
- REDIS_HOST=redis
- REDIS_PORT=6379
depends_on:
- redis
links:
- redis
volumes:
- ./logs/besu/:/var/log/besu/
x-metricbeat-def:
&metricbeat-def
build: ./metricbeat
environment:
- ENV_NAME=dev
- IP_ADDRESS=127.0.0.1
- REDIS_HOST=redis
- REDIS_PORT=6379
depends_on:
- redis
links:
- redis
x-docker-logging:
&docker-logging
x-ethsignerProxy-def:
&ethsignerProxy-def
image: consensys/quorum-ethsigner:${QUORUM_ETHSIGNER_VERSION:-latest}
command: [
"--chain-id=1337",
"--http-listen-host=0.0.0.0",
"--downstream-http-port=8545",
"--downstream-http-host=rpcnode",
"file-based-signer",
"-k",
"/opt/ethsigner/keyfile",
"-p",
"/opt/ethsigner/passwordfile"
]
ports:
- 8545
services:
validator1:
<< : *besu-bootnode-def
environment:
- OTEL_RESOURCE_ATTRIBUTES=service.name=validator1,service.version=${BESU_VERSION:-latest}
volumes:
- public-keys:/tmp/
- ./config/besu/config.toml:/config/config.toml
- ./config/besu/permissions_config.toml:/config/permissions_config.toml
- ./config/besu/static-nodes.json:/config/static-nodes.json
- ./config/besu/log-config.xml:/config/log-config.xml
- ./config/besu/log-config-splunk.xml:/config/log-config-splunk.xml
- ./logs/besu:/tmp/besu
- ./config/besu/${BESU_CONS_ALGO:-ibft2}Genesis.json:/config/genesis.json
- ./config/besu/networkFiles/validator1/keys:/opt/besu/keys
networks:
quorum-dev-quickstart:
ipv4_address: 172.16.239.11
validator2:
<< : *besu-def
environment:
- OTEL_RESOURCE_ATTRIBUTES=service.name=validator2,service.version=${BESU_VERSION:-latest}
volumes:
- public-keys:/opt/besu/public-keys/
- ./config/besu/config.toml:/config/config.toml
- ./config/besu/permissions_config.toml:/config/permissions_config.toml
- ./config/besu/static-nodes.json:/config/static-nodes.json
- ./config/besu/log-config.xml:/config/log-config.xml
- ./config/besu/log-config-splunk.xml:/config/log-config-splunk.xml
- ./logs/besu:/tmp/besu
- ./config/besu/${BESU_CONS_ALGO:-ibft2}Genesis.json:/config/genesis.json
- ./config/besu/networkFiles/validator2/keys:/opt/besu/keys
depends_on:
- validator1
networks:
quorum-dev-quickstart:
ipv4_address: 172.16.239.12
validator3:
<< : *besu-def
environment:
- OTEL_RESOURCE_ATTRIBUTES=service.name=validator3,service.version=${BESU_VERSION:-latest}
volumes:
- public-keys:/opt/besu/public-keys/
- ./config/besu/config.toml:/config/config.toml
- ./config/besu/permissions_config.toml:/config/permissions_config.toml
- ./config/besu/static-nodes.json:/config/static-nodes.json
- ./config/besu/log-config.xml:/config/log-config.xml
- ./config/besu/log-config-splunk.xml:/config/log-config-splunk.xml
- ./logs/besu:/tmp/besu
- ./config/besu/${BESU_CONS_ALGO:-ibft2}Genesis.json:/config/genesis.json
- ./config/besu/networkFiles/validator3/keys:/opt/besu/keys
depends_on:
- validator1
networks:
quorum-dev-quickstart:
ipv4_address: 172.16.239.13
validator4:
<< : *besu-def
environment:
- OTEL_RESOURCE_ATTRIBUTES=service.name=validator4,service.version=${BESU_VERSION:-latest}
volumes:
- public-keys:/opt/besu/public-keys/
- ./config/besu/config.toml:/config/config.toml
- ./config/besu/permissions_config.toml:/config/permissions_config.toml
- ./config/besu/static-nodes.json:/config/static-nodes.json
- ./config/besu/log-config.xml:/config/log-config.xml
- ./config/besu/log-config-splunk.xml:/config/log-config-splunk.xml
- ./logs/besu:/tmp/besu
- ./config/besu/${BESU_CONS_ALGO:-ibft2}Genesis.json:/config/genesis.json
- ./config/besu/networkFiles/validator4/keys:/opt/besu/keys
depends_on:
- validator1
networks:
quorum-dev-quickstart:
ipv4_address: 172.16.239.14
rpcnode:
<< : *besu-def
container_name: rpcnode
environment:
- OTEL_RESOURCE_ATTRIBUTES=service.name=rpcnode,service.version=${BESU_VERSION:-latest}
volumes:
- public-keys:/opt/besu/public-keys/
- ./config/besu/config.toml:/config/config.toml
- ./config/besu/permissions_config.toml:/config/permissions_config.toml
- ./config/besu/static-nodes.json:/config/static-nodes.json
- ./config/besu/log-config.xml:/config/log-config.xml
- ./config/besu/log-config-splunk.xml:/config/log-config-splunk.xml
- ./logs/besu:/tmp/besu
- ./config/besu/${BESU_CONS_ALGO:-ibft2}Genesis.json:/config/genesis.json
- ./config/besu/networkFiles/rpcnode/keys:/opt/besu/keys
depends_on:
- validator1
ports:
- 8545:8545/tcp
- 8546:8546/tcp
networks:
quorum-dev-quickstart:
ipv4_address: 172.16.239.15
ethsignerProxy:
<< : *ethsignerProxy-def
<< : *docker-logging
volumes:
- ./config/ethsigner/password:/opt/ethsigner/passwordfile
- ./config/ethsigner/key:/opt/ethsigner/keyfile
depends_on:
- validator1
- rpcnode
ports:
- 18545:8545/tcp
networks:
quorum-dev-quickstart:
ipv4_address: 172.16.239.40
member1tessera:
<< : *tessera-def
ports:
- 9081:9080
environment:
- TESSERA_CONFIG_TYPE="-09"
volumes:
- ./config/tessera/networkFiles/member1:/config/keys
- member1tessera:/data
- ./logs/tessera:/var/log/tessera/
networks:
quorum-dev-quickstart:
ipv4_address: 172.16.239.26
member1besu:
<< : *besu-tx-def
environment:
- OTEL_RESOURCE_ATTRIBUTES=service.name=member1besu,service.version=${BESU_VERSION:-latest}
- LOG4J_CONFIGURATION_FILE=/config/log-config.xml
- NODE_ID=6
entrypoint:
- /bin/bash
- -c
- |
while [ ! -f "/opt/besu/public-keys/bootnode_pubkey" ]; do sleep 5; done ;
/opt/besu/bin/besu \
--config-file=/config/config.toml \
--p2p-host=$$(hostname -i) \
--genesis-file=/config/genesis.json \
--node-private-key-file=/opt/besu/keys/key \
--min-gas-price=0 \
--privacy-enabled \
--privacy-url=http://member1tessera:9101 \
--privacy-public-key-file=/config/tessera/tm.pub \
--privacy-onchain-groups-enabled=${PRIVACY_ONCHAIN_GROUPS_ENABLED:-false} \
--rpc-http-api=EEA,WEB3,ETH,NET,PRIV,PERM,${BESU_CONS_API:-IBFT} \
--rpc-ws-api=EEA,WEB3,ETH,NET,PRIV,PERM,${BESU_CONS_API:-IBFT} ;
volumes:
- public-keys:/opt/besu/public-keys/
- ./config/besu/config.toml:/config/config.toml
- ./config/besu/permissions_config.toml:/config/permissions_config.toml
- ./config/besu/static-nodes.json:/config/static-nodes.json
- ./config/besu/log-config.xml:/config/log-config.xml
- ./logs/besu:/tmp/besu
- ./config/besu/${BESU_CONS_ALGO:-ibft2}Genesis.json:/config/genesis.json
- ./config/besu/networkFiles/member1/keys:/opt/besu/keys
- ./config/tessera/networkFiles/member1/tm.pub:/config/tessera/tm.pub
depends_on:
- validator1
- member1tessera
ports:
- 20000:8545/tcp
- 20001:8546/tcp
networks:
quorum-dev-quickstart:
ipv4_address: 172.16.239.16
member2tessera:
<< : *tessera-def
ports:
- 9082:9080
environment:
- TESSERA_CONFIG_TYPE="-09"
volumes:
- ./config/tessera/networkFiles/member2:/config/keys
- member2tessera:/data
- ./logs/tessera:/var/log/tessera/
networks:
quorum-dev-quickstart:
ipv4_address: 172.16.239.27
member2besu:
<< : *besu-tx-def
environment:
- OTEL_RESOURCE_ATTRIBUTES=service.name=member2besu,service.version=${BESU_VERSION:-latest}
- LOG4J_CONFIGURATION_FILE=/config/log-config.xml
- NODE_ID=7
entrypoint:
- /bin/bash
- -c
- |
while [ ! -f "/opt/besu/public-keys/bootnode_pubkey" ]; do sleep 5; done ;
/opt/besu/bin/besu \
--config-file=/config/config.toml \
--p2p-host=$$(hostname -i) \
--genesis-file=/config/genesis.json \
--node-private-key-file=/opt/besu/keys/key \
--min-gas-price=0 \
--privacy-enabled \
--privacy-url=http://member2tessera:9101 \
--privacy-public-key-file=/config/tessera/tm.pub \
--privacy-onchain-groups-enabled=${PRIVACY_ONCHAIN_GROUPS_ENABLED:-false} \
--rpc-http-api=EEA,WEB3,ETH,NET,PRIV,PERM,${BESU_CONS_API:-IBFT} \
--rpc-ws-api=EEA,WEB3,ETH,NET,PRIV,PERM,${BESU_CONS_API:-IBFT} ;
volumes:
- public-keys:/opt/besu/public-keys/
- ./config/besu/config.toml:/config/config.toml
- ./config/besu/permissions_config.toml:/config/permissions_config.toml
- ./config/besu/static-nodes.json:/config/static-nodes.json
- ./config/besu/log-config.xml:/config/log-config.xml
- ./config/besu/log-config-splunk.xml:/config/log-config-splunk.xml
- ./logs/besu:/tmp/besu
- ./config/besu/${BESU_CONS_ALGO:-ibft2}Genesis.json:/config/genesis.json
- ./config/besu/networkFiles/member2/keys:/opt/besu/keys
- ./config/tessera/networkFiles/member2/tm.pub:/config/tessera/tm.pub
depends_on:
- validator1
- member2tessera
ports:
- 20002:8545/tcp
- 20003:8546/tcp
networks:
quorum-dev-quickstart:
ipv4_address: 172.16.239.17
member3tessera:
<< : *tessera-def
ports:
- 9083:9080
environment:
- TESSERA_CONFIG_TYPE="-09"
volumes:
- ./config/tessera/networkFiles/member3:/config/keys
- member3tessera:/data
- ./logs/tessera:/var/log/tessera/
networks:
quorum-dev-quickstart:
ipv4_address: 172.16.239.28
member3besu:
<< : *besu-tx-def
environment:
- LOG4J_CONFIGURATION_FILE=/config/log-config.xml
- OTEL_RESOURCE_ATTRIBUTES=service.name=member3besu,service.version=${BESU_VERSION:-latest}
- NODE_ID=8
entrypoint:
- /bin/bash
- -c
- |
while [ ! -f "/opt/besu/public-keys/bootnode_pubkey" ]; do sleep 5; done ;
/opt/besu/bin/besu \
--config-file=/config/config.toml \
--p2p-host=$$(hostname -i) \
--genesis-file=/config/genesis.json \
--node-private-key-file=/opt/besu/keys/key \
--min-gas-price=0 \
--privacy-enabled \
--privacy-url=http://member3tessera:9101 \
--privacy-public-key-file=/config/tessera/tm.pub \
--privacy-onchain-groups-enabled=${PRIVACY_ONCHAIN_GROUPS_ENABLED:-false} \
--rpc-http-api=EEA,WEB3,ETH,NET,PRIV,PERM,${BESU_CONS_API:-IBFT} \
--rpc-ws-api=EEA,WEB3,ETH,NET,PRIV,PERM,${BESU_CONS_API:-IBFT} ;
volumes:
- public-keys:/opt/besu/public-keys/
- ./config/besu/config.toml:/config/config.toml
- ./config/besu/permissions_config.toml:/config/permissions_config.toml
- ./config/besu/static-nodes.json:/config/static-nodes.json
- ./config/besu/log-config.xml:/config/log-config.xml
- ./config/besu/log-config-splunk.xml:/config/log-config-splunk.xml
- ./logs/besu:/tmp/besu
- ./config/besu/${BESU_CONS_ALGO:-ibft2}Genesis.json:/config/genesis.json
- ./config/besu/networkFiles/member3/keys:/opt/besu/keys
- ./config/tessera/networkFiles/member3/tm.pub:/config/tessera/tm.pub
depends_on:
- validator1
- member3tessera
ports:
- 20004:8545/tcp
- 20005:8546/tcp
networks:
quorum-dev-quickstart:
ipv4_address: 172.16.239.18
explorer:
build: block-explorer-light/.
image: quorum-dev-quickstart/block-explorer-light:develop
<< : *docker-logging
depends_on:
- rpcnode
ports:
- 25000:80/tcp
networks:
quorum-dev-quickstart:
ipv4_address: 172.16.239.31
prometheus:
image: "prom/prometheus"
volumes:
- ./config/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus:/prometheus
command:
- --config.file=/etc/prometheus/prometheus.yml
ports:
- 9090:9090/tcp
networks:
quorum-dev-quickstart:
ipv4_address: 172.16.239.32
grafana:
image: "grafana/grafana"
environment:
- GF_AUTH_ANONYMOUS_ENABLED=true
volumes:
- ./config/grafana/provisioning/:/etc/grafana/provisioning/
- grafana:/var/lib/grafana
ports:
- 3000:3000/tcp
networks:
quorum-dev-quickstart:
ipv4_address: 172.16.239.33
redis:
<< : *redis-def
networks:
quorum-dev-quickstart:
ipv4_address: 172.16.239.34
elasticsearch:
<< : *elasticsearch-def
networks:
quorum-dev-quickstart:
ipv4_address: 172.16.239.35
kibana:
<< : *kibana-def
networks:
quorum-dev-quickstart:
ipv4_address: 172.16.239.36
logstash:
<< : *logstash-def
networks:
quorum-dev-quickstart:
ipv4_address: 172.16.239.37
filebeat:
<< : *filebeat-def
networks:
quorum-dev-quickstart:
ipv4_address: 172.16.239.38
metricbeat:
<< : *metricbeat-def
networks:
quorum-dev-quickstart:
ipv4_address: 172.16.239.39
volumes:
public-keys:
prometheus:
grafana:
cakeshop:
member1tessera:
member2tessera:
member3tessera:
splunk:
ethlogger:
networks:
quorum-dev-quickstart:
driver: bridge
ipam:
config:
- subnet: 172.16.239.0/24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment