Crates.io | linera-alloy-provider |
lib.rs | linera-alloy-provider |
version | 0.1.0 |
source | src |
created_at | 2024-06-01 09:29:36.394579 |
updated_at | 2024-06-01 09:29:36.394579 |
description | Interface with an Ethereum blockchain |
homepage | https://github.com/MathieuDutSik/alloy |
repository | https://github.com/MathieuDutSik/alloy |
max_upload_size | |
id | 1258587 |
size | 199,887 |
Interface with an Ethereum blockchain.
This crate contains the Provider
trait, which exposes Ethereum JSON-RPC
methods. Providers in alloy are similar to ethers.js
providers. They manage
an RpcClient
and allow other parts of the program to easily make RPC calls.
Unlike an ethers.js
Provider, an alloy Provider is network-aware. It is
parameterized with a Network
from [linera-alloy-networks
]. This allows the Provider
to expose a consistent interface to the rest of the program, while adjusting
request and response types to match the underlying blockchain.
Providers can be composed via stacking. For example, a Provider
that tracks
the nonce for a given address can be stacked onto a Provider
that signs
transactions to create a Provider
that can send signed transactions with
correct nonces.
The ProviderBuilder
struct can quickly create a stacked provider, similar to
tower::ServiceBuilder
.
pubsub
- Enable support for subscription methods.ws
- Enable WebSocket support. Implictly enables pubsub
.ipc
- Enable IPC support. Implictly enables pubsub
.TODO :)