,
22 | }
23 | ```
24 |
--------------------------------------------------------------------------------
/vocs/docs/pages/rpc-providers/http-provider.md:
--------------------------------------------------------------------------------
1 | ## HTTP Provider
2 |
3 | The `Http` provider establishes an HTTP connection with a node, allowing you to send JSON-RPC requests to the node to fetch data, simulate calls, send transactions and much more.
4 |
5 | ### Initializing an Http Provider
6 |
7 | The recommended way of initializing a `Http` provider is by using the [`connect_http`](https://docs.rs/alloy/latest/alloy/providers/struct.ProviderBuilder.html#method.connect_http) method on the [`ProviderBuilder`](https://docs.rs/alloy/latest/alloy/providers/struct.ProviderBuilder.html).
8 |
9 | ```rust
10 | //! Example of creating an HTTP provider using the `connect_http` method on the `ProviderBuilder`.
11 |
12 | use alloy::providers::{Provider, ProviderBuilder}; // [!code focus]
13 | use std::error::Error;
14 |
15 | #[tokio::main]
16 | async fn main() -> Result<(), Box