Skip to content

Commit

Permalink
Add initial itest
Browse files Browse the repository at this point in the history
  • Loading branch information
wcgcyx committed Jan 5, 2022
1 parent 673eeaa commit b0184e0
Show file tree
Hide file tree
Showing 12 changed files with 739 additions and 0 deletions.
48 changes: 48 additions & 0 deletions messaging/relayer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,45 @@
version: "3.8"

x-besu-bootnode-def:
&besu-bootnode-def
restart: "on-failure"
image: hyperledger/besu:${BESU_VERSION:-latest}
entrypoint:
- /bin/bash
- -c
- |
/opt/besu/bin/besu public-key export --to=/tmp/bootnode_pubkey;
/opt/besu/bin/besu \
--config-file=/config/config.toml \
--genesis-file=/config/genesis.json \
--node-private-key-file=/opt/besu/keys/key ;
services:

bc31node1:
<< : *besu-bootnode-def
environment:
- OTEL_RESOURCE_ATTRIBUTES=service.name=bc31node1,service.version=${BESU_VERSION:-latest}
volumes:
- ./env/blockchains/bc31:/config
- ./env/blockchains/keys:/opt/besu/keys
networks:
- shared
ports:
- 8311:8546

bc32node1:
<< : *besu-bootnode-def
environment:
- OTEL_RESOURCE_ATTRIBUTES=service.name=bc32node1,service.version=${BESU_VERSION:-latest}
volumes:
- ./env/blockchains/bc32:/config
- ./env/blockchains/keys:/opt/besu/keys
networks:
- shared
ports:
- 8321:8546

rabbitmq:
image: rabbitmq:3.9-management
container_name: rabbitmq
Expand All @@ -14,12 +53,17 @@ services:
interval: 30s
timeout: 10s
retries: 5
depends_on:
- bc31node1
- bc32node1

observer:
image: consensys/gpact/messaging/relayer
container_name: observer
networks:
- shared
ports:
- 9525:9425
env_file:
- ./env/.env.observer.example
command: /app/build/observer
Expand All @@ -32,6 +76,8 @@ services:
container_name: relayer
networks:
- shared
ports:
- 9625:9425
env_file:
- ./env/.env.relayer.example
command: /app/build/relayer
Expand All @@ -44,6 +90,8 @@ services:
container_name: dispatcher
networks:
- shared
ports:
- 9725:9425
env_file:
- ./env/.env.dispatcher.example
command: /app/build/dispatcher
Expand Down
58 changes: 58 additions & 0 deletions messaging/relayer/env/blockchains/bc31/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@

logging="INFO"
#logging="DEBUG"
data-path="/opt/besu/data"
host-whitelist=["*"]

# rpc
rpc-http-enabled=true
rpc-http-host="0.0.0.0"
rpc-http-port=8545
# rpc-http-cors-origins=["*"]
rpc-http-api = ["ETH", "NET", "WEB3"]
#rpc-http-api = ["ETH", "NET", "WEB3", "EEA", "PERM", "IBFT"]


# ws
rpc-ws-enabled=true
rpc-ws-host="0.0.0.0"
rpc-ws-port=8546
rpc-ws-api = ["ETH", "NET", "WEB3", "EEA", "PERM", "IBFT"]

# graphql
#graphql-http-enabled=true
#graphql-http-host="0.0.0.0"
#graphql-http-port=8547
#graphql-http-cors-origins=["*"]

# metrics
#metrics-enabled=true
#metrics-host="0.0.0.0"
#metrics-port=9545

# permissions
#permissions-nodes-config-file-enabled=true
#permissions-nodes-config-file="/config/permissions_config.toml"

# bootnodes
bootnodes=["enode://c1979a8a48693db804316b5acebe35e11731e1fb1c9c21ff7268ab25db6f6e03390a429b83cf0ec0865a7205f2669ec1ace652a3def11e2e01571c74939cbe22@172.16.239.11:30303"]


# Discovery at boot is set to a list of static files, but will also discover new nodes should they be added
# static nodes
static-nodes-file="/config/static-nodes.json"

discovery-enabled=false


#p2p-enabled = true
#p2p-port = 30303


min-gas-price = "0"
miner-extra-data = "0x0000000000000000000000000000000000000000000000000000000000003100"


# Improve ability to debug by enabling revert reasons / require reasons.
revert-reason-enabled=true

