feat: add handshake with query for n2c (#266)

This commit is contained in:
Andrew Westberg 2023-06-27 12:46:24 -04:00 committed by GitHub
parent 31a87032ca
commit 554fa1578e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 138 additions and 28 deletions

View file

@ -55,7 +55,15 @@ async fn main() {
// we connect to the unix socket of the local node. Make sure you have the right
// path for your environment
let mut client = NodeClient::connect("/tmp/node.socket", MAINNET_MAGIC)
let socket_path = "/tmp/node.socket";
// we connect to the unix socket of the local node and perform a handshake query
let version_table = NodeClient::handshake_query(socket_path, MAINNET_MAGIC)
.await
.unwrap();
info!("handshake query result: {:?}", version_table);
let mut client = NodeClient::connect(socket_path, MAINNET_MAGIC)
.await
.unwrap();