Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
EtherCoreAdmin committed Feb 3, 2020
1 parent 4449c03 commit 7b314e7
Show file tree
Hide file tree
Showing 22 changed files with 417 additions and 2 deletions.
34 changes: 32 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
# PoA Launcher
# EtherCore PoA Launcher

![Kim lunch](./meme.jpg)
![Kim launch](./meme.jpg)

EtherCore PoA sidechain launcher

## Prerequisite

+ New vitural machine with Ubuntu 18.04 installed

Recommended spec)

AWS `m5a.xlarge` (4 Cores 16GB Ram) for beginners

## One-line installer

This command will initialize the poa sidechain on your server

## PoA launcher composition

+ One parity node for block explorer & api service
+ Two geth PoA validator node
+ Blockscout open-source block explorer
+ eth-netstats poa network dashboard
+ eth-net-intelligence-api node stats reporting api

## Recommendation

If you are going to use this launcher for production, please change your wallet since the private keys are public from github!

## TO-DO

+ Add web wallet service
+ Add faucet service
+ Add mainnet-sidechain bridge service
24 changes: 24 additions & 0 deletions api-config/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[
{
"name" : "node-app",
"script" : "app.js",
"log_date_format" : "YYYY-MM-DD HH:mm Z",
"merge_logs" : false,
"watch" : false,
"max_restarts" : 10,
"exec_interpreter" : "node",
"exec_mode" : "fork_mode",
"env":
{
"NODE_ENV" : "production",
"RPC_HOST" : "localhost",
"RPC_PORT" : "8545",
"LISTENING_PORT" : "30303",
"INSTANCE_NAME" : "Parity PoA node",
"CONTACT_DETAILS" : "",
"WS_SERVER" : "ws://127.0.0.1:3000",
"WS_SECRET" : "poasidechain",
"VERBOSITY" : 2
}
}
]
24 changes: 24 additions & 0 deletions api-config/app2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[
{
"name" : "node2-app",
"script" : "app.js",
"log_date_format" : "YYYY-MM-DD HH:mm Z",
"merge_logs" : false,
"watch" : false,
"max_restarts" : 10,
"exec_interpreter" : "node",
"exec_mode" : "fork_mode",
"env":
{
"NODE_ENV" : "production",
"RPC_HOST" : "localhost",
"RPC_PORT" : "8745",
"LISTENING_PORT" : "30503",
"INSTANCE_NAME" : "Geth PoA Validator 1",
"CONTACT_DETAILS" : "",
"WS_SERVER" : "ws://127.0.0.1:3000",
"WS_SECRET" : "poasidechain",
"VERBOSITY" : 2
}
}
]
24 changes: 24 additions & 0 deletions api-config/app3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[
{
"name" : "node3-app",
"script" : "app.js",
"log_date_format" : "YYYY-MM-DD HH:mm Z",
"merge_logs" : false,
"watch" : false,
"max_restarts" : 10,
"exec_interpreter" : "node",
"exec_mode" : "fork_mode",
"env":
{
"NODE_ENV" : "production",
"RPC_HOST" : "localhost",
"RPC_PORT" : "8945",
"LISTENING_PORT" : "30703",
"INSTANCE_NAME" : "Geth PoA Validator 2",
"CONTACT_DETAILS" : "",
"WS_SERVER" : "ws://127.0.0.1:3000",
"WS_SECRET" : "poasidechain",
"VERBOSITY" : 2
}
}
]
2 changes: 2 additions & 0 deletions aws.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
wget https://packages.erlang-solutions.com/erlang-solutions_2.0_all.deb && sudo dpkg -i erlang-solutions_2.0_all.deb && curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - && sudo add-apt-repository -y ppa:deadsnakes/ppa && sudo apt-get install -y libpython3.7 libpython3.7-dev libpython3.7-minimal libpython3.7-stdlib python3.7 python3.7-dev python3.7-distutils python3.7-lib2to3 python3.7-minimal python3.7-venv python3.7-doc binfmt-support build-essential nodejs gcc g++ pkg-config file make cmake libgmp3-dev libtool esl-erlang elixir postgresql postgresql-contrib && curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && sudo python3.7 get-pip.py && rm get-pip.py && sudo python3.7 -m pip install pandas pathlib web3 && sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'poasidechain';"
10 changes: 10 additions & 0 deletions dev.secret.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
use Mix.Config