39 changes: 39 additions & 0 deletions messaging/relayer/env/blockchains/bc31/genesis.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"config":{
"chainId":31,
"muirglacierblock":12965000,
"constantinoplefixblock": 0,
"clique":{
"blockperiodseconds":1,
"epochlength":30000
}
},
"coinbase":"0x0000000000000000000000000000000000000000",
"difficulty":"0x1",
"extraData":"0x00000000000000000000000000000000000000000000000000000000000000004592c8e45706cc08b8f44b11e43cba0cfc5892cb0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"gasLimit":"0xa00000",
"mixHash":"0x0000000000000000000000000000000000000000000000000000000000000000",
"nonce":"0x0",
"timestamp":"0x5c51a607",
"alloc": {
"fe3b557e8fb62b89f4916b721be55ceb828dbd73": {
"privateKey": "8f2a55949038a9610f50fb23b5883af3b4ecb3c3bb792cbcefbd1542c692be63",
"comment": "private key and this comment are ignored. In a real chain, the private key should NOT be stored",
"balance": "0xad78ebc5ac6200000"
},
"627306090abaB3A6e1400e9345bC60c78a8BEf57": {
"privateKey": "c87509a1c067bbde78beb793e6fa76530b6382a4c0241e5e4a9ec0a0f44dc0d3",
"comment": "private key and this comment are ignored. In a real chain, the private key should NOT be stored",
"balance": "90000000000000000000000"
},
"f17f52151EbEF6C7334FAD080c5704D77216b732": {
"privateKey": "ae6ae8e5ccbfb04590405997ee2d52d2b330726137b875053c36d94e974d162f",
"comment": "private key and this comment are ignored. In a real chain, the private key should NOT be stored",
"balance": "90000000000000000000000"
}
},
"number":"0x0",
"gasUsed":"0x0",
"parentHash":"0x0000000000000000000000000000000000000000000000000000000000000000"
}

27 changes: 27 additions & 0 deletions messaging/relayer/env/blockchains/bc31/log-config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="INFO" monitorInterval="5">

<Properties>
<Property name="root.log.level">INFO</Property>
</Properties>

<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout alwaysWriteExceptions="false" pattern='{"timestamp":"%d{ISO8601}","container":"${hostName}","level":"%level","thread":"%t","class":"%c{1}","message":"%msg","throwable":"%enc{%throwable}{JSON}"}%n'/>
</Console>
<RollingFile name="RollingFile" fileName="/tmp/besu/besu-${env:HOSTNAME}.log" filePattern="/temp/besu/besu-${env:HOSTNAME}.log" >
<PatternLayout alwaysWriteExceptions="false" pattern='{"timestamp":"%d{ISO8601}","container":"${hostName}","level":"%level","thread":"%t","class":"%c{1}","message":"%msg","throwable":"%enc{%throwable}{JSON}"}%n'/>
<Policies>
<SizeBasedTriggeringPolicy size="10 MB" />
</Policies>
</RollingFile>
</Appenders>

<Loggers>
<Root level="${sys:root.log.level}">
<AppenderRef ref="RollingFile" />
<AppenderRef ref="Console" />
</Root>
</Loggers>

</Configuration>
3 changes: 3 additions & 0 deletions messaging/relayer/env/blockchains/bc31/static-nodes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[
"enode://c1979a8a48693db804316b5acebe35e11731e1fb1c9c21ff7268ab25db6f6e03390a429b83cf0ec0865a7205f2669ec1ace652a3def11e2e01571c74939cbe22@172.16.239.11:30303"
]
58 changes: 58 additions & 0 deletions messaging/relayer/env/blockchains/bc32/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@

logging="INFO"
#logging="DEBUG"
data-path="/opt/besu/data"
host-whitelist=["*"]

# rpc
rpc-http-enabled=true
rpc-http-host="0.0.0.0"
rpc-http-port=8545
# rpc-http-cors-origins=["*"]
rpc-http-api = ["ETH", "NET", "WEB3"]
#rpc-http-api = ["ETH", "NET", "WEB3", "EEA", "PERM", "IBFT"]


# ws
rpc-ws-enabled=true
rpc-ws-host="0.0.0.0"
rpc-ws-port=8546
rpc-ws-api = ["ETH", "NET", "WEB3", "EEA", "PERM", "IBFT"]

# graphql
#graphql-http-enabled=true
#graphql-http-host="0.0.0.0"
#graphql-http-port=8547
#graphql-http-cors-origins=["*"]

# metrics
#metrics-enabled=true
#metrics-host="0.0.0.0"
#metrics-port=9545

# permissions
#permissions-nodes-config-file-enabled=true
#permissions-nodes-config-file="/config/permissions_config.toml"

# bootnodes
bootnodes=["enode://c1979a8a48693db804316b5acebe35e11731e1fb1c9c21ff7268ab25db6f6e03390a429b83cf0ec0865a7205f2669ec1ace652a3def11e2e01571c74939cbe22@172.16.239.12:30303"]


