Allow polymorphic content in chain-sync
This commit is contained in:
parent
99f42632fc
commit
cb2f243fa6
3 changed files with 90 additions and 25 deletions
|
|
@ -1,4 +1,4 @@
|
|||
use pallas_chainsync::{Consumer, Point};
|
||||
use pallas_chainsync::{ClientConsumer, Point};
|
||||
use pallas_handshake::n2c::{Client, VersionTable};
|
||||
use pallas_handshake::MAINNET_MAGIC;
|
||||
use pallas_machines::run_agent;
|
||||
|
|
@ -8,6 +8,8 @@ use std::os::unix::net::UnixStream;
|
|||
fn main() {
|
||||
env_logger::init();
|
||||
|
||||
// we connect to the unix socket of the local node. Make sure you have the right
|
||||
// path for your environment
|
||||
let bearer = UnixStream::connect("/tmp/node.socket").unwrap();
|
||||
|
||||
let mut muxer = Multiplexer::try_setup(bearer, &vec![0, 4, 5]).unwrap();
|
||||
|
|
@ -24,7 +26,7 @@ fn main() {
|
|||
)];
|
||||
|
||||
let (cs_rx, cs_tx) = muxer.use_channel(5);
|
||||
let cs = Consumer::initial(known_points);
|
||||
let cs = ClientConsumer::initial(known_points);
|
||||
let cs = run_agent(cs, cs_rx, &cs_tx).unwrap();
|
||||
println!("{:?}", cs);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
use net2::TcpStreamExt;
|
||||
use std::net::TcpStream;
|
||||
|
||||
use pallas_chainsync::{Consumer, Point};
|
||||
use pallas_chainsync::{ClientConsumer, Point};
|
||||
use pallas_handshake::n2n::{Client, VersionTable};
|
||||
use pallas_handshake::MAINNET_MAGIC;
|
||||
use pallas_machines::run_agent;
|
||||
|
|
@ -29,7 +29,7 @@ fn main() {
|
|||
|
||||
let (cs_rx, cs_tx) = muxer.use_channel(2);
|
||||
|
||||
let cs = Consumer::initial(known_points);
|
||||
let cs = ClientConsumer::initial(known_points);
|
||||
let cs = run_agent(cs, cs_rx, &cs_tx).unwrap();
|
||||
|
||||
println!("{:?}", cs);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue