1
0
mirror of https://github.com/oceanprotocol/barge.git synced 2024-11-22 09:47:04 +01:00

Running proof of authority network.

This commit is contained in:
ssallam 2018-05-22 16:29:54 +02:00
parent 60e58ebb99
commit b28fe99f07
11 changed files with 336 additions and 5 deletions

12
.idea/docker-images.iml Normal file
View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TestRunnerService">
<option name="projectConfiguration" value="Twisted Trial" />
<option name="PROJECT_TEST_RUNNER" value="Twisted Trial" />
</component>
</module>

1
parity/.env Executable file
View File

@ -0,0 +1 @@
NETWORK_NAME=ocean-protocol

View File

@ -1 +1,25 @@
# Instructions to run a Parity dev node using Docker Compose
### Pre-requisites
* Docker
* Docker-compose
### Run a private network based on this repository
* Download/clone the files in this repository
`git clone https://github.com/oceanprotocol/docker-images.git`
* cd into `parity`
* Run: `docker-compose up -d`
* This will run 3 validator/authority nodes and 3 user nodes
### Add more authority nodes to the base network
* Run the private network as described above
* Create a new validator account:
`curl --data '{"jsonrpc":"2.0","method":"parity_newAccountFromPhrase","params":["nodeX", "nodeX"],"id":0}' -H "Content-Type: application/json" -X POST localhost:8545`
* Returns something like this: `{"jsonrpc":"2.0","result":"0x00aa39d30f0d20ff03a22ccfc30b7efbfca597c2","id":0}`
* Copy the file `parity/keys/UTC--2018-05-22T13-53-28Z--ed4d9a7c-4206-bbf3-673c-fdd1d41b4dcb` to `parity/authorities` and rename it to `validatorX.json` (pick a better name) then modify the contents to indent properly
* Add a simple text file named `validatorX.pwd` in `parity/authorities` and add the password `nodeX` (or whatever was specified in the "params":["nodeX", "nodeX"])
* Copy/paste one of the validator specs in the docker-compose.yml file and modify it to reflect the new node name and make sure to point to the new `validatorX.json` and `validayorX.pwd` files.
* Also specify the address in the --engine-signer option
* And add the name in the volumes section in the compose file
* Make a copy of `parity/node0.network.key` and modify the key inside this file (anything should do)

View File

@ -0,0 +1 @@
["123"]

141
parity/docker-compose.yml Normal file
View File

@ -0,0 +1,141 @@
version: '2.1'
services:
validator0:
image: parity/parity:latest
command:
--config /parity/config/validator.toml
--engine-signer 0x00bd138abd70e2f00903268f3db08f2d25677c9e
--dapps-interface 0.0.0.0
--ws-interface 0.0.0.0
--ui-interface 0.0.0.0
--unsafe-expose
--jsonrpc-cors all
volumes:
- ./parity/config:/parity/config:ro
- validator0:/root/.local/share/io.parity.ethereum/
- ./parity/authorities/validator0.json:/root/.local/share/io.parity.ethereum/keys/${NETWORK_NAME}/validator.json:ro
- ./parity/keys:/root/.local/share/io.parity.ethereum/keys/${NETWORK_NAME}
- ./parity/authorities/validator0.pwd:/parity/validator.pwd:ro
- ./parity/node0.network.key:/root/.local/share/io.parity.ethereum/network/key:ro
ports:
- 8545:8545
networks:
my_net:
ipv4_address: 172.16.0.10
validator1:
image: parity/parity:latest
command:
--config /parity/config/validator.toml
--engine-signer 0x00aa39d30f0d20ff03a22ccfc30b7efbfca597c2
volumes:
- ./parity/config:/parity/config:ro
- validator1:/root/.local/share/io.parity.ethereum/
- ./parity/authorities/validator1.json:/root/.local/share/io.parity.ethereum/keys/${NETWORK_NAME}/validator.json:ro
- ./parity/authorities/validator1.pwd:/parity/validator.pwd:ro
- ./parity/node1.network.key:/root/.local/share/io.parity.ethereum/network/key:ro
networks:
my_net:
ipv4_address: 172.16.0.11
validator2:
image: parity/parity:latest
command:
--config /parity/config/validator.toml
--engine-signer 0x002e28950558fbede1a9675cb113f0bd20912019
volumes:
- ./parity/config:/parity/config:ro
- validator2:/root/.local/share/io.parity.ethereum/
- ./parity/authorities/validator2.json:/root/.local/share/io.parity.ethereum/keys/${NETWORK_NAME}/validator.json:ro
- ./parity/authorities/validator2.pwd:/parity/validator.pwd:ro
- ./parity/node2.network.key:/root/.local/share/io.parity.ethereum/network/key:ro
networks:
my_net:
ipv4_address: 172.16.0.12
validator3:
image: parity/parity:latest
command:
--config /parity/config/validator.toml
--engine-signer 0x00050e34c6ce4edc8ba451aeef2ebb48d7688b8e
volumes:
- ./parity/config:/parity/config:ro
- validator3:/root/.local/share/io.parity.ethereum/
- ./parity/authorities/validator3.json:/root/.local/share/io.parity.ethereum/keys/${NETWORK_NAME}/validator.json:ro
- ./parity/authorities/validator3.pwd:/parity/validator.pwd:ro
- ./parity/node3.network.key:/root/.local/share/io.parity.ethereum/network/key:ro
networks:
my_net:
ipv4_address: 172.16.0.13
user0:
image: parity/parity:latest
command:
--config /parity/config/member.toml
--dapps-interface 0.0.0.0
--ws-interface 0.0.0.0
--ui-interface 0.0.0.0
--unsafe-expose
volumes:
- ./parity/config:/parity/config:ro
- ./parity/keys:/root/.local/share/io.parity.ethereum/keys/${NETWORK_NAME}
ports:
- 8180:8180
- 8546:8546
- 30303:30303
networks:
my_net:
ipv4_address: 172.16.0.20
user1:
image: parity/parity:latest
command:
--config /parity/config/member.toml
volumes:
- ./parity/config:/parity/config:ro
networks:
my_net:
ipv4_address: 172.16.0.21
user2:
image: parity/parity:latest
command:
--config /parity/config/member.toml
volumes:
- ./parity/config:/parity/config:ro
networks:
my_net:
ipv4_address: 172.16.0.22
monitor:
image: buythewhale/ethstats_monitor
volumes:
- ./monitor/app.json:/home/ethnetintel/eth-net-intelligence-api/app.json:ro
networks:
my_net:
ipv4_address: 172.16.0.100
dashboard:
image: buythewhale/ethstats
volumes:
- ./dashboard/ws_secret.json:/eth-netstats/ws_secret.json:ro
ports:
- 3001:3000
networks:
my_net:
ipv4_address: 172.16.0.200
volumes:
validator0:
validator1:
validator2:
validator3:
networks:
my_net:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.16.0.1/24
gateway: 172.16.0.1

