i was trying to create a private IPFS network
Ubuntu linux
go version1.10.4
ipfs: 0.4.18
i got "ipfs-swarm-key-gen: command not found" when i was trying install swarm.key
@zhongzhouli Get ipfs-swarm-key-gen in https://github.com/Kubuxu/go-ipfs-swarm-key-gen and generate swarm.key by it.
Finally, you need put swarm.key into ~/.ipfs or IPFS_PATH.
(closing for tracking)
@zhongzhouli Get
ipfs-swarm-key-genin https://github.com/Kubuxu/go-ipfs-swarm-key-gen and generateswarm.keyby it.Finally, you need put
swarm.keyinto~/.ipfsorIPFS_PATH.
yes, i tried to follow the step, i got this problem after ipfs-swarm-key-gen > ~/.ipfs/swarm.key.
could you please show me what should i do?
@zhongzhouli Did you execute go get -u github.com/Kubuxu/go-ipfs-swarm-key-gen/ipfs-swarm-key-gen successfully?
@zhongzhouli Did you execute
go get -u github.com/Kubuxu/go-ipfs-swarm-key-gen/ipfs-swarm-key-gensuccessfully?
I am not able to run this command. getting error : package github.com/Kubuxu/go-ipfs-swarm-key-gen/ipfs-swarm-key-gen: cannot download, $GOPATH not set. For more details see: go help gopath
Even I have set the GOPATH in .bashrc
export GOPATH=/usr/lib/go/
export PATH=$PATH:$GOPATH/bin
please help..
@npatni0102 please ask on https://discuss.ipfs.io.
@zhongzhouli
You need to specify the directory of ipfs-swarm-key-gen before executing the command, but it is generally installed in this directory as below, you can try this command:
./go/bin/ipfs-swarm-key-gen > ~/.ipfs/swarm.key
If it doesn't work, then search for the directory of ipfs-swarm-key-gen and change the part that says ./go/bin/ to the specified directory of ipfs-swarm-key-gen
Another alternative (only works on Ubuntu) run this command in the terminal:

It's good! Save the go complie time~
ipfs-swarm-key-gen.sh
#!/bin/bash
set -eu
function main() {
echo -e "/key/swarm/psk/1.0.0/\n/base16/\n$(tr -dc 'a-f0-9' < /dev/urandom | head -c64)"
}
main "$@"
Another simple way
#!/bin/bash
set -eu
function main() {
echo -e "/key/swarm/psk/1.0.0/\n/base16/\n$(hexdump -n 32 -e '16/1 "%02x"' /dev/urandom)"
}
main "$@"
there needs to have more doc for these 'features', based on what I see, it is just this
Better docs is the blocker for graduating this feature as "stable": https://github.com/ipfs/go-ipfs/issues/7086.
Most helpful comment
@zhongzhouli Get
ipfs-swarm-key-genin https://github.com/Kubuxu/go-ipfs-swarm-key-gen and generateswarm.keyby it.Finally, you need put
swarm.keyinto~/.ipfsorIPFS_PATH.