Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nanne007/libp2p-rpc
A libp2p behaviour to enable you do request/response things upon substream.
https://github.com/nanne007/libp2p-rpc
libp2p network rpc rust
Last synced: 8 days ago
JSON representation
A libp2p behaviour to enable you do request/response things upon substream.
- Host: GitHub
- URL: https://github.com/nanne007/libp2p-rpc
- Owner: nanne007
- License: mit
- Created: 2020-03-21T05:14:08.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-07-01T12:48:24.000Z (over 4 years ago)
- Last Synced: 2023-07-13T19:50:49.723Z (over 1 year ago)
- Topics: libp2p, network, rpc, rust
- Language: Rust
- Homepage:
- Size: 25.4 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
``` rust
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),
);
```