# Discovery at boot is set to a list of static files, but will also discover new nodes should they be added
# static nodes
static-nodes-file="/config/static-nodes.json"

discovery-enabled=false


#p2p-enabled = true
#p2p-port = 30303


min-gas-price = "0"
miner-extra-data = "0x0000000000000000000000000000000000000000000000000000000000003100"


# Improve ability to debug by enabling revert reasons / require reasons.
revert-reason-enabled=true

39 changes: 39 additions & 0 deletions messaging/relayer/env/blockchains/bc32/genesis.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"config":{
"chainId":32,
"muirglacierblock":12965000,
"constantinoplefixblock": 0,
"clique":{
"blockperiodseconds":1,
"epochlength":30000
}
},
"coinbase":"0x0000000000000000000000000000000000000000",
"difficulty":"0x1",
"extraData":"0x00000000000000000000000000000000000000000000000000000000000000004592c8e45706cc08b8f44b11e43cba0cfc5892cb0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"gasLimit":"0xa00000",
"mixHash":"0x0000000000000000000000000000000000000000000000000000000000000000",
"nonce":"0x0",
"timestamp":"0x5c51a607",
"alloc": {
"fe3b557e8fb62b89f4916b721be55ceb828dbd73": {
"privateKey": "8f2a55949038a9610f50fb23b5883af3b4ecb3c3bb792cbcefbd1542c692be63",
"comment": "private key and this comment are ignored. In a real chain, the private key should NOT be stored",
"balance": "0xad78ebc5ac6200000"
},
"627306090abaB3A6e1400e9345bC60c78a8BEf57": {
"privateKey": "c87509a1c067bbde78beb793e6fa76530b6382a4c0241e5e4a9ec0a0f44dc0d3",
"comment": "private key and this comment are ignored. In a real chain, the private key should NOT be stored",
"balance": "90000000000000000000000"
},
"f17f52151EbEF6C7334FAD080c5704D77216b732": {
"privateKey": "ae6ae8e5ccbfb04590405997ee2d52d2b330726137b875053c36d94e974d162f",
"comment": "private key and this comment are ignored. In a real chain, the private key should NOT be stored",
"balance": "90000000000000000000000"
}
},
"number":"0x0",
"gasUsed":"0x0",
"parentHash":"0x0000000000000000000000000000000000000000000000000000000000000000"
}

27 changes: 27 additions & 0 deletions messaging/relayer/env/blockchains/bc32/log-config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="INFO" monitorInterval="5">

<Properties>
<Property name="root.log.level">INFO</Property>
</Properties>

<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout alwaysWriteExceptions="false" pattern='{"timestamp":"%d{ISO8601}","container":"${hostName}","level":"%level","thread":"%t","class":"%c{1}","message":"%msg","throwable":"%enc{%throwable}{JSON}"}%n'/>
</Console>
<RollingFile name="RollingFile" fileName="/tmp/besu/besu-${env:HOSTNAME}.log" filePattern="/temp/besu/besu-${env:HOSTNAME}.log" >
<PatternLayout alwaysWriteExceptions="false" pattern='{"timestamp":"%d{ISO8601}","container":"${hostName}","level":"%level","thread":"%t","class":"%c{1}","message":"%msg","throwable":"%enc{%throwable}{JSON}"}%n'/>
<Policies>
<SizeBasedTriggeringPolicy size="10 MB" />
</Policies>
</RollingFile>
</Appenders>

<Loggers>
<Root level="${sys:root.log.level}">
<AppenderRef ref="RollingFile" />
<AppenderRef ref="Console" />
</Root>
</Loggers>

</Configuration>
3 changes: 3 additions & 0 deletions messaging/relayer/env/blockchains/bc32/static-nodes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[
"enode://c1979a8a48693db804316b5acebe35e11731e1fb1c9c21ff7268ab25db6f6e03390a429b83cf0ec0865a7205f2669ec1ace652a3def11e2e01571c74939cbe22@172.16.239.12:30303"
]
1 change: 1 addition & 0 deletions messaging/relayer/env/blockchains/keys/key
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0fd4aecd8f02b24f468325aa06e1428ab8076d283bac3ed804c9f70187dedb63
1 change: 1 addition & 0 deletions messaging/relayer/env/blockchains/keys/key.pub
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
c1979a8a48693db804316b5acebe35e11731e1fb1c9c21ff7268ab25db6f6e03390a429b83cf0ec0865a7205f2669ec1ace652a3def11e2e01571c74939cbe22
Loading

0 comments on commit b0184e0

Please sign in to comment.