Registry / networking / libp2p-go-libp2p-gorpc

libp2p-go-libp2p-gorpc

JSON →
library0.6.0gogounverified

A libp2p-based RPC framework inspired by Go's net/rpc, with context support and streaming.

go get github.com/libp2p/go-libp2p-gorpc
INSTALL
IMPORT
SIG · LIBP2P-GO-LIBP2P-G
L
libp2p-go-libp2p-gorpc
networkinggov0.6.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

gorpc
github.com/libp2p/go-libp2p-gorpc

Register a simple RPC service on a libp2p host.

package main import ( "context" "github.com/libp2p/go-libp2p" gorpc "github.com/libp2p/go-libp2p-gorpc" ) type Greeter struct{} func (g *Greeter) Greet(ctx context.Context, name string, reply *string) error { *reply = "Hello, " + name return nil } func main() { host, _ := libp2p.New() server := gorpc.NewServer(host, "myprotocol") server.Register(&Greeter{}) select {} }
Debug
Known issues
gotchaMethods must satisfy specific signature requirements (context, marshalable types).
fix
Ensure exported methods follow the pattern: func (t *T) Method(ctx context.Context, arg T1, reply *T2) error.
affects: >=0.1.0
Upgrade
Version history
0.6.0latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
libp2p-go-libp2p-gorpc — go get libp2p-go-libp2p-gorpc · libregistry