From 15261f5aa8a0c20ffc269b510e51c5522327cd40 Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 27 Oct 2023 03:17:42 +0200 Subject: [PATCH] packages/hyprspace: init: print simple config snippet for peer entry --- packages/networking/hyprspace/cli/init.go | 12 ++++++++++++ packages/networking/hyprspace/project.nix | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/networking/hyprspace/cli/init.go b/packages/networking/hyprspace/cli/init.go index e7f47b1..ad63381 100644 --- a/packages/networking/hyprspace/cli/init.go +++ b/packages/networking/hyprspace/cli/init.go @@ -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("}") + } } diff --git a/packages/networking/hyprspace/project.nix b/packages/networking/hyprspace/project.nix index 08e9bf3..66c5e37 100644 --- a/packages/networking/hyprspace/project.nix +++ b/packages/networking/hyprspace/project.nix @@ -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;