Skip to content

Commit

Permalink
fix: add devcoin to faucet after deployment (#10903)
Browse files Browse the repository at this point in the history
This PR uses the API added in #10580 to add the just deployed DevCoin
contract.
  • Loading branch information
alexghr authored Dec 21, 2024
1 parent df04911 commit 6aa5369
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions .github/workflows/devnet-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,13 @@ jobs:
run: |
set -eu -o pipefail
pxe_port_forward_pid=""
ethereum_port_forward_pid=""
port_forward_pids=()
cleanup() {
echo "Cleaning up port-forward processes..."
if [ -n "$pxe_port_forward_pid" ]; then
kill $pxe_port_forward_pid 2>/dev/null || true
fi
if [ -n "$ethereum_port_forward_pid" ]; then
kill $ethereum_port_forward_pid 2>/dev/null || true
fi
echo "Cleaning up port-forwards..."
for pid in "${port_forward_pids[@]}"; do
kill $pid 2>/dev/null
done
}
trap cleanup EXIT
Expand All @@ -109,6 +105,7 @@ jobs:
helm get values $NAMESPACE -n $NAMESPACE -o json --all > helm_values.json
PXE_PORT="$(jq -r .pxe.service.nodePort helm_values.json)"
FAUCET_PORT="$(jq -r .faucet.apiServerPort helm_values.json)"
ETHEREUM_PORT="$(jq -r .ethereum.service.port helm_values.json)"
L1_CHAIN_ID="$(jq -r .ethereum.chainId helm_values.json)"
Expand All @@ -117,13 +114,16 @@ jobs:
rm helm_values.json
kubectl port-forward -n $NAMESPACE svc/$NAMESPACE-aztec-network-pxe $PXE_PORT &
pxe_port_forward_pid=$!
kubectl port-forward -n $NAMESPACE svc/$NAMESPACE-aztec-network-pxe $PXE_PORT &>/dev/null &
port_forward_pids+=($!)
kubectl port-forward -n $NAMESPACE svc/$NAMESPACE-aztec-network-faucet-api $FAUCET_PORT &>/dev/null &
port_forward_pids+=($!)
# port-forward directly to the pod because the Eth node does not have a service definition
ETH_POD_NAME=$(kubectl get pods -n $NAMESPACE -l app=ethereum -o jsonpath='{.items[0].metadata.name}')
kubectl port-forward -n $NAMESPACE pod/$ETH_POD_NAME $ETHEREUM_PORT &
ethereum_port_forward_pid=$!
kubectl port-forward -n $NAMESPACE pod/$ETH_POD_NAME $ETHEREUM_PORT &>/dev/null &
port_forward_pids+=($!)
# wait for port-forwards to establish
sleep 5
Expand All @@ -136,3 +136,8 @@ jobs:
--json | tee ./basic_contracts.json
aws s3 cp ./basic_contracts.json ${{ env.CONTRACT_S3_BUCKET }}/devnet/basic_contracts.json
DEVCOIN_L1_ADDRESS=$(jq -r .devCoinL1 ./basic_contracts.json)
DEVCOIN_DRIP_AMOUNT=1000000000
curl -X POST -d address=$DEVCOIN_L1_ADDRESS -d amount=$DEVCOIN_DRIP_AMOUNT \
http://127.0.0.1:$FAUCET_PORT/l1-asset

0 comments on commit 6aa5369

Please sign in to comment.