packages/hyprspace: better swarm key handling
This commit is contained in:
parent
a1ddafe045
commit
8b6e5b831c
1 changed files with 9 additions and 3 deletions
|
@ -63,9 +63,15 @@ func CreateNode(ctx context.Context, inputKey string, port int, handler network.
|
|||
return
|
||||
}
|
||||
|
||||
swarmKey, err := os.Open(os.Getenv("HYPRSPACE_SWARM_KEY"))
|
||||
if err != nil {
|
||||
return
|
||||
var swarmKey *os.File
|
||||
swarmKeyFile, ok := os.LookupEnv("HYPRSPACE_SWARM_KEY")
|
||||
if ok {
|
||||
fmt.Println("[+] Using swarm key " + swarmKeyFile)
|
||||
swarmKey, err = os.Open(swarmKeyFile)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
defer swarmKey.Close()
|
||||
}
|
||||
extraBootstrapNodes := []string{}
|
||||
ipfsApiStr, ok := os.LookupEnv("HYPRSPACE_IPFS_API")
|
||||
|
|
Loading…
Add table
Reference in a new issue