├── ipfs-swarm-key-gen └── main.go └── README.md /ipfs-swarm-key-gen/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "crypto/rand" 4 | import "encoding/hex" 5 | import "fmt" 6 | import "log" 7 | 8 | func main() { 9 | key := make([]byte, 32) 10 | _, err := rand.Read(key) 11 | if err != nil { 12 | log.Fatalln("While trying to read random source:", err) 13 | } 14 | 15 | fmt.Println("/key/swarm/psk/1.0.0/") 16 | fmt.Println("/base16/") 17 | fmt.Print(hex.EncodeToString(key)) 18 | } 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## ipfs-swarm-key-gen 2 | 3 | This program generates swarm.key file for IPFS Private Network feature. 4 | 5 | ### Installation 6 | it is obsolate 7 | ``` 8 | go get -u github.com/Kubuxu/go-ipfs-swarm-key-gen/ipfs-swarm-key-gen 9 | ``` 10 | use following 11 | ``` 12 | go install github.com/Kubuxu/go-ipfs-swarm-key-gen/ipfs-swarm-key-gen@latest 13 | ``` 14 | 15 | ### Usage 16 | 17 | ``` 18 | ipfs-swarm-key-gen > ~/.ipfs/swarm.key 19 | ``` 20 | 21 | Change `~/.ipfs/` to different directory if you use custom IPFS_PATH. 22 | 23 | 24 | ### License 25 | 26 | MIT 27 | --------------------------------------------------------------------------------