Skip to content

Commit

Permalink
feat: update scripts to not require addresses anymore (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiendan authored Jun 16, 2023
1 parent 62d985a commit fd28a2f
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 27 deletions.
6 changes: 1 addition & 5 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 8 additions & 5 deletions contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,26 @@ 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}
- EDENA_HOST_PORT=${EDENA_HOST_PORT}
- 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:
Expand Down
10 changes: 8 additions & 2 deletions executor-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,19 @@ 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}
- AUTH0_ISSUER_URL=${AUTH0_ISSUER_URL}
- 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
13 changes: 8 additions & 5 deletions subnet-edena.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 8 additions & 5 deletions subnet-incal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 6 additions & 5 deletions subnet-topos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fd28a2f

Please sign in to comment.