diff --git a/amis/docker-compose-v-n.yml b/amis/docker-compose-v-n.yml new file mode 100644 index 000000000000..037d05965c46 --- /dev/null +++ b/amis/docker-compose-v-n.yml @@ -0,0 +1,196 @@ +version: '3' +services: + validator-01: + hostname: validator-01 + build: + dockerfile: amis/geth/Dockerfile + context: ../ + image: amis_geth:latest + ports: + - '30303:30303' + environment: + - IDENTITY=validator-01 + - NODEKEY=1862cf0b92e8da1c92521006f29a5a9cca33ee7537a23112719c41bf816832f2 + - BOOTNODES=enode://52870b1bb7874e4ebffd708fbdea7add773912c000e54e5b504ea01ecd956ecb2b54ea4b2076fcfbd24121209dfe97ca8b6368926ce1956e53f63fd20c0e29d7@172.16.238.10:30303,enode://c8fa7bd31ac2bd271fbbc7c5503bff29a94b8301bac5fa5ab7e8787672febc0541926dcb5d8698ef36e66ccba84ef071ee1d29f9aebc9e6bbf4cfeb4e4dce8ad@172.16.238.11:30304,enode://a5a6c556e7ac360e8f2eee5d03c11f447c3d918d73692958695b429b9f0d67fbcb817aea2c169d7abd5a80bbae2adf6bf7e0237c8f78d93d6a82a27efe12ec57@172.16.238.12:30305,enode://5cd6270a6317e8bb1c8a70e5041260ae2864dc35103d27e129c6b0f9cf657cf3db866199a528b33d0ffb48f4e71b1ec8a01102e753cd527afa9c2ba3dfd4515d@172.16.238.13:30306 + - PORT=30303 + - GAS_LIMIT=250000000 + - GLOBAL_SLOTS=4096 + - ACCOUNT_SLOTS=4096 + - GLOBAL_QUEUE=2048 + - ACCOUNT_QUEUE=2048 + - PROMETHEUS_ADDR=http://192.168.99.100:9091 + networks: + app_net: + ipv4_address: 172.16.238.10 + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8545"] + interval: 30s + timeout: 10s + retries: 5 + validator-02: + hostname: validator-02 + image: amis_geth:latest + ports: + - '30304:30304' + environment: + - IDENTITY=validator-02 + - NODEKEY=72fa6fc77e8ea98a5adc168c0ceed63205d9580dcbb969df794248dee5a00ea5 + - BOOTNODES=enode://52870b1bb7874e4ebffd708fbdea7add773912c000e54e5b504ea01ecd956ecb2b54ea4b2076fcfbd24121209dfe97ca8b6368926ce1956e53f63fd20c0e29d7@172.16.238.10:30303,enode://c8fa7bd31ac2bd271fbbc7c5503bff29a94b8301bac5fa5ab7e8787672febc0541926dcb5d8698ef36e66ccba84ef071ee1d29f9aebc9e6bbf4cfeb4e4dce8ad@172.16.238.11:30304,enode://a5a6c556e7ac360e8f2eee5d03c11f447c3d918d73692958695b429b9f0d67fbcb817aea2c169d7abd5a80bbae2adf6bf7e0237c8f78d93d6a82a27efe12ec57@172.16.238.12:30305,enode://5cd6270a6317e8bb1c8a70e5041260ae2864dc35103d27e129c6b0f9cf657cf3db866199a528b33d0ffb48f4e71b1ec8a01102e753cd527afa9c2ba3dfd4515d@172.16.238.13:30306 + - PORT=30304 + - GAS_LIMIT=250000000 + - GLOBAL_SLOTS=4096 + - ACCOUNT_SLOTS=4096 + - GLOBAL_QUEUE=2048 + - ACCOUNT_QUEUE=2048 + - PROMETHEUS_ADDR=http://192.168.99.100:9091 + networks: + app_net: + ipv4_address: 172.16.238.11 + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8545"] + interval: 30s + timeout: 10s + retries: 5 + links: + - validator-01 + - validator-03 + - validator-04 + validator-03: + hostname: validator-03 + image: amis_geth:latest + ports: + - '30305:30305' + environment: + - IDENTITY=validator-03 + - NODEKEY=31f07e972131b6449296d519a99b0b6a4b58426f3a56093174601475efd5c944 + - BOOTNODES=enode://52870b1bb7874e4ebffd708fbdea7add773912c000e54e5b504ea01ecd956ecb2b54ea4b2076fcfbd24121209dfe97ca8b6368926ce1956e53f63fd20c0e29d7@172.16.238.10:30303,enode://c8fa7bd31ac2bd271fbbc7c5503bff29a94b8301bac5fa5ab7e8787672febc0541926dcb5d8698ef36e66ccba84ef071ee1d29f9aebc9e6bbf4cfeb4e4dce8ad@172.16.238.11:30304,enode://a5a6c556e7ac360e8f2eee5d03c11f447c3d918d73692958695b429b9f0d67fbcb817aea2c169d7abd5a80bbae2adf6bf7e0237c8f78d93d6a82a27efe12ec57@172.16.238.12:30305,enode://5cd6270a6317e8bb1c8a70e5041260ae2864dc35103d27e129c6b0f9cf657cf3db866199a528b33d0ffb48f4e71b1ec8a01102e753cd527afa9c2ba3dfd4515d@172.16.238.13:30306 + - PORT=30305 + - GAS_LIMIT=250000000 + - GLOBAL_SLOTS=4096 + - ACCOUNT_SLOTS=4096 + - GLOBAL_QUEUE=2048 + - ACCOUNT_QUEUE=2048 + - PROMETHEUS_ADDR=http://192.168.99.100:9091 + networks: + app_net: + ipv4_address: 172.16.238.12 + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8545"] + interval: 30s + timeout: 10s + retries: 5 + links: + - validator-01 + validator-04: + hostname: validator-04 + image: amis_geth:latest + ports: + - '30306:30306' + environment: + - IDENTITY=validator-04 + - NODEKEY=4b67c5a38c067a477088b2d2607dbec6ce2b2febcba9fe64bc27ee81e4f34532 + - BOOTNODES=enode://52870b1bb7874e4ebffd708fbdea7add773912c000e54e5b504ea01ecd956ecb2b54ea4b2076fcfbd24121209dfe97ca8b6368926ce1956e53f63fd20c0e29d7@172.16.238.10:30303,enode://c8fa7bd31ac2bd271fbbc7c5503bff29a94b8301bac5fa5ab7e8787672febc0541926dcb5d8698ef36e66ccba84ef071ee1d29f9aebc9e6bbf4cfeb4e4dce8ad@172.16.238.11:30304,enode://a5a6c556e7ac360e8f2eee5d03c11f447c3d918d73692958695b429b9f0d67fbcb817aea2c169d7abd5a80bbae2adf6bf7e0237c8f78d93d6a82a27efe12ec57@172.16.238.12:30305,enode://5cd6270a6317e8bb1c8a70e5041260ae2864dc35103d27e129c6b0f9cf657cf3db866199a528b33d0ffb48f4e71b1ec8a01102e753cd527afa9c2ba3dfd4515d@172.16.238.13:30306 + - PORT=30306 + - GAS_LIMIT=250000000 + - GLOBAL_SLOTS=4096 + - ACCOUNT_SLOTS=4096 + - GLOBAL_QUEUE=2048 + - ACCOUNT_QUEUE=2048 + - PROMETHEUS_ADDR=http://192.168.99.100:9091 + networks: + app_net: + ipv4_address: 172.16.238.13 + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8545"] + interval: 30s + timeout: 10s + retries: 5 + links: + - validator-01 + # nodes + node-01: + hostname: node-01 + build: + dockerfile: amis/geth_node/Dockerfile + context: ../ + image: amis_geth_node:latest + ports: + - '30307:30307' + - '1001:8545' + environment: + - IDENTITY=node-01 + - NODEKEY=76fe9f521650d1d27e662a3b597ddf35b7808efe3cd359e03831d2486278936c + - BOOTNODES=enode://52870b1bb7874e4ebffd708fbdea7add773912c000e54e5b504ea01ecd956ecb2b54ea4b2076fcfbd24121209dfe97ca8b6368926ce1956e53f63fd20c0e29d7@172.16.238.10:30303,enode://c8fa7bd31ac2bd271fbbc7c5503bff29a94b8301bac5fa5ab7e8787672febc0541926dcb5d8698ef36e66ccba84ef071ee1d29f9aebc9e6bbf4cfeb4e4dce8ad@172.16.238.11:30304,enode://a5a6c556e7ac360e8f2eee5d03c11f447c3d918d73692958695b429b9f0d67fbcb817aea2c169d7abd5a80bbae2adf6bf7e0237c8f78d93d6a82a27efe12ec57@172.16.238.12:30305,enode://5cd6270a6317e8bb1c8a70e5041260ae2864dc35103d27e129c6b0f9cf657cf3db866199a528b33d0ffb48f4e71b1ec8a01102e753cd527afa9c2ba3dfd4515d@172.16.238.13:30306 + - PORT=30307 + - GAS_LIMIT=250000000 + - GLOBAL_SLOTS=4096 + - ACCOUNT_SLOTS=4096 + - GLOBAL_QUEUE=2048 + - ACCOUNT_QUEUE=2048 + - PROMETHEUS_ADDR=http://192.168.99.100:9091 + networks: + app_net: + ipv4_address: 172.16.238.14 + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8545"] + interval: 30s + timeout: 10s + retries: 5 + node-02: + hostname: node-02 + image: amis_geth_node:latest + ports: + - '30308:30308' + - '1002:8545' + environment: + - IDENTITY=node-02 + - NODEKEY=bc55080293076742083b6bfcf5c4997f7fc8d8b67ad8b95d98357a198761b227 + - BOOTNODES=enode://52870b1bb7874e4ebffd708fbdea7add773912c000e54e5b504ea01ecd956ecb2b54ea4b2076fcfbd24121209dfe97ca8b6368926ce1956e53f63fd20c0e29d7@172.16.238.10:30303,enode://c8fa7bd31ac2bd271fbbc7c5503bff29a94b8301bac5fa5ab7e8787672febc0541926dcb5d8698ef36e66ccba84ef071ee1d29f9aebc9e6bbf4cfeb4e4dce8ad@172.16.238.11:30304,enode://a5a6c556e7ac360e8f2eee5d03c11f447c3d918d73692958695b429b9f0d67fbcb817aea2c169d7abd5a80bbae2adf6bf7e0237c8f78d93d6a82a27efe12ec57@172.16.238.12:30305,enode://5cd6270a6317e8bb1c8a70e5041260ae2864dc35103d27e129c6b0f9cf657cf3db866199a528b33d0ffb48f4e71b1ec8a01102e753cd527afa9c2ba3dfd4515d@172.16.238.13:30306 + - PORT=30308 + - GAS_LIMIT=250000000 + - GLOBAL_SLOTS=4096 + - ACCOUNT_SLOTS=4096 + - GLOBAL_QUEUE=2048 + - ACCOUNT_QUEUE=2048 + - PROMETHEUS_ADDR=http://192.168.99.100:9091 + networks: + app_net: + ipv4_address: 172.16.238.15 + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8545"] + interval: 30s + timeout: 10s + retries: 5 + node-03: + hostname: node-03 + image: amis_geth_node:latest + ports: + - '30309:30309' + - '1003:8545' + environment: + - IDENTITY=node-03 + - NODEKEY=3cb529ac00f009d7250e710bcde83c30b9c532a13441d5fe9765f8ba37c6943e + - BOOTNODES=enode://52870b1bb7874e4ebffd708fbdea7add773912c000e54e5b504ea01ecd956ecb2b54ea4b2076fcfbd24121209dfe97ca8b6368926ce1956e53f63fd20c0e29d7@172.16.238.10:30303,enode://c8fa7bd31ac2bd271fbbc7c5503bff29a94b8301bac5fa5ab7e8787672febc0541926dcb5d8698ef36e66ccba84ef071ee1d29f9aebc9e6bbf4cfeb4e4dce8ad@172.16.238.11:30304,enode://a5a6c556e7ac360e8f2eee5d03c11f447c3d918d73692958695b429b9f0d67fbcb817aea2c169d7abd5a80bbae2adf6bf7e0237c8f78d93d6a82a27efe12ec57@172.16.238.12:30305,enode://5cd6270a6317e8bb1c8a70e5041260ae2864dc35103d27e129c6b0f9cf657cf3db866199a528b33d0ffb48f4e71b1ec8a01102e753cd527afa9c2ba3dfd4515d@172.16.238.13:30306 + - PORT=30309 + - GAS_LIMIT=250000000 + - GLOBAL_SLOTS=4096 + - ACCOUNT_SLOTS=4096 + - GLOBAL_QUEUE=2048 + - ACCOUNT_QUEUE=2048 + - PROMETHEUS_ADDR=http://192.168.99.100:9091 + networks: + app_net: + ipv4_address: 172.16.238.16 + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8545"] + interval: 30s + timeout: 10s + retries: 5 +networks: + app_net: + driver: bridge + ipam: + driver: default + config: + - + subnet: 172.16.238.0/24 diff --git a/amis/docker-compose-v.yml b/amis/docker-compose-v.yml new file mode 100644 index 000000000000..91eec9a0ab1c --- /dev/null +++ b/amis/docker-compose-v.yml @@ -0,0 +1,118 @@ +version: '3' +services: + validator-01: + hostname: validator-01 + build: + dockerfile: amis/geth/Dockerfile + context: ../ + image: amis_geth:latest + ports: + - '30303:30303' + environment: + - IDENTITY=validator-01 + - NODEKEY=1862cf0b92e8da1c92521006f29a5a9cca33ee7537a23112719c41bf816832f2 + - BOOTNODES=enode://52870b1bb7874e4ebffd708fbdea7add773912c000e54e5b504ea01ecd956ecb2b54ea4b2076fcfbd24121209dfe97ca8b6368926ce1956e53f63fd20c0e29d7@172.16.238.10:30303,enode://c8fa7bd31ac2bd271fbbc7c5503bff29a94b8301bac5fa5ab7e8787672febc0541926dcb5d8698ef36e66ccba84ef071ee1d29f9aebc9e6bbf4cfeb4e4dce8ad@172.16.238.11:30304,enode://a5a6c556e7ac360e8f2eee5d03c11f447c3d918d73692958695b429b9f0d67fbcb817aea2c169d7abd5a80bbae2adf6bf7e0237c8f78d93d6a82a27efe12ec57@172.16.238.12:30305,enode://5cd6270a6317e8bb1c8a70e5041260ae2864dc35103d27e129c6b0f9cf657cf3db866199a528b33d0ffb48f4e71b1ec8a01102e753cd527afa9c2ba3dfd4515d@172.16.238.13:30306 + - PORT=30303 + - GAS_LIMIT=250000000 + - GLOBAL_SLOTS=4096 + - ACCOUNT_SLOTS=4096 + - GLOBAL_QUEUE=2048 + - ACCOUNT_QUEUE=2048 + - PROMETHEUS_ADDR=http://192.168.99.100:9091 + networks: + app_net: + ipv4_address: 172.16.238.10 + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8545"] + interval: 30s + timeout: 10s + retries: 5 + validator-02: + hostname: validator-02 + image: amis_geth:latest + ports: + - '30304:30304' + environment: + - IDENTITY=validator-02 + - NODEKEY=72fa6fc77e8ea98a5adc168c0ceed63205d9580dcbb969df794248dee5a00ea5 + - BOOTNODES=enode://52870b1bb7874e4ebffd708fbdea7add773912c000e54e5b504ea01ecd956ecb2b54ea4b2076fcfbd24121209dfe97ca8b6368926ce1956e53f63fd20c0e29d7@172.16.238.10:30303,enode://c8fa7bd31ac2bd271fbbc7c5503bff29a94b8301bac5fa5ab7e8787672febc0541926dcb5d8698ef36e66ccba84ef071ee1d29f9aebc9e6bbf4cfeb4e4dce8ad@172.16.238.11:30304,enode://a5a6c556e7ac360e8f2eee5d03c11f447c3d918d73692958695b429b9f0d67fbcb817aea2c169d7abd5a80bbae2adf6bf7e0237c8f78d93d6a82a27efe12ec57@172.16.238.12:30305,enode://5cd6270a6317e8bb1c8a70e5041260ae2864dc35103d27e129c6b0f9cf657cf3db866199a528b33d0ffb48f4e71b1ec8a01102e753cd527afa9c2ba3dfd4515d@172.16.238.13:30306 + - PORT=30304 + - GAS_LIMIT=250000000 + - GLOBAL_SLOTS=4096 + - ACCOUNT_SLOTS=4096 + - GLOBAL_QUEUE=2048 + - ACCOUNT_QUEUE=2048 + - PROMETHEUS_ADDR=http://192.168.99.100:9091 + networks: + app_net: + ipv4_address: 172.16.238.11 + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8545"] + interval: 30s + timeout: 10s + retries: 5 + links: + - validator-01 + - validator-03 + - validator-04 + validator-03: + hostname: validator-03 + image: amis_geth:latest + ports: + - '30305:30305' + environment: + - IDENTITY=validator-03 + - NODEKEY=31f07e972131b6449296d519a99b0b6a4b58426f3a56093174601475efd5c944 + - BOOTNODES=enode://52870b1bb7874e4ebffd708fbdea7add773912c000e54e5b504ea01ecd956ecb2b54ea4b2076fcfbd24121209dfe97ca8b6368926ce1956e53f63fd20c0e29d7@172.16.238.10:30303,enode://c8fa7bd31ac2bd271fbbc7c5503bff29a94b8301bac5fa5ab7e8787672febc0541926dcb5d8698ef36e66ccba84ef071ee1d29f9aebc9e6bbf4cfeb4e4dce8ad@172.16.238.11:30304,enode://a5a6c556e7ac360e8f2eee5d03c11f447c3d918d73692958695b429b9f0d67fbcb817aea2c169d7abd5a80bbae2adf6bf7e0237c8f78d93d6a82a27efe12ec57@172.16.238.12:30305,enode://5cd6270a6317e8bb1c8a70e5041260ae2864dc35103d27e129c6b0f9cf657cf3db866199a528b33d0ffb48f4e71b1ec8a01102e753cd527afa9c2ba3dfd4515d@172.16.238.13:30306 + - PORT=30305 + - GAS_LIMIT=250000000 + - GLOBAL_SLOTS=4096 + - ACCOUNT_SLOTS=4096 + - GLOBAL_QUEUE=2048 + - ACCOUNT_QUEUE=2048 + - PROMETHEUS_ADDR=http://192.168.99.100:9091 + networks: + app_net: + ipv4_address: 172.16.238.12 + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8545"] + interval: 30s + timeout: 10s + retries: 5 + links: + - validator-01 + validator-04: + hostname: validator-04 + image: amis_geth:latest + ports: + - '30306:30306' + environment: + - IDENTITY=validator-04 + - NODEKEY=4b67c5a38c067a477088b2d2607dbec6ce2b2febcba9fe64bc27ee81e4f34532 + - BOOTNODES=enode://52870b1bb7874e4ebffd708fbdea7add773912c000e54e5b504ea01ecd956ecb2b54ea4b2076fcfbd24121209dfe97ca8b6368926ce1956e53f63fd20c0e29d7@172.16.238.10:30303,enode://c8fa7bd31ac2bd271fbbc7c5503bff29a94b8301bac5fa5ab7e8787672febc0541926dcb5d8698ef36e66ccba84ef071ee1d29f9aebc9e6bbf4cfeb4e4dce8ad@172.16.238.11:30304,enode://a5a6c556e7ac360e8f2eee5d03c11f447c3d918d73692958695b429b9f0d67fbcb817aea2c169d7abd5a80bbae2adf6bf7e0237c8f78d93d6a82a27efe12ec57@172.16.238.12:30305,enode://5cd6270a6317e8bb1c8a70e5041260ae2864dc35103d27e129c6b0f9cf657cf3db866199a528b33d0ffb48f4e71b1ec8a01102e753cd527afa9c2ba3dfd4515d@172.16.238.13:30306 + - PORT=30306 + - GAS_LIMIT=250000000 + - GLOBAL_SLOTS=4096 + - ACCOUNT_SLOTS=4096 + - GLOBAL_QUEUE=2048 + - ACCOUNT_QUEUE=2048 + - PROMETHEUS_ADDR=http://192.168.99.100:9091 + networks: + app_net: + ipv4_address: 172.16.238.13 + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8545"] + interval: 30s + timeout: 10s + retries: 5 + links: + - validator-01 +networks: + app_net: + driver: bridge + ipam: + driver: default + config: + - + subnet: 172.16.238.0/24 + diff --git a/amis/geth/Dockerfile b/amis/geth/Dockerfile new file mode 100644 index 000000000000..bb7d553eb5e1 --- /dev/null +++ b/amis/geth/Dockerfile @@ -0,0 +1,24 @@ +FROM alpine:3.5 + +RUN mkdir -p /eth +RUN echo "{\"config\": {\"chainId\": 2016,\"istanbul\": {}},\"nonce\": \"0x0000000000000000\",\"timestamp\": \"0x0\",\"parentHash\": \"0x0000000000000000000000000000000000000000000000000000000000000000\",\"extraData\": \"0x0000000000000000000000000000000000000000000000000000000000000000f89af8549444add0ec310f115a0e603b2d7db9f067778eaf8a94294fc7e8f22b3bcdcf955dd7ff3ba2ed833f8212946beaaed781d2d2ab6350f5c4566a2c6eaac407a6948be76812f765c24641ec63dc2852b378aba2b440b8410000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0\",\"gasLimit\": \"0x47e7c4\",\"difficulty\": \"0x1\",\"mixhash\": \"0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365\",\"coinbase\": \"0x0000000000000000000000000000000000000000\",\"alloc\": {\"0x1a9afb711302c5f83b5902843d1c007a1a137632\": {\"balance\": \"999900000000000000000000000000000000000000000\"},\"0x26c7ea56af25113f712befbf2077798fd7fbdb7c\": {\"balance\": \"999900000000000000000000000000000000000000000\"},\"0xa4137d4ad166ae825f1b8dbb0c3d48f25f172e9e\": {\"balance\": \"999900000000000000000000000000000000000000000\"},\"0xf5aee8f402a330bbdb5063080c31ff2df47dbb0a\": {\"balance\": \"999900000000000000000000000000000000000000000\"},\"0xcce903202b149c677f91d30dddf83d05a741871a\": {\"balance\": \"999900000000000000000000000000000000000000000\"},\"0xcc09b0634677b41668e6386844233528cee0a7d5\": {\"balance\": \"999900000000000000000000000000000000000000000\"},\"0x3e28ea543417edafa7625e823d35e20b09115baa\": {\"balance\": \"999900000000000000000000000000000000000000000\"}}}" > /eth/genesis.json +RUN mkdir -p /eth/keystore +RUN echo "{\"address\":\"1a9afb711302c5f83b5902843d1c007a1a137632\",\"Crypto\":{\"cipher\":\"aes-128-ctr\",\"ciphertext\":\"132b50d7c8944a115824de7c00911c40a90f84f27c614b7a3ef05ee8fd414312\",\"cipherparams\":{\"iv\":\"0f745599d1b3303988ce210fb82b8c7f\"},\"kdf\":\"scrypt\",\"kdfparams\":{\"dklen\":32,\"n\":262144,\"p\":1,\"r\":8,\"salt\":\"bce940bac232b4a9c5a2d50e5be51fde5cecfa7da9d49d8f650f91167bebf0de\"},\"mac\":\"36d515070b797aec58a574a3e04ea109498ee7674b15d7f952322cda7dcb68e3\"},\"id\":\"5d212b4c-3dd0-4c52-a32f-e42bf1b41133\",\"version\":3}" > /eth/keystore/UTC--2016-01-30T11-59-48.610306220Z--1a9afb711302c5f83b5902843d1c007a1a137632 +ADD . /go-ethereum +RUN \ + apk add --update git go make gcc musl-dev linux-headers && \ + (cd go-ethereum && make geth) && \ + cp go-ethereum/build/bin/geth /geth && \ + apk del git go make gcc musl-dev linux-headers && \ + rm -rf /go-ethereum && rm -rf /var/cache/apk/* + +EXPOSE 8545 +EXPOSE 30303 +EXPOSE 30304 +EXPOSE 30305 +EXPOSE 30306 + +ADD amis/geth/entrypoint.sh entrypoint.sh +RUN chmod +x entrypoint.sh + +CMD ["sh", "entrypoint.sh"] diff --git a/amis/geth/entrypoint.sh b/amis/geth/entrypoint.sh new file mode 100644 index 000000000000..2a3900ddfade --- /dev/null +++ b/amis/geth/entrypoint.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +/geth \ + --datadir "/eth" \ + init "/eth/genesis.json" + +/geth \ + --identity "$IDENTITY" \ + --rpc \ + --rpcaddr "0.0.0.0" \ + --rpcport "8545" \ + --rpccorsdomain "*" \ + --datadir "/eth" \ + --port "$PORT" \ + --rpcapi "db,eth,net,web3" \ + --networkid "20160816" \ + --nat "any" \ + --nodekeyhex "$NODEKEY" \ + --bootnodes "$BOOTNODES" \ + --targetgaslimit $GAS_LIMIT \ + --txpool.globalslots $GLOBAL_SLOTS \ + --txpool.accountslots $ACCOUNT_SLOTS \ + --txpool.globalqueue $GLOBAL_QUEUE \ + --txpool.accountqueue $ACCOUNT_QUEUE \ + --mine \ + --minerthreads 1 \ + --debug \ + --metrics \ + --promaddr "$PROMETHEUS_ADDR" diff --git a/amis/geth_node/Dockerfile b/amis/geth_node/Dockerfile new file mode 100644 index 000000000000..b551f6c7661e --- /dev/null +++ b/amis/geth_node/Dockerfile @@ -0,0 +1,23 @@ +FROM alpine:3.5 + +RUN mkdir -p /eth +RUN echo "{\"config\": {\"chainId\": 2016,\"istanbul\": {}},\"nonce\": \"0x0000000000000000\",\"timestamp\": \"0x0\",\"parentHash\": \"0x0000000000000000000000000000000000000000000000000000000000000000\",\"extraData\": \"0x0000000000000000000000000000000000000000000000000000000000000000f89af8549444add0ec310f115a0e603b2d7db9f067778eaf8a94294fc7e8f22b3bcdcf955dd7ff3ba2ed833f8212946beaaed781d2d2ab6350f5c4566a2c6eaac407a6948be76812f765c24641ec63dc2852b378aba2b440b8410000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0\",\"gasLimit\": \"0x47e7c4\",\"difficulty\": \"0x1\",\"mixhash\": \"0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365\",\"coinbase\": \"0x0000000000000000000000000000000000000000\",\"alloc\": {\"0x1a9afb711302c5f83b5902843d1c007a1a137632\": {\"balance\": \"999900000000000000000000000000000000000000000\"},\"0x26c7ea56af25113f712befbf2077798fd7fbdb7c\": {\"balance\": \"999900000000000000000000000000000000000000000\"},\"0xa4137d4ad166ae825f1b8dbb0c3d48f25f172e9e\": {\"balance\": \"999900000000000000000000000000000000000000000\"},\"0xf5aee8f402a330bbdb5063080c31ff2df47dbb0a\": {\"balance\": \"999900000000000000000000000000000000000000000\"},\"0xcce903202b149c677f91d30dddf83d05a741871a\": {\"balance\": \"999900000000000000000000000000000000000000000\"},\"0xcc09b0634677b41668e6386844233528cee0a7d5\": {\"balance\": \"999900000000000000000000000000000000000000000\"},\"0x3e28ea543417edafa7625e823d35e20b09115baa\": {\"balance\": \"999900000000000000000000000000000000000000000\"}}}" > /eth/genesis.json +RUN mkdir -p /eth/keystore +RUN echo "{\"address\":\"1a9afb711302c5f83b5902843d1c007a1a137632\",\"Crypto\":{\"cipher\":\"aes-128-ctr\",\"ciphertext\":\"132b50d7c8944a115824de7c00911c40a90f84f27c614b7a3ef05ee8fd414312\",\"cipherparams\":{\"iv\":\"0f745599d1b3303988ce210fb82b8c7f\"},\"kdf\":\"scrypt\",\"kdfparams\":{\"dklen\":32,\"n\":262144,\"p\":1,\"r\":8,\"salt\":\"bce940bac232b4a9c5a2d50e5be51fde5cecfa7da9d49d8f650f91167bebf0de\"},\"mac\":\"36d515070b797aec58a574a3e04ea109498ee7674b15d7f952322cda7dcb68e3\"},\"id\":\"5d212b4c-3dd0-4c52-a32f-e42bf1b41133\",\"version\":3}" > /eth/keystore/UTC--2016-01-30T11-59-48.610306220Z--1a9afb711302c5f83b5902843d1c007a1a137632 +ADD . /go-ethereum +RUN \ + apk add --update git go make gcc musl-dev linux-headers && \ + (cd go-ethereum && make geth) && \ + cp go-ethereum/build/bin/geth /geth && \ + apk del git go make gcc musl-dev linux-headers && \ + rm -rf /go-ethereum && rm -rf /var/cache/apk/* + +EXPOSE 8545 +EXPOSE 30307 +EXPOSE 30308 +EXPOSE 30309 + +ADD amis/geth_node/entrypoint.sh entrypoint.sh +RUN chmod +x entrypoint.sh + +CMD ["sh", "entrypoint.sh"] diff --git a/amis/geth_node/entrypoint.sh b/amis/geth_node/entrypoint.sh new file mode 100644 index 000000000000..4c5795e84362 --- /dev/null +++ b/amis/geth_node/entrypoint.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +/geth \ + --datadir "/eth" \ + init "/eth/genesis.json" + +/geth \ + --identity "$IDENTITY" \ + --rpc \ + --rpcaddr "0.0.0.0" \ + --rpcport "8545" \ + --rpccorsdomain "*" \ + --datadir "/eth" \ + --port "$PORT" \ + --rpcapi "db,eth,net,web3" \ + --networkid "20160816" \ + --nat "any" \ + --nodekeyhex "$NODEKEY" \ + --bootnodes "$BOOTNODES" \ + --targetgaslimit $GAS_LIMIT \ + --txpool.globalslots $GLOBAL_SLOTS \ + --txpool.accountslots $ACCOUNT_SLOTS \ + --txpool.globalqueue $GLOBAL_QUEUE \ + --txpool.accountqueue $ACCOUNT_QUEUE \ + --minerthreads 1 \ + --debug \ + --metrics \ + --promaddr "$PROMETHEUS_ADDR" diff --git a/amis/prometheus/docker-compose.yaml b/amis/prometheus/docker-compose.yaml new file mode 100644 index 000000000000..213296df4e5f --- /dev/null +++ b/amis/prometheus/docker-compose.yaml @@ -0,0 +1,49 @@ +version: '3' + +volumes: + prometheus_data: {} + grafana_data: {} + +services: + prometheus: + image: prom/prometheus:v1.5.2 + volumes: + - ./prometheus/:/etc/prometheus/ + - prometheus_data:/prometheus + command: + - '-config.file=/etc/prometheus/prometheus.yaml' + ports: + - 9090:9090 + links: + - cadvisor:cadvisor + depends_on: + - cadvisor + + metrics-gateway: + image: prom/pushgateway:v0.3.1 + ports: + - 9091:9091 + + node-exporter: + image: prom/node-exporter:v0.13.0 + expose: + - 9100 + + cadvisor: + image: google/cadvisor:v0.24.1 + volumes: + - /:/rootfs:ro + - /var/run:/var/run:rw + - /sys:/sys:ro + - /var/lib/docker/:/var/lib/docker:ro + expose: + - 8080 + + grafana: + image: grafana/grafana:4.1.2 + depends_on: + - prometheus + ports: + - 3000:3000 + volumes: + - grafana_data:/var/lib/grafana diff --git a/amis/prometheus/grafana/dashboard.json b/amis/prometheus/grafana/dashboard.json new file mode 100644 index 000000000000..9d48b583a86e --- /dev/null +++ b/amis/prometheus/grafana/dashboard.json @@ -0,0 +1,751 @@ +{ + "overwrite": true, + "dashboard": { + "annotations": { + "list": [] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "hideControls": false, + "id": null, + "links": [], + "refresh": "10s", + "rows": [ + { + "collapse": false, + "height": "250px", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "datasource": null, + "fill": 1, + "id": 8, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 4, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "geth_api_txsend", + "intervalFactor": 2, + "legendFormat": "{{exported_instance}}", + "metric": "geth_api_txsend", + "refId": "A", + "step": 20 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "geth_api_txsend", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + }, + { + "aliasColors": {}, + "bars": false, + "datasource": null, + "fill": 1, + "id": 6, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 4, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "geth_chain_tx_inserts", + "intervalFactor": 2, + "legendFormat": "{{exported_instance}}", + "metric": "geth_chain_tx_inserts", + "refId": "A", + "step": 20 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "geth_chain_tx_inserts", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + }, + { + "aliasColors": {}, + "bars": false, + "datasource": null, + "fill": 1, + "id": 7, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 4, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "rate(geth_chain_tx_inserts[1m])", + "intervalFactor": 2, + "legendFormat": "{{exported_instance}}", + "metric": "geth_chain_tx_inserts", + "refId": "A", + "step": 20 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "geth_chain_tx_inserts rate (tps)", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + } + ], + "repeat": null, + "repeatIteration": null, + "repeatRowId": null, + "showTitle": false, + "title": "Dashboard Row", + "titleSize": "h6" + }, + { + "collapse": false, + "height": 250, + "panels": [ + { + "aliasColors": {}, + "bars": false, + "datasource": null, + "fill": 1, + "id": 5, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 6, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "geth_consensus_istanbul_core_sequence", + "intervalFactor": 2, + "legendFormat": "{{exported_instance}}", + "metric": "geth_consensus_istanbul_core_sequence", + "refId": "A", + "step": 10 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "geth_consensus_istanbul_core_sequence", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + }, + { + "aliasColors": {}, + "bars": false, + "datasource": null, + "fill": 1, + "id": 4, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 6, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "geth_chain_forkblocks", + "intervalFactor": 2, + "legendFormat": "{{exported_instance}}", + "metric": "geth_chain_forkblocks", + "refId": "A", + "step": 10 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "geth_chain_forkblocks", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + } + ], + "repeat": null, + "repeatIteration": null, + "repeatRowId": null, + "showTitle": false, + "title": "Dashboard Row", + "titleSize": "h6" + }, + { + "collapse": false, + "height": 250, + "panels": [ + { + "aliasColors": {}, + "bars": false, + "datasource": null, + "fill": 1, + "id": 2, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 6, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "geth_consensus_istanbul_core_round", + "intervalFactor": 2, + "legendFormat": "{{exported_instance}}", + "metric": "geth_consensus_istanbul_core_round", + "refId": "A", + "step": 10 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "geth_consensus_istanbul_core_round", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + }, + { + "aliasColors": {}, + "bars": false, + "datasource": null, + "fill": 1, + "id": 3, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 6, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "geth_consensus_istanbul_core_consensus", + "intervalFactor": 2, + "legendFormat": "{{exported_instance}}", + "metric": "geth_consensus_istanbul_core_consensus", + "refId": "A", + "step": 10 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "geth_consensus_istanbul_core_consensus(ms)", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + } + ], + "repeat": null, + "repeatIteration": null, + "repeatRowId": null, + "showTitle": false, + "title": "Dashboard Row", + "titleSize": "h6" + }, + { + "collapse": false, + "height": 250, + "panels": [ + { + "aliasColors": {}, + "bars": false, + "datasource": null, + "fill": 1, + "id": 9, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 6, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "geth_txpool_queued_ratelimit", + "intervalFactor": 2, + "legendFormat": "{{exported_instance}}", + "metric": "geth_txpool_queued_ratelimit", + "refId": "A", + "step": 10 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "geth_txpool_queued_ratelimit", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + }, + { + "aliasColors": {}, + "bars": false, + "datasource": null, + "fill": 1, + "id": 10, + "legend": { + "avg": false, + "current": false, + "max": false, + "min": false, + "show": true, + "total": false, + "values": false + }, + "lines": true, + "linewidth": 1, + "links": [], + "nullPointMode": "null", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "span": 6, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "geth_txpool_pending_ratelimit", + "intervalFactor": 2, + "legendFormat": "{{exported_instance}}", + "metric": "geth_txpool_pending_ratelimit", + "refId": "A", + "step": 10 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "geth_txpool_pending_ratelimit", + "tooltip": { + "shared": true, + "sort": 0, + "value_type": "individual" + }, + "type": "graph", + "xaxis": { + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + } + ], + "repeat": null, + "repeatIteration": null, + "repeatRowId": null, + "showTitle": false, + "title": "Dashboard Row", + "titleSize": "h6" + } + ], + "schemaVersion": 14, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "browser", + "title": "geth", + "version": 1 + } +} diff --git a/amis/prometheus/grafana/datasource.json b/amis/prometheus/grafana/datasource.json new file mode 100644 index 000000000000..35884655409e --- /dev/null +++ b/amis/prometheus/grafana/datasource.json @@ -0,0 +1,7 @@ +{ + "name":"geth-prometheus", + "type":"prometheus", + "url":"http://192.168.99.100:9090", + "access":"proxy", + "isDefault":true +} diff --git a/amis/prometheus/prometheus/prometheus.yaml b/amis/prometheus/prometheus/prometheus.yaml new file mode 100644 index 000000000000..099dc5be1508 --- /dev/null +++ b/amis/prometheus/prometheus/prometheus.yaml @@ -0,0 +1,8 @@ +global: + scrape_interval: 5s + external_labels: + monitor: 'my-monitor' +scrape_configs: + - job_name: 'prometheus' + static_configs: + - targets: ['prometheus:9090', 'cadvisor:8080', 'node-exporter:9100', 'metrics-gateway:9091'] diff --git a/amis/prometheus/run.sh b/amis/prometheus/run.sh new file mode 100755 index 000000000000..2a9de5c81b92 --- /dev/null +++ b/amis/prometheus/run.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +PROMETHEUS_URL=192.168.99.100:3000 +PROMETHEUS_USER=admin +PROMETHEUS_PW=admin + +echo "run prometheus" + +docker-compose up -d + +echo "" +sleep 3 +echo "create datasource" + +curl -X POST -d @grafana/datasource.json "http://$PROMETHEUS_USER:$PROMETHEUS_PW@$PROMETHEUS_URL/api/datasources" \ + -H "Accept: application/json" \ + -H "Content-Type:application/json" + +echo "" +echo "create dashboard " + +curl -X POST -d @grafana/dashboard.json "http://$PROMETHEUS_USER:$PROMETHEUS_PW@$PROMETHEUS_URL/api/dashboards/db" \ + -H "Accept: application/json" \ + -H "Content-Type:application/json" + +echo ""