From 58bc923a7c6cef0d9e40a7a8f2908e3d03494e2a Mon Sep 17 00:00:00 2001 From: Marc Doerflinger Date: Fri, 9 Aug 2024 10:35:00 +0000 Subject: [PATCH 1/5] write deployed addresses to file --- scripts/deploy_all.ts | 10 ++++++++-- scripts/libs/constants.ts | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/deploy_all.ts b/scripts/deploy_all.ts index 1c41e2ad2..323262ea1 100644 --- a/scripts/deploy_all.ts +++ b/scripts/deploy_all.ts @@ -8,6 +8,8 @@ import { RegistryAddresses, deployAndInitializeRegistry } from "./libs/registry" import { ServiceAddresses, deployAndRegisterServices } from "./libs/services"; import { loadVerificationQueueState } from "./libs/verification_queue"; import { logger } from "./logger"; +import { WRITE_ADDRESSES_TO_FILE } from "./libs/constants"; +import fs from "fs"; async function main() { @@ -124,8 +126,8 @@ function printAddresses( // distributionAddress: AddressLike, distributionNftId: string, // productAddress: AddressLike, productNftId: string, ) { - let addresses = "\nAddresses of deployed smart contracts:\n==========\n"; - addresses += `Library Addresses:\n----------\n`; + let addresses = "\n# Addresses of deployed smart contracts:\n# ==========\n"; + addresses += `# Library Addresses:\n# ----------\n`; for (const lib in libraries) { let libName = lib.toUpperCase(); libName = libName.replace("ADDRESS", "_ADDRESS"); @@ -212,6 +214,10 @@ function printAddresses( // addresses += `productNftId: ${productNftId}\n`; logger.info(addresses); + + if (WRITE_ADDRESSES_TO_FILE) { + fs.writeFileSync("deployment.env", addresses); + } } main().catch((error) => { diff --git a/scripts/libs/constants.ts b/scripts/libs/constants.ts index 86e7cdd36..32e6f1065 100644 --- a/scripts/libs/constants.ts +++ b/scripts/libs/constants.ts @@ -3,3 +3,4 @@ export const POOL_IS_VERIFYING = process.env.POOL_IS_VERIFYING != undefined ? pr export const POOL_COLLATERALIZATION_LEVEL = parseFloat(process.env.POOL_COLLATERALIZATION_LEVEL || "1"); export const DISTRIBUTION_IS_VERIFYING = process.env.DISTRIBUTION_IS_VERIFYING != undefined ? process.env.DISTRIBUTION_IS_VERIFYING.toLowerCase() === "true" : true; export const GAS_PRICE = process.env.GAS_PRICE !== undefined ? parseInt(process.env.GAS_PRICE) : undefined; +export const WRITE_ADDRESSES_TO_FILE = process.env.WRITE_ADDRESSES_TO_FILE != undefined ? process.env.WRITE_ADDRESSES_TO_FILE.toLowerCase() === "true" : false; From 9932d0c0086d62c7b11a440451851858a971da34 Mon Sep 17 00:00:00 2001 From: Marc Doerflinger Date: Fri, 9 Aug 2024 10:35:32 +0000 Subject: [PATCH 2/5] deploy fire example during github action --- .github/workflows/build.yml | 10 +++++++--- .gitignore | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8105a7e43..c23c9c971 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -177,6 +177,10 @@ jobs: - name: Run deployment script env: - SKIP_VERIFICATION: true - run: hh run scripts/deploy_all.ts - \ No newline at end of file + WRITE_ADDRESSES_TO_FILE: true + + run: | + hh node 2&>1 & + hh run scripts/deploy_all.ts --network localhost + mv deployment.env .env + hh run scripts/deploy_fire_components.ts --network localhost diff --git a/.gitignore b/.gitignore index 2ffe654d9..4cf4c1132 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,4 @@ lcov.info .*.drawio.bkp deployments/ soljson*.js +deployment.env From a62683efa09c7e54fd0603c489caa07312a0f8fe Mon Sep 17 00:00:00 2001 From: Marc Doerflinger Date: Fri, 9 Aug 2024 10:47:35 +0000 Subject: [PATCH 3/5] fix node startup --- .github/workflows/build.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c23c9c971..01f13518f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -154,7 +154,7 @@ jobs: permissions: contents: read # id-token: write - needs: [build_hardhat, build_foundry, test_foundry] + # needs: [build_hardhat, build_foundry, test_foundry] steps: - name: Checkout uses: actions/checkout@v4 @@ -175,12 +175,11 @@ jobs: npm install -g hardhat-shorthand npm install - - name: Run deployment script + - name: Run deployment script for gif and fire components env: WRITE_ADDRESSES_TO_FILE: true - run: | - hh node 2&>1 & + hh node & hh run scripts/deploy_all.ts --network localhost mv deployment.env .env hh run scripts/deploy_fire_components.ts --network localhost From fc50fa088ccf12de0199b21c1c99070cb3ce2031 Mon Sep 17 00:00:00 2001 From: Marc Doerflinger Date: Fri, 9 Aug 2024 10:49:52 +0000 Subject: [PATCH 4/5] fix run dependency --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 01f13518f..7d53d3550 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -154,7 +154,7 @@ jobs: permissions: contents: read # id-token: write - # needs: [build_hardhat, build_foundry, test_foundry] + needs: [build_hardhat, build_foundry] steps: - name: Checkout uses: actions/checkout@v4 From 584caa5d1f13a473627059d255876fac20d38990 Mon Sep 17 00:00:00 2001 From: Marc Doerflinger Date: Fri, 9 Aug 2024 10:54:33 +0000 Subject: [PATCH 5/5] null node output --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7d53d3550..9d2b3e0cc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -179,7 +179,7 @@ jobs: env: WRITE_ADDRESSES_TO_FILE: true run: | - hh node & + hh node > /dev/null 2>&1 & hh run scripts/deploy_all.ts --network localhost mv deployment.env .env hh run scripts/deploy_fire_components.ts --network localhost