bootstrap node just refers to a node that’s queried on initial connect for peer discovery. So what I do is:
await ipfs.bootstrap.add("<multiaddr of node>"); await ipfs.swarm.connect("<multiaddr of node>");
The multiaddr should be your own node that you’re hosting. The
bootstrap.add is so next time, it’ll connect to the desired node on startup. The
swarm.connect is so it connects to the node immediately.
The biggest pitfall to this is I find after some time, you can lose connection to the bootstrap node. To remedy this, I found if I listen on a topic (like
keep-alive), and publish to it (can be anything) on both the bootstrap node and the browser node, the connection can stay active for several hours (possibly days if stable enough). I briefly describe this pitfall in a different upcoming blogpost here (keep in mind this is an older draft, but I think the info there will still be useful).