diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index f723caa1be..dcb5b37774 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -48,7 +48,7 @@ jobs: # this might remove tools that are actually needed, # if set to "true" but frees about 6 GB tool-cache: false - + # all of these default to true, but feel free to set to # "false" if necessary for your workflow android: true @@ -66,7 +66,7 @@ jobs: run: | wget http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_128.0.6613.137-1_amd64.deb sudo apt-get install ./google-chrome-stable_128.0.6613.137-1_amd64.deb - + - name: Checkout uses: actions/checkout@v4 @@ -136,9 +136,9 @@ jobs: PRIVATE_KEY_CCTP: ${{ secrets.E2E_PRIVATE_KEY_CCTP }} NEXT_PUBLIC_IS_E2E_TEST: true NEXT_PUBLIC_INFURA_KEY: ${{ secrets.NEXT_PUBLIC_INFURA_KEY }} - NEXT_PUBLIC_LOCAL_ETHEREUM_RPC_URL: http://127.0.0.1:8545 - NEXT_PUBLIC_LOCAL_ARBITRUM_RPC_URL: http://127.0.0.1:8547 - NEXT_PUBLIC_LOCAL_L3_RPC_URL: http://127.0.0.1:3347 + NEXT_PUBLIC_RPC_URL_NITRO_TESTNODE_L1: http://127.0.0.1:8545 + NEXT_PUBLIC_RPC_URL_NITRO_TESTNODE_L2: http://127.0.0.1:8547 + NEXT_PUBLIC_RPC_URL_NITRO_TESTNODE_L3: http://127.0.0.1:3347 - name: Archive e2e artifacts uses: actions/upload-artifact@v4 diff --git a/README.md b/README.md index 74739c0054..a57218f6fc 100644 --- a/README.md +++ b/README.md @@ -73,9 +73,9 @@ Interested in contributing to this repo? We welcome your contribution. 4. For custom urls, set optional vars: - - `NEXT_PUBLIC_ETHEREUM_RPC_URL=my-eth-node` - - `NEXT_PUBLIC_SEPOLIA_RPC_URL=my-sepolia-node` - (see [.env.sample](./packages/arb-token-bridge-ui/.env.sample)) + - `NEXT_PUBLIC_RPC_URL_ETHEREUM=my-eth-node` + - `NEXT_PUBLIC_RPC_URL_SEPOLIA=my-sepolia-node` + (see [.env.local.sample](./packages/arb-token-bridge-ui/.env.local.sample)) If no custom URL is provided, Infura will be used by default. 5. Build the project and internal packages diff --git a/packages/arb-token-bridge-ui/.e2e.env.sample b/packages/arb-token-bridge-ui/.e2e.env.sample index 28ca742afc..f19f94abc2 100644 --- a/packages/arb-token-bridge-ui/.e2e.env.sample +++ b/packages/arb-token-bridge-ui/.e2e.env.sample @@ -1,9 +1,9 @@ NEXT_PUBLIC_INFURA_KEY= NETWORK_NAME=localhost -NEXT_PUBLIC_LOCAL_ETHEREUM_RPC_URL=http://127.0.0.1:8545 -NEXT_PUBLIC_LOCAL_ARBITRUM_RPC_URL=http://127.0.0.1:8547 -NEXT_PUBLIC_LOCAL_L3_RPC_URL=http://127.0.0.1:3347 +NEXT_PUBLIC_RPC_URL_NITRO_TESTNODE_L1=http://127.0.0.1:8545 +NEXT_PUBLIC_RPC_URL_NITRO_TESTNODE_L2=http://127.0.0.1:8547 +NEXT_PUBLIC_RPC_URL_NITRO_TESTNODE_L3=http://127.0.0.1:3347 CYPRESS_RECORD_VIDEO=false diff --git a/packages/arb-token-bridge-ui/.env.local.sample b/packages/arb-token-bridge-ui/.env.local.sample index 6461aa06bf..bb2d9a54f5 100644 --- a/packages/arb-token-bridge-ui/.env.local.sample +++ b/packages/arb-token-bridge-ui/.env.local.sample @@ -1,26 +1,39 @@ +# ----- Infura ----- + # Default Infura key. If no network-specific keys are set, it will fallback to this key. NEXT_PUBLIC_INFURA_KEY= -# L1 +# L1 Mainnet NEXT_PUBLIC_INFURA_KEY_ETHEREUM= + # L1 Testnet NEXT_PUBLIC_INFURA_KEY_SEPOLIA= NEXT_PUBLIC_INFURA_KEY_HOLESKY= -# L2 +# L2 Mainnet NEXT_PUBLIC_INFURA_KEY_ARBITRUM_ONE= NEXT_PUBLIC_INFURA_KEY_BASE= + # L2 Testnet NEXT_PUBLIC_INFURA_KEY_ARBITRUM_SEPOLIA= NEXT_PUBLIC_INFURA_KEY_BASE_SEPOLIA= -NEXT_PUBLIC_SENTRY_DSN= +# ----- Custom RPCs ----- -NEXT_PUBLIC_ETHEREUM_RPC_URL= -NEXT_PUBLIC_SEPOLIA_RPC_URL= +# L1 Mainnet +NEXT_PUBLIC_RPC_URL_ETHEREUM= -NEXT_PUBLIC_LOCAL_ETHEREUM_RPC_URL="http://localhost:8545" -NEXT_PUBLIC_LOCAL_ARBITRUM_RPC_URL="http://localhost:8547" +# L1 Testnet +NEXT_PUBLIC_RPC_URL_SEPOLIA= + +# Nitro Testnode +NEXT_PUBLIC_RPC_URL_NITRO_TESTNODE_L1="http://127.0.0.1:8545" +NEXT_PUBLIC_RPC_URL_NITRO_TESTNODE_L2="http://127.0.0.1:8547" +NEXT_PUBLIC_RPC_URL_NITRO_TESTNODE_L3="http://127.0.0.1:3347" + +# ----- Other ----- + +NEXT_PUBLIC_SENTRY_DSN= NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID= diff --git a/packages/arb-token-bridge-ui/src/hooks/__tests__/useBalance.test.tsx b/packages/arb-token-bridge-ui/src/hooks/__tests__/useBalance.test.tsx index 033fa1da6c..c248098b40 100644 --- a/packages/arb-token-bridge-ui/src/hooks/__tests__/useBalance.test.tsx +++ b/packages/arb-token-bridge-ui/src/hooks/__tests__/useBalance.test.tsx @@ -17,7 +17,7 @@ const Container = ({ children }: PropsWithChildren) => ( ) const provider = new StaticJsonRpcProvider( - process.env.NEXT_PUBLIC_ETHEREUM_RPC_URL, + process.env.NEXT_PUBLIC_RPC_URL_ETHEREUM, 1 ) jest.mock('../../token-bridge-sdk/utils', () => ({ diff --git a/packages/arb-token-bridge-ui/src/util/networks.ts b/packages/arb-token-bridge-ui/src/util/networks.ts index a28f528d29..bb3fa0dbaa 100644 --- a/packages/arb-token-bridge-ui/src/util/networks.ts +++ b/packages/arb-token-bridge-ui/src/util/networks.ts @@ -205,12 +205,12 @@ export const supportedCustomOrbitParentChains = [ export const rpcURLs: { [chainId: number]: string } = { // L1 [ChainId.Ethereum]: loadEnvironmentVariableWithFallback({ - env: process.env.NEXT_PUBLIC_ETHEREUM_RPC_URL, + env: process.env.NEXT_PUBLIC_RPC_URL_ETHEREUM, fallback: chainIdToInfuraUrl(ChainId.Ethereum) }), // L1 Testnets [ChainId.Sepolia]: loadEnvironmentVariableWithFallback({ - env: process.env.NEXT_PUBLIC_SEPOLIA_RPC_URL, + env: process.env.NEXT_PUBLIC_RPC_URL_SEPOLIA, fallback: chainIdToInfuraUrl(ChainId.Sepolia) }), [ChainId.Holesky]: 'https://ethereum-holesky-rpc.publicnode.com', @@ -414,15 +414,15 @@ export const defaultL3CustomGasTokenNetwork: ArbitrumNetwork = { } export const localL1NetworkRpcUrl = loadEnvironmentVariableWithFallback({ - env: process.env.NEXT_PUBLIC_LOCAL_ETHEREUM_RPC_URL, + env: process.env.NEXT_PUBLIC_RPC_URL_NITRO_TESTNODE_L1, fallback: 'http://127.0.0.1:8545' }) export const localL2NetworkRpcUrl = loadEnvironmentVariableWithFallback({ - env: process.env.NEXT_PUBLIC_LOCAL_ARBITRUM_RPC_URL, + env: process.env.NEXT_PUBLIC_RPC_URL_NITRO_TESTNODE_L2, fallback: 'http://127.0.0.1:8547' }) export const localL3NetworkRpcUrl = loadEnvironmentVariableWithFallback({ - env: process.env.NEXT_PUBLIC_LOCAL_L3_RPC_URL, + env: process.env.NEXT_PUBLIC_RPC_URL_NITRO_TESTNODE_L3, fallback: 'http://127.0.0.1:3347' }) diff --git a/packages/arb-token-bridge-ui/src/util/wagmi/setup.ts b/packages/arb-token-bridge-ui/src/util/wagmi/setup.ts index 3e119caae0..aded4842ab 100644 --- a/packages/arb-token-bridge-ui/src/util/wagmi/setup.ts +++ b/packages/arb-token-bridge-ui/src/util/wagmi/setup.ts @@ -3,7 +3,11 @@ import { mainnet, arbitrum } from '@wagmi/core/chains' import { publicProvider } from 'wagmi/providers/public' import { jsonRpcProvider } from 'wagmi/providers/jsonRpc' import { connectorsForWallets, getDefaultWallets } from '@rainbow-me/rainbowkit' -import { trustWallet, okxWallet } from '@rainbow-me/rainbowkit/wallets' +import { + trustWallet, + okxWallet, + rabbyWallet +} from '@rainbow-me/rainbowkit/wallets' import { sepolia, @@ -178,7 +182,7 @@ export function getProps(targetChainKey: string | null) { ...wallets, { groupName: 'More', - wallets: [trustWallet({ chains, projectId })] + wallets: [trustWallet({ chains, projectId }), rabbyWallet({ chains })] } ]) diff --git a/packages/arb-token-bridge-ui/synpress.cctp.config.ts b/packages/arb-token-bridge-ui/synpress.cctp.config.ts index bc6679e52f..348a7a1509 100644 --- a/packages/arb-token-bridge-ui/synpress.cctp.config.ts +++ b/packages/arb-token-bridge-ui/synpress.cctp.config.ts @@ -66,7 +66,7 @@ if (!process.env.PRIVATE_KEY_USER) { const SEPOLIA_INFURA_RPC_URL = `https://sepolia.infura.io/v3/${INFURA_KEY}` const sepoliaRpcUrl = - process.env.NEXT_PUBLIC_SEPOLIA_RPC_URL ?? SEPOLIA_INFURA_RPC_URL + process.env.NEXT_PUBLIC_RPC_URL_SEPOLIA ?? SEPOLIA_INFURA_RPC_URL const arbSepoliaRpcUrl = 'https://sepolia-rollup.arbitrum.io/rpc' const sepoliaProvider = new StaticJsonRpcProvider(sepoliaRpcUrl) diff --git a/packages/arb-token-bridge-ui/synpress.config.ts b/packages/arb-token-bridge-ui/synpress.config.ts index 31ae417ba1..da2deeeae7 100644 --- a/packages/arb-token-bridge-ui/synpress.config.ts +++ b/packages/arb-token-bridge-ui/synpress.config.ts @@ -77,17 +77,23 @@ export default defineConfig({ const isCustomFeeToken = isNonZeroAddress(ethBridger.nativeToken) if (!ethRpcUrl && !isOrbitTest) { - throw new Error('NEXT_PUBLIC_LOCAL_ETHEREUM_RPC_URL variable missing.') + throw new Error( + 'NEXT_PUBLIC_RPC_URL_NITRO_TESTNODE_L1 variable missing.' + ) } if (!arbRpcUrl) { - throw new Error('NEXT_PUBLIC_LOCAL_ARBITRUM_RPC_URL variable missing.') + throw new Error( + 'NEXT_PUBLIC_RPC_URL_NITRO_TESTNODE_L2 variable missing.' + ) } if (!l3RpcUrl && isOrbitTest) { - throw new Error('NEXT_PUBLIC_LOCAL_L3_RPC_URL variable missing.') + throw new Error( + 'NEXT_PUBLIC_RPC_URL_NITRO_TESTNODE_L3 variable missing.' + ) } if (!sepoliaRpcUrl) { throw new Error( - 'process.env.NEXT_PUBLIC_SEPOLIA_RPC_URL variable missing.' + 'process.env.NEXT_PUBLIC_RPC_URL_SEPOLIA variable missing.' ) } @@ -246,19 +252,19 @@ const ethRpcUrl = (() => { // For consistency purpose, we would be using 'custom-localhost' // MetaMask auto-detects same rpc url and blocks adding new custom network with same rpc // so we have to add a / to the end of the rpc url - if (!process.env.NEXT_PUBLIC_LOCAL_ETHEREUM_RPC_URL) { + if (!process.env.NEXT_PUBLIC_RPC_URL_NITRO_TESTNODE_L1) { return MAINNET_INFURA_RPC_URL } - if (process.env.NEXT_PUBLIC_LOCAL_ETHEREUM_RPC_URL.endsWith('/')) { - return process.env.NEXT_PUBLIC_LOCAL_ETHEREUM_RPC_URL + if (process.env.NEXT_PUBLIC_RPC_URL_NITRO_TESTNODE_L1.endsWith('/')) { + return process.env.NEXT_PUBLIC_RPC_URL_NITRO_TESTNODE_L1 } - return process.env.NEXT_PUBLIC_LOCAL_ETHEREUM_RPC_URL + '/' + return process.env.NEXT_PUBLIC_RPC_URL_NITRO_TESTNODE_L1 + '/' })() -const arbRpcUrl = process.env.NEXT_PUBLIC_LOCAL_ARBITRUM_RPC_URL -const l3RpcUrl = process.env.NEXT_PUBLIC_LOCAL_L3_RPC_URL +const arbRpcUrl = process.env.NEXT_PUBLIC_RPC_URL_NITRO_TESTNODE_L2 +const l3RpcUrl = process.env.NEXT_PUBLIC_RPC_URL_NITRO_TESTNODE_L3 const sepoliaRpcUrl = - process.env.NEXT_PUBLIC_SEPOLIA_RPC_URL ?? SEPOLIA_INFURA_RPC_URL + process.env.NEXT_PUBLIC_RPC_URL_SEPOLIA ?? SEPOLIA_INFURA_RPC_URL const arbSepoliaRpcUrl = 'https://sepolia-rollup.arbitrum.io/rpc' const parentProvider = new StaticJsonRpcProvider(