You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Delegated routing allows a libp2p node running in a constrained environment (for example a browser) to offload network operations and queries to a more capable node running elsewhere.
The libp2p node created by this app has no transports, connection encrypters or muxers - it uses only a Delegated Routing V1 HTTP API client to look up CID providers and Peer Info from a more capable libp2p node running in a separate process.
Running this example
Install the example dependencies
$ npm i
Start the Helia node in ./server.js - this is the node we will delegate operations to
$ node ./server.js
Start the lightweight browser libp2p node
$ npm start
This should open your browser to https://localhost:3000. If it does not, go ahead and do that now.
Finding Content Providers via the Delegate
Enter the CID of the block you wish to find providers for, one is pre-filled for your convenience
Click "Find Providers"
If any exist, provders will start to appear in the box beneath the input fields
Finding Peers via the Delegate
Enter the PeerId of the peer you wish to find, one is pre-filled for your convenience
Click "Find PeerInfo"
If found, multiaddrs for the peer will appear in the box beneath the input fields
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
About
How to use other libp2p nodes to perform delegated routing