How do I add a swarm key to the core.BuildCfg in go-ipfs?

Hi, I’m using the go-ipfs-as-a-library example. It works great. I’d like to try using it with a private network. I’ve setup a private network and have a swarm key - something like


I’d like to spawn a IPFS node using the go-ipfs core and have it use this swarm key. I think it should be some option in the core.BuildCfg but I still haven’t figured it out.

Could anyone please help me to setup a node using the core to use a pre-generated swarm key?

Does it work if you put your swarm key file in your repo path (just like normal go-ipfs)?

Yeah, that works! Thanks.

1 Like