Skip to content

Commit e13abfa

Browse files
committed
feat(daemon): print version
License: MIT Signed-off-by: Overbool <overbool.xu@gmail.com>
1 parent 987fef1 commit e13abfa

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cmd/ipfs/daemon.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ import (
88
"net/http"
99
_ "net/http/pprof"
1010
"os"
11+
"runtime"
1112
"sort"
1213
"sync"
1314

15+
version "github.com/ipfs/go-ipfs"
1416
utilmain "github.com/ipfs/go-ipfs/cmd/ipfs/util"
1517
oldcmds "github.com/ipfs/go-ipfs/commands"
1618
"github.com/ipfs/go-ipfs/core"
@@ -191,6 +193,11 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment
191193
log.Errorf("Injecting prometheus handler for metrics failed with message: %s\n", err.Error())
192194
}
193195

196+
// print the ipfs version
197+
fmt.Printf("go-ipfs version: %s\n"+
198+
"Repo version: %d\nSystem version: %s\nGolang version: %s\n",
199+
version.CurrentVersionNumber, fsrepo.RepoVersion, runtime.GOARCH+"/"+runtime.GOOS, runtime.Version())
200+
194201
// let the user know we're going.
195202
fmt.Printf("Initializing daemon...\n")
196203

0 commit comments

Comments
 (0)