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
Basically every time when a project gets created that only uses libp2p and not IPFS the creator has to reinvent a good way to store and read the config, among other things.
In IPFS this is already handled as the config simply gets stored in the repo and additionally gets auto-created, therefore simplifying the process of creating an application on top of IPFS drastically.
For libp2p this process is still manual and involves basically reinventing the wheel of config storage. Sure there are good libraries for this task out there already, but why bother with yet another library if this functionality would be integrated (possibly using one of those libraries). Additionally applications that run in both non-browser and browser environments wouldn't have to worry about creating and testing a config storage mechanism for both.
Example syntax:
constLibp2p=require('libp2p')constTCP=require('libp2p-tcp')constSECIO=require('libp2p-secio')constSPDY=require('libp2p-spdy')constMPLEX=require('libp2p-mplex')constmodules={transport: [newTCP()],connection: {muxer: [SPDY,MPLEX],crypto: [SECIO]}}constNode=newLibp2p.Managed({storage: '$HOME/.my-awesome-app',// this could also be reduced to an 'appID' property based on which the path for the storage folder could be created.// appID: 'my-awesome-app', // would set storage on linux to $HOME/.config/libp2p/$appID, win %APPDATA%\Libp2p\%appID%, etc...modules: modules,// include the modules. the user-config could allow the user to disable specific modules (e.x. mdns - or some could be off-by-default)multiaddrs: ['/ip4/127.0.0.1/tcp/5343','/ip4/0.0.0.0/tcp/5234/ws'],// multiaddrs to listen on (needs to be specified here as the peerId gets created at a later stage, can also be modified via user-config)// autoinit/autostart: true // could be added to simplify things even more})Node.init({ignoreIfAlreadyExists: true},err=>{if(err)throwerrNode.start(err=>{if(err)throwerrNode.peerInfo.multiaddrs.toArray().forEach(a=>console.log('Listening on %s',a.toString()))})})
The text was updated successfully, but these errors were encountered:
Type: feature
Severity: low/med
Description: "Managed" libp2p node
Basically every time when a project gets created that only uses libp2p and not IPFS the creator has to reinvent a good way to store and read the config, among other things.
In IPFS this is already handled as the config simply gets stored in the repo and additionally gets auto-created, therefore simplifying the process of creating an application on top of IPFS drastically.
For libp2p this process is still manual and involves basically reinventing the wheel of config storage. Sure there are good libraries for this task out there already, but why bother with yet another library if this functionality would be integrated (possibly using one of those libraries). Additionally applications that run in both non-browser and browser environments wouldn't have to worry about creating and testing a config storage mechanism for both.
Example syntax:
The text was updated successfully, but these errors were encountered: