diff --git a/README.md b/README.md index 48e8430..00127a2 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ The default versions are always a combination of component versions which are co | Component name | Required by | Version | IP Address | Ports exposed | | -------------- | ------------------ | --------------------------------- | --------------- | ------------- | | ganache | ocean-contracts | latest | 172.15.0.3 | 8545 -> 8545 | -| ocean-contracts | | v1.1.15 | 172.15.0.14 | | +| ocean-contracts | | v2.0.2 | 172.15.0.14 | | | Aquarius | | v5.1.4 | 172.15.0.5 | 5000 -> 5000 | | Elasticsearch | Aquarius | 8.5.1 | 172.15.0.6 | | | Provider | | v2.1.3 | 172.15.0.4 | 8030 -> 8030 | diff --git a/cleanup.sh b/cleanup.sh index be8b1f8..5082b7e 100755 --- a/cleanup.sh +++ b/cleanup.sh @@ -15,6 +15,13 @@ docker container stop ocean_kindcluster_1 docker container stop ocean_redis_1 docker container stop ocean_dashboard_1 docker container stop docker-registry +docker container stop ocean_pdr-trader_1 +docker container stop ocean_pdr-predictoor1_1 +docker container stop ocean_pdr-predictoor2_1 +docker container stop ocean_pdr-predictoor3_1 +docker container stop ocean_pdr-trueval_1 +docker container stop ocean_pdr-publisher_1 +docker container stop ocean_pdr-dfbuyer_1 docker container rm ocean_aquarius_1 docker container rm ocean_graph-node_1 docker container rm ocean_subgraph_1 @@ -31,6 +38,13 @@ docker container rm ocean_kindcluster_1 docker container rm ocean_redis_1 docker container rm ocean_dashboard_1 docker container rm docker-registry +docker container rm ocean_pdr-trader_1 +docker container rm ocean_pdr-predictoor1_1 +docker container rm ocean_pdr-predictoor2_1 +docker container rm ocean_pdr-predictoor3_1 +docker container rm ocean_pdr-trueval_1 +docker container rm ocean_pdr-publisher_1 +docker container rm ocean_pdr-dfbuyer_1 docker volume rm ocean_graphipfs docker volume rm ocean_graphpgsql docker volume rm ocean_provider1db diff --git a/compose-files/ganache.yml b/compose-files/ganache.yml index bf9d023..ccd1c28 100644 --- a/compose-files/ganache.yml +++ b/compose-files/ganache.yml @@ -7,4 +7,4 @@ services: networks: backend: ipv4_address: 172.15.0.3 - entrypoint: ["node","/app/dist/node/cli.js","--database.dbPath", "./ganache_cache","--chain.chainId","0x2324","--chain.networkId","0x2324","-l","10000000000","-g","1","--chain.hardfork","${GANACHE_HARDFORK}","--miner.blockTime","0","--miner.instamine", "eager","--wallet.mnemonic","${GANACHE_MNEMONIC}", "-e","1000000"] + entrypoint: ["node","/app/dist/node/cli.js","--database.dbPath", "./ganache_cache","--chain.chainId","0x2324","--chain.networkId","0x2324","-a","20","-l","50000000","-g","1","--chain.hardfork","${GANACHE_FORK}","--miner.blockTime","${GANACHE_BLOCKTIME}","--miner.instamine","${GANACHE_INSTAMINE}","--wallet.mnemonic","${GANACHE_MNEMONIC}", "-e","1000000"] \ No newline at end of file diff --git a/compose-files/pdr-dfbuyer.yml b/compose-files/pdr-dfbuyer.yml new file mode 100644 index 0000000..3e207c7 --- /dev/null +++ b/compose-files/pdr-dfbuyer.yml @@ -0,0 +1,21 @@ +version: "3" +services: + pdr-dfbuyer: + image: oceanprotocol/pdr-backend:${PDR_BACKEND_VERSION:-latest} + command: dfbuyer + networks: + backend: + ipv4_address: 172.15.0.44 + environment: + RPC_URL: ${NETWORK_RPC_URL} + SUBGRAPH_URL: http://172.15.0.15:8000/subgraphs/name/oceanprotocol/ocean-subgraph + PRIVATE_KEY: "0x1f990f8b013fc5c7955e0f8746f11ded231721b9cf3f99ff06cdc03492b28090" + WAIT_FOR_SUBGRAPH: "true" + WEEKLY_SPEND_LIMIT: 10000 + DELAYED_STARTUP: 120 + ADDRESS_FILE: /ocean-contracts/artifacts/address.json + depends_on: + - ganache + volumes: + - ${OCEAN_ARTIFACTS_FOLDER}:/ocean-contracts/artifacts/ + - ${OCEAN_SUBGRAPH_FOLDER}:/ocean-subgraph/ diff --git a/compose-files/pdr-predictoor.yml b/compose-files/pdr-predictoor.yml new file mode 100644 index 0000000..ca94787 --- /dev/null +++ b/compose-files/pdr-predictoor.yml @@ -0,0 +1,56 @@ +version: "3" +services: + pdr-predictoor1: + image: oceanprotocol/pdr-backend:${PDR_BACKEND_VERSION:-latest} + command: predictoor + networks: + backend: + ipv4_address: 172.15.0.41 + environment: + RPC_URL: ${NETWORK_RPC_URL} + SUBGRAPH_URL: http://172.15.0.15:8000/subgraphs/name/oceanprotocol/ocean-subgraph + PRIVATE_KEY: "0xef4b441145c1d0f3b4bc6d61d29f5c6e502359481152f869247c7a4244d45209" + WAIT_FOR_SUBGRAPH: "true" + DELAYED_STARTUP: 120 + ADDRESS_FILE: /ocean-contracts/artifacts/address.json + depends_on: + - ganache + volumes: + - ${OCEAN_ARTIFACTS_FOLDER}:/ocean-contracts/artifacts/ + - ${OCEAN_SUBGRAPH_FOLDER}:/ocean-subgraph/ + pdr-predictoor2: + image: oceanprotocol/pdr-backend:${PDR_BACKEND_VERSION:-latest} + command: predictoor + networks: + backend: + ipv4_address: 172.15.0.45 + environment: + RPC_URL: ${NETWORK_RPC_URL} + SUBGRAPH_URL: http://172.15.0.15:8000/subgraphs/name/oceanprotocol/ocean-subgraph + PRIVATE_KEY: "0x4ed947ad7e139926e31a6442d55b2e99d141f97f46151a8769d57f514f3db868" + WAIT_FOR_SUBGRAPH: "true" + DELAYED_STARTUP: 120 + ADDRESS_FILE: /ocean-contracts/artifacts/address.json + depends_on: + - ganache + volumes: + - ${OCEAN_ARTIFACTS_FOLDER}:/ocean-contracts/artifacts/ + - ${OCEAN_SUBGRAPH_FOLDER}:/ocean-subgraph/ + pdr-predictoor3: + image: oceanprotocol/pdr-backend:${PDR_BACKEND_VERSION:-latest} + command: predictoor + networks: + backend: + ipv4_address: 172.15.0.46 + environment: + RPC_URL: ${NETWORK_RPC_URL} + SUBGRAPH_URL: http://172.15.0.15:8000/subgraphs/name/oceanprotocol/ocean-subgraph + PRIVATE_KEY: "0xa50c16d96ed01ac8f967b77b01b1fa94f751c4c600b564fd770e239ebd7d869d" + WAIT_FOR_SUBGRAPH: "true" + DELAYED_STARTUP: 120 + ADDRESS_FILE: /ocean-contracts/artifacts/address.json + depends_on: + - ganache + volumes: + - ${OCEAN_ARTIFACTS_FOLDER}:/ocean-contracts/artifacts/ + - ${OCEAN_SUBGRAPH_FOLDER}:/ocean-subgraph/ diff --git a/compose-files/pdr-publisher.yml b/compose-files/pdr-publisher.yml new file mode 100644 index 0000000..0f6590c --- /dev/null +++ b/compose-files/pdr-publisher.yml @@ -0,0 +1,25 @@ +version: '3' +services: + pdr-publisher: + image: oceanprotocol/pdr-backend:${PDR_BACKEND_VERSION:-latest} + command: publisher + networks: + backend: + ipv4_address: 172.15.0.43 + environment: + RPC_URL: ${NETWORK_RPC_URL} + ADDRESS_FILE: /root/.ocean/ocean-contracts/artifacts/address.json + PRIVATE_KEY: "0xc594c6e5def4bab63ac29eed19a134c130388f74f019bc74b8f4389df2837a58" + OPF_DEPLOYER_PRIVATE_KEY: "0xc594c6e5def4bab63ac29eed19a134c130388f74f019bc74b8f4389df2837a58" + PREDICTOOR_PRIVATE_KEY: "0xef4b441145c1d0f3b4bc6d61d29f5c6e502359481152f869247c7a4244d45209" + PREDICTOOR2_PRIVATE_KEY: "0x4ed947ad7e139926e31a6442d55b2e99d141f97f46151a8769d57f514f3db868" + PREDICTOOR3_PRIVATE_KEY: "0xa50c16d96ed01ac8f967b77b01b1fa94f751c4c600b564fd770e239ebd7d869d" + TRADER_PRIVATE_KEY: "0x8467415bb2ba7c91084d932276214b11a3dd9bdb2930fefa194b666dd8020b99" + DFBUYER_PRIVATE_KEY: "0x1f990f8b013fc5c7955e0f8746f11ded231721b9cf3f99ff06cdc03492b28090" + PDR_WEBSOCKET_KEY: "0xfd5c1ccea015b6d663618850824154a3b3fb2882c46cefb05b9a93fea8c3d215" + PDR_MM_USER: "0x1263dc73bef43a9da06149c7e598f52025bf4027f1d6c13896b71e81bb9233fb" + WAIT_FOR_CONTRACTS: "true" + depends_on: + - ganache + volumes: + - ${OCEAN_ARTIFACTS_FOLDER}:/root/.ocean/ocean-contracts/artifacts diff --git a/compose-files/pdr-trader.yml b/compose-files/pdr-trader.yml new file mode 100644 index 0000000..3782ba4 --- /dev/null +++ b/compose-files/pdr-trader.yml @@ -0,0 +1,20 @@ +version: "3" +services: + pdr-trader: + image: oceanprotocol/pdr-backend:${PDR_BACKEND_VERSION:-latest} + command: trader + networks: + backend: + ipv4_address: 172.15.0.42 + environment: + RPC_URL: ${NETWORK_RPC_URL} + SUBGRAPH_URL: http://172.15.0.15:8000/subgraphs/name/oceanprotocol/ocean-subgraph + PRIVATE_KEY: "0x8467415bb2ba7c91084d932276214b11a3dd9bdb2930fefa194b666dd8020b99" + WAIT_FOR_SUBGRAPH: "true" + DELAYED_STARTUP: 120 + ADDRESS_FILE: /ocean-contracts/artifacts/address.json + depends_on: + - ganache + volumes: + - ${OCEAN_ARTIFACTS_FOLDER}:/ocean-contracts/artifacts/ + - ${OCEAN_SUBGRAPH_FOLDER}:/ocean-subgraph/ diff --git a/compose-files/pdr-trueval.yml b/compose-files/pdr-trueval.yml new file mode 100644 index 0000000..ac92f17 --- /dev/null +++ b/compose-files/pdr-trueval.yml @@ -0,0 +1,20 @@ +version: "3" +services: + pdr-trueval: + image: oceanprotocol/pdr-backend:${PDR_BACKEND_VERSION:-latest} + command: trueval + networks: + backend: + ipv4_address: 172.15.0.40 + environment: + RPC_URL: ${NETWORK_RPC_URL} + SUBGRAPH_URL: http://172.15.0.15:8000/subgraphs/name/oceanprotocol/ocean-subgraph + PRIVATE_KEY: "0xc594c6e5def4bab63ac29eed19a134c130388f74f019bc74b8f4389df2837a58" + WAIT_FOR_SUBGRAPH: "true" + DELAYED_STARTUP: 120 + ADDRESS_FILE: /ocean-contracts/artifacts/address.json + depends_on: + - ganache + volumes: + - ${OCEAN_ARTIFACTS_FOLDER}:/ocean-contracts/artifacts/ + - ${OCEAN_SUBGRAPH_FOLDER}:/ocean-subgraph/ diff --git a/compose-files/thegraph.yml b/compose-files/thegraph.yml index cb5baad..5d393d4 100644 --- a/compose-files/thegraph.yml +++ b/compose-files/thegraph.yml @@ -50,6 +50,7 @@ services: - ocean-contracts volumes: - ${OCEAN_ARTIFACTS_FOLDER}:/ocean-contracts/artifacts/ + - ${OCEAN_SUBGRAPH_FOLDER}:/ocean-subgraph/ volumes: graphpgsql: diff --git a/start_ocean.sh b/start_ocean.sh index 7de9a2a..d933f8b 100755 --- a/start_ocean.sh +++ b/start_ocean.sh @@ -42,6 +42,10 @@ export POD_CONFIGURATION_VERSION=${POD_CONFIGURATION_VERSION:-oceanprotocol/pod- export POD_PUBLISHING_VERSION=${POD_PUBLISHING_VERSION:-oceanprotocol/pod-publishing:v4main} export WAIT_FOR_C2DIMAGES=${WAIT_FOR_C2DIMAGES:-false} +export PDR_PUBLISHER_VERSION=${PDR_PUBLISHER_VERSION:-latest} +export PDR_BACKEND_VERSION=${PDR_BACKEND_VERSION:-latest} + + export PROJECT_NAME="ocean" export FORCEPULL="false" @@ -64,9 +68,12 @@ else fi export NETWORK_RPC_PORT="8545" export NETWORK_RPC_URL="http://"${NETWORK_RPC_HOST}:${NETWORK_RPC_PORT} + # Use this seed on ganache to always create the same wallets export GANACHE_MNEMONIC=${GANACHE_MNEMONIC:-"taxi music thumb unique chat sand crew more leg another off lamp"} -export GANACHE_HARDFORK=${GANACHE_HARDFORK:-"istanbul"} +export GANACHE_INSTAMINE=${GANACHE_INSTAMINE:-"eager"} +export GANACHE_BLOCKTIME=${GANACHE_BLOCKTIME:-0} +export GANACHE_FORK=${GANACHE_FORK:-"istanbul"} # Ocean contracts export OCEAN_HOME="${HOME}/.ocean" export CONTRACTS_OWNER_ROLE_ADDRESS="${CONTRACTS_OWNER_ROLE_ADDRESS}" @@ -76,6 +83,10 @@ export OCEAN_ARTIFACTS_FOLDER="${OCEAN_HOME}/ocean-contracts/artifacts" mkdir -p ${OCEAN_ARTIFACTS_FOLDER} export OCEAN_C2D_FOLDER="${OCEAN_HOME}/ocean-c2d/" mkdir -p ${OCEAN_C2D_FOLDER} +export OCEAN_SUBGRAPH_FOLDER="${OCEAN_HOME}/ocean-subgraph/" +rm -f "${OCEAN_SUBGRAPH_FOLDER}/ready" +mkdir -p ${OCEAN_SUBGRAPH_FOLDER} + export ADDRESS_FILE="${OCEAN_ARTIFACTS_FOLDER}/address.json" echo "export ADDRESS_FILE=${ADDRESS_FILE}" @@ -254,6 +265,44 @@ while :; do export DEPLOY_SUBGRAPH=false printf $COLOR_Y'Ocean subgraph will not be deployed, the last deployment (if any) will be intact ...\n\n'$COLOR_RESET ;; + --predictoor) + # Add what we need + COMPOSE_FILES+=" -f ${COMPOSE_DIR}/thegraph.yml" + # We should remove what is not needed for now, but ocean,py requires both aqua & provider + #COMPOSE_FILES="${COMPOSE_FILES/ -f ${COMPOSE_DIR}\/provider.yml/}" + #COMPOSE_FILES="${COMPOSE_FILES/ -f ${COMPOSE_DIR}\/redis.yml/}" + #COMPOSE_FILES="${COMPOSE_FILES/ -f ${COMPOSE_DIR}\/aquarius.yml/}" + #COMPOSE_FILES="${COMPOSE_FILES/ -f ${COMPOSE_DIR}\/elasticsearch.yml/}" + #COMPOSE_FILES="${COMPOSE_FILES/ -f ${COMPOSE_DIR}\/dashboard.yml/}" + # Enforce images + #export CONTRACTS_VERSION=predictoor + #export SUBGRAPH_VERSION=predictoor + export PDR_BACKEND_VERSION=${PDR_BACKEND_VERSION:-latest} + + # replicate true blockchain behiavour + export GANACHE_INSTAMINE=strict + export GANACHE_BLOCKTIME=1 + ;; + --with-pdr-trueval) + COMPOSE_FILES+=" -f ${COMPOSE_DIR}/pdr-trueval.yml" + printf $COLOR_Y'Starting with pdr-trueval...\n\n'$COLOR_RESET + ;; + --with-pdr-trader) + COMPOSE_FILES+=" -f ${COMPOSE_DIR}/pdr-trader.yml" + printf $COLOR_Y'Starting with pdr-trader...\n\n'$COLOR_RESET + ;; + --with-pdr-predictoor) + COMPOSE_FILES+=" -f ${COMPOSE_DIR}/pdr-predictoor.yml" + printf $COLOR_Y'Starting with pdr-predictoor...\n\n'$COLOR_RESET + ;; + --with-pdr-publisher) + COMPOSE_FILES+=" -f ${COMPOSE_DIR}/pdr-publisher.yml" + printf $COLOR_Y'Starting with pdr-publisher...\n\n'$COLOR_RESET + ;; + --with-pdr-dfbuyer) + COMPOSE_FILES+=" -f ${COMPOSE_DIR}/pdr-dfbuyer.yml" + printf $COLOR_Y'Starting with pdr-dfbuyer...\n\n'$COLOR_RESET + ;; ################################################# # Cleaning switches #################################################