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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
swarmKey, err := os.Open(os.Getenv("HYPRSPACE_SWARM_KEY"))
|
var swarmKey *os.File
|
||||||
if err != nil {
|
swarmKeyFile, ok := os.LookupEnv("HYPRSPACE_SWARM_KEY")
|
||||||
return
|
if ok {
|
||||||
|
fmt.Println("[+] Using swarm key " + swarmKeyFile)
|
||||||
|
swarmKey, err = os.Open(swarmKeyFile)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
defer swarmKey.Close()
|
||||||
}
|
}
|
||||||
extraBootstrapNodes := []string{}
|
extraBootstrapNodes := []string{}
|
||||||
ipfsApiStr, ok := os.LookupEnv("HYPRSPACE_IPFS_API")
|
ipfsApiStr, ok := os.LookupEnv("HYPRSPACE_IPFS_API")
|
||||||
|
|
Loading…
Add table
Reference in a new issue