I am trying to create a Private network between a browser (chrome) and a go-node. I have created a custom libp2p bundle and in it defined a Connection Protector (with my swarm key). The IPFS node does not seem to pick it up. Has anyone successfully created a private network in browser? For now I am running it as a full node on the page, and later plan to put it in a service worker.
It’s take me a while but I was able to get this to work with a custom libp2p and protector. You then need to make sure your go-node has ws port accessible so the js-ipfs browser node can communicate with it. If you need additional help let me know
Is there any way that you can provide an example of this?
I have been trying to get this to work for some time now and the best I have is an instance of libp2p connecting to the node with a custom protector, but when I try to pass that instance or bundle into IPFS, IPFS won’t connect.
I have also tried this example from IPFS https://github.com/ipfs/js-ipfs/tree/master/examples/custom-libp2p, but when adding a custom protector I am met with: “connProtector is not allowed”
Maybe i’m missing something?
const Protector = require('libp2p-pnet')
connProtector: new Protector(swarmKeyBuffer),
ipfs config Addresses:
I’ve succeeded on it. just setting
and make libp2pBundle have a protector of libp2p-pnet will do.
it might be because different version of libp2p. My js-ipfs node can add connProtector but custom-libp2p example cannot. I have to manually add
unfortunately this just switch off warnings. connProtector hasn’t been accepted anyway. upgrade libp2p to 0.23.0 resolves the problem
Can you show me exactly how to do it?
Hi there, does anyone have a working example of connecting a browser node to a private node using swarm keys ?
I’ve tried various examples, and i end up with
connection.getPeerInfo is not a function when adding a
connProtector to ipfs.libp2p
I am looking for this information as well. I’ve moved my back-end IPFS network to a private network of go-ipfs nodes using a
swarm.key, by following these directions. I’m aware of the requirements to use secure websockets when connecting between a browser and a go-ipfs node. But how do I implement the
swarm.key into a browser node running js-ipfs?
If anyone has a link to an example, gist, documentation, or whatever, please add it.
Brave Browser has an integrated IPFS node.
Just create a
echo -e "/key/swarm/psk/1.0.0/\n/base16/\n`tr -dc 'a-f0-9' < /dev/random | head -c64`"
and place it in the IPFS data directory. On my GNU/Linux system, that directory is: