[RPC] Upgrade jsonrpsee to solved HttpClient Port force check
The currently used jsonrpsee version is 0.16. When the rpc client creates the HttpClientBuilder, if the seed node https:://dev-seed.rooch.network/ is passed in, an error will be thrown.
Error: Networking or low-level protocol error: Invalid Url: Port number is missing in the URL
The reason is that jsonrpsee 0.16 and previous versions have a bug when constructing the http client, which requires the port to be forced to be passed in. The 0.17 version fixes the bug and automatically recognizes https and http, and then adds port 443 or 80.
However, starting from version 0.17, the HttpClient and RpcResult structures of jsonrpsee have undergone major changes.
- HttpClient has added generics.
/// HTTP Transport Client.
#[derive(Debug, Clone)]
pub struct HttpTransportClient<S> {
/// Target to connect to.
target: String,
/// HTTP client
client: S,
/// Configurable max request body size
max_request_size: u32,
/// Configurable max response body size
max_response_size: u32,
/// Max length for logging for requests and responses
///
/// Logs bigger than this limit will be truncated.
max_log_length: u32,
/// Custom headers to pass with every request.
headers: HeaderMap,
}
- RpcResult is adjusted from std::result::Result<T, Error> to std::result::Result<T, ErrorObjectOwned>
When upgrading jsonrpsee, need to refactor the RPC server and RPC client before. Also ensure compatibility of RPC returns.
Workaround solution, display specified port, such as https://dev-seed.rooch.network:443/