packages/hyprspace: init: print simple config snippet for peer entry

This commit is contained in:
Max Headroom 2023-10-27 03:17:42 +02:00
parent ed3d8fd7ab
commit 15261f5aa8
2 changed files with 13 additions and 1 deletions

View file

@ -9,6 +9,7 @@ import (
"github.com/DataDrake/cli-ng/v2/cmd"
"github.com/hyprspace/hyprspace/config"
"github.com/libp2p/go-libp2p/core/crypto"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/multiformats/go-multibase"
)
@ -66,4 +67,15 @@ func InitRun(r *cmd.Root, c *cmd.Sub) {
checkErr(err)
fmt.Printf("Initialized new config at %s\n", configPath)
peerId, err := peer.IDFromPrivateKey(privKey)
if err == nil {
fmt.Println("Add this entry to your other peers:")
fmt.Println("{")
hostname, err := os.Hostname()
if err == nil {
fmt.Printf(" \"name\": \"%s\",\n", hostname)
}
fmt.Printf(" \"id\": \"%s\"\n", peerId)
fmt.Println("}")
}
}

View file

@ -10,7 +10,7 @@
};
packages.hyprspace = with pkgs; buildGo120Module rec {
pname = "hyprspace";
version = "0.8.1";
version = "0.8.2";
src = with inputs.nix-filter.lib; let
dirs = map inDirectory;