From 2fbd448b1189665310b5f936d4d43be012dd1aed Mon Sep 17 00:00:00 2001 From: Shreerang Kale Date: Fri, 18 Oct 2024 16:51:22 +0530 Subject: [PATCH] Add script to deploy tokens in nitro contracts --- .../docker-compose-nitro-contracts.yml | 1 + .../nitro-contracts/deploy-l1-tokens.sh | 27 +++++++++++++++++++ .../cerc-nitro-contracts/Dockerfile | 2 +- 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100755 stack-orchestrator/config/nitro-contracts/deploy-l1-tokens.sh diff --git a/stack-orchestrator/compose/docker-compose-nitro-contracts.yml b/stack-orchestrator/compose/docker-compose-nitro-contracts.yml index b7826a4..a7caf24 100644 --- a/stack-orchestrator/compose/docker-compose-nitro-contracts.yml +++ b/stack-orchestrator/compose/docker-compose-nitro-contracts.yml @@ -18,6 +18,7 @@ services: volumes: - nitro_deployment:/app/deployment - ../config/nitro-contracts/deploy-l1-contracts.sh:/app/deploy-l1-contracts.sh + - ../config/nitro-contracts/deploy-l1-tokens.sh:/app/deploy-l1-tokens.sh command: ["bash", "-c", "/app/deploy-l1-contracts.sh"] extra_hosts: - "host.docker.internal:host-gateway" diff --git a/stack-orchestrator/config/nitro-contracts/deploy-l1-tokens.sh b/stack-orchestrator/config/nitro-contracts/deploy-l1-tokens.sh new file mode 100755 index 0000000..c15a7e5 --- /dev/null +++ b/stack-orchestrator/config/nitro-contracts/deploy-l1-tokens.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +set -e +if [ -n "$CERC_SCRIPT_DEBUG" ]; then + set -x +fi + +addresses_deployment_file="packages/nitro-protocol/addresses.json" +nitro_addresses_file="/app/deployment/nitro-addresses.json" + +echo "Using the following environment variables:" +echo "GETH_URL: ${GETH_URL}" +echo "GETH_CHAIN_ID: ${GETH_CHAIN_ID}" +echo "GETH_DEPLOYER_PK: ${GETH_DEPLOYER_PK}" +echo "TOKEN_NAME: ${TOKEN_NAME}" +echo "TOKEN_SYMBOL: ${TOKEN_SYMBOL}" +echo "INITIAL_TOKEN_SUPPLY: ${INITIAL_TOKEN_SUPPLY}" +echo "DISABLE_DETERMINISTIC_DEPLOYMENT: ${DISABLE_DETERMINISTIC_DEPLOYMENT}" + +cp ${nitro_addresses_file} ${addresses_deployment_file} + +# Deploy custom token +yarn contracts:deploy-token-geth + +cp ${addresses_deployment_file} ${nitro_addresses_file} + +echo "Done" diff --git a/stack-orchestrator/container-build/cerc-nitro-contracts/Dockerfile b/stack-orchestrator/container-build/cerc-nitro-contracts/Dockerfile index 5fe2df7..ca0db4d 100644 --- a/stack-orchestrator/container-build/cerc-nitro-contracts/Dockerfile +++ b/stack-orchestrator/container-build/cerc-nitro-contracts/Dockerfile @@ -7,4 +7,4 @@ WORKDIR /app COPY . . RUN echo "Installing dependencies" && \ - yarn && yarn build + yarn -- 2.45.2