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

Commit

Permalink
Merge pull request #15 from hyprspace/feature/dht-client
Browse files Browse the repository at this point in the history
Switch to DHTClient Mode & Build Smaller Binaries
  • Loading branch information
alecbcs authored Jun 26, 2021
2 parents f4a7b5a + 1e23bdb commit 05cc6b0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ do
platform_split=(${platform//\// })
GOOS=${platform_split[0]}
GOARCH=${platform_split[1]}
env GOOS=$GOOS GOARCH=$GOARCH go build -ldflags "-X github.com/hyprspace/hyprspace/cli.appVersion=$1" -o hyprspace-$1-${GOOS}-${GOARCH} .
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} .

done
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ require (
github.com/DataDrake/cli-ng/v2 v2.0.2
github.com/hashicorp/go-version v1.2.1 // indirect
github.com/inconshreveable/go-update v0.0.0-20160112193335-8152e7eb6ccf
github.com/ipfs/go-datastore v0.4.5
github.com/kr/text v0.2.0 // indirect
github.com/libp2p/go-libp2p v0.14.1
github.com/libp2p/go-libp2p-core v0.8.5
Expand Down
6 changes: 2 additions & 4 deletions p2p/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"sync"

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

// Create DHT Subsystem
dhtOut, err = dht.New(ctx, node)
if err != nil {
return
}
dhtOut = dht.NewDHTClient(ctx, node, datastore.NewMapDatastore())

// Define Bootstrap Nodes.
peers := []string{
Expand Down

0 comments on commit 05cc6b0

Please sign in to comment.