Create an HTTP provider pointed at the node's public RPC endpoint.
(&self)
| 152 | |
| 153 | /// Create an HTTP provider pointed at the node's public RPC endpoint. |
| 154 | pub fn provider(&self) -> Result<RootProvider<Base>> { |
| 155 | let url = format!("http://{}", self.http_api_addr); |
| 156 | let client = RpcClient::builder().http(url.parse()?); |
| 157 | Ok(RootProvider::<Base>::new(client)) |
| 158 | } |
| 159 | |
| 160 | /// HTTP RPC address for the local node. |
| 161 | pub const fn http_addr(&self) -> SocketAddr { |