1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import {
createTestClient,
createPublicClient,
createWalletClient,
http,
} from 'viem'
import { goerli, optimismGoerli } from 'viem/chains'
// we should instead use .env to determine chain so we can support alternate l1/l2 pairs
const L1_CHAIN = goerli
const L2_CHAIN = optimismGoerli
const L1_RPC_URL = 'http://localhost:8545'
const L2_RPC_URL = 'http://localhost:9545'
const l1TestClient = createTestClient({
mode: 'anvil',
chain: L1_CHAIN,
transport: http(L1_RPC_URL),
})
const l2TestClient = createTestClient({
mode: 'anvil',
chain: L2_CHAIN,
transport: http(L2_RPC_URL),
})
const l1PublicClient = createPublicClient({
chain: L1_CHAIN,
transport: http(L1_RPC_URL),
})
const l2PublicClient = createPublicClient({
chain: L2_CHAIN,
transport: http(L2_RPC_URL),
})
const l1WalletClient = createWalletClient({
chain: L1_CHAIN,
transport: http(L1_RPC_URL),
})
const l2WalletClient = createWalletClient({
chain: L2_CHAIN,
transport: http(L2_RPC_URL),
})
export {
l1TestClient,
l2TestClient,
l1PublicClient,
l2PublicClient,
l1WalletClient,
l2WalletClient,
}