diff --git a/core/core.go b/core/core.go index 8a993bc0e6e..908b6dd45d6 100644 --- a/core/core.go +++ b/core/core.go @@ -44,6 +44,7 @@ import ( discovery "gx/ipfs/QmQHmMFyhfp2ZXnbYWqAWhEideDCNDM6hzJwqCU29Y5zV2/go-libp2p/p2p/discovery" p2pbhost "gx/ipfs/QmQHmMFyhfp2ZXnbYWqAWhEideDCNDM6hzJwqCU29Y5zV2/go-libp2p/p2p/host/basic" rhost "gx/ipfs/QmQHmMFyhfp2ZXnbYWqAWhEideDCNDM6hzJwqCU29Y5zV2/go-libp2p/p2p/host/routed" + identify "gx/ipfs/QmQHmMFyhfp2ZXnbYWqAWhEideDCNDM6hzJwqCU29Y5zV2/go-libp2p/p2p/protocol/identify" ping "gx/ipfs/QmQHmMFyhfp2ZXnbYWqAWhEideDCNDM6hzJwqCU29Y5zV2/go-libp2p/p2p/protocol/ping" ds "gx/ipfs/QmRWDav6mzWseLWeYfVd5fvUKiVe9xNH29YfMF438fG364/go-datastore" goprocess "gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess" @@ -86,6 +87,10 @@ const ( onlineMode ) +func init() { + identify.ClientVersion = "go-ipfs/" + config.CurrentVersionNumber + "/" + config.CurrentCommit +} + // IpfsNode is IPFS Core module. It represents an IPFS instance. type IpfsNode struct { diff --git a/test/sharness/t0020-init.sh b/test/sharness/t0020-init.sh index f5d68f591cb..d54af7d3c1e 100755 --- a/test/sharness/t0020-init.sh +++ b/test/sharness/t0020-init.sh @@ -117,6 +117,10 @@ test_expect_success "Welcome readme doesn't exists" ' test_must_fail ipfs cat /ipfs/$HASH_WELCOME_DOCS/readme ' +test_expect_success "ipfs id agent string contains correct version" ' + ipfs id -f "" | grep $(ipfs version -n) +' + test_expect_success "clean up ipfs dir" ' rm -rf "$IPFS_PATH" '