149
parity/monitor/app.json Executable file
View File

@ -0,0 +1,149 @@
[
{
"name" : "validator0",
"script" : "app.js",
"log_date_format" : "YYYY-MM-DD HH:mm Z",
"merge_logs" : false,
"watch" : true,
"max_restarts" : 10,
"exec_interpreter" : "node",
"exec_mode" : "fork_mode",
"env":
{
"NODE_ENV" : "production",
"RPC_HOST" : "validator0",
"RPC_PORT" : "8545",
"LISTENING_PORT" : "30303",
"INSTANCE_NAME" : "validator0",
"WS_SERVER" : "ws://dashboard:3000",
"WS_SECRET" : "123",
"VERBOSITY" : 3
}
},
{
"name" : "validator1",
"script" : "app.js",
"log_date_format" : "YYYY-MM-DD HH:mm Z",
"merge_logs" : false,
"watch" : true,
"max_restarts" : 10,
"exec_interpreter" : "node",
"exec_mode" : "fork_mode",
"env":
{
"NODE_ENV" : "production",
"RPC_HOST" : "validator1",
"RPC_PORT" : "8545",
"LISTENING_PORT" : "30303",
"INSTANCE_NAME" : "validator1",
"WS_SERVER" : "ws://dashboard:3000",
"WS_SECRET" : "123",
"VERBOSITY" : 3
}
},
{
"name" : "validator2",
"script" : "app.js",
"log_date_format" : "YYYY-MM-DD HH:mm Z",
"merge_logs" : false,
"watch" : true,
"max_restarts" : 10,
"exec_interpreter" : "node",
"exec_mode" : "fork_mode",
"env":
{
"NODE_ENV" : "production",
"RPC_HOST" : "validator2",
"RPC_PORT" : "8545",
"LISTENING_PORT" : "30303",
"INSTANCE_NAME" : "validator2",
"WS_SERVER" : "ws://dashboard:3000",
"WS_SECRET" : "123",
"VERBOSITY" : 3
}
},
{
"name" : "validator3",
"script" : "app.js",
"log_date_format" : "YYYY-MM-DD HH:mm Z",
"merge_logs" : false,
"watch" : true,
"max_restarts" : 10,
"exec_interpreter" : "node",
"exec_mode" : "fork_mode",
"env":
{
"NODE_ENV" : "production",
"RPC_HOST" : "validator3",
"RPC_PORT" : "8545",
"LISTENING_PORT" : "30303",
"INSTANCE_NAME" : "validator3",
"WS_SERVER" : "ws://dashboard:3000",
"WS_SECRET" : "123",
"VERBOSITY" : 3
}
},
{
"name" : "user0",
"script" : "app.js",
"log_date_format" : "YYYY-MM-DD HH:mm Z",
"merge_logs" : false,
"watch" : true,
"max_restarts" : 10,
"exec_interpreter" : "node",
"exec_mode" : "fork_mode",
"env":
{
"NODE_ENV" : "production",
"RPC_HOST" : "user0",
"RPC_PORT" : "8545",
"LISTENING_PORT" : "30303",
"INSTANCE_NAME" : "user0",
"WS_SERVER" : "ws://dashboard:3000",
"WS_SECRET" : "123",
"VERBOSITY" : 3
}
},
{
"name" : "user1",
"script" : "app.js",
"log_date_format" : "YYYY-MM-DD HH:mm Z",
"merge_logs" : false,
"watch" : true,
"max_restarts" : 10,
"exec_interpreter" : "node",
"exec_mode" : "fork_mode",
"env":
{
"NODE_ENV" : "production",
"RPC_HOST" : "user1",
"RPC_PORT" : "8545",
"LISTENING_PORT" : "30303",
"INSTANCE_NAME" : "user1",
"WS_SERVER" : "ws://dashboard:3000",
"WS_SECRET" : "123",
"VERBOSITY" : 3
}
},
{
"name" : "user2",
"script" : "app.js",
"log_date_format" : "YYYY-MM-DD HH:mm Z",
"merge_logs" : false,
"watch" : true,
"max_restarts" : 10,
"exec_interpreter" : "node",
"exec_mode" : "fork_mode",
"env":
{
"NODE_ENV" : "production",
"RPC_HOST" : "user2",
"RPC_PORT" : "8545",
"LISTENING_PORT" : "30303",
"INSTANCE_NAME" : "user2",
"WS_SERVER" : "ws://dashboard:3000",
"WS_SECRET" : "123",
"VERBOSITY" : 3
}
}
]

