From 553177c6ebea52bcd97d6c10e41a94549eed15f7 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Mon, 19 Aug 2024 16:27:19 -0700 Subject: [PATCH 1/2] build: cleanup --- Makefile | 15 ++++++++++----- README.md | 6 +++--- TROUBLESHOOTING.md | 10 +--------- contract/Makefile | 13 ------------- contract/package.json | 4 +--- 5 files changed, 15 insertions(+), 33 deletions(-) diff --git a/Makefile b/Makefile index 04085c9..2623397 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,19 @@ -e2e: build build - yarn workspace dapp-agoric-orca-contract test; yarn workspace dapp-agoric-orca-contract build; yarn workspace dapp-agoric-orca-contract e2e +.DEFAULT_GOAL := build + +e2e: build + make -C contract build e2e + build: - yarn workspace dapp-agoric-orca-contract test; yarn workspace dapp-agoric-orca-contract build; + yarn workspace dapp-agoric-orca-contract build + redeploy: yarn workspace dapp-agoric-orca-contract deployc + test-orca: yarn workspace dapp-agoric-orca-contract test + fund: yarn workspace dapp-agoric-orca-contract fund + add-address: yarn workspace dapp-agoric-orca-contract add:address -lint: - yarn workspace dapp-agoric-orca-contract lint diff --git a/README.md b/README.md index 685e19d..b1b7827 100644 --- a/README.md +++ b/README.md @@ -73,13 +73,13 @@ make fund # Build & Deploy the dapp From the top level directory, run: ``` -make +yarn build ``` # Tests From top-level directory: ``` -make test-orca +yarn test ``` # tests from root directory @@ -145,4 +145,4 @@ http://127.0.0.1:26657/abci_query?path=%22/cosmos.bank.v1beta1.Query/AllBalances agd tx bank send keplr1 agoric15ch7da0d8nvqc8hk6dguq4ext0lvskpjcwm3patf8sygm63chmpqjlzt74 1000uist -y --chain-id agoriclocal ``` -# \ No newline at end of file +# diff --git a/TROUBLESHOOTING.md b/TROUBLESHOOTING.md index 2cb92b6..ec0087d 100644 --- a/TROUBLESHOOTING.md +++ b/TROUBLESHOOTING.md @@ -25,15 +25,7 @@ src/orchdev.proposal.js */ ``` -5) possible import rejection SES -check for `bn.js` containing `while (j-- > 0) {` - -we can check for this from outside the container: -``` -kubectl exec -it agoriclocal-genesis-0 -- cat ./node_modules/bn.js/lib/bn.js | grep "j\-\-" -``` - -If the file is there, we can do `make copy-bn-js ` +5) obsolete, left to not reset serial numbering 6) ``` diff --git a/contract/Makefile b/contract/Makefile index 37be559..0febb3e 100644 --- a/contract/Makefile +++ b/contract/Makefile @@ -214,12 +214,6 @@ proposal-start-vote: bundle-debug: bash scripts/bundle-debug.sh -# patch -copy-bn-js: - kubectl exec -i agoriclocal-genesis-0 -c validator -- rm -f -v /root/node_modules/bn.js/lib/bn.js - cp ./PATCH-bn.js ../node_modules/bn.js/lib/bn.js - kubectl cp ../node_modules/bn.js/lib/bn.js default/agoriclocal-genesis-0:/root/node_modules/bn.js/lib/bn.js - copy-vow-js: cp ./PATCH-vat.js ../node_modules/@agoric/vow/vat.js kubectl cp ../node_modules/@agoric/vow/vat.js default/agoriclocal-genesis-0:/root/node_modules/@agoric/vow/vat.js @@ -229,10 +223,6 @@ copy-vow-js: # kubectl cp ../node_modules/@agoric/vow/vat.js default/agoriclocal-genesis-0:/root/node_modules/@agoric/async-flow/node_modules/@agoric/vow/vat.js -# kubectl exec -i agoriclocal-genesis-0 -c validator -- cat /root/node_modules/bn.js/lib/bn.js | grep "PATCH" -patch: - patch ../node_modules/bn.js/lib/bn.js < ../xxpatches/bn.js+5.2.1.patch - cleanc: kubectl exec -i agoriclocal-genesis-0 -c validator -- bash -c "rm -rf -v ./*" @@ -267,6 +257,3 @@ e2e: kubectl exec -i agoriclocal-genesis-0 -c validator -- bash -c "yarn node scripts/deploy-contract.js --install src/orca.contract.js --eval src/orca.proposal.js" kubectl exec -i agoriclocal-genesis-0 -c validator -- bash -c "yarn node scripts/deploy-contract.js --install src/orca.contract.js --eval src/orca.proposal.js" # todo: figure out why this sequence # is always off by 1 forcing a retry - -lint: - yarn lint --fix-dry-run --ignore-pattern "*patch*" \ No newline at end of file diff --git a/contract/package.json b/contract/package.json index f176af3..70cc00c 100644 --- a/contract/package.json +++ b/contract/package.json @@ -11,10 +11,8 @@ "docker:make": "docker compose exec agd make -C /workspace/contract", "make:help": "make list", "start": "make clean start", - "start2": "make clean start2", - "build2": "yarn build:deployer2", + "build": "yarn build:deployer", "build:deployer": "rollup -c rollup.config.mjs", - "build:deployer2": "echo \"deployer2\"; agoric run scripts/build-contract-deployer.js", "deploy": "make dev-working", "test": "ava", "lint": "tsc && eslint '**/*.js'", From 4cf97a425693731528eb9a518a3ac24caa9ba00f Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Mon, 19 Aug 2024 17:05:48 -0700 Subject: [PATCH 2/2] fixup! build: cleanup --- Makefile | 9 --------- README.md | 2 +- contract/Makefile | 25 +++++++++++-------------- 3 files changed, 12 insertions(+), 24 deletions(-) diff --git a/Makefile b/Makefile index 2623397..9c09cf6 100644 --- a/Makefile +++ b/Makefile @@ -8,12 +8,3 @@ build: redeploy: yarn workspace dapp-agoric-orca-contract deployc - -test-orca: - yarn workspace dapp-agoric-orca-contract test - -fund: - yarn workspace dapp-agoric-orca-contract fund - -add-address: - yarn workspace dapp-agoric-orca-contract add:address diff --git a/README.md b/README.md index b1b7827..7fb15d2 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ This will fund the pool, provision the smart wallet, and will also fund `CLIENTA This can be ran from the top-level directory ``` -make fund +make -C contract fund-account ``` # Build & Deploy the dapp diff --git a/contract/Makefile b/contract/Makefile index 0febb3e..9d584f7 100644 --- a/contract/Makefile +++ b/contract/Makefile @@ -234,26 +234,23 @@ deployc: kubectl exec -i agoriclocal-genesis-0 -c validator -- bash -c "yarn node scripts/deploy-contract.js --install src/orca.contract.js --eval src/orca.proposal.js" deploy: yarn node scripts/deploy-contract.js --install src/orca.contract.js --eval src/orca.proposal.js -test-orca: - yarn test ./test/orca-contract.test.js # todo remove clean install steps after debugging e2e: - make clean - make cleanc - yarn cache clean - kubectl exec -i agoriclocal-genesis-0 -c validator -- bash -c "yarn cache clean" - kubectl exec -i agoriclocal-genesis-0 -c validator -- bash -c "rm -rf -v /root/*" +# make clean +# make cleanc +# yarn cache clean +# kubectl exec -i agoriclocal-genesis-0 -c validator -- bash -c "yarn cache clean" +# kubectl exec -i agoriclocal-genesis-0 -c validator -- bash -c "rm -rf -v /root/*" yarn run build:deployer make copy-project kubectl exec -i agoriclocal-genesis-0 -c validator -- bash -c "yarn install" - kubectl exec -i agoriclocal-genesis-0 -c validator -- bash -c "yarn add @endo/patterns@1.3.0" - kubectl exec -i agoriclocal-genesis-0 -c validator -- bash -c "yarn add @agoric/orchestration@0.1.1-dev-9c9e5cf.0" - kubectl exec -i agoriclocal-genesis-0 -c validator -- bash -c "yarn add @agoric/vow@0.1.1-dev-9c9e5cf.0" - kubectl exec -i agoriclocal-genesis-0 -c validator -- bash -c "yarn add @agoric/async-flow@0.1.1-dev-9c9e5cf.0" - make copy-bn-js - kubectl exec -i agoriclocal-genesis-0 -c validator -- bash -c "yarn build:deployer" - kubectl exec -i agoriclocal-genesis-0 -c validator -- bash -c "yarn node scripts/deploy-contract.js --install src/orca.contract.js --eval src/orca.proposal.js" +# kubectl exec -i agoriclocal-genesis-0 -c validator -- bash -c "yarn add @endo/patterns@1.3.0" +# kubectl exec -i agoriclocal-genesis-0 -c validator -- bash -c "yarn add @agoric/orchestration@0.1.1-dev-9c9e5cf.0" +# kubectl exec -i agoriclocal-genesis-0 -c validator -- bash -c "yarn add @agoric/vow@0.1.1-dev-9c9e5cf.0" +# kubectl exec -i agoriclocal-genesis-0 -c validator -- bash -c "yarn add @agoric/async-flow@0.1.1-dev-9c9e5cf.0" +# kubectl exec -i agoriclocal-genesis-0 -c validator -- bash -c "yarn build:deployer" kubectl exec -i agoriclocal-genesis-0 -c validator -- bash -c "yarn node scripts/deploy-contract.js --install src/orca.contract.js --eval src/orca.proposal.js" +# kubectl exec -i agoriclocal-genesis-0 -c validator -- bash -c "yarn node scripts/deploy-contract.js --install src/orca.contract.js --eval src/orca.proposal.js" # todo: figure out why this sequence # is always off by 1 forcing a retry