From 09bbc1c6ad31f975d82a25d272121d1d8bbd5f9e Mon Sep 17 00:00:00 2001 From: "wagmi.x" Date: Fri, 1 Nov 2024 16:44:52 +0800 Subject: [PATCH] feat: add swoker url --- cmd/ipfs/kubo/daemon.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cmd/ipfs/kubo/daemon.go b/cmd/ipfs/kubo/daemon.go index 956057fe607..d04fc63da95 100644 --- a/cmd/ipfs/kubo/daemon.go +++ b/cmd/ipfs/kubo/daemon.go @@ -5,6 +5,7 @@ import ( "errors" _ "expvar" "fmt" + "github.com/crustio/go-ipfs-encryptor/crust" "math" "net" "net/http" @@ -587,6 +588,18 @@ take effect. // start MFS pinning thread startPinMFS(cctx, daemonConfigPollInterval, &ipfsPinMFSNode{node}) + // Set crust + cfg, err = repo.Config() + if err != nil { + return err + } + + if cc, ok := cfg.Datastore.Spec["crust"]; ok { + if len(cc.(string)) != 0 { + crust.Worker.SetUrl(cc.(string)) + fmt.Printf("Crust sworker url: %s\n", cc.(string)) + } + } // The daemon is *finally* ready. fmt.Printf("Daemon is ready\n")