trpc-libp2p
v1.0.0
Published
This project is the implementation of [libp2p][libp2p] transport for [tRPC][tRPC].
Readme
tRPC-libP2P
This project is the implementation of libp2p transport for tRPC.
The specific implementation is completely inspired by wsLink and wsAdapter.
The underlying layer adopts BSON serialization (not transformer).
Plans
- [ ] Ping/Pong keep alive
- [ ] Stronger support for KAD
Usages
For server, because the specific implementation is similar, the operation method on the server is almost the same as the tRPC WebSocket document.
applyHandler(server, options)- @server libP2P instance
- @options
- options.router the AppRouter instance for tRPC
Very easy to use, you can see the example file.
For client, Similarly, it is almost a direct copy of wsLink.
createP2PClient(options)- @options
- options.url the MultiAddr for libP2P server
- options.node the libP2P instance
- @options
You can see the example file.
