Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_feat: integrating waku go bindings #6283

Draft
wants to merge 20 commits into
base: feature/nwaku-in-status
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "third_party/nwaku"]
path = third_party/nwaku
url = https://github.com/waku-org/nwaku
9 changes: 3 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ else
endif

ifeq ($(detected_OS),Darwin)
GOBIN_SHARED_LIB_EXT := dylib
GOBIN_SHARED_LIB_EXT := so
GOBIN_SHARED_LIB_CFLAGS := CGO_ENABLED=1 GOOS=darwin
else ifeq ($(detected_OS),Windows)
GOBIN_SHARED_LIB_EXT := dll
Expand Down Expand Up @@ -212,19 +212,16 @@ statusgo-library: ##@cross-compile Build status-go as static library for current
@echo "Static library built:"
@ls -la build/bin/libstatus.*

LIBWAKU := third_party/nwaku/build/libwaku.$(GOBIN_SHARED_LIB_EXT)
LIBWAKU := $(CURDIR)/vendor/github.com/waku-org/waku-go-bindings/third_party/nwaku/build/libwaku.$(GOBIN_SHARED_LIB_EXT)
$(LIBWAKU):
@echo "Building libwaku"
$(MAKE) -C third_party/nwaku update || { echo "nwaku make update failed"; exit 1; }
$(MAKE) -C ./third_party/nwaku libwaku
$(MAKE) -C $(CURDIR)/vendor/github.com/waku-org/waku-go-bindings/waku

build-libwaku: $(LIBWAKU)

statusgo-shared-library: generate
statusgo-shared-library: ##@cross-compile Build status-go as shared library for current platform
ifeq ($(USE_NWAKU),true)
$(MAKE) $(LIBWAKU)
endif
## cmd/library/README.md explains the magic incantation behind this
mkdir -p build/bin/statusgo-lib
go run cmd/library/*.go > build/bin/statusgo-lib/main.go
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ require (
github.com/siphiuel/lc-proxy-wrapper v0.0.0-20230516150924-246507cee8c7
github.com/urfave/cli/v2 v2.27.2
github.com/waku-org/go-waku v0.8.1-0.20250122182117-bf357f223b55
github.com/waku-org/waku-go-bindings v0.0.0-20250130081538-a4db2843d020
github.com/wk8/go-ordered-map/v2 v2.1.7
github.com/yeqown/go-qrcode/v2 v2.2.1
github.com/yeqown/go-qrcode/writer/standard v1.2.1
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2162,6 +2162,10 @@ github.com/waku-org/go-zerokit-rln-arm v0.0.0-20230916171929-1dd9494ff065 h1:Sd7
github.com/waku-org/go-zerokit-rln-arm v0.0.0-20230916171929-1dd9494ff065/go.mod h1:7cSGUoGVIla1IpnChrLbkVjkYgdOcr7rcifEfh4ReR4=
github.com/waku-org/go-zerokit-rln-x86_64 v0.0.0-20230916171518-2a77c3734dd1 h1:4HSdWMFMufpRo3ECTX6BrvA+VzKhXZf7mS0rTa5cCWU=
github.com/waku-org/go-zerokit-rln-x86_64 v0.0.0-20230916171518-2a77c3734dd1/go.mod h1:+LeEYoW5/uBUTVjtBGLEVCUe9mOYAlu5ZPkIxLOSr5Y=
github.com/waku-org/waku-go-bindings v0.0.0-20250122175840-9c78421cd09f h1:apETMA44/ezqVy6j5/L5mtu4boPxBEMWIt/AkDQ05yM=
github.com/waku-org/waku-go-bindings v0.0.0-20250122175840-9c78421cd09f/go.mod h1:eFNpq6IGg3WsFaWdpy0O8yaIFa+ZVD5KbsOY7kxjJgQ=
github.com/waku-org/waku-go-bindings v0.0.0-20250130081538-a4db2843d020 h1:7B975cTxZ5yxsqIYXE/6YZUs2u8bAeNcNv1sjAFgono=
github.com/waku-org/waku-go-bindings v0.0.0-20250130081538-a4db2843d020/go.mod h1:eFNpq6IGg3WsFaWdpy0O8yaIFa+ZVD5KbsOY7kxjJgQ=
github.com/wealdtech/go-ens/v3 v3.5.0 h1:Huc9GxBgiGweCOGTYomvsg07K2QggAqZpZ5SuiZdC8o=
github.com/wealdtech/go-ens/v3 v3.5.0/go.mod h1:bVuYoWYEEeEu7Zy95rIMjPR34QFJarxt8p84ywSo0YM=
github.com/wealdtech/go-multicodec v1.4.0 h1:iq5PgxwssxnXGGPTIK1srvt6U5bJwIp7k6kBrudIWxg=
Expand Down
5 changes: 3 additions & 2 deletions node/status_node_services.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ import (
"github.com/status-im/status-go/timesource"
wakuv1common "github.com/status-im/status-go/wakuv1/common"
"github.com/status-im/status-go/wakuv2"
"github.com/waku-org/waku-go-bindings/waku"
)

var (
Expand Down Expand Up @@ -383,8 +384,8 @@ func (b *StatusNode) wakuV2Service(nodeConfig *params.NodeConfig) (*wakuv2.Waku,
}
}

nwakuCfg := &wakuv2.WakuConfig{
NodeKey: hex.EncodeToString(crypto.FromECDSA(nodeKey)),
nwakuCfg := &waku.WakuConfig{
Nodekey: hex.EncodeToString(crypto.FromECDSA(nodeKey)),
Host: nodeConfig.WakuV2Config.Host,
TcpPort: nodeConfig.WakuV2Config.Port,
LogLevel: "DEBUG", // TODO-nwaku ?
Expand Down
5 changes: 3 additions & 2 deletions protocol/waku_builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (

"github.com/status-im/status-go/waku/bridge"
wakutypes "github.com/status-im/status-go/waku/types"
"github.com/waku-org/waku-go-bindings/waku"
)

type testWakuV2Config struct {
Expand All @@ -34,8 +35,8 @@ func NewTestWakuV2(s *suite.Suite, cfg testWakuV2Config) *waku2.Waku {
EnableDiscV5: false,
}

nWakuConfig := &waku2.WakuConfig{
EnableRelay: true,
nWakuConfig := &waku.WakuConfig{
Relay: true,
LogLevel: "DEBUG",
ClusterID: cfg.clusterID,
Shards: []uint16{wakuv2.DefaultShardIndex},
Expand Down
1 change: 0 additions & 1 deletion third_party/nwaku
Submodule nwaku deleted from 625c8e

This file was deleted.

This file was deleted.

Loading
Loading