diff --git a/.env b/.env deleted file mode 100644 index 8fa94d0..0000000 --- a/.env +++ /dev/null @@ -1,11 +0,0 @@ -# Must be set to true for the first run, change it to "false" to avoid migrating the smart contracts on each run. -DEPLOY_CONTRACTS=true -# Ganache specific option, these two options have no effect when not running ganache-cli -GANACHE_DATABASE_PATH=. -REUSE_DATABASE=false -# Specify which ethereum client to run or connect to: kovan, ganache, or ocean_poa_net_local -KEEPER_NETWORK_NAME=ganache -ARTIFACTS_FOLDER=~/.ocean/keeper-contracts/artifacts -# Specify which ocean version use: stable, latests, ... -OCEAN_VERSION=stable -COMPOSE_FILE=docker-compose.yml diff --git a/brizo.env b/brizo.env index 2f64e90..bb3d2f9 100755 --- a/brizo.env +++ b/brizo.env @@ -1,17 +1,12 @@ # Use this file to set the env vars required for Brizo. -KEEPER_URL=http://parity-node:8545 -LOCAL_CONTRACTS=true -KEEPER_NETWORK_NAME=ocean_poa_net_local - -SECRET_STORE_URL=http://secret-store:12001 -PARITY_URL=http://parity-node:8545 # Set a valid parity address and password to have seamless interaction with the `keeper` PARITY_ADDRESS=0x00bd138abd70e2f00903268f3db08f2d25677c9e PARITY_PASSWORD=node0 AQUARIUS_URL=http://aquarius:5000 -BRIZO_URL=http://brizo:8030 +SECRET_STORE_URL=http://secret-store:12001 +RPC_URL=http://keeper-node:8545 AZURE_ACCOUNT_NAME= AZURE_ACCOUNT_KEY= diff --git a/compose-files/aquarius.yml b/compose-files/aquarius.yml new file mode 100644 index 0000000..f0aab6f --- /dev/null +++ b/compose-files/aquarius.yml @@ -0,0 +1,20 @@ +version: '2.1' +services: + aquarius: + image: oceanprotocol/aquarius:${OCEAN_VERSION:-stable} + ports: + - 5000:5000 + networks: + backend: + ipv4_address: 172.15.0.15 + depends_on: + - mongodb + environment: + DB_HOSTNAME: mongodb + + mongodb: + image: mongo:3.6 + command: mongod + networks: + backend: + ipv4_address: 172.15.0.11 diff --git a/compose-files/brizo.yml b/compose-files/brizo.yml new file mode 100644 index 0000000..9759ae3 --- /dev/null +++ b/compose-files/brizo.yml @@ -0,0 +1,18 @@ +version: '2.1' +services: + brizo: + image: oceanprotocol/brizo:${OCEAN_VERSION:-stable} + ports: + - 8030:8030 + networks: + backend: + ipv4_address: 172.15.0.17 + depends_on: + - keeper-node + env_file: + - ${BRIZO_ENV_FILE} + environment: + KEEPER_URL: ${KEEPER_RPC_URL} + LOCAL_CONTRACTS: ${KEEPER_DEPLOY_CONTRACTS} + volumes: + - ${KEEPER_ARTIFACTS_FOLDER}:/usr/local/keeper-contracts:ro diff --git a/compose-files/keeper_contracts.yml b/compose-files/keeper_contracts.yml new file mode 100644 index 0000000..f4fd543 --- /dev/null +++ b/compose-files/keeper_contracts.yml @@ -0,0 +1,20 @@ +version: '2.1' +services: + keeper-contracts: + image: oceanprotocol/keeper-contracts:${OCEAN_VERSION:-stable} + networks: + backend: + ipv4_address: 172.15.0.14 + environment: + DEPLOY_CONTRACTS: ${KEEPER_DEPLOY_CONTRACTS} + LOCAL_CONTRACTS: ${KEEPER_DEPLOY_CONTRACTS} + REUSE_DATABASE: ${GANACHE_REUSE_DATABASE} + DATABASE_PATH: "/ganache-db" + NETWORK_NAME: ${KEEPER_NETWORK_NAME} + KEEPER_RPC_HOST: ${KEEPER_RPC_HOST} + KEEPER_RPC_PORT: ${KEEPER_RPC_PORT} + KEEPER_RPC_URL: ${KEEPER_RPC_URL} + depends_on: + - keeper-node + volumes: + - ${KEEPER_ARTIFACTS_FOLDER}:/keeper-contracts/artifacts/ diff --git a/compose-files/network_volumes.yml b/compose-files/network_volumes.yml new file mode 100644 index 0000000..14bf031 --- /dev/null +++ b/compose-files/network_volumes.yml @@ -0,0 +1,14 @@ +version: '2.1' + +networks: + backend: + driver: bridge + ipam: + driver: default + config: + - subnet: 172.15.0.1/24 + gateway: 172.15.0.1 + +volumes: + keeper-node: + secret-store: diff --git a/compose-files/nodes/ganache_node.yml b/compose-files/nodes/ganache_node.yml new file mode 100644 index 0000000..76b7aed --- /dev/null +++ b/compose-files/nodes/ganache_node.yml @@ -0,0 +1,11 @@ +version: '2.1' +services: + keeper-node: + image: trufflesuite/ganache-cli:latest + command: + -d + ports: + - 8545:8545 + networks: + backend: + ipv4_address: 172.15.0.12 diff --git a/compose-files/nodes/kovan_node.yml b/compose-files/nodes/kovan_node.yml new file mode 100644 index 0000000..cdf7d8d --- /dev/null +++ b/compose-files/nodes/kovan_node.yml @@ -0,0 +1,22 @@ +version: '2.1' +services: + keeper-node: + image: parity/parity:stable + command: + --chain kovan + --base-path /home/parity/base + --keys-path /home/parity/.local/share/io.parity.ethereum/keys + --light + --ws-interface all + --jsonrpc-cors all + --jsonrpc-interface all + --jsonrpc-hosts all + --jsonrpc-apis all + --unsafe-expose + volumes: + - ../networks/kovan/keys:/home/parity/.local/share/io.parity.ethereum/keys/kovan + ports: + - 8545:8545 + networks: + backend: + ipv4_address: 172.15.0.12 diff --git a/compose-files/nodes/nile_node.yml b/compose-files/nodes/nile_node.yml new file mode 100644 index 0000000..990da8a --- /dev/null +++ b/compose-files/nodes/nile_node.yml @@ -0,0 +1,29 @@ +version: '2.1' +services: + keeper-node: + image: parity/parity:stable + command: + --config /home/parity/parity/config/config.toml + --db-path /home/parity/chains + --keys-path /home/parity/.local/share/io.parity.ethereum/keys + --base-path /home/parity/base + --engine-signer 0x00bd138abd70e2f00903268f3db08f2d25677c9e + --ws-interface all + --jsonrpc-cors all + --jsonrpc-interface all + --jsonrpc-hosts all + --jsonrpc-apis all + --unsafe-expose + --unlock 0x00bd138abd70e2f00903268f3db08f2d25677c9e + volumes: + - ../networks/nile/config:/home/parity/parity/config + - keeper-node:/home/parity/.local/share/io.parity.ethereum/ + - ../networks/nile/authorities/validator0.json:/home/parity/.local/share/io.parity.ethereum/keys/nile/validator.json + - ../networks/nile/keys:/home/parity/.local/share/io.parity.ethereum/keys/nile + - ../networks/nile/authorities/validator0.pwd:/home/parity/parity/validator.pwd + - ../networks/nile/node0.network.key:/home/parity/.local/share/io.parity.ethereum/network/key + ports: + - 8545:8545 + networks: + backend: + ipv4_address: 172.15.0.12 diff --git a/compose-files/nodes/spree_node.yml b/compose-files/nodes/spree_node.yml new file mode 100644 index 0000000..642df6e --- /dev/null +++ b/compose-files/nodes/spree_node.yml @@ -0,0 +1,27 @@ +version: '2.1' +services: + keeper-node: + image: parity/parity:stable + command: + --config /home/parity/config/config.toml + --db-path /home/parity/chains + --keys-path /home/parity/.local/keys + --base-path /home/parity/base + --min-gas-price 0 + --jsonrpc-cors all + --jsonrpc-interface all + --jsonrpc-hosts all + --jsonrpc-apis all + --unsafe-expose + --unlock 0x00bd138abd70e2f00903268f3db08f2d25677c9e + volumes: + - ../networks/spree/config:/home/parity/config + - ../networks/spree/authorities/validator0.json:/home/parity/.local/keys/spree/validator.json + - ../networks/spree/keys:/home/parity/.local/keys/spree + - ../networks/spree/authorities/validator0.pwd:/home/parity/validator.pwd:ro + - ../networks/spree/node0.network.key:/home/parity/.local/share/io.parity.ethereum/network/key:ro + ports: + - 8545:8545 + networks: + backend: + ipv4_address: 172.15.0.12 diff --git a/compose-files/pleuston.yml b/compose-files/pleuston.yml new file mode 100644 index 0000000..e56bb07 --- /dev/null +++ b/compose-files/pleuston.yml @@ -0,0 +1,20 @@ +version: '2.1' +services: + pleuston: + image: oceanprotocol/pleuston:${OCEAN_VERSION:-stable} + networks: + backend: + ipv4_address: 172.15.0.19 + ports: + - 3000:3000 + depends_on: + - keeper-node + - aquarius + - brizo + environment: + # Need browser to connect to exposed ports + KEEPER_HOST: localhost + AQUARIUS_HOST: localhost + LOCAL_CONTRACTS: ${KEEPER_DEPLOY_CONTRACTS} + volumes: + - ${KEEPER_ARTIFACTS_FOLDER}:/pleuston/node_modules/@oceanprotocol/keeper-contracts/artifacts/:ro diff --git a/compose-files/secret_store.yml b/compose-files/secret_store.yml new file mode 100644 index 0000000..692873f --- /dev/null +++ b/compose-files/secret_store.yml @@ -0,0 +1,52 @@ +version: '2.1' +services: + secret-store: + image: oceanprotocol/parity-ethereum:master + entrypoint: /opt/parity/parity + command: + --config /etc/parity/secretstore/config.toml + --jsonrpc-cors all + --jsonrpc-interface all + --jsonrpc-hosts all + --jsonrpc-apis all + --base-path /secret-store/ + volumes: + - ../networks/secret-store/config/:/etc/parity/secretstore/ + - secret-store:/secret-store/ + - ../networks/secret-store/keys/:/secret-store/keys/secretstore/ + ports: + - 12000:12000 + - 12001 + networks: + backend: + ipv4_address: 172.15.0.13 + + secret-store-cors-proxy: + image: nginx:alpine + volumes: + - ../cors-proxy.conf:/etc/nginx/nginx.conf:ro + depends_on: + - secret-store + ports: + - 12001:12001 + networks: + backend: + ipv4_address: 172.15.0.16 + command: nginx -g 'daemon off;' + + secret-store-signing-node: + image: parity/parity:stable + command: + --chain dev + --light + --jsonrpc-interface all + --jsonrpc-apis secretstore + --jsonrpc-cors all + --keys-path /home/parity/.local/keys + ports: + - 9545:8545 + volumes: + - ../networks/secret-store/keys:/home/parity/.local/keys/DevelopmentChain:ro + networks: + backend: + ipv4_address: 172.15.0.18 \ No newline at end of file diff --git a/docker-compose-local-parity-node.yml b/docker-compose-local-parity-node.yml deleted file mode 100644 index 137f6a8..0000000 --- a/docker-compose-local-parity-node.yml +++ /dev/null @@ -1,130 +0,0 @@ -version: '2.1' - -services: - mongodb: - image: mongo:3.6 - ports: - - "27017:27017" - command: mongod - networks: - backend: - ipv4_address: 172.15.0.11 - - parity-node: - image: oceanprotocol/parity-ethereum:beta - entrypoint: /opt/parity/parity - command: - --config /home/parity/parity/config/secretstoreclient.toml - --db-path /home/parity/chains - --keys-path /home/parity/.local/share/io.parity.ethereum/keys - --base-path /home/parity/base - --engine-signer 0x00bd138abd70e2f00903268f3db08f2d25677c9e - --ws-interface all - --jsonrpc-cors all - --jsonrpc-interface all - --jsonrpc-hosts all - --jsonrpc-apis all - --unsafe-expose - --unlock 0x00bd138abd70e2f00903268f3db08f2d25677c9e - volumes: - - ./parity/parity/config:/home/parity/parity/config - - parity-node:/home/parity/.local/share/io.parity.ethereum/ - - ./parity/parity/authorities/validator0.json:/home/parity/.local/share/io.parity.ethereum/keys/ocean-network/validator.json - - ./parity/parity/keys:/home/parity/.local/share/io.parity.ethereum/keys/ocean-network - - ./parity/parity/authorities/validator0.pwd:/home/parity/parity/validator.pwd - - ./parity/parity/node0.network.key:/home/parity/.local/share/io.parity.ethereum/network/key - ports: - - 8545:8545 - networks: - backend: - ipv4_address: 172.15.0.12 - - secret-store: - image: oceanprotocol/parity-ethereum:master - # entrypoint: tail -f /dev/null - entrypoint: /opt/parity/parity - command: - --config /etc/parity/secretstore/config.toml --jsonrpc-cors all --jsonrpc-interface all --jsonrpc-hosts all --jsonrpc-apis all - volumes: - - ./parity/secret_store/config/:/etc/parity/secretstore/ - - secret-store:/parity_data/ - - ./parity/secret_store/keys/:/parity_data/keys/ocean-network/ - ports: - - 12000:12000 - - 12001 - networks: - backend: - ipv4_address: 172.15.0.13 - - secret-store-cors-proxy: - image: nginx:alpine - volumes: - - ./cors-proxy.conf:/etc/nginx/nginx.conf:ro - depends_on: - - secret-store - ports: - - 12001:12001 - networks: - backend: - ipv4_address: 172.15.0.16 - command: nginx -g 'daemon off;' - - keeper-contracts: - image: oceanprotocol/keeper-contracts:${OCEAN_VERSION:-stable} - networks: - backend: - ipv4_address: 172.15.0.14 - environment: - LOCAL_CONTRACTS: "true" - DEPLOY_CONTRACTS: ${DEPLOY_CONTRACTS} - DATABASE_PATH: "/ganache-db" - REUSE_DATABASE: ${REUSE_DATABASE} - NETWORK_NAME: ${KEEPER_NETWORK_NAME} - POA_HOST: "parity-node" - volumes: - - ${ARTIFACTS_FOLDER}:/keeper-contracts/artifacts/ - - ${GANACHE_DATABASE_PATH}/ganache-db:/ganache-db - - aquarius: - image: oceanprotocol/aquarius:${OCEAN_VERSION:-stable} - ports: - - 5000:5000 - networks: - backend: - ipv4_address: 172.15.0.15 - depends_on: - - keeper-contracts - environment: - KEEPER_HOST: http://parity-node - DB_HOSTNAME: mongodb - LOCAL_CONTRACTS: 'true' - volumes: - - ${ARTIFACTS_FOLDER}:/usr/local/keeper-contracts/:ro - - brizo: - image: oceanprotocol/brizo:${OCEAN_VERSION:-stable} - ports: - - 8030:8030 - networks: - backend: - ipv4_address: 172.15.0.17 - depends_on: - - keeper-contracts - - parity-node - env_file: - - ${BRIZO_ENV_FILE} - volumes: - - ${ARTIFACTS_FOLDER}:/usr/local/keeper-contracts/:ro - -networks: - backend: - driver: bridge - ipam: - driver: default - config: - - subnet: 172.15.0.1/24 - gateway: 172.15.0.1 - -volumes: - parity-node: - secret-store: diff --git a/docker-compose-no-pleuston.yml b/docker-compose-no-pleuston.yml deleted file mode 100644 index 7b5f94d..0000000 --- a/docker-compose-no-pleuston.yml +++ /dev/null @@ -1,61 +0,0 @@ -version: '2.1' - -services: - mongodb: - image: mongo:3.6 - ports: - - "27017:27017" - command: mongod - networks: - - backend - - keeper-contracts: - image: oceanprotocol/keeper-contracts:${OCEAN_VERSION:-stable} - ports: - - 8545:8545 - networks: - - backend - environment: - LOCAL_CONTRACTS: "true" - DEPLOY_CONTRACTS: ${DEPLOY_CONTRACTS} - DATABASE_PATH: "/ganache-db" - REUSE_DATABASE: ${REUSE_DATABASE} - NETWORK_NAME: ${KEEPER_NETWORK_NAME} - volumes: - - ${ARTIFACTS_FOLDER}:/keeper-contracts/artifacts/ - - ${GANACHE_DATABASE_PATH}/ganache-db:/ganache-db - - aquarius: - image: oceanprotocol/aquarius:${OCEAN_VERSION:-stable} - ports: - - 5000:5000 - networks: - - backend - depends_on: - - keeper-contracts - environment: - KEEPER_URL: http://keeper-contracts:8545 - DB_HOSTNAME: mongodb - LOCAL_CONTRACTS: "true" - volumes: - - ${ARTIFACTS_FOLDER}:/usr/local/keeper-contracts/:ro - - brizo: - image: oceanprotocol/brizo:${OCEAN_VERSION:-stable} - ports: - - 8030:8030 - networks: - - backend - depends_on: - - keeper-contracts - env_file: - - ${BRIZO_ENV_FILE} - environment: - KEEPER_URL: http://keeper-contracts:8545 - volumes: - - ${ARTIFACTS_FOLDER}:/usr/local/keeper-contracts/:ro - -networks: - backend: - - diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 3e05634..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,75 +0,0 @@ -version: '2.1' - -services: - mongodb: - image: mongo:3.6 - ports: - - "27017:27017" - command: mongod - networks: - - backend - - keeper-contracts: - image: oceanprotocol/keeper-contracts:${OCEAN_VERSION:-stable} - ports: - - 8545:8545 - networks: - - backend - environment: - LOCAL_CONTRACTS: "true" - DEPLOY_CONTRACTS: ${DEPLOY_CONTRACTS} - DATABASE_PATH: "/ganache-db" - REUSE_DATABASE: ${REUSE_DATABASE} - NETWORK_NAME: ${KEEPER_NETWORK_NAME} - volumes: - - ${ARTIFACTS_FOLDER}:/keeper-contracts/artifacts/ - - ${GANACHE_DATABASE_PATH}/ganache-db:/ganache-db - - aquarius: - image: oceanprotocol/aquarius:${OCEAN_VERSION:-stable} - ports: - - 5000:5000 - networks: - - backend - depends_on: - - keeper-contracts - environment: - KEEPER_URL: http://keeper-contracts:8545 - DB_HOSTNAME: mongodb - LOCAL_CONTRACTS: "true" - volumes: - - ${ARTIFACTS_FOLDER}:/usr/local/keeper-contracts/:ro - - brizo: - image: oceanprotocol/brizo:${OCEAN_VERSION:-stable} - ports: - - 8030:8030 - networks: - - backend - depends_on: - - keeper-contracts - env_file: - - ${BRIZO_ENV_FILE} - environment: - KEEPER_URL: "http://keeper-contracts:8545" - volumes: - - ${ARTIFACTS_FOLDER}:/usr/local/keeper-contracts/:ro - - pleuston: - image: oceanprotocol/pleuston:${OCEAN_VERSION:-stable} - ports: - - 3000:3000 - depends_on: - - keeper-contracts - environment: - NODE_HOST: localhost - AQUARIUS_HOST: localhost - BRIZO_HOST: localhost - LOCAL_CONTRACTS: 'true' - volumes: - - ${ARTIFACTS_FOLDER}:/pleuston/node_modules/@oceanprotocol/keeper-contracts/artifacts/:ro - -networks: - backend: - - diff --git a/parity/parity/keys/validator.json b/networks/kovan/keys/validator.json similarity index 100% rename from parity/parity/keys/validator.json rename to networks/kovan/keys/validator.json diff --git a/parity/parity/authorities/validator0.json b/networks/nile/authorities/validator0.json similarity index 100% rename from parity/parity/authorities/validator0.json rename to networks/nile/authorities/validator0.json diff --git a/parity/parity/authorities/validator0.pwd b/networks/nile/authorities/validator0.pwd similarity index 100% rename from parity/parity/authorities/validator0.pwd rename to networks/nile/authorities/validator0.pwd diff --git a/parity/parity/authorities/validator1.json b/networks/nile/authorities/validator1.json similarity index 100% rename from parity/parity/authorities/validator1.json rename to networks/nile/authorities/validator1.json diff --git a/parity/parity/authorities/validator1.pwd b/networks/nile/authorities/validator1.pwd similarity index 100% rename from parity/parity/authorities/validator1.pwd rename to networks/nile/authorities/validator1.pwd diff --git a/parity/parity/authorities/validator2.json b/networks/nile/authorities/validator2.json similarity index 100% rename from parity/parity/authorities/validator2.json rename to networks/nile/authorities/validator2.json diff --git a/parity/parity/authorities/validator2.pwd b/networks/nile/authorities/validator2.pwd similarity index 100% rename from parity/parity/authorities/validator2.pwd rename to networks/nile/authorities/validator2.pwd diff --git a/networks/nile/config/chain.json b/networks/nile/config/chain.json new file mode 100644 index 0000000..2d5a8aa --- /dev/null +++ b/networks/nile/config/chain.json @@ -0,0 +1,150 @@ +{ + "name": "nile", + "engine": { + "authorityRound": { + "params": { + "stepDuration": "1", + "validators": { + "list": [ + "0xa1345ed0b2d1e193aead673e33dac56515af128a", + "0xf4a2dbd5d67ef3019a7e4b188b92128c86d76bf9", + "0xcdbe5f61fac89e2cfcfa3727805d5cb8bc4f9afd" + ] + }, + "validateScoreTransition": 1000000000, + "validateStepTransition": 1500000000, + "maximumUncleCount": 1000000000 + } + } + }, + "params": { + "maximumExtraDataSize": "0x20", + "minGasLimit": "0x1388", + "networkID": "0x2323", + "gasLimitBoundDivisor": "0x400", + "eip140Transition": 0, + "eip211Transition": 0, + "eip214Transition": 0, + "eip658Transition": 0 + }, + "genesis": { + "seal": { + "authorityRound": { + "step": "0x0", + "signature": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + } + }, + "difficulty": "0x20000", + "gasLimit": "0x165A0BC00" + }, + "accounts": { + "0x0000000000000000000000000000000000000001": { + "balance": "1", + "builtin": { + "name": "ecrecover", + "pricing": { + "linear": { + "base": 3000, + "word": 0 + } + } + } + }, + "0x0000000000000000000000000000000000000002": { + "balance": "1", + "builtin": { + "name": "sha256", + "pricing": { + "linear": { + "base": 60, + "word": 12 + } + } + } + }, + "0x0000000000000000000000000000000000000003": { + "balance": "1", + "builtin": { + "name": "ripemd160", + "pricing": { + "linear": { + "base": 600, + "word": 120 + } + } + } + }, + "0x0000000000000000000000000000000000000004": { + "balance": "1", + "builtin": { + "name": "identity", + "pricing": { + "linear": { + "base": 15, + "word": 3 + } + } + } + }, + "0xf5d60efcad44babc8d85eb8df57d9e3a5101eb93": { + "balance": "0x2000000000000000000" + }, + "0x61f9546cd2bd5e46bdb915ab9c69210c6ee043d2": { + "balance": "0x2000000000000000000" + }, + "0x8d968b9bc8fe3b1d233ae6238c771544dd7c8fb2": { + "balance": "0x2000000000000000000" + }, + "0x63132a33765fe352187c93e45fac1b9162399e5c": { + "balance": "0x2000000000000000000" + }, + "0x95a165da81359c11aafb4490fe6afeb6ee4f7c2e": { + "balance": "0x2000000000000000000" + }, + "0x9224dff492427471092d13b36866875d7e0f2dd6": { + "balance": "0x2000000000000000000" + }, + "0x9aa9bfa819800a44803dcacc514bb443a2baade6": { + "balance": "0x2000000000000000000" + }, + "0x85ef014983c1bad421cc00941c18122066da5860": { + "balance": "0x2000000000000000000" + }, + "0xc6fffcb664a60c019a335902112584829a91c0a0": { + "balance": "0x2000000000000000000" + }, + "0xdbb63fb51453714f5efed3c2846160018fb3f43c": { + "balance": "0x2000000000000000000" + }, + "0x23be64786fe4467635e65aea49f9dd7a0b05d7b5": { + "balance": "0x2000000000000000000" + }, + "0x3c80c7163c1e6730f2ba80df707178dcdee44475": { + "balance": "0x2000000000000000000" + }, + "0xe49c5f9c8a78884c8ba2aa161b8c41bf21b96751": { + "balance": "0x2000000000000000000" + }, + "0xf7f2673e854e7b33a62beec796dec5d61ac9c40a": { + "balance": "0x2000000000000000000" + }, + "0xe739ed3643970d106c4b1c51de91b7992400e50c": { + "balance": "0x2000000000000000000" + }, + "0x85a7273ff4f4ffce0c708f47ab45249867679bcf": { + "balance": "0x2000000000000000000" + }, + "0x4156e7abdfe6e08c16ef2b241661276af57f9ead": { + "balance": "0x2000000000000000000" + }, + "0x480b0e0a641ae45521377d4984d085a003934561": { + "balance": "0x200000000000000000000000" + }, + "0xb08eb95236499f072b2ae3c91a8f911d6c853b4d": { + "balance": "0x200000000000000000000000" + }, + "0x4899f06b5e60140f1885599bf3a562cb25775adc": { + "balance": "0x200000000000000000000000" + } + } +} diff --git a/networks/nile/config/config.toml b/networks/nile/config/config.toml new file mode 100644 index 0000000..f00a82b --- /dev/null +++ b/networks/nile/config/config.toml @@ -0,0 +1,24 @@ +# Users config file in users.toml +# This configuration file can be used for either Alice, Bob or Charlie + +[parity] +chain = "/home/parity/parity/config/chain.json" + +[rpc] +port = 8545 +interface = "0.0.0.0" +cors = ["all"] +hosts = ["all"] +apis = ["web3", "eth", "pubsub", "net", "parity", "parity_pubsub", "parity_accounts", "traces", "rpc", "shh", "shh_pubsub"] + +[network] +port = 30303 +bootnodes = [ + "enode://11939f77e6ff12655fce3185057443c71d2732fe85b3896033329d3278798d4ea8ff64f2e318a68b63b283b6e95ba3680fccc90ae135c1a7c6383e3439b6458a@18.210.120.241:30303", + "enode://9e33335578ad186fd20fdafb43ee6348772812a036b99b1e5782f1b181719935a4f18398884c4c9c7fe47ab5f20d2d9ed41357eb5e037f557c4e1a82de89e137@35.171.30.2:30303", + "enode://22d89d3c5f798d50d1bb366632e0fcaa6987f4b02a395cd979241d0a6e3c728692e690782e55a60dbd991e8354d14fcd50fd21c8bd4e98fac6913a702211ffdf@54.163.9.188:30303" +] +discovery = true + +[account] +password = ["/home/parity/parity/validator.pwd"] diff --git a/parity/parity/keys/account1.json b/networks/nile/keys/account1.json similarity index 100% rename from parity/parity/keys/account1.json rename to networks/nile/keys/account1.json diff --git a/parity/parity/keys/account2.json b/networks/nile/keys/account2.json similarity index 100% rename from parity/parity/keys/account2.json rename to networks/nile/keys/account2.json diff --git a/parity/parity/keys/address_book.json b/networks/nile/keys/address_book.json similarity index 100% rename from parity/parity/keys/address_book.json rename to networks/nile/keys/address_book.json diff --git a/parity/parity/keys/master0.json b/networks/nile/keys/master0.json similarity index 100% rename from parity/parity/keys/master0.json rename to networks/nile/keys/master0.json diff --git a/parity/parity/keys/master1.json b/networks/nile/keys/master1.json similarity index 100% rename from parity/parity/keys/master1.json rename to networks/nile/keys/master1.json diff --git a/networks/nile/keys/validator.json b/networks/nile/keys/validator.json new file mode 100644 index 0000000..f3eee24 --- /dev/null +++ b/networks/nile/keys/validator.json @@ -0,0 +1,23 @@ +{ + "id": "0902d04b-f26e-5c1f-e3ae-78d2c1cb16e7", + "version": 3, + "crypto": { + "cipher": "aes-128-ctr", + "cipherparams": { + "iv": "6a829fe7bc656d85f6c2e9fd21784952" + }, + "ciphertext": "1bfec0b054a648af8fdd0e85662206c65a4af0ed15fede4ad41ca9ab7b504ce2", + "kdf": "pbkdf2", + "kdfparams": { + "c": 10240, + "dklen": 32, + "prf": "hmac-sha256", + "salt": "95f96b5ee22dd537e06076eb8d7078eb7275d29af935782fe476696b11be50e5" + }, + "mac": "4af2215c3cd9447a5b0512d7d1c3ea5a4435981e1c8f48bf71d7a49c0e5b4986" + }, + "address": "00bd138abd70e2f00903268f3db08f2d25677c9e", + "name": "Validator0", + "meta": "{}" +} + diff --git a/parity/parity/node0.network.key b/networks/nile/node0.network.key similarity index 100% rename from parity/parity/node0.network.key rename to networks/nile/node0.network.key diff --git a/parity/parity/node1.network.key b/networks/nile/node1.network.key similarity index 100% rename from parity/parity/node1.network.key rename to networks/nile/node1.network.key diff --git a/parity/parity/node2.network.key b/networks/nile/node2.network.key similarity index 100% rename from parity/parity/node2.network.key rename to networks/nile/node2.network.key diff --git a/parity/secret_store/config/chain.json b/networks/secret-store/config/chain.json similarity index 98% rename from parity/secret_store/config/chain.json rename to networks/secret-store/config/chain.json index 2159599..2e0bc84 100644 --- a/parity/secret_store/config/chain.json +++ b/networks/secret-store/config/chain.json @@ -1,5 +1,5 @@ { - "name": "ocean-network", + "name": "secretstore", "engine": { "authorityRound": { "params": { @@ -20,7 +20,7 @@ "params": { "maximumExtraDataSize": "0x20", "minGasLimit": "0x1388", - "networkID": "0x2324", + "networkID": "0x2325", "gasLimitBoundDivisor": "0x400", "eip140Transition": 0, "eip211Transition": 0, diff --git a/parity/secret_store/config/config.toml b/networks/secret-store/config/config.toml similarity index 98% rename from parity/secret_store/config/config.toml rename to networks/secret-store/config/config.toml index 07ff86b..be5cf44 100644 --- a/parity/secret_store/config/config.toml +++ b/networks/secret-store/config/config.toml @@ -16,9 +16,6 @@ hosts = ["all"] [ipc] disable = true -[dapps] -disable = true - [websockets] disable = true diff --git a/parity/secret_store/config/password b/networks/secret-store/config/password similarity index 100% rename from parity/secret_store/config/password rename to networks/secret-store/config/password diff --git a/parity/secret_store/keys/account1.json b/networks/secret-store/keys/account1.json similarity index 100% rename from parity/secret_store/keys/account1.json rename to networks/secret-store/keys/account1.json diff --git a/parity/secret_store/keys/account2.json b/networks/secret-store/keys/account2.json similarity index 100% rename from parity/secret_store/keys/account2.json rename to networks/secret-store/keys/account2.json diff --git a/parity/secret_store/keys/address_book.json b/networks/secret-store/keys/address_book.json similarity index 100% rename from parity/secret_store/keys/address_book.json rename to networks/secret-store/keys/address_book.json diff --git a/parity/secret_store/keys/ss1.json b/networks/secret-store/keys/ss1.json similarity index 100% rename from parity/secret_store/keys/ss1.json rename to networks/secret-store/keys/ss1.json diff --git a/networks/spree/authorities/validator0.json b/networks/spree/authorities/validator0.json new file mode 100644 index 0000000..15d6d06 --- /dev/null +++ b/networks/spree/authorities/validator0.json @@ -0,0 +1,22 @@ +{ + "id": "0902d04b-f26e-5c1f-e3ae-78d2c1cb16e7", + "version": 3, + "crypto": { + "cipher": "aes-128-ctr", + "cipherparams": { + "iv": "6a829fe7bc656d85f6c2e9fd21784952" + }, + "ciphertext": "1bfec0b054a648af8fdd0e85662206c65a4af0ed15fede4ad41ca9ab7b504ce2", + "kdf": "pbkdf2", + "kdfparams": { + "c": 10240, + "dklen": 32, + "prf": "hmac-sha256", + "salt": "95f96b5ee22dd537e06076eb8d7078eb7275d29af935782fe476696b11be50e5" + }, + "mac": "4af2215c3cd9447a5b0512d7d1c3ea5a4435981e1c8f48bf71d7a49c0e5b4986" + }, + "address": "00bd138abd70e2f00903268f3db08f2d25677c9e", + "name": "Validator0", + "meta": "{}" +} diff --git a/networks/spree/authorities/validator0.pwd b/networks/spree/authorities/validator0.pwd new file mode 100644 index 0000000..ce118da --- /dev/null +++ b/networks/spree/authorities/validator0.pwd @@ -0,0 +1 @@ +node0 diff --git a/networks/spree/authorities/validator1.json b/networks/spree/authorities/validator1.json new file mode 100644 index 0000000..cdf3b7a --- /dev/null +++ b/networks/spree/authorities/validator1.json @@ -0,0 +1,22 @@ +{ + "id": "e854acbe-e6b2-e812-9f84-7b0945a1f14f", + "version": 3, + "crypto": { + "cipher": "aes-128-ctr", + "cipherparams": { + "iv": "1b90ae52dcc1bc285ae3846d0ca9be53" + }, + "ciphertext": "b80f21bfb2029dafc89c36c6838e7a9e711ee13ec3e6900c3b097e45ae2ece7c", + "kdf": "pbkdf2", + "kdfparams": { + "c": 10240, + "dklen": 32, + "prf": "hmac-sha256", + "salt": "d823ab988002888a19336ab6650b83a4c536b42612148c9c5337ec4d92e981d1" + }, + "mac": "f8d1e53f4be85b0f77aa02bfe08b93eacdef74995822a59ddaea0497a69318af" + }, + "address": "00aa39d30f0d20ff03a22ccfc30b7efbfca597c2", + "name": "Validator1", + "meta": "{}" +} diff --git a/networks/spree/authorities/validator1.pwd b/networks/spree/authorities/validator1.pwd new file mode 100644 index 0000000..f50c4f2 --- /dev/null +++ b/networks/spree/authorities/validator1.pwd @@ -0,0 +1 @@ +node1 diff --git a/networks/spree/authorities/validator2.json b/networks/spree/authorities/validator2.json new file mode 100644 index 0000000..31dc1c2 --- /dev/null +++ b/networks/spree/authorities/validator2.json @@ -0,0 +1,22 @@ +{ + "id": "26ef5e07-4494-52b5-653f-a982ac907807", + "version": 3, + "crypto": { + "cipher": "aes-128-ctr", + "cipherparams": { + "iv": "53addf73788522f6d5bf73abb0e0b8da" + }, + "ciphertext": "88c1013308cff929825e5da57ceaf15ae86e656165bcb2de3b06b24985358af6", + "kdf": "pbkdf2", + "kdfparams": { + "c": 10240, + "dklen": 32, + "prf": "hmac-sha256", + "salt": "ab8efcf7ee2c368eced8982b22328d862ea0c15307ce6ccd5994fae5a9b13244" + }, + "mac": "c93ca54145b4f21b62c422247609d0b891149f0d9752f6fe9ef60421f10bad6c" + }, + "address": "002e28950558fbede1a9675cb113f0bd20912019", + "name": "Validator2", + "meta": "{}" +} diff --git a/networks/spree/authorities/validator2.pwd b/networks/spree/authorities/validator2.pwd new file mode 100644 index 0000000..6810417 --- /dev/null +++ b/networks/spree/authorities/validator2.pwd @@ -0,0 +1 @@ +node2 diff --git a/parity/parity/config/chain.json b/networks/spree/config/chain.json similarity index 57% rename from parity/parity/config/chain.json rename to networks/spree/config/chain.json index f2a61e7..3361e87 100644 --- a/parity/parity/config/chain.json +++ b/networks/spree/config/chain.json @@ -1,32 +1,39 @@ { - "name": "ocean-network", + "name": "spree", "engine": { "authorityRound": { "params": { "stepDuration": "1", "validators": { "list": [ - "0x00Bd138aBD70e2F00903268F3Db08f2D25677C9e", - "0x00Aa39d30F0D20FF03a22cCfc30B7EfbFca597C2", - "0x002e28950558fbede1a9675cb113f0bd20912019" + "0x00bd138abd70e2f00903268f3db08f2d25677c9e", + "0xf4a2dbd5d67ef3019a7e4b188b92128c86d76bf9", + "0xcdbe5f61fac89e2cfcfa3727805d5cb8bc4f9afd" ] }, "validateScoreTransition": 1000000000, "validateStepTransition": 1500000000, - "maximumUncleCount": 1000000000 + "maximumUncleCount": 1000000000 } } }, "params": { + "gasLimitBoundDivisor": "0x0400", + "accountStartNonce": "0x0", "maximumExtraDataSize": "0x20", "minGasLimit": "0x1388", "networkID": "0x2324", - "gasLimitBoundDivisor": "0x400", - "eip140Transition": 0, - "eip211Transition": 0, - "eip214Transition": 0, - "eip658Transition": 0 - + "eip140Transition": "0x0", + "eip211Transition": "0x0", + "eip214Transition": "0x0", + "eip658Transition": "0x0", + "wasmActivationTransition": "0x0", + "eip145Transition": "0x0", + "eip1014Transition": "0x0", + "eip1052Transition": "0x0", + "eip1283Transition": "0x0", + "kip4Transition": "0x0", + "kip6Transition": "0x0" }, "genesis": { "seal": { @@ -87,6 +94,57 @@ } } }, + "0x0000000000000000000000000000000000000005": { + "balance": "1", + "builtin": { + "name": "modexp", + "activate_at": 0, + "pricing": { + "modexp": { + "divisor": 20 + } + } + } + }, + "0x0000000000000000000000000000000000000006": { + "balance": "1", + "builtin": { + "name": "alt_bn128_add", + "activate_at": 0, + "pricing": { + "linear": { + "base": 500, + "word": 0 + } + } + } + }, + "0x0000000000000000000000000000000000000007": { + "balance": "1", + "builtin": { + "name": "alt_bn128_mul", + "activate_at": 0, + "pricing": { + "linear": { + "base": 40000, + "word": 0 + } + } + } + }, + "0x0000000000000000000000000000000000000008": { + "balance": "1", + "builtin": { + "name": "alt_bn128_pairing", + "activate_at": 0, + "pricing": { + "alt_bn128_pairing": { + "base": 100000, + "pair": 80000 + } + } + } + }, "0x6B0c56d1Ad5144b4d37fa6e27DC9afd5C2435c3B": { "balance": "0x200000000000000000000000000000000000000000000000" }, @@ -103,4 +161,4 @@ "balance": "0x200000000000000000000000000000000000000000000000" } } -} \ No newline at end of file +} diff --git a/networks/spree/config/config.toml b/networks/spree/config/config.toml new file mode 100644 index 0000000..ab4e6e9 --- /dev/null +++ b/networks/spree/config/config.toml @@ -0,0 +1,17 @@ +[parity] +chain = "/home/parity/config/chain.json" + +[rpc] +interface = "0.0.0.0" +cors = ["all"] +hosts = ["all"] +apis = ["web3", "eth", "net", "parity", "traces", "rpc", "personal", "parity_accounts", "signer", "parity_set"] + +[account] +password = ["/home/parity/validator.pwd"] + +[mining] +engine_signer = "0x00bd138abd70e2f00903268f3db08f2d25677c9e" +reseal_on_txs = "none" +force_sealing = true +reseal_min_period = 500 diff --git a/networks/spree/keys/account1.json b/networks/spree/keys/account1.json new file mode 100644 index 0000000..2226e59 --- /dev/null +++ b/networks/spree/keys/account1.json @@ -0,0 +1,22 @@ +{ + "id": "50aa801a-8d66-1402-1fa4-d8987868c2ce", + "version": 3, + "crypto": { + "cipher": "aes-128-ctr", + "cipherparams": { + "iv": "a874e6fe50a5bb088826c45560dc1b7e" + }, + "ciphertext": "2383c6aa50c744b6558e77b5dcec6137f647c81f10f71f22a87321fd1306056c", + "kdf": "pbkdf2", + "kdfparams": { + "c": 10240, + "dklen": 32, + "prf": "hmac-sha256", + "salt": "eca6ccc9fbb0bdc3a516c7576808ba5031669e6878f3bb95624ddb46449e119c" + }, + "mac": "14e9a33a45ae32f88a0bd5aac14521c1fcf14f56fd55c1a1c080b2f81ddb8d44" + }, + "address": "068ed00cf0441e4829d9784fcbe7b9e26d4bd8d0", + "name": "", + "meta": "{}" +} diff --git a/networks/spree/keys/account2.json b/networks/spree/keys/account2.json new file mode 100644 index 0000000..7409b18 --- /dev/null +++ b/networks/spree/keys/account2.json @@ -0,0 +1,22 @@ +{ + "id": "ce455fdd-11fd-5a71-0a31-9d0bec6a605d", + "version": 3, + "crypto": { + "cipher": "aes-128-ctr", + "cipherparams": { + "iv": "56b27c187d45aab59377869042b948aa" + }, + "ciphertext": "c774b879793e2e54b85071d929cc7fbb11b47f6bab6e590edf3997fe4373eaf8", + "kdf": "pbkdf2", + "kdfparams": { + "c": 10240, + "dklen": 32, + "prf": "hmac-sha256", + "salt": "33b3b99e4c6f7f6d7d804555d40c08e4a2acba20e1e46aca712c82c3b9bab749" + }, + "mac": "10ee295ce6b1553887413f0e717ccedc1bddb62572bb9208ec3bd091085990db" + }, + "address": "a99d43d86a0758d5632313b8fa3972b6088a21bb", + "name": "", + "meta": "{}" +} diff --git a/networks/spree/keys/address_book.json b/networks/spree/keys/address_book.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/networks/spree/keys/address_book.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/networks/spree/keys/master0.json b/networks/spree/keys/master0.json new file mode 100644 index 0000000..51c8c83 --- /dev/null +++ b/networks/spree/keys/master0.json @@ -0,0 +1,21 @@ +{ + "id": "0d1533e9-dd7a-a838-68dc-36ddc025c1ab", + "version": 3, + "crypto": { + "cipher": "aes-128-ctr", + "cipherparams": { + "iv": "acbabbab8eab2b952ad3cf2bd1aab0ca" + }, + "ciphertext": "134b54d057c3c0a9ac08b5eae36c46ab8dd45774215ce860afaeb4e8e50c927d", + "kdf": "pbkdf2", + "kdfparams": { + "c": 10240, + "dklen": 32, + "prf": "hmac-sha256", + "salt": "6f9e3ebd99b24becad3e8f773f44df8397cad68694abf7651880528d9552bfe7" + }, + "mac": "f8939019ec29b46694b5ac07fdf971ec740ca4de23e7ae84a1239f54c617f7d9" + }, + "address": "6b0c56d1ad5144b4d37fa6e27dc9afd5c2435c3b", + "name": "master0" +} diff --git a/networks/spree/keys/master1.json b/networks/spree/keys/master1.json new file mode 100644 index 0000000..5c78953 --- /dev/null +++ b/networks/spree/keys/master1.json @@ -0,0 +1,21 @@ +{ + "id": "76d1dcd3-0c3b-24c8-0875-78e3cc151659", + "version": 3, + "crypto": { + "cipher": "aes-128-ctr", + "cipherparams": { + "iv": "6cbc68e1c87f82cefc954217cec45d64" + }, + "ciphertext": "a0f97cd495dbe38dc6fa13c23a7cc15a6abc75b894827bd2729a72bc3a1ec92d", + "kdf": "pbkdf2", + "kdfparams": { + "c": 10240, + "dklen": 32, + "prf": "hmac-sha256", + "salt": "b7704b289ced489bf6da93f6d335537763d3cc68460509321a73e50b185685de" + }, + "mac": "881850b5ce7709a7fd5ea923d97f77f0bd8717f054c44d35104cafc78d21813c" + }, + "address": "0011598de1016a350ad719d23586273804076774", + "name": "master1" +} diff --git a/networks/spree/keys/validator.json b/networks/spree/keys/validator.json new file mode 100644 index 0000000..f3eee24 --- /dev/null +++ b/networks/spree/keys/validator.json @@ -0,0 +1,23 @@ +{ + "id": "0902d04b-f26e-5c1f-e3ae-78d2c1cb16e7", + "version": 3, + "crypto": { + "cipher": "aes-128-ctr", + "cipherparams": { + "iv": "6a829fe7bc656d85f6c2e9fd21784952" + }, + "ciphertext": "1bfec0b054a648af8fdd0e85662206c65a4af0ed15fede4ad41ca9ab7b504ce2", + "kdf": "pbkdf2", + "kdfparams": { + "c": 10240, + "dklen": 32, + "prf": "hmac-sha256", + "salt": "95f96b5ee22dd537e06076eb8d7078eb7275d29af935782fe476696b11be50e5" + }, + "mac": "4af2215c3cd9447a5b0512d7d1c3ea5a4435981e1c8f48bf71d7a49c0e5b4986" + }, + "address": "00bd138abd70e2f00903268f3db08f2d25677c9e", + "name": "Validator0", + "meta": "{}" +} + diff --git a/networks/spree/node0.network.key b/networks/spree/node0.network.key new file mode 100644 index 0000000..4ca292b --- /dev/null +++ b/networks/spree/node0.network.key @@ -0,0 +1 @@ +b3244c104fb56d28d3979f6cd14a8b5cf5b109171d293f4454c97c173a9f9374 diff --git a/networks/spree/node1.network.key b/networks/spree/node1.network.key new file mode 100644 index 0000000..0eb7d3b --- /dev/null +++ b/networks/spree/node1.network.key @@ -0,0 +1 @@ +c07b4807e704dfff975d82fc807a3da7947838379007b49c51f6a04faf4cdea8 diff --git a/networks/spree/node2.network.key b/networks/spree/node2.network.key new file mode 100644 index 0000000..224e330 --- /dev/null +++ b/networks/spree/node2.network.key @@ -0,0 +1 @@ +d8bf44e2b69604bde8c84c4b403114f4410dc4f57d80e026b24b8f1af70d5633 diff --git a/parity/.env b/parity/.env deleted file mode 100755 index c94bcb8..0000000 --- a/parity/.env +++ /dev/null @@ -1 +0,0 @@ -NETWORK_NAME=ocean-network diff --git a/parity/README.md b/parity/README.md deleted file mode 100644 index d553e18..0000000 --- a/parity/README.md +++ /dev/null @@ -1,111 +0,0 @@ -# Ocean private test net using Proof Of Authority consensus -### Setup - -0. Install [docker](https://docs.docker.com/engine/installation/) and [docker-compose](https://docs.docker.com/compose/install/) -1. Run `git clone https://github.com/oceanprotocol/docker-images.git` -2. Run `cd docker-images/parity` -3. Run `docker-compose up ` (add `-d` to run in daemon mode) -4. This will run 3 validator/authority nodes and 1 user node - -### Access JSON RPC -Access JSON RPC at [http://127.0.0.1:8545](http://127.0.0.1:8545). - -### Some handy curl commands - -### Send transaction -``` -curl --data '{"jsonrpc":"2.0","method":"personal_sendTransaction","params":[{"from":"0x
","to":"0x
","value":"0x"}, ""],"id":0}' -H "Content-Type: application/json" -X POST localhost:8545 -``` - -#### Unlock account -replace `null` with number of seconds to indicate how long account will be unlocked -Account address goes in the first param (here is's just "0x") -``` -curl --data '{"method":"personal_unlockAccount","params":["0x","hunter2",null],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545 - -``` - -### New account -Using just a password -``` -curl --data '{"method":"personal_newAccount","params":["password-hunter2"],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545 -``` - -Using a recovery phrase and password -``` -curl --data '{"method":"parity_newAccountFromPhrase","params":["stylus outing overhand dime radial seducing harmless uselessly evasive tastiness eradicate imperfect","hunter2"],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545 -``` - -Refer to these sources for more goodies: -* https://github.com/paritytech/wiki -* https://github.com/paritytech/wiki/blob/master/JSONRPC-personal-module.md -* https://github.com/paritytech/wiki/blob/master/JSONRPC-parity_accounts-module.md - -### Instructions to add a validator node using Docker Compose -* Run the private network as described above -* Create a new validator account: - `curl --data '{"jsonrpc":"2.0","method":"parity_newAccountFromPhrase","params":["nodeX-phrase", "nodeX-password"],"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 improve indentation (optional) -* Add a simple text file named `validatorX.pwd` in `parity/authorities` and add the password `nodeX-password` (or whatever was specified in the "params":["nodeX-phrase", "nodeX-password"]) -* Copy/paste a validator image definition section 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. - * This is what will be added to the docker-compose.yml file: -``` - validatorX: - image: parity/parity:stable - command: - --config /parity/config/validator.toml - --engine-signer 0x00aa39d30f0d20ff03a22ccfc30b7efbfca597c2 - volumes: - - ./parity/config:/parity/config:ro - - validatorX:/root/.local/share/io.parity.ethereum/ - - ./parity/authorities/validatorX.json:/root/.local/share/io.parity.ethereum/keys/${NETWORK_NAME}/validator.json:ro - - ./parity/authorities/validatorX.pwd:/parity/validator.pwd:ro - - ./parity/nodeX.network.key:/root/.local/share/io.parity.ethereum/network/key:ro - networks: - my_net: - ipv4_address: 172.16.0.13 - -``` - * Make sure to assign a new `ipv4_address` address - * Specify the new account address in the --engine-signer option - * And add the name in the volumes section in the compose file: -``` -volumes: - validator0: - validator1: - validator2: - validatorX: - -``` -* Generate a new bootnode key and add it here `docker-images/parity/parity/nodeX.network.key` -* Get an enode address and add it in both `member.toml` and `validator.toml` files in the bootnodes list under `[network]` -* Update the validators list in `chain.json` by adding the new account to the existing list - - -## Notes -* We ran into an issue with running smart contracts where a function in one contract fails if it calls a function of another contract - * This problem is fixed by adding the following lines to the `chain.json` file to enable byzantium mode in the EVM: -``` - "eip140Transition": 0, - "eip211Transition": 0, - "eip214Transition": 0, - "eip658Transition": 0 -``` - * The problem is reported in `https://github.com/paritytech/parity/issues/8503` and `https://github.com/ethereum/solidity/issues/3969` - -## The ocean test net -The private test net is running on Azure VM `ocn-hackaton` with ip address `40.115.16.244` - -To connect to the network, provide the ip address and use port `8545` - -To deploy keeper-contracts, use the following in your truffle.js file: -``` -ocean_poa_net: { - host: 'http://40.115.16.244', - port: 8545, - network_id: '*', - gas: 6000000, - from: "0x00bd138abd70e2f00903268f3db08f2d25677c9e" -}, -``` \ No newline at end of file diff --git a/parity/docker-compose.yml b/parity/docker-compose.yml deleted file mode 100644 index 1c658cc..0000000 --- a/parity/docker-compose.yml +++ /dev/null @@ -1,88 +0,0 @@ -version: '2.1' -services: - validator0: - image: parity/parity:stable - command: - --config /parity/config/validator.toml - --engine-signer 0x00bd138abd70e2f00903268f3db08f2d25677c9e - --jsonrpc-interface 0.0.0.0 - --ws-interface 0.0.0.0 - --ui-interface 0.0.0.0 - --unsafe-expose - --jsonrpc-cors all - --unlock 0x00bd138abd70e2f00903268f3db08f2d25677c9e - 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:stable - 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:stable - 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 - - user0: - image: parity/parity:stable - command: - --config /parity/config/member.toml - --jsonrpc-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 - - -volumes: - validator0: - validator1: - validator2: -networks: - my_net: - driver: bridge - ipam: - driver: default - config: - - subnet: 172.16.0.1/24 - gateway: 172.16.0.1 diff --git a/parity/parity/config/member.toml b/parity/parity/config/member.toml deleted file mode 100644 index 0d5d34d..0000000 --- a/parity/parity/config/member.toml +++ /dev/null @@ -1,18 +0,0 @@ -[parity] -chain = "/parity/config/chain.json" - -[rpc] -interface = "0.0.0.0" -cors = ["all"] -hosts = ["all"] -apis = ["web3", "eth", "net", "parity", "traces", "rpc", "personal", "parity_accounts", "signer", "parity_set"] - -[network] -bootnodes = [ - "enode://147573f46fe9f5cc38fbe070089a31390baec5dd2827c8f2ef168833e4d0254fbee3969a02c5b9910ea5d5b23d86a6ed5eabcda17cc12007b7d9178b6c697aa5@172.16.0.10:30303", - "enode://1412ee9b9e23700e4a67a8fe3d8d02e10376b6e1cb748eaaf8aa60d4652b27872a8e1ad65bb31046438a5d3c1b71b00ec3ce0b4b42ac71464b28026a3d0b53af@172.16.0.11:30303", - "enode://9076c143a487aa163437a86f7d009f257f405c50bb2316800b9c9cc40e5a38fef5b414a47636ec38fdabc8a1872b563effa8574a7f8f85dc6bde465c368f1bf5@172.16.0.12:30303" -] - -[ui] -interface = "0.0.0.0" diff --git a/parity/parity/config/secretstoreclient.toml b/parity/parity/config/secretstoreclient.toml deleted file mode 100644 index ddc3ec3..0000000 --- a/parity/parity/config/secretstoreclient.toml +++ /dev/null @@ -1,26 +0,0 @@ -# Users config file in users.toml -# This configuration file can be used for either Alice, Bob or Charlie - -[parity] -chain = "/home/parity/parity/config/chain.json" - -[rpc] -port = 8545 -interface = "0.0.0.0" -cors = ["all"] -hosts = ["all"] -apis = ["web3", "secretstore", "eth", "pubsub", "net", "parity", "parity_pubsub", "parity_accounts", "traces", "rpc", "shh", "shh_pubsub"] - -[secretstore] -disable = true # users do not run a secret store node - -[network] -port = 30303 -bootnodes = [ - "enode://16bddd0215f9bb8a9328671b7b1554a7811cf310065fde04248ce4cea92fe2831412894c912e6b9e45019d5011631452055a5c1873f2d6760baa95f51c449787@172.15.0.13:30303", - "enode://bd97feab0fdd069c3fe1f260285053f6a6fa6eaa840bfd6730a1ce6b0b9eccef616bfca7b498fb04c02f5fb9ecd8c40617c32acbdd4b55d306a3f4468b6885f2@172.15.0.12:30303" -] -discovery = true - -[account] -password = ["/home/parity/parity/validator.pwd"] diff --git a/parity/parity/config/validator.toml b/parity/parity/config/validator.toml deleted file mode 100644 index 046293d..0000000 --- a/parity/parity/config/validator.toml +++ /dev/null @@ -1,24 +0,0 @@ -[parity] -chain = "/home/parity/parity/config/chain.json" - -[rpc] -interface = "0.0.0.0" -cors = ["all"] -hosts = ["all"] -apis = ["web3", "eth", "net", "parity", "traces", "rpc", "personal", "parity_accounts", "signer", "parity_set"] - -[network] -bootnodes = [ - "enode://147573f46fe9f5cc38fbe070089a31390baec5dd2827c8f2ef168833e4d0254fbee3969a02c5b9910ea5d5b23d86a6ed5eabcda17cc12007b7d9178b6c697aa5@172.16.0.10:30303", - "enode://1412ee9b9e23700e4a67a8fe3d8d02e10376b6e1cb748eaaf8aa60d4652b27872a8e1ad65bb31046438a5d3c1b71b00ec3ce0b4b42ac71464b28026a3d0b53af@172.16.0.11:30303", - "enode://9076c143a487aa163437a86f7d009f257f405c50bb2316800b9c9cc40e5a38fef5b414a47636ec38fdabc8a1872b563effa8574a7f8f85dc6bde465c368f1bf5@172.16.0.12:30303" -] - -[account] -password = ["/home/parity/parity/validator.pwd"] - -[mining] -reseal_on_txs = "none" - -[secretstore] -disable = true diff --git a/start_ocean.sh b/start_ocean.sh index 6568dc1..9bcf19e 100755 --- a/start_ocean.sh +++ b/start_ocean.sh @@ -1,15 +1,29 @@ #!/usr/bin/env bash -# Must be set to true for the first run, change it to "false" to avoid migrating the smart contracts on each run. -export DEPLOY_CONTRACTS="true" -# Ganache specific option, these two options have no effect when not running ganache-cli -export GANACHE_DATABASE_PATH="." -export REUSE_DATABASE="false" -# Specify which ethereum client to run or connect to: kovan, ganache, or ocean_poa_net_local -export KEEPER_NETWORK_NAME="ganache" -export ARTIFACTS_FOLDER=~/.ocean/keeper-contracts/artifacts +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" +COMPOSE_DIR="${DIR}/compose-files" + export PROJECT_NAME="ocean" -export BRIZO_ENV_FILE=./brizo.env +# default to latest versions +export OCEAN_VERSION=latest + +# keeper options +export KEEPER_DEPLOY_CONTRACTS="false" +export KEEPER_ARTIFACTS_FOLDER=$HOME/.ocean/keeper-contracts/artifacts +# Specify which ethereum client to run or connect to: development, kovan, spree or nile +export KEEPER_NETWORK_NAME="nile" +export NODE_FILE=${COMPOSE_DIR}/nodes/nile_node.yml + +# Ganache specific option, these two options have no effect when not running ganache-cli +export GANACHE_DATABASE_PATH="${DIR}" +export GANACHE_REUSE_DATABASE="false" + +export BRIZO_ENV_FILE="${DIR}/brizo.env" + +# Specify the ethereum default RPC container provider +export KEEPER_RPC_HOST='keeper-node' +export KEEPER_RPC_PORT='8545' +export KEEPER_RPC_URL="http://"${KEEPER_RPC_HOST}:${KEEPER_RPC_PORT} # colors COLOR_R="\033[0;31m" # red @@ -30,39 +44,94 @@ function show_banner { show_banner -# default to latest versions -export OCEAN_VERSION=latest -COMPOSE_FILE='docker-compose.yml' +COMPOSE_FILES="" +COMPOSE_FILES+=" -f ${COMPOSE_DIR}/network_volumes.yml" +COMPOSE_FILES+=" -f ${COMPOSE_DIR}/pleuston.yml" +COMPOSE_FILES+=" -f ${COMPOSE_DIR}/aquarius.yml" +COMPOSE_FILES+=" -f ${COMPOSE_DIR}/brizo.yml" +COMPOSE_FILES+=" -f ${COMPOSE_DIR}/secret_store.yml" while :; do case $1 in + ################################################# + # Version switches + ################################################# --latest) export OCEAN_VERSION=latest printf $COLOR_Y'Switched to latest components...\n\n'$COLOR_RESET ;; - --reuse-database) - export REUSE_DATABASE="true" - printf $COLOR_Y'Starting and reusing the database ...\n\n'$COLOR_RESET - ;; + ################################################# + # Exclude switches + ################################################# --no-pleuston) - COMPOSE_FILE='docker-compose-no-pleuston.yml' + COMPOSE_FILES=${COMPOSE_FILES/ -f ${COMPOSE_DIR}\/pleuston.yml/} printf $COLOR_Y'Starting without Pleuston...\n\n'$COLOR_RESET ;; - --local-parity-node) - export KEEPER_NETWORK_NAME="ocean_poa_net_local" - COMPOSE_FILE='docker-compose-local-parity-node.yml' - printf $COLOR_Y'Starting with local Parity node...\n\n'$COLOR_RESET + --no-brizo) + COMPOSE_FILES=${COMPOSE_FILES/ -f ${COMPOSE_DIR}\/brizo.yml/} + printf $COLOR_Y'Starting without Brizo...\n\n'$COLOR_RESET + ;; + --no-aquarius) + COMPOSE_FILES=${COMPOSE_FILES/ -f ${COMPOSE_DIR}\/aquarius.yml/} + printf $COLOR_Y'Starting without Aquarius...\n\n'$COLOR_RESET + ;; + --no-secret-store) + COMPOSE_FILES=${COMPOSE_FILES/ -f ${COMPOSE_DIR}\/secret_store.yml/} + printf $COLOR_Y'Starting without Secret Store...\n\n'$COLOR_RESET + ;; + ################################################# + # Contract/Storage switches + ################################################# + --reuse-ganache-database) + export GANACHE_REUSE_DATABASE="true" + printf $COLOR_Y'Starting and reusing the database ...\n\n'$COLOR_RESET + ;; + ################################################# + # Node type switches + ################################################# + # connects you to kovan + --local-kovan-node) + export NODE_FILE=${COMPOSE_DIR}/nodes/kovan_node.yml + export KEEPER_NETWORK_NAME="kovan" + printf $COLOR_Y'Starting with local Kovan node...\n\n'$COLOR_RESET + ;; + # spins up a new ganache blockchain + --local-ganache-node) + COMPOSE_FILES+=" -f ${COMPOSE_DIR}/keeper_contracts.yml" + export NODE_FILE=${COMPOSE_DIR}/nodes/ganache_node.yml + export KEEPER_NETWORK_NAME="development" + export KEEPER_DEPLOY_CONTRACTS="true" + #rm -f ${KEEPER_ARTIFACTS_FOLDER}/*.development.json + printf $COLOR_Y'Starting with local Ganache node...\n\n'$COLOR_RESET + ;; + # connects you to nile ocean testnet + --local-nile-node) + export NODE_FILE=${COMPOSE_DIR}/nodes/nile_node.yml + export KEEPER_NETWORK_NAME="nile" + printf $COLOR_Y'Starting with local Nile node...\n\n'$COLOR_RESET + ;; + # spins up spree local testnet + --local-spree-node) + COMPOSE_FILES+=" -f ${COMPOSE_DIR}/keeper_contracts.yml" + export NODE_FILE=${COMPOSE_DIR}/nodes/spree_node.yml + export KEEPER_NETWORK_NAME="spree" + export KEEPER_DEPLOY_CONTRACTS="true" + #rm -f ${KEEPER_ARTIFACTS_FOLDER}/*.development.json + printf $COLOR_Y'Starting with local Spree node...\n\n'$COLOR_RESET ;; + ################################################# + # Cleaning switches + ################################################# --purge) - docker network rm $PROJECT_NAME_backend || true - docker network rm $PROJECT_NAME_default || true - docker volume rm $PROJECT_NAME_parity-node || true - docker volume rm $PROJECT_NAME_secret-store || true - read -p "Are you sure you want to delete $ARTIFACTS_FOLDER? " -n 1 -r + docker network rm ${PROJECT_NAME}_backend || true + docker network rm ${PROJECT_NAME}_default || true + docker volume rm ${PROJECT_NAME}_keeper-node || true + docker volume rm ${PROJECT_NAME}_secret-store || true + read -p "Are you sure you want to delete $KEEPER_ARTIFACTS_FOLDER? " -n 1 -r echo if [[ $REPLY =~ ^[Yy]$ ]] then - rm -rf $ARTIFACTS_FOLDER + rm -rf ${KEEPER_ARTIFACTS_FOLDER} fi ;; --) # End of all options. @@ -75,7 +144,7 @@ while :; do ;; *) printf $COLOR_Y'Starting Ocean...\n\n'$COLOR_RESET - docker-compose --project-name=$PROJECT_NAME -f $COMPOSE_FILE up + docker-compose --project-name=$PROJECT_NAME $COMPOSE_FILES -f ${NODE_FILE} up --remove-orphans break esac shift