View File

@ -7,8 +7,9 @@
"validators": {
"list": [
"0x00Bd138aBD70e2F00903268F3Db08f2D25677C9e",
"0x00Aa39d30F0D20FF03a22cCfc30B7EfbFca597C2",
"0x002e28950558fbede1a9675cb113f0bd20912019"
"0x00aa39d30f0d20ff03a22ccfc30b7efbfca597c2",
"0x002e28950558fbede1a9675cb113f0bd20912019",
"0x00050e34c6ce4edc8ba451aeef2ebb48d7688b8e"
]
},
"validateScoreTransition": 1000000000,

View File

@ -11,7 +11,8 @@ apis = ["web3", "eth", "net", "parity", "traces", "rpc", "personal", "parity_acc
bootnodes = [
"enode://147573f46fe9f5cc38fbe070089a31390baec5dd2827c8f2ef168833e4d0254fbee3969a02c5b9910ea5d5b23d86a6ed5eabcda17cc12007b7d9178b6c697aa5@172.16.0.10:30303",
"enode://1412ee9b9e23700e4a67a8fe3d8d02e10376b6e1cb748eaaf8aa60d4652b27872a8e1ad65bb31046438a5d3c1b71b00ec3ce0b4b42ac71464b28026a3d0b53af@172.16.0.11:30303",
"enode://9076c143a487aa163437a86f7d009f257f405c50bb2316800b9c9cc40e5a38fef5b414a47636ec38fdabc8a1872b563effa8574a7f8f85dc6bde465c368f1bf5@172.16.0.12:30303"
"enode://9076c143a487aa163437a86f7d009f257f405c50bb2316800b9c9cc40e5a38fef5b414a47636ec38fdabc8a1872b563effa8574a7f8f85dc6bde465c368f1bf5@172.16.0.12:30303",
"enode://a9fa615b065e0ffe0e64f915126ed4154bc89a03003c5ad6188109a289cb5ccc970ae708d4b40d763f42770e0ebe7e8e6835a9d78db2972b5a90bf12ee392e3f@172.16.0.13:30303"
]
[ui]

View File

@ -11,7 +11,8 @@ apis = ["web3", "eth", "net", "parity", "traces", "rpc", "personal", "parity_acc
bootnodes = [
"enode://147573f46fe9f5cc38fbe070089a31390baec5dd2827c8f2ef168833e4d0254fbee3969a02c5b9910ea5d5b23d86a6ed5eabcda17cc12007b7d9178b6c697aa5@172.16.0.10:30303",
"enode://1412ee9b9e23700e4a67a8fe3d8d02e10376b6e1cb748eaaf8aa60d4652b27872a8e1ad65bb31046438a5d3c1b71b00ec3ce0b4b42ac71464b28026a3d0b53af@172.16.0.11:30303",
"enode://9076c143a487aa163437a86f7d009f257f405c50bb2316800b9c9cc40e5a38fef5b414a47636ec38fdabc8a1872b563effa8574a7f8f85dc6bde465c368f1bf5@172.16.0.12:30303"
"enode://9076c143a487aa163437a86f7d009f257f405c50bb2316800b9c9cc40e5a38fef5b414a47636ec38fdabc8a1872b563effa8574a7f8f85dc6bde465c368f1bf5@172.16.0.12:30303",
"enode://a9fa615b065e0ffe0e64f915126ed4154bc89a03003c5ad6188109a289cb5ccc970ae708d4b40d763f42770e0ebe7e8e6835a9d78db2972b5a90bf12ee392e3f@172.16.0.13:30303"
]
[account]

View File

@ -1 +1 @@
{"parity://1.ui.parity":{"last_accessed":1526652994}}
{"":{"last_accessed":1526999158},"parity://1.ui.parity":{"last_accessed":1526997474}}

0
parity/parity/keys/validator.json Executable file → Normal file
View File