Skip to content

Commit

Permalink
fix: force the infuraKey for the web3 provider to be different from t… (
Browse files Browse the repository at this point in the history
#683)

* fix: force the infuraKey for the web3 provider to be different from the IPFS Infura project ID

* adapt Chromatic config
  • Loading branch information
levalleux-ludo authored Mar 18, 2024
1 parent afcf2c8 commit cc35d57
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/chromatic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
uses: SpicyPizza/[email protected]
with:
envkey_REACT_APP_WALLET_CONNECT_PROJECT_ID: ${{ secrets.REACT_APP_WALLET_CONNECT_PROJECT_ID }}
envkey_STORYBOOK_INFURA_PROJECT_SECRET: ${{ secrets.INFURA_PROJECT_SECRET }}
envkey_STORYBOOK_REACT_APP_INFURA_KEY: ${{ secrets.REACT_APP_INFURA_KEY }}
envkey_STORYBOOK_REACT_APP_MAGIC_API_KEY: ${{ secrets.REACT_APP_MAGIC_API_KEY }}
directory: ./packages/react-kit
file_name: .env
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/pin-to-pinata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,52 +34,52 @@ jobs:
env:
PINATA_JWT: ${{ secrets.PINATA_JWT }}
INFURA_PROJECT_ID: ${{ secrets.INFURA_PROJECT_ID }}
STORYBOOK_INFURA_PROJECT_SECRET: ${{ secrets.STORYBOOK_INFURA_PROJECT_SECRET }}
STORYBOOK_REACT_APP_INFURA_KEY: ${{ secrets.STORYBOOK_REACT_APP_INFURA_KEY }}
run: |
echo "Pin for testing/mumbai env..."
npm run pin-to-pinata -- \
-e testing \
-c testing-80001-0 \
-fd ${{ env.FROM_DATE }} \
-p ${{ env.PINATA_JWT }} \
-i ${{ env.INFURA_PROJECT_ID }}/${{ env.STORYBOOK_INFURA_PROJECT_SECRET }}
-i ${{ env.INFURA_PROJECT_ID }}/${{ env.STORYBOOK_REACT_APP_INFURA_KEY }}
echo "Pin for testing/goerli env..."
npm run pin-to-pinata -- \
-e testing \
-c testing-5-0 \
-fd ${{ env.FROM_DATE }} \
-p ${{ env.PINATA_JWT }} \
-i ${{ env.INFURA_PROJECT_ID }}/${{ env.STORYBOOK_INFURA_PROJECT_SECRET }}
-i ${{ env.INFURA_PROJECT_ID }}/${{ env.STORYBOOK_REACT_APP_INFURA_KEY }}
echo "Pin for staging/mumbai env..."
npm run pin-to-pinata -- \
-e staging \
-c staging-80001-0 \
-fd ${{ env.FROM_DATE }} \
-p ${{ env.PINATA_JWT }} \
-i ${{ env.INFURA_PROJECT_ID }}/${{ env.STORYBOOK_INFURA_PROJECT_SECRET }}
-i ${{ env.INFURA_PROJECT_ID }}/${{ env.STORYBOOK_REACT_APP_INFURA_KEY }}
echo "Pin for staging/goerli env..."
npm run pin-to-pinata -- \
-e staging \
-c staging-5-0 \
-fd ${{ env.FROM_DATE }} \
-p ${{ env.PINATA_JWT }} \
-i ${{ env.INFURA_PROJECT_ID }}/${{ env.STORYBOOK_INFURA_PROJECT_SECRET }}
-i ${{ env.INFURA_PROJECT_ID }}/${{ env.STORYBOOK_REACT_APP_INFURA_KEY }}
echo "Pin for production/polygon env..."
npm run pin-to-pinata -- \
-e production \
-c production-137-0 \
-fd ${{ env.FROM_DATE }} \
-p ${{ env.PINATA_JWT }} \
-i ${{ env.INFURA_PROJECT_ID }}/${{ env.STORYBOOK_INFURA_PROJECT_SECRET }}
-i ${{ env.INFURA_PROJECT_ID }}/${{ env.STORYBOOK_REACT_APP_INFURA_KEY }}
echo "Pin for production/ethereum env..."
npm run pin-to-pinata -- \
-e production \
-c production-1-0 \
-fd ${{ env.FROM_DATE }} \
-p ${{ env.PINATA_JWT }} \
-i ${{ env.INFURA_PROJECT_ID }}/${{ env.STORYBOOK_INFURA_PROJECT_SECRET }}
-i ${{ env.INFURA_PROJECT_ID }}/${{ env.STORYBOOK_REACT_APP_INFURA_KEY }}
2 changes: 1 addition & 1 deletion packages/react-kit/.env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
REACT_APP_WALLET_CONNECT_PROJECT_ID=
STORYBOOK_REACT_APP_MAGIC_API_KEY=
STORYBOOK_INFURA_PROJECT_SECRET=
STORYBOOK_REACT_APP_INFURA_KEY=
STORYBOOK_DATA_TOKENS_LIST=
STORYBOOK_DATA_ENV_NAME=
STORYBOOK_DATA_SELLER_ID=
Expand Down
7 changes: 3 additions & 4 deletions packages/react-kit/src/lib/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ if (!magicLinkKey) {
);
}
const infuraKey =
process.env.STORYBOOK_INFURA_PROJECT_SECRET ||
process.env.INFURA_PROJECT_SECRET ||
process.env.REACT_APP_INFURA_IPFS_PROJECT_SECRET;
process.env.STORYBOOK_REACT_APP_INFURA_KEY ||
process.env.REACT_APP_INFURA_KEY;
if (!infuraKey) {
throw new Error(
"STORYBOOK_INFURA_PROJECT_SECRET/INFURA_PROJECT_SECRET/REACT_APP_INFURA_IPFS_PROJECT_SECRET is not defined"
"STORYBOOK_REACT_APP_INFURA_KEY/REACT_APP_INFURA_KEY is not defined"
);
}

Expand Down

0 comments on commit cc35d57

Please sign in to comment.