Skip to content

Commit

Permalink
script to upload tally.json to ipfs
Browse files Browse the repository at this point in the history
  • Loading branch information
yuetloo committed Jan 2, 2024
1 parent 443f899 commit 1ba175e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions contracts/sh/upload-tally.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -e


# Upload the tally.json file in the contracts directory to IPFS
#
# Usage: ./upload-tally.sh
#
# Make sure the PINATA_JWT secret is set in the AWS secrets manager
# aws scretsmanager create-secret --name PINATA_JWT --secret-string "SECRET_VALUE"
#

CONTRACTS_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && cd .. && pwd )

cd $CONTRACT_DIR
PINATA_JWT=$(aws secretsmanager get-secret-value --secret-id PINATA_JWT | jq -r '.SecretString')
curl --location --request POST 'https://api.pinata.cloud/pinning/pinFileToIPFS' \
--header "Authorization: Bearer ${PINATA_JWT}" \
--form 'file=@"tally.json"'

0 comments on commit 1ba175e

Please sign in to comment.