Skip to content

Commit

Permalink
Merge pull request #450 from ourzora/switch-to-tenderly
Browse files Browse the repository at this point in the history
Add tenderly rpc endpoints
  • Loading branch information
neokry authored Apr 16, 2024
2 parents 2787448 + 8d9be7b commit 85617b2
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 20 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Add the following variables to `apps/web/.env.local`:

```
#alchemy
NEXT_PUBLIC_ALCHEMY_ID=<ALCHEMY_API_KEY>
NEXT_PUBLIC_TENDERLY_RPC_KEY=<ALCHEMY_API_KEY>
#tenderly
Expand Down
3 changes: 1 addition & 2 deletions apps/web/.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@

NEXT_PUBLIC_UPLOAD_API=https://upload-api.zora.co
NEXT_PUBLIC_IPFS_GATEWAY=https://ipfs.decentralized-content.com
NEXT_PUBLIC_CHAIN_ID=5
NEXT_PUBLIC_NETWORK_TYPE=mainnet
NEXT_PUBLIC_NETWORK_TYPE=testnet
10 changes: 5 additions & 5 deletions apps/web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ Nouns Builder currently only supports two networks: `mainnet` and `goerli testne
You can swap out the environment variables as defined below to run against mainnnet or testnet locally.

```
# the default chain id defined in .env, to run against testnet
NEXT_PUBLIC_ALCHEMY_ID=<TESTNET_ALCHEMY_API_KEY>
NEXT_PUBLIC_CHAIN_ID=5
# the default network type is defined in .env, to run against testnet
NEXT_PUBLIC_TENDERLY_RPC_KEY=<TENDERLY_RPC_API_KEY>
NEXT_PUBLIC_NETWORK_TYPE="testnet"
# to run against mainnet locally
NEXT_PUBLIC_ALCHEMY_ID=<MAINNET_ALCHEMY_API_KEY>
NEXT_PUBLIC_CHAIN_ID=1
NEXT_PUBLIC_TENDERLY_RPC_KEY=<TENDERLY_RPC_API_KEY>
NEXT_PUBLIC_NETWORK_TYPE="mainnet"
```

### Writing Tests
Expand Down
12 changes: 6 additions & 6 deletions apps/web/src/constants/rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import { foundry } from 'wagmi/chains'
import { CHAIN_ID } from 'src/typings'

export const RPC_URL = {
[CHAIN_ID.ETHEREUM]: `https://eth-mainnet.g.alchemy.com/v2/${process.env.NEXT_PUBLIC_ALCHEMY_ID}`,
[CHAIN_ID.OPTIMISM]: `https://opt-mainnet.g.alchemy.com/v2/${process.env.NEXT_PUBLIC_ALCHEMY_ID}`,
[CHAIN_ID.SEPOLIA]: `https://eth-sepolia.g.alchemy.com/v2/${process.env.NEXT_PUBLIC_ALCHEMY_ID}`,
[CHAIN_ID.OPTIMISM_SEPOLIA]: `https://opt-sepolia.g.alchemy.com/v2/${process.env.NEXT_PUBLIC_ALCHEMY_ID}`,
[CHAIN_ID.BASE]: `https://hardworking-wild-arm.base-mainnet.discover.quiknode.pro/${process.env.NEXT_PUBLIC_QUICKNODE_ID}`,
[CHAIN_ID.BASE_SEPOLIA]: 'https://sepolia.base.org',
[CHAIN_ID.ETHEREUM]: ` https://mainnet.gateway.tenderly.co/${process.env.NEXT_PUBLIC_TENDERLY_RPC_KEY}`,
[CHAIN_ID.OPTIMISM]: `https://optimism.gateway.tenderly.co/${process.env.NEXT_PUBLIC_TENDERLY_RPC_KEY}`,
[CHAIN_ID.SEPOLIA]: ` https://sepolia.gateway.tenderly.co/${process.env.NEXT_PUBLIC_TENDERLY_RPC_KEY}`,
[CHAIN_ID.OPTIMISM_SEPOLIA]: `https://optimism-sepolia.gateway.tenderly.co/${process.env.NEXT_PUBLIC_TENDERLY_RPC_KEY}`,
[CHAIN_ID.BASE]: `https://base.gateway.tenderly.co/${process.env.NEXT_PUBLIC_TENDERLY_RPC_KEY}`,
[CHAIN_ID.BASE_SEPOLIA]: `https://base-sepolia.gateway.tenderly.co/${process.env.NEXT_PUBLIC_TENDERLY_RPC_KEY}`,
[CHAIN_ID.ZORA]: 'https://rpc.zora.energy',
[CHAIN_ID.ZORA_SEPOLIA]: 'https://sepolia.rpc.zora.energy',
[CHAIN_ID.FOUNDRY]: foundry.rpcUrls.default.http[0],
Expand Down
4 changes: 0 additions & 4 deletions apps/web/src/data/contract/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
zora,
zoraSepolia,
} from 'wagmi/chains'
import { alchemyProvider } from 'wagmi/providers/alchemy'
import { jsonRpcProvider } from 'wagmi/providers/jsonRpc'

import { PUBLIC_IS_TESTNET } from 'src/constants/defaultChains'
Expand All @@ -29,9 +28,6 @@ export const L2_CHAINS = PUBLIC_IS_TESTNET
const { chains, publicClient } = configureChains(
[...TESTNET_CHAINS, ...MAINNET_CHAINS],
[
alchemyProvider({
apiKey: process.env.NEXT_PUBLIC_ALCHEMY_ID as string,
}),
jsonRpcProvider({
rpc: (chain) => ({
http: RPC_URL[chain.id as CHAIN_ID],
Expand Down
3 changes: 1 addition & 2 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@
"PRIVATE_ALCHEMY_ID",
"PRIVATE_REDIS_CONNECTION_URI",
"ETHERSCAN_API_KEY",
"NEXT_PUBLIC_CHAIN_ID",
"NEXT_PUBLIC_UPLOAD_API",
"NEXT_PUBLIC_IPFS_UPLOAD_API",
"NEXT_PUBLIC_ALCHEMY_ID",
"NEXT_PUBLIC_TENDERLY_RPC_KEY",
"NEXT_PUBLIC_QUICKNODE_ID",
"NEXT_PUBLIC_IPFS_GATEWAY",
"NEXT_PUBLIC_SENTRY_DSN",
Expand Down

0 comments on commit 85617b2

Please sign in to comment.