Line data Source code
1 : #include "fd_rpc_client.h" 2 : #include "fd_rpc_client_private.h" 3 : 4 : #include "../../../util/fd_util.h" 5 : #include "../../../util/net/fd_ip4.h" 6 : 7 : #include <stdio.h> 8 : 9 : int 10 : main( int argc, 11 0 : char ** argv ) { 12 0 : fd_boot( &argc, &argv ); 13 : 14 0 : fd_rpc_client_t _rpc[1]; 15 0 : void * shrpc = fd_rpc_client_new( _rpc, FD_IP4_ADDR(127, 0, 0, 1), 8899 ); FD_TEST( !!shrpc ); 16 0 : fd_rpc_client_t * rpc = fd_rpc_client_join( shrpc ); FD_TEST( !!rpc ); 17 : 18 0 : long request_id = fd_rpc_client_request_transaction_count( rpc ); 19 0 : FD_TEST( request_id>=0 ); 20 0 : fd_rpc_client_response_t * response = fd_rpc_client_status( rpc, request_id, 1 ); 21 0 : FD_TEST( !!response ); 22 : 23 0 : FD_TEST( response->status==FD_RPC_CLIENT_SUCCESS ); 24 : 25 0 : printf( "%lu\n", response->result.transaction_count.transaction_count ); 26 : 27 0 : fd_halt(); 28 0 : return 0; 29 0 : }