Skip to content

Commit e78af63

Browse files
authored
Merge pull request #48 from ipfs/release-01
chore: release v0.1.0
2 parents 6d76fcf + f8d7013 commit e78af63

File tree

6 files changed

+61
-6
lines changed

6 files changed

+61
-6
lines changed

daemon.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ func newDaemon(ctx context.Context, acceleratedDHT bool) (*daemon, error) {
5656
libp2p.ConnectionGater(&privateAddrFilterConnectionGater{}),
5757
libp2p.ResourceManager(rm),
5858
libp2p.EnableHolePunching(),
59+
libp2p.UserAgent(userAgent),
5960
)
6061
if err != nil {
6162
return nil, err
@@ -93,7 +94,7 @@ func newDaemon(ctx context.Context, acceleratedDHT bool) (*daemon, error) {
9394
libp2p.DefaultMuxers,
9495
libp2p.Muxer("/mplex/6.7.0", mplex.DefaultTransport),
9596
libp2p.EnableHolePunching(),
96-
libp2p.UserAgent("ipfs-check"),
97+
libp2p.UserAgent(userAgent),
9798
)
9899
}}, nil
99100
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.21
55
require (
66
github.com/gavv/httpexpect/v2 v2.16.0
77
github.com/ipfs-shipyard/vole v0.0.0-20240801195547-d7b80a461193
8-
github.com/ipfs/boxo v0.21.0
8+
github.com/ipfs/boxo v0.22.0
99
github.com/ipfs/go-block-format v0.2.0
1010
github.com/ipfs/go-cid v0.4.1
1111
github.com/ipfs/go-datastore v0.6.0

go.sum

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,8 @@ github.com/ipfs-shipyard/vole v0.0.0-20240801195547-d7b80a461193 h1:5HPfcUkFXM5K
208208
github.com/ipfs-shipyard/vole v0.0.0-20240801195547-d7b80a461193/go.mod h1:ibnGHr4b6P1OYWIR2HLKT1ONUbmd1ZGe9gzRWb/Kcto=
209209
github.com/ipfs/bbloom v0.0.4 h1:Gi+8EGJ2y5qiD5FbsbpX/TMNcJw8gSqr7eyjHa4Fhvs=
210210
github.com/ipfs/bbloom v0.0.4/go.mod h1:cS9YprKXpoZ9lT0n/Mw/a6/aFV6DTjTLYHeA+gyqMG0=
211-
github.com/ipfs/boxo v0.21.0 h1:XpGXb+TQQ0IUdYaeAxGzWjSs6ow/Lce148A/2IbRDVE=
212-
github.com/ipfs/boxo v0.21.0/go.mod h1:NmweAYeY1USOaJJxouy7DLr/Y5M8UBSsCI2KRivO+TY=
211+
github.com/ipfs/boxo v0.22.0 h1:QTC+P5uhsBNq6HzX728nsLyFW6rYDeR/5hggf9YZX78=
212+
github.com/ipfs/boxo v0.22.0/go.mod h1:yp1loimX0BDYOR0cyjtcXHv15muEh5V1FqO2QLlzykw=
213213
github.com/ipfs/go-block-format v0.2.0 h1:ZqrkxBA2ICbDRbK8KJs/u0O3dlp6gmAuuXUJNiW1Ycs=
214214
github.com/ipfs/go-block-format v0.2.0/go.mod h1:+jpL11nFx5A/SPpsoBn6Bzkra/zaArfSmsknbPMYgzM=
215215
github.com/ipfs/go-cid v0.0.3/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM=
@@ -247,6 +247,8 @@ github.com/ipfs/go-metrics-interface v0.0.1 h1:j+cpbjYvu4R8zbleSs36gvB7jR+wsL2fG
247247
github.com/ipfs/go-metrics-interface v0.0.1/go.mod h1:6s6euYU4zowdslK0GKHmqaIZ3j/b/tL7HTWtJ4VPgWY=
248248
github.com/ipfs/go-peertaskqueue v0.8.1 h1:YhxAs1+wxb5jk7RvS0LHdyiILpNmRIRnZVztekOF0pg=
249249
github.com/ipfs/go-peertaskqueue v0.8.1/go.mod h1:Oxxd3eaK279FxeydSPPVGHzbwVeHjatZ2GA8XD+KbPU=
250+
github.com/ipfs/go-test v0.0.4 h1:DKT66T6GBB6PsDFLoO56QZPrOmzJkqU1FZH5C9ySkew=
251+
github.com/ipfs/go-test v0.0.4/go.mod h1:qhIM1EluEfElKKM6fnWxGn822/z9knUGM1+I/OAQNKI=
250252
github.com/ipld/go-codec-dagpb v1.6.0 h1:9nYazfyu9B1p3NAgfVdpRco3Fs2nFC72DqVsMj6rOcc=
251253
github.com/ipld/go-codec-dagpb v1.6.0/go.mod h1:ANzFhfP2uMJxRBr8CE+WQWs5UsNa0pYtmKZ+agnUw9s=
252254
github.com/ipld/go-ipld-prime v0.21.0 h1:n4JmcpOlPDIxBcY037SVfpd1G+Sj1nKZah0m6QH9C2E=

main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"crypto/subtle"
66
"encoding/json"
7+
"fmt"
78
"log"
89
"net"
910
"net/http"
@@ -17,7 +18,7 @@ import (
1718

1819
func main() {
1920
app := cli.NewApp()
20-
app.Name = "ipfs-check"
21+
app.Name = name
2122
app.Usage = "Server tool for checking the accessibility of your data by IPFS peers"
2223
app.Flags = []cli.Flag{
2324
&cli.StringFlag{
@@ -61,6 +62,7 @@ func main() {
6162
}
6263

6364
func startServer(ctx context.Context, d *daemon, tcpListener, metricsUsername, metricPassword string) error {
65+
fmt.Printf("Starting %s %s\n", name, version)
6466
l, err := net.Listen("tcp", tcpListener)
6567
if err != nil {
6668
return err

version.go

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
package main
2+
3+
import (
4+
_ "embed"
5+
"encoding/json"
6+
"fmt"
7+
"runtime/debug"
8+
"time"
9+
)
10+
11+
//go:embed version.json
12+
var versionJSON []byte
13+
14+
var name = "ipfs-check"
15+
var version = buildVersion()
16+
var userAgent = name + "/" + version
17+
18+
func buildVersion() string {
19+
// Read version from embedded JSON file.
20+
var verMap map[string]string
21+
json.Unmarshal(versionJSON, &verMap)
22+
release := verMap["version"]
23+
24+
var revision string
25+
var day string
26+
var dirty bool
27+
28+
info, ok := debug.ReadBuildInfo()
29+
if !ok {
30+
return release + " dev-build"
31+
}
32+
for _, kv := range info.Settings {
33+
switch kv.Key {
34+
case "vcs.revision":
35+
revision = kv.Value[:7]
36+
case "vcs.time":
37+
t, _ := time.Parse(time.RFC3339, kv.Value)
38+
day = t.UTC().Format("2006-01-02")
39+
case "vcs.modified":
40+
dirty = kv.Value == "true"
41+
}
42+
}
43+
if dirty {
44+
revision += "-dirty"
45+
}
46+
if revision != "" {
47+
return fmt.Sprintf("%s %s-%s", release, day, revision)
48+
}
49+
return release + " dev-build"
50+
}

version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"version": ""
2+
"version": "0.1.0"
33
}

0 commit comments

Comments
 (0)