Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replacing hardcode RPC URLs with environment variables #248

Merged
merged 2 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/bundle-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ jobs:
cache: 'yarn'
- run: yarn install --frozen-lockfile
- run: yarn bundle
- env:
ETH_PROVIDER_URL_MAINNET: ${{ secrets.ETH_PROVIDER_URL_MAINNET }}
ETH_PROVIDER_URL_TESTNET: ${{ secrets.ETH_PROVIDER_URL_TESTNET }}
BNB_PROVIDER_URL_MAINNET: ${{ secrets.BNB_PROVIDER_URL_MAINNET }}
BNB_PROVIDER_URL_TESTNET: ${{ secrets.BNB_PROVIDER_URL_TESTNET }}
BTC_PROVIDER_URL_MAINNET: ${{ secrets.BTC_PROVIDER_URL_MAINNET }}
BTC_PROVIDER_URL_TESTNET: ${{ secrets.BTC_PROVIDER_URL_TESTNET }}

- uses: google-github-actions/setup-gcloud@v1
- uses: google-github-actions/auth@v1
with:
Expand Down
13 changes: 13 additions & 0 deletions packages/near-fast-auth-signer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,16 @@ yarn start
- Navigates to the appropate UI route (/login)
- Returns true if login was successful
- Throws error if failed or cancelled by user


### Provider URLs
To configure provider urls, configure following environment variables. For local development, simply create `.env` on root directory and configure environment variables.

```bash
ETH_PROVIDER_URL_MAINNET=''
ETH_PROVIDER_URL_TESTNET=''
BNB_PROVIDER_URL_MAINNET=''
BNB_PROVIDER_URL_TESTNET=''
BTC_PROVIDER_URL_MAINNET=''
BTC_PROVIDER_URL_TESTNET=''
```
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ const FAST_AUTH_RELAYER_URL = 'https://near-relayer-testnet.stage.api.pagoda.co'

const CHAIN_CONFIG: ChainMap = {
ETH: {
providerUrl: 'https://sepolia.infura.io/v3/6df51ccaa17f4e078325b5050da5a2dd',
providerUrl: environment.NETWORK_ID === 'mainnet' ? process.env.ETH_PROVIDER_URL_MAINNET : process.env.ETH_PROVIDER_URL_TESTNET,
},
BNB: {
providerUrl: 'https://data-seed-prebsc-1-s1.bnbchain.org:8545',
providerUrl: environment.NETWORK_ID === 'mainnet' ? process.env.BNB_PROVIDER_URL_MAINNET : process.env.BNB_PROVIDER_URL_TESTNET,
},
BTC: {
networkType: 'testnet',
networkType: environment.NETWORK_ID || 'testnet',
// API ref: https://github.com/Blockstream/esplora/blob/master/API.md
providerUrl: 'https://blockstream.info/testnet/api/',
providerUrl: environment.NETWORK_ID === 'mainnet' ? process.env.BTC_PROVIDER_URL_MAINNET : process.env.BTC_PROVIDER_URL_TESTNET,
},
};

Expand Down
Loading