Skip to content
Open
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
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,31 @@ await server.start()
// "http://localhost:8545/n"
```

#### Viem Test Client

```ts
import { Instance, Server } from 'prool'
import { createTestClient, http } from 'viem'
import { foundry } from 'viem/chains'

const server = Server.create({
instance: Instance.anvil(),
})
await server.start()

const client = createTestClient({
chain: foundry,
mode: 'anvil',
transport: http('http://localhost:8545/1'),
})

await client.mine({ blocks: 1 })
```

The server lazily starts the Anvil instance for `/1` when the test client sends
its first request. To start it eagerly, request `http://localhost:8545/1/start`
before creating the client.

### Tempo (Execution Node)

#### Requirements
Expand Down Expand Up @@ -264,4 +289,4 @@ const instance_3 = await pool.start(3)

## License

[MIT](/LICENSE) License
[MIT](/LICENSE) License