Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jxom authored May 30, 2024
1 parent 6bcd848 commit 2e9b24b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
# http-proxy-pool

```ts
import { createProxyPool } from 'http-proxy-pool'
import { defineProxyPool } from 'http-proxy-pool'
import { alto, anvil } from 'http-proxy-pool/instances/ethereum'

const executionPool = createProxyPool({
const executionProxy = defineProxyPool({
instance: anvil({
// ...
forkRpcUrl: 'https://cloudflare-eth.com'
}),
port: 8545,
})

await executionPool.start()
await executionProxy.start()
// Instances started at:
// "http://localhost:8545/1"
// "http://localhost:8545/2"
// "http://localhost:8545/3"
// "http://localhost:8545/n"

const bundlerPool = createProxyPool({
const bundlerProxy = defineProxyPool({
instance: ({ id }) => alto({
// ...
executionRpcUrl: `${executionPool.hostname}/${id}`
}),
port: 4337,
})

await bundlerPool.start()
await bundlerProxy.start()
// Instances started at:
// "http://localhost:4337/1" (executionRpcUrl: "http://localhost:8545/1")
// "http://localhost:4337/2" (executionRpcUrl: "http://localhost:8545/2")
// "http://localhost:4337/3" (executionRpcUrl: "http://localhost:8545/3")
// "http://localhost:4337/n" (executionRpcUrl: "http://localhost:8545/n")
```
```

0 comments on commit 2e9b24b

Please sign in to comment.