Skip to content

Commit

Permalink
feat: subgraph build pinning
Browse files Browse the repository at this point in the history
  • Loading branch information
roderik committed Sep 28, 2024
1 parent 4c55728 commit 8444e4b
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/solidity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -265,16 +265,19 @@ jobs:
npx graph codegen subgraph.yaml
npx graph build --ipfs=https://ipfs.network.thegraph.com subgraph.yaml | tee build_output.txt
cat build_output.txt
# Extract and process IPFS hashes from the file
ipfs_hashes=$(grep -oP 'Qm[a-zA-Z0-9]{44}' build_output.txt)
echo "IPFS hashes: $ipfs_hashes"
for hash in $ipfs_hashes; do
echo "Processing IPFS hash: $hash"
curl -X POST -u "${{ secrets.INFURA_IPFS_API_KEY }}:${{ secrets.INFURA_IPFS_API_SECRET }}" "https://ipfs.infura.io:5001/api/v0/pin/add?arg=$hash"
curl --request POST --url https://api.chainstack.com/v1/ipfs/pins/pinbycid \
--header 'accept: application/json' \
--header 'authorization: Bearer ${{ secrets.CHAINSTACK_API_KEY }}' \
--header 'content-type: application/json' \
--data "{\"cid\": \"$hash\"}"
echo "Pinning $hash to Infura"
curl -s -X POST -u "${{ secrets.INFURA_IPFS_API_KEY }}:${{ secrets.INFURA_IPFS_API_SECRET }}" "https://ipfs.infura.io:5001/api/v0/pin/add?arg=$hash" || true
echo "Pinning $hash to Chainstack"
curl -s --request POST --url https://api.chainstack.com/v1/ipfs/pins/pinbycid --header 'accept: application/json' --header 'authorization: Bearer ${{ secrets.CHAINSTACK_API_KEY }}' --header 'content-type: application/json' --data "{\"bucket_id\": \"BUCK-8412-8292-8457\", \"cid\": \"$hash\"}" || true
done
# Write IPFS hashes to a file
Expand Down

0 comments on commit 8444e4b

Please sign in to comment.