Skip to content

A libp2p behaviour to enable you do request/response things upon substream.

License

Notifications You must be signed in to change notification settings

nanne007/libp2p-rpc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

libp2p-rpc

Implementation of RPC protocol for libp2p. The core idea is adopted from libra network implementation. I implement it to learn the design and concept of libp2p, so use it at your risk.

Usage

        let mut rpc = Rpc::new(RpcConfig::default());
        rpc.add_protocol(TEST_PROTOCOL);
        let swarm = Swarm::new(transport, rpc, pubkey.clone().into_peer_id());
        swarm.send_rpc(
            peer_id,
            TEST_PROTOCOL,
            Bytes::from(data),
            Duration::from_secs(10),
        );

About

A libp2p behaviour to enable you do request/response things upon substream.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages