From ebd4571ac8373b67766a01b837d44c820a872f24 Mon Sep 17 00:00:00 2001 From: Levi Schoen Date: Wed, 14 Dec 2022 12:41:53 -0800 Subject: [PATCH] switch cd pipelines to operate on internal testnet --- .github/scripts/seed-internal-testnet.sh | 24 +++++++++++------------ .github/workflows/cd-internal-testnet.yml | 15 ++++++-------- .github/workflows/cd-seed-chain.yml | 4 ++++ 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/.github/scripts/seed-internal-testnet.sh b/.github/scripts/seed-internal-testnet.sh index 2a30d2f9..aadfbf86 100755 --- a/.github/scripts/seed-internal-testnet.sh +++ b/.github/scripts/seed-internal-testnet.sh @@ -2,8 +2,8 @@ set -ex # configure kava binary to talk to the desired chain endpoint -kava config node ${CHAIN_API_URL} -kava config chain-id ${CHAIN_ID} +kava config node "${CHAIN_API_URL}" +kava config chain-id "${CHAIN_ID}" # use the test keyring to allow scriptng key generation kava config keyring-backend test @@ -22,26 +22,26 @@ echo "sweet ocean blush coil mobile ten floor sample nuclear power legend where yes y | kava tx issuance issue 200000000ukava kava1van3znl6597xgwwh46jgquutnqkwvwszjg04fz --from dev-wallet --gas-prices 0.5ukava # deploy and fund USDC ERC20 contract -USD_CONTRACT_DEPLOY=$(npx hardhat --network demonet deploy-erc20 "USD Coin" USDC 6) +USD_CONTRACT_DEPLOY=$(npx hardhat --network "${ERC20_DEPLOYER_NETWORK_NAME}" deploy-erc20 "USD Coin" USDC 6) USD_CONTRACT_ADDRESS=${USD_CONTRACT_DEPLOY: -42} -npx hardhat --network demonet mint-erc20 "$USD_CONTRACT_ADDRESS" 0x6767114FFAA17C6439D7AEA480738B982CE63A02 1000000000000 +npx hardhat --network "${ERC20_DEPLOYER_NETWORK_NAME}" mint-erc20 "$USD_CONTRACT_ADDRESS" 0x6767114FFAA17C6439D7AEA480738B982CE63A02 1000000000000 # # deploy and fund wKava ERC20 contract -wKAVA_CONTRACT_DEPLOY=$(npx hardhat --network demonet deploy-erc20 "Wrapped Kava" wKava 6) +wKAVA_CONTRACT_DEPLOY=$(npx hardhat --network "${ERC20_DEPLOYER_NETWORK_NAME}" deploy-erc20 "Wrapped Kava" wKava 6) wKAVA_CONTRACT_ADDRESS=${wKAVA_CONTRACT_DEPLOY: -42} -npx hardhat --network demonet mint-erc20 "$wKAVA_CONTRACT_ADDRESS" 0x6767114FFAA17C6439D7AEA480738B982CE63A02 1000000000000 +npx hardhat --network "${ERC20_DEPLOYER_NETWORK_NAME}" mint-erc20 "$wKAVA_CONTRACT_ADDRESS" 0x6767114FFAA17C6439D7AEA480738B982CE63A02 1000000000000 # deploy and fund BNB contract -BNB_CONTRACT_DEPLOY=$(npx hardhat --network demonet deploy-erc20 "Binance" BNB 8) +BNB_CONTRACT_DEPLOY=$(npx hardhat --network "${ERC20_DEPLOYER_NETWORK_NAME}" deploy-erc20 "Binance" BNB 8) BNB_CONTRACT_ADDRESS=${BNB_CONTRACT_DEPLOY: -42} -npx hardhat --network demonet mint-erc20 "$BNB_CONTRACT_ADDRESS" 0x6767114FFAA17C6439D7AEA480738B982CE63A02 1000000000000 +npx hardhat --network "${ERC20_DEPLOYER_NETWORK_NAME}" mint-erc20 "$BNB_CONTRACT_ADDRESS" 0x6767114FFAA17C6439D7AEA480738B982CE63A02 1000000000000 # deploy and fund USDT contract -USDT_CONTRACT_DEPLOY=$(npx hardhat --network demonet deploy-erc20 "USDT" USDT 6) +USDT_CONTRACT_DEPLOY=$(npx hardhat --network "${ERC20_DEPLOYER_NETWORK_NAME}" deploy-erc20 "USDT" USDT 6) USDT_CONTRACT_ADDRESS=${USDT_CONTRACT_DEPLOY: -42} -npx hardhat --network demonet mint-erc20 "$USDT_CONTRACT_ADDRESS" 0x6767114FFAA17C6439D7AEA480738B982CE63A02 1000000000000 +npx hardhat --network "${ERC20_DEPLOYER_NETWORK_NAME}" mint-erc20 "$USDT_CONTRACT_ADDRESS" 0x6767114FFAA17C6439D7AEA480738B982CE63A02 1000000000000 # deploy and fund DAI contract -DAI_CONTRACT_DEPLOY=$(npx hardhat --network demonet deploy-erc20 "DAI" DAI 18) +DAI_CONTRACT_DEPLOY=$(npx hardhat --network "${ERC20_DEPLOYER_NETWORK_NAME}" deploy-erc20 "DAI" DAI 18) DAI_CONTRACT_ADDRESS=${DAI_CONTRACT_DEPLOY: -42} -npx hardhat --network demonet mint-erc20 "$DAI_CONTRACT_ADDRESS" 0x6767114FFAA17C6439D7AEA480738B982CE63A02 1000000000000 +npx hardhat --network "${ERC20_DEPLOYER_NETWORK_NAME}" mint-erc20 "$DAI_CONTRACT_ADDRESS" 0x6767114FFAA17C6439D7AEA480738B982CE63A02 1000000000000 diff --git a/.github/workflows/cd-internal-testnet.yml b/.github/workflows/cd-internal-testnet.yml index 3a580bf4..1b54bf40 100644 --- a/.github/workflows/cd-internal-testnet.yml +++ b/.github/workflows/cd-internal-testnet.yml @@ -5,10 +5,6 @@ on: workflows: [Continuous Integration (Kava Master)] types: - completed - push: - # run CD on any push to the development branch - branches: - - ls-internal-testnet-cd-go-live jobs: # in order: @@ -23,8 +19,8 @@ jobs: uses: ./.github/workflows/cd-reset-internal-testnet.yml with: aws-region: us-east-1 - chain-id: demo_2221-17000 - ssm-document-name: kava-demonet-node-update + chain-id: kava_2221-17000 + ssm-document-name: kava-testnet-internal-node-update playbook-name: reset-internal-testnet-playbook.yml playbook-infrastructure-branch: master secrets: inherit @@ -34,8 +30,8 @@ jobs: uses: ./.github/workflows/cd-start-chain.yml with: aws-region: us-east-1 - chain-id: demo_2221-17000 - ssm-document-name: kava-demonet-node-update + chain-id: kava_2221-17000 + ssm-document-name: kava-testnet-internal-node-update playbook-name: start-chain-api-playbook.yml playbook-infrastructure-branch: master secrets: inherit @@ -45,8 +41,9 @@ jobs: seed-chain-state: uses: ./.github/workflows/cd-seed-chain.yml with: - chain-api-url: https://rpc.data.demonet.us-east.production.kava.io:443 + chain-api-url: https://rpc.app.internal.testnet.us-east.production.kava.io:443 chain-id: kava_2221-17000 seed-script-filename: seed-internal-testnet.sh + erc20-deployer-network-name: internal_testnet secrets: inherit needs: [start-chain-api] diff --git a/.github/workflows/cd-seed-chain.yml b/.github/workflows/cd-seed-chain.yml index 36267d23..5c5fb4ce 100644 --- a/.github/workflows/cd-seed-chain.yml +++ b/.github/workflows/cd-seed-chain.yml @@ -12,6 +12,9 @@ on: seed-script-filename: required: true type: string + erc20-deployer-network-name: + required: true + type: string secrets: DEV_WALLET_MNEMONIC: required: true @@ -66,3 +69,4 @@ jobs: CHAIN_ID: ${{ inputs.chain-id }} DEV_WALLET_MNEMONIC: ${{ secrets.DEV_WALLET_MNEMONIC }} SEED_SCRIPT_FILENAME: ${{ inputs.seed-script-filename }} + ERC20_DEPLOYER_NETWORK_NAME: ${{ inputs.erc20-deployer-network-name }}