Merge pull request #83 from garious/tcp-client

TCP subscription service
This commit is contained in:
Greg Fitzgerald
2018-03-28 13:19:38 -06:00
committed by GitHub
3 changed files with 73 additions and 59 deletions

View File

@@ -6,7 +6,7 @@ use solana::mint::Mint;
use solana::signature::{KeyPair, KeyPairUtil};
use solana::transaction::Transaction;
use std::io::stdin;
use std::net::UdpSocket;
use std::net::{TcpStream, UdpSocket};
use std::time::Instant;
fn main() {
@@ -18,7 +18,8 @@ fn main() {
let mint_pubkey = mint.pubkey();
let socket = UdpSocket::bind(send_addr).unwrap();
let mut acc = AccountantStub::new(addr, socket);
let stream = TcpStream::connect(send_addr).unwrap();
let mut acc = AccountantStub::new(addr, socket, stream);
let last_id = acc.get_last_id().unwrap();
let txs = acc.get_balance(&mint_pubkey).unwrap().unwrap();