Skip to content
This repository was archived by the owner on Feb 24, 2024. It is now read-only.

Commit 05cc6b0

Browse files
authored
Merge pull request #15 from hyprspace/feature/dht-client
Switch to DHTClient Mode & Build Smaller Binaries
2 parents f4a7b5a + 1e23bdb commit 05cc6b0

3 files changed

Lines changed: 4 additions & 5 deletions

File tree

.github/workflows/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ do
77
platform_split=(${platform//\// })
88
GOOS=${platform_split[0]}
99
GOARCH=${platform_split[1]}
10-
env GOOS=$GOOS GOARCH=$GOARCH go build -ldflags "-X github.com/hyprspace/hyprspace/cli.appVersion=$1" -o hyprspace-$1-${GOOS}-${GOARCH} .
10+
env GOOS=$GOOS GOARCH=$GOARCH CGO_ENABLED=0 go build -ldflags "-s -w -X github.com/hyprspace/hyprspace/cli.appVersion=$1" -o hyprspace-$1-${GOOS}-${GOARCH} .
1111

1212
done

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ require (
66
github.com/DataDrake/cli-ng/v2 v2.0.2
77
github.com/hashicorp/go-version v1.2.1 // indirect
88
github.com/inconshreveable/go-update v0.0.0-20160112193335-8152e7eb6ccf
9+
github.com/ipfs/go-datastore v0.4.5
910
github.com/kr/text v0.2.0 // indirect
1011
github.com/libp2p/go-libp2p v0.14.1
1112
github.com/libp2p/go-libp2p-core v0.8.5

p2p/node.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"fmt"
66
"sync"
77

8+
"github.com/ipfs/go-datastore"
89
"github.com/libp2p/go-libp2p"
910
"github.com/libp2p/go-libp2p-core/crypto"
1011
"github.com/libp2p/go-libp2p-core/host"
@@ -38,10 +39,7 @@ func CreateNode(ctx context.Context, inputKey string, port int, handler network.
3839
node.SetStreamHandler(Protocol, handler)
3940

4041
// Create DHT Subsystem
41-
dhtOut, err = dht.New(ctx, node)
42-
if err != nil {
43-
return
44-
}
42+
dhtOut = dht.NewDHTClient(ctx, node, datastore.NewMapDatastore())
4543

4644
// Define Bootstrap Nodes.
4745
peers := []string{

0 commit comments

Comments
 (0)