Skip to content

Commit

Permalink
derive network name from subgraph node
Browse files Browse the repository at this point in the history
  • Loading branch information
yuetloo committed Feb 9, 2024
1 parent 06faf7d commit 2cf06a4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/finalize-round.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:

env:
NODE_VERSION: 20.x
NETWORK: "arbitrum-sepolia"
COORDINATOR_MACISK: ${{ secrets.ARBITRUM_GOERLI_COORDINATOR_MACI_PRIVATE_KEY }}
WALLET_PRIVATE_KEY: ${{ secrets.ARBITRUM_GOERLI_COORDINATOR_WALLET_PRIVATE_KEY }}
CIRCUIT_TYPE: micro
Expand Down Expand Up @@ -61,6 +60,10 @@ jobs:
run: |
export SUBGRPAH_URL="https://api.thegraph.com/subgraphs/name/${{ github.event.inputs.subgraph_name }}"
echo $SUBGRAPH_URL
export SUBGRAPH_NAME=${{ github.event.inputs.subgraph_name }}
export CHAIN_QUERY=$(node -e 'console.log(`{"query":"{indexingStatusForCurrentVersion(subgraphName: \\\"${process.env.SUBGRAPH_NAME}\\\") { chains { network }}}"}`)')
export CHAIN=$(curl -s -X POST -d '{"query":"{indexingStatusForCurrentVersion(subgraphName:) { chains { network }}}"}' https://api.thegraph.com/index-node/graphql)
export NETWORK=$(node -e 'console.log(JSON.parse(process.env.CHAIN).data.indexingStatusForCurrentVersion.chains[0].network)')
export ROUND=$(curl -X POST -d '{"query":"{clrFunds {id currentRound {id maci maciTxHash}}}"}' $SUBGRPAH_URL)
export CLRFUND_ADDRESS=$(node -e 'console.log(JSON.parse(process.env.ROUND).data.clrFunds[0].id)')
export ROUND_ADDRESS=$(node -e 'console.log(JSON.parse(process.env.ROUND).data.clrFunds[0].currentRound.id)')
Expand Down

0 comments on commit 2cf06a4

Please sign in to comment.