diff --git a/.env b/.env index 7201dce..5097984 100644 --- a/.env +++ b/.env @@ -21,12 +21,8 @@ AUTH0_ISSUER_URL=https://dev-z8x4rhzfosi03fqx.us.auth0.com/ REDIS_HOST=localhost REDIS_PORT=6379 -# Common -TOPOS_CORE_CONTRACT_ADDRESS=0x1D7b9f9b1FF6cf0A3BEB0F84fA6F8628E540E97F -SUBNET_REGISTRATOR_CONTRACT_ADDRESS=0xC9109ADccD6fDF867d52abf1Daf049E59fd9D82e - # Stack version TOPOS_EDGE_VERSION=develop -TOPOS_MESSAGING_PROTOCOL_CONTRACTS_VERSION=1.1.1 +TOPOS_MESSAGING_PROTOCOL_CONTRACTS_VERSION=pr-88 TOPOS_VERSION=main-tce EXECUTOR_SERVICE_VERSION=0.1.0-alpha diff --git a/contracts.yml b/contracts.yml index 3a4ca29..a636919 100644 --- a/contracts.yml +++ b/contracts.yml @@ -21,7 +21,6 @@ services: - TOPOS_CORE_PROXY_SALT=${TOPOS_CORE_PROXY_SALT} - ERC20_MESSAGING_SALT=${ERC20_MESSAGING_SALT} - SUBNET_REGISTRATOR_SALT=${SUBNET_REGISTRATOR_SALT} - - SUBNET_REGISTRATOR_CONTRACT_ADDRESS=${SUBNET_REGISTRATOR_CONTRACT_ADDRESS} - INCAL_HOST_PORT=${INCAL_HOST_PORT} - INCAL_CHAIN_ID=${INCAL_CHAIN_ID} - INCAL_LOGO_URL=${INCAL_LOGO_URL} @@ -29,15 +28,19 @@ services: - EDENA_CHAIN_ID=${EDENA_CHAIN_ID} - EDENA_LOGO_URL=${EDENA_LOGO_URL} command: bash -c " - npm run deploy:topos-msg-protocol http://topos-node-1:8545 $$(cat /data/topos/data-1/consensus/validator.key) && - npm run deploy http://topos-node-1:8545 artifacts/contracts/topos-core/SubnetRegistrator.sol/SubnetRegistrator.json $SUBNET_REGISTRATOR_SALT 4000000 && - npm run register-subnet http://topos-node-1:8545 $SUBNET_REGISTRATOR_CONTRACT_ADDRESS Incal $INCAL_CHAIN_ID localhost:$INCAL_HOST_PORT INCA $INCAL_LOGO_URL $$(cat /data/incal/data-1/consensus/validator.key) && - npm run register-subnet http://topos-node-1:8545 $SUBNET_REGISTRATOR_CONTRACT_ADDRESS Edena $EDENA_CHAIN_ID localhost:$EDENA_HOST_PORT EDEN $EDENA_LOGO_URL $$(cat /data/edena/data-1/consensus/validator.key)" + npx ts-node scripts/deploy-topos-msg-protocol http://topos-node-1:8545 $(cat /data/topos/data-1/consensus/validator.key) > /contracts/.env && + echo export SUBNET_REGISTRATOR_CONTRACT_ADDRESS=$(npx ts-node scripts/deploy http://topos-node-1:8545 artifacts/contracts/topos-core/SubnetRegistrator.sol/SubnetRegistrator.json $SUBNET_REGISTRATOR_SALT 4000000) >> /contracts/.env && + source /contracts/.env && + npm run register-subnet http://topos-node-1:8545 $(printenv SUBNET_REGISTRATOR_CONTRACT_ADDRESS) Incal $INCAL_CHAIN_ID localhost:$INCAL_HOST_PORT INCA $INCAL_LOGO_URL $(cat /data/incal/data-1/consensus/validator.key) && + npm run register-subnet http://topos-node-1:8545 $(printenv SUBNET_REGISTRATOR_CONTRACT_ADDRESS) Edena $EDENA_CHAIN_ID localhost:$EDENA_HOST_PORT EDEN $EDENA_LOGO_URL $(cat /data/edena/data-1/consensus/validator.key)" volumes: + - contracts:/contracts - topos-data:/data/topos - incal-data:/data/incal - edena-data:/data/edena depends_on: + contracts-init: + condition: service_completed_successfully topos-node-1: condition: service_healthy incal-node-1: diff --git a/executor-service.yml b/executor-service.yml index de75f60..246d9a2 100644 --- a/executor-service.yml +++ b/executor-service.yml @@ -14,6 +14,14 @@ services: init: true profiles: - executor-service + depends_on: + contracts-topos: + condition: service_completed_successfully + volumes: + - contracts:/contracts + command: bash -c " + source /contracts/.env && + npm run start:prod" environment: - PRIVATE_KEY=${PRIVATE_KEY} - AUTH0_AUDIENCE=${AUTH0_AUDIENCE} @@ -21,6 +29,4 @@ services: - REDIS_HOST=${REDIS_HOST} - REDIS_PORT=${REDIS_PORT} - TOPOS_SUBNET_ENDPOINT=localhost:${TOPOS_HOST_PORT} - - SUBNET_REGISTRATOR_CONTRACT_ADDRESS=${SUBNET_REGISTRATOR_CONTRACT_ADDRESS} - - TOPOS_CORE_CONTRACT_ADDRESS=${TOPOS_CORE_CONTRACT_ADDRESS} network_mode: "host" # Port 3000 will be used on the host diff --git a/subnet-edena.yml b/subnet-edena.yml index e23e882..2e69cb9 100644 --- a/subnet-edena.yml +++ b/subnet-edena.yml @@ -132,23 +132,26 @@ services: image: ghcr.io/topos-network/topos:${TOPOS_VERSION} container_name: edena-sequencer init: true - command: - - "boot" - - "sequencer" - - "run" volumes: + - contracts:/contracts - edena-data:/data depends_on: tce-boot: condition: service_healthy + contracts-topos: + condition: service_completed_successfully contracts-edena: condition: service_completed_successfully + entrypoint: "" + command: bash -c " + source /contracts/.env && + export SUBNET_CONTRACT_ADDRESS=$(printenv TOPOS_CORE_CONTRACT_ADDRESS) && + init.sh boot sequencer run" environment: - RUST_LOG=info,topos=debug - TOOLCHAIN_VERSION=stable - RUST_BACKTRACE=full - SUBNET_JSONRPC_ENDPOINT=edena-node-1:8545 - - SUBNET_CONTRACT_ADDRESS=${TOPOS_CORE_CONTRACT_ADDRESS} - TOPOS_LOCAL_SUBNET_DATA_DIR=/data/data-1 - TOPOS_BASE_TCE_API_URL=http://infra-tce-boot-1:1340 - TOPOS_OTLP_SERVICE_NAME=local-edena-sequencer diff --git a/subnet-incal.yml b/subnet-incal.yml index 0e5206a..489cb3c 100644 --- a/subnet-incal.yml +++ b/subnet-incal.yml @@ -132,23 +132,26 @@ services: image: ghcr.io/topos-network/topos:${TOPOS_VERSION} container_name: incal-sequencer init: true - command: - - "boot" - - "sequencer" - - "run" volumes: + - contracts:/contracts - incal-data:/data depends_on: tce-boot: condition: service_healthy + contracts-topos: + condition: service_completed_successfully contracts-incal: condition: service_completed_successfully + entrypoint: "" + command: bash -c " + source /contracts/.env && + export SUBNET_CONTRACT_ADDRESS=$(printenv TOPOS_CORE_CONTRACT_ADDRESS) && + init.sh boot sequencer run" environment: - RUST_LOG=info,topos=debug - TOOLCHAIN_VERSION=stable - RUST_BACKTRACE=full - SUBNET_JSONRPC_ENDPOINT=incal-node-1:8545 - - SUBNET_CONTRACT_ADDRESS=${TOPOS_CORE_CONTRACT_ADDRESS} - TOPOS_LOCAL_SUBNET_DATA_DIR=/data/data-1 - TOPOS_BASE_TCE_API_URL=http://infra-tce-boot-1:1340 - TOPOS_OTLP_SERVICE_NAME=local-incal-sequencer diff --git a/subnet-topos.yml b/subnet-topos.yml index 9f4805e..b9047e5 100644 --- a/subnet-topos.yml +++ b/subnet-topos.yml @@ -132,23 +132,24 @@ services: image: ghcr.io/topos-network/topos:${TOPOS_VERSION} container_name: topos-sequencer init: true - command: - - "boot" - - "sequencer" - - "run" volumes: + - contracts:/contracts - topos-data:/data depends_on: tce-boot: condition: service_started contracts-topos: condition: service_completed_successfully + entrypoint: "" + command: bash -c " + source /contracts/.env && + export SUBNET_CONTRACT_ADDRESS=$(printenv TOPOS_CORE_CONTRACT_ADDRESS) && + init.sh boot sequencer run" environment: - RUST_LOG=info,topos=debug - TOOLCHAIN_VERSION=stable - RUST_BACKTRACE=full - SUBNET_JSONRPC_ENDPOINT=topos-node-1:8545 - - SUBNET_CONTRACT_ADDRESS=${TOPOS_CORE_CONTRACT_ADDRESS} - TOPOS_LOCAL_SUBNET_DATA_DIR=/data/data-1 - TOPOS_BASE_TCE_API_URL=http://infra-tce-boot-1:1340 - TOPOS_OTLP_SERVICE_NAME=local-topos-sequencer