# Configure your database
config :explorer, Explorer.Repo,
database: "explorer_dev",
hostname: "localhost",
username: "postgres",
password: "poasidechain",
pool_size: 20,
timeout: 80_000
32 changes: 32 additions & 0 deletions geth.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"config": {
"chainId": 2020,
"homesteadBlock": 0,
"eip150Block": 0,
"eip155Block": 0,
"eip158Block": 0,
"byzantiumBlock": 0,
"constantinopleBlock": 0,
"petersburgBlock": 0,
"istanbulBlock": 0,
"clique": {
"period": 1,
"epoch": 450000
}
},
"nonce": "0x0",
"timestamp": "0x5e385f2d",
"extraData": "0x000000000000000000000000000000000000000000000000000000000000000031d05c2CFd341dDc1f7FA1aebE27E21379a6120164B8d819460452f9b5c726E29720626b6D9744200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"gasLimit": "0xc845880",
"difficulty": "0x1",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x0000000000000000000000000000000000000000",
"alloc": {
"0xaf6F001FdB3CD98CD38A3f6C7306706D98689dF0": {
"balance": "0x33b2e3c9fd0803ce8000000"
}
},
"number": "0x0",
"gasUsed": "0x0",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
}
11 changes: 11 additions & 0 deletions init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
sudo cp bin/* /usr/local/bin
sudo cp systemd/* /etc/systemd/system
geth --datadir nodes/geth init geth.json
geth --datadir nodes/geth2 init geth.json
cd eth-netstats && npm i && cd ..
cd eth-net-intelligence-api && npm i && cd ..
cp ws_secret.json eth-netstats
cp api-config/* eth-net-intelligence-api
cp dev.secret.exs blockscout/apps/explorer/config/dev.secret.exs
cd blockscout && cp apps/block_scout_web/config/dev.secret.exs.example apps/block_scout_web/config/dev.secret.exs && mix do deps.get, local.rebar --force, deps.compile, compile && mix do ecto.create, ecto.migrate && cd apps/block_scout_web/assets; npm install && node_modules/webpack/bin/webpack.js --mode production; cd - && cd apps/explorer && npm install; cd - && mix phx.digest && cd apps/block_scout_web && mix phx.gen.cert blockscout blockscout.local; cd -
1 change: 1 addition & 0 deletions nodes/geth/geth/nodekey
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
f734ec272aef419c928fca10d971af6aa66bd916872f26a1438c6caae47d74a7
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"31d05c2cfd341ddc1f7fa1aebe27e21379a61201","crypto":{"cipher":"aes-128-ctr","ciphertext":"7c5c0aff3d0805a7319a698a4396424d3b0dee60a28379ee7d036e6742a9c694","cipherparams":{"iv":"1debf1d326b4da6a97fcaaba102a6fa3"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"4260e27eab7a848a6496c7217ea7355ac70fdd9c62279322fff5b1bffe6c95b8"},"mac":"d301e6e76d2e0bb4b531c11353e7f02eb6870b49bfabb37cce0e92da6686a3d7"},"id":"7cff1dbe-b3b6-4fd1-905d-d4f4cbee2847","version":3}
1 change: 1 addition & 0 deletions nodes/geth2/geth/nodekey
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dcaffb57bcdf84d9ec9f72aaf2ceafa359dab027d451a6c69431f6879f8fd95a
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"address":"64b8d819460452f9b5c726e29720626b6d974420","crypto":{"cipher":"aes-128-ctr","ciphertext":"5dd2b401e6ac540b21f3150ad9d36ec9940a6b3b8eca47d0eafbdefe4428d18b","cipherparams":{"iv":"4e0c0c080a9b5e3db3b434d7350b74fe"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"ea64e8c4ffc86fd341d2dc039343b99d0d69ce889b61832a353bf8000deeb446"},"mac":"4ac3d7541703fd68444ae5c3a4f148d3875b3d758ffedcd7f61c95ebc9653867"},"id":"b523dbb5-781b-48af-b905-91b709f65fb3","version":3}
1 change: 1 addition & 0 deletions nodes/parity/network/key
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9d4899cbd9686510f04507b81e4c2f9bba145df0e4fe6e4985ed7d67886e9127
174 changes: 174 additions & 0 deletions parity.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
{
"name":"PoA",
"dataDir":"poa",
"engine":{
"clique":{
"params":{
"period":1,
"epoch":450000
}
}
},
"params":{
"gasLimitBoundDivisor":"0x400",
"accountStartNonce":"0x0",
"maximumExtraDataSize":"0xffff",
"minGasLimit":"0x1388",
"networkID":"0x7e4",
"eip150Transition":"0x0",
"eip160Transition":"0x0",
"eip161abcTransition":"0x0",
"eip161dTransition":"0x0",
"eip155Transition":"0x0",
"maxCodeSize":"0x6000",
"maxCodeSizeTransition":"0x0",
"eip140Transition":"0x0",
"eip211Transition":"0x0",
"eip214Transition":"0x0",
"eip658Transition":"0x0",
"eip145Transition":"0x0",
"eip1014Transition":"0x0",
"eip1052Transition":"0x0",
"eip1283Transition":"0x0",
"eip1344Transition":"0x0",
"eip1706Transition":"0x0",
"eip1884Transition":"0x0",
"eip2028Transition":"0x0"
},
"genesis":{
"author":"0x0000000000000000000000000000000000000000",
"difficulty":"0x1",
"extraData":"0x000000000000000000000000000000000000000000000000000000000000000031d05c2CFd341dDc1f7FA1aebE27E21379a6120164B8d819460452f9b5c726E29720626b6D9744200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"gasLimit":"0xc845880",
"parentHash":"0x0000000000000000000000000000000000000000000000000000000000000000",
"seal":{
"ethereum":{
"nonce":"0x0000000000000000",
"mixHash":"0x0000000000000000000000000000000000000000000000000000000000000000"
}
},
"timestamp":"0x5e385f2d"
},
"nodes":[
"enode://d45875c480cbe72a6a17158991a1af6b1e3f643928c39302064dcd0b0d4429afd342b993064febc10b4f42a8f46bf631adedb0f353477efdffe87dc75bae013e@127.0.0.1:30303",
"enode://464101aea7a11ebc1d5013e015b459bad010c7814e98d980db375dc94f9f75096cf67eed83fc5500f1703cec292ba806978cc98e83f76007118808f5aae0b969@127.0.0.1:30503",
"enode://102ce55c5680dc2bd68a0adc6d914dc8512ac2ea2adb0b9b4f5e4200a7f67e6586d85834486e501903d22e56d21ee878a5140369b482bd459f763c5dfd4e5f9f@127.0.0.1:30703"
],
"accounts":{
"0x0000000000000000000000000000000000000001":{
"builtin":{
"name":"ecrecover",
"pricing":{
"linear":{
"base":3000,
"word":0
}
}
}
},
"0x0000000000000000000000000000000000000002":{
"builtin":{
"name":"sha256",
"pricing":{
"linear":{
"base":60,
"word":12
}
}
}
},
"0x0000000000000000000000000000000000000003":{
"builtin":{
"name":"ripemd160",
"pricing":{
"linear":{
"base":600,
"word":120
}
}
}
},
"0x0000000000000000000000000000000000000004":{
"builtin":{
"name":"identity",
"pricing":{
"linear":{
"base":15,
"word":3
}
}
}
},
"0x0000000000000000000000000000000000000005":{
"builtin":{
"name":"modexp",
"activate_at":"0x0",
"pricing":{
"modexp":{
"divisor":20
}
}
}
},
"0x0000000000000000000000000000000000000006":{
"builtin":{
"name":"alt_bn128_add",
"pricing":{
"0x0":{
"info":"EIP 1108 transition",
"price":{
"alt_bn128_const_operations":{
"price":150
}
}
}
}
}
},
"0x0000000000000000000000000000000000000007":{
"builtin":{
"name":"alt_bn128_mul",
"pricing":{
"0x0":{
"info":"EIP 1108 transition",
"price":{
"alt_bn128_const_operations":{
"price":6000
}
}
}
}
}
},
"0x0000000000000000000000000000000000000008":{
"builtin":{
"name":"alt_bn128_pairing",
"pricing":{
"0x0":{
"info":"EIP 1108 transition",
"price":{
"alt_bn128_pairing":{
"base":45000,
"pair":34000
}
}
}
}
}
},
"0x0000000000000000000000000000000000000009":{
"builtin":{
"name":"blake2_f",
"activate_at":"0x0",
"pricing":{
"blake2_f":{
"gas_per_round":1
}
}
}
},
"0xaf6F001FdB3CD98CD38A3f6C7306706D98689dF0":{
"balance":"0x33b2e3c9fd0803ce8000000"
}
}
}
1 change: 1 addition & 0 deletions password.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
poasidechain
2 changes: 2 additions & 0 deletions start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
sudo systemctl start parity geth geth2 netstats blockscout
15 changes: 15 additions & 0 deletions systemd/blockscout.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Unit]
Description=Blockscout Explorer Daemon
After=parity.target

[Service]
Type=simple
User=ubuntu
WorkingDirectory=/home/ubuntu/poa-launcher/blockscout
ExecStart=/usr/bin/mix phx.server
KillMode=control-group
Restart=always
RestartSec=10s

[Install]
WantedBy=multi-user.target
15 changes: 15 additions & 0 deletions systemd/geth.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Unit]
Description=Geth Node Daemon
After=network-online.target

[Service]
Type=simple
User=ubuntu
WorkingDirectory=/home/ubuntu
ExecStart=/usr/local/bin/geth --datadir="/home/ubuntu/poa-launcher/nodes/geth" --networkid=2020 --port=30503 --rpc --rpcport=8745 --nousb --cache=10000 --mine --miner.etherbase="0x31d05c2CFd341dDc1f7FA1aebE27E21379a61201" --miner.extradata="Geth PoA Validator 1" --txpool.pricelimit=0 --txpool.accountslots=200000 --txpool.globalslots=200000 --txpool.accountqueue=200000 --txpool.globalqueue=200000 --miner.gasprice=0 --miner.gastarget=210000000 --miner.gaslimit=210000000 --bootnodes="enode://d45875c480cbe72a6a17158991a1af6b1e3f643928c39302064dcd0b0d4429afd342b993064febc10b4f42a8f46bf631adedb0f353477efdffe87dc75bae013e@127.0.0.1:30303,enode://102ce55c5680dc2bd68a0adc6d914dc8512ac2ea2adb0b9b4f5e4200a7f67e6586d85834486e501903d22e56d21ee878a5140369b482bd459f763c5dfd4e5f9f@127.0.0.1:30703"
KillMode=process
Restart=always
RestartSec=10s

[Install]
WantedBy=multi-user.target
Loading

0 comments on commit 7b314e7

Please sign in to comment.