@cryptotaxi247 / kubo / commits / 7c0149d04

set the agent version based on version string

License: MIT Signed-off-by: Jeromy <why@ipfs.io>

Jeromy committed Jan 6, 2017 at 06:30 UTC 7c0149d048dd8267850d0e3fc615c700750407a6
2 files changed +9
core/core.go
+5
@@ -44,6 +44,7 @@ import (
44 discovery "gx/ipfs/QmQHmMFyhfp2ZXnbYWqAWhEideDCNDM6hzJwqCU29Y5zV2/go-libp2p/p2p/discovery"
45 p2pbhost "gx/ipfs/QmQHmMFyhfp2ZXnbYWqAWhEideDCNDM6hzJwqCU29Y5zV2/go-libp2p/p2p/host/basic"
46 rhost "gx/ipfs/QmQHmMFyhfp2ZXnbYWqAWhEideDCNDM6hzJwqCU29Y5zV2/go-libp2p/p2p/host/routed"
47 + identify "gx/ipfs/QmQHmMFyhfp2ZXnbYWqAWhEideDCNDM6hzJwqCU29Y5zV2/go-libp2p/p2p/protocol/identify"
48 ping "gx/ipfs/QmQHmMFyhfp2ZXnbYWqAWhEideDCNDM6hzJwqCU29Y5zV2/go-libp2p/p2p/protocol/ping"
49 ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore"
50 goprocess "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess"
@@ -86,6 +87,10 @@ const (
87 onlineMode
88 )
89
90 +func init() {
91 + identify.ClientVersion = "go-ipfs/" + config.CurrentVersionNumber + "/" + config.CurrentCommit
92 +}
93 +
94 // IpfsNode is IPFS Core module. It represents an IPFS instance.
95 type IpfsNode struct {
96
test/sharness/t0020-init.sh
+4
@@ -117,6 +117,10 @@ test_expect_success "Welcome readme doesn't exists" '
117 test_must_fail ipfs cat /ipfs/$HASH_WELCOME_DOCS/readme
118 '
119
120 +test_expect_success "ipfs id agent string contains correct version" '
121 + ipfs id -f "<aver>" | grep $(ipfs version -n)
122 +'
123 +
124 test_expect_success "clean up ipfs dir" '
125 rm -rf "$IPFS_PATH"
126 '