* Chore(filter v2) test updates (#811) * test: Test incorrect protocol identifiers * fix: return errors in FilterSubscribeOption * test: Test incorrect push identifier added - test incorrect subscribe identifier separated * test: Test Ping failure after unsubscription * test: Test PubSub with single content topic * test: Simplify test PubSub with single content topic * test: Test with single pubsub and multiple content topics * test: Test with multiple PubSub and multiple contentTopic * test: Test with multiple overlaping contentTopics - test contentTopics limit * test: refactor tests to fix concurrent run errors * test: Test subscription refresh * test: Test error handling for subscribe * test: Test subscription to multiple full nodes * update test to fix #804 * Update waku/v2/protocol/filter/filter_test.go Combine log messages Co-authored-by: richΛrd <info@richardramos.me> * Update waku/v2/protocol/filter/filter_test.go Delete commented - temporary code Co-authored-by: richΛrd <info@richardramos.me> * Update waku/v2/protocol/filter/filter_test.go fmt.Sprintf instead of "+" suffix => more performance and beauty Co-authored-by: richΛrd <info@richardramos.me> * Update waku/v2/protocol/filter/filter_test.go Adjust comment with code Co-authored-by: richΛrd <info@richardramos.me> * Update waku/v2/protocol/filter/filter_test.go Combine multiple related log entries into one. Co-authored-by: richΛrd <info@richardramos.me> * Update waku/v2/protocol/filter/filter_test.go Align comment with the code Co-authored-by: richΛrd <info@richardramos.me> * Update waku/v2/protocol/filter/filter_test.go Use fmt.Sprintf() instead of "+" for more beauty and speed Co-authored-by: richΛrd <info@richardramos.me> * test: refactor tests with prepareData() * test: Test incorrect protocol identifiers * chore: rebase onto latest master * test: Test incorrect push identifier added - test incorrect subscribe identifier separated * test: Test Ping failure after unsubscription * test: Test PubSub with single content topic * test: Simplify test PubSub with single content topic * test: Test with single pubsub and multiple content topics * test: Test with multiple PubSub and multiple contentTopic * test: Test with multiple overlaping contentTopics - test contentTopics limit * test: refactor tests to fix concurrent run errors * test: Test subscription refresh * test: Test error handling for subscribe * test: Test subscription to multiple full nodes * update test to fix #804 * Update waku/v2/protocol/filter/filter_test.go Combine log messages Co-authored-by: richΛrd <info@richardramos.me> * Update waku/v2/protocol/filter/filter_test.go Delete commented - temporary code Co-authored-by: richΛrd <info@richardramos.me> * Update waku/v2/protocol/filter/filter_test.go fmt.Sprintf instead of "+" suffix => more performance and beauty Co-authored-by: richΛrd <info@richardramos.me> * Update waku/v2/protocol/filter/filter_test.go Adjust comment with code Co-authored-by: richΛrd <info@richardramos.me> * Update waku/v2/protocol/filter/filter_test.go Combine multiple related log entries into one. Co-authored-by: richΛrd <info@richardramos.me> * Update waku/v2/protocol/filter/filter_test.go Align comment with the code Co-authored-by: richΛrd <info@richardramos.me> * Update waku/v2/protocol/filter/filter_test.go Use fmt.Sprintf() instead of "+" for more beauty and speed Co-authored-by: richΛrd <info@richardramos.me> * test: refactor tests with prepareData() * test: Test incorrect protocol identifiers * fix: return errors in FilterSubscribeOption * test: Test incorrect push identifier added - test incorrect subscribe identifier separated * test: Test Ping failure after unsubscription * test: Test PubSub with single content topic * test: Simplify test PubSub with single content topic * test: Test with single pubsub and multiple content topics * test: Test with multiple PubSub and multiple contentTopic * test: Test with multiple overlaping contentTopics - test contentTopics limit * test: refactor tests to fix concurrent run errors * test: Test subscription refresh * test: Test error handling for subscribe * test: Test subscription to multiple full nodes * update test to fix #804 * Update waku/v2/protocol/filter/filter_test.go Combine log messages Co-authored-by: richΛrd <info@richardramos.me> * Update waku/v2/protocol/filter/filter_test.go Delete commented - temporary code Co-authored-by: richΛrd <info@richardramos.me> * Update waku/v2/protocol/filter/filter_test.go fmt.Sprintf instead of "+" suffix => more performance and beauty Co-authored-by: richΛrd <info@richardramos.me> * Update waku/v2/protocol/filter/filter_test.go Adjust comment with code Co-authored-by: richΛrd <info@richardramos.me> * Update waku/v2/protocol/filter/filter_test.go Combine multiple related log entries into one. Co-authored-by: richΛrd <info@richardramos.me> * Update waku/v2/protocol/filter/filter_test.go Align comment with the code Co-authored-by: richΛrd <info@richardramos.me> * Update waku/v2/protocol/filter/filter_test.go Use fmt.Sprintf() instead of "+" for more beauty and speed Co-authored-by: richΛrd <info@richardramos.me> * test: refactor tests with prepareData() * Fix error during rebase * Sync filter tests with latest master * Refactor context initialization for test * test: Incorrect Subscribe Identifier refactored with custom subscribe * test: refactor into multiple files * test: Subscribe with multiple light nodes to one full node * test: shared mode for full node creation - test preview Subscribe fullNode to fullNode * test: test Subscribe fullNode to fullNode --------- Co-authored-by: Richard Ramos <info@richardramos.me> Co-authored-by: Prem Chaitanya Prathi <chaitanyaprem@gmail.com> * string generators for testing * fix CodeQL findings * merge variants of UTF8 String generator into one --------- Co-authored-by: Richard Ramos <info@richardramos.me> Co-authored-by: Prem Chaitanya Prathi <chaitanyaprem@gmail.com>
go-waku
A Go implementation of the Waku v2 protocol.
Install
Building from source
git clone https://github.com/waku-org/go-waku
cd go-waku
make
# See the available command line options with
./build/waku --help
Nix
You can build Waku v2 node using Nix Flakes:
nix build github:waku-org/go-waku
Or build the library using:
nix build github:waku-org/go-waku#library
To start a shell with build dependencies use:
nix develop
Docker
docker run -i -t -p 60000:60000 -p 9000:9000/udp \
wakuorg/go-waku:latest \ # or, the image:tag of your choice
--dns-discovery:true \
--dns-discovery-url:enrtree://ANEDLO25QVUGJOUTQFRYKWX6P4Z4GKVESBMHML7DZ6YK4LGS5FC5O@prod.wakuv2.nodes.status.im \
--discv5-discovery
or build and run the image with:
docker build -t wakuorg/go-waku:latest .
docker run wakuorg/go-waku:latest --help
Building on windows
Windows requires the following tools to be installed
- git bash (which is installed as part of Git)
- chocolatey
- make
- mingw
- go
Library
go get github.com/waku-org/go-waku
C Bindings
make static-library
make dynamic-library
Mobile libraries
Requires gomobile
make mobile-android
make mobile-ios
Tutorials and documentation
- Receive and send messages using Waku Relay
- Send messages using Waku Lightpush
- Encrypting and decrypting Waku Messages
- Retrieve message history using Waku Store
- C Bindings
- Waku Specs, has information of waku topics, wakuv1/wakuv2 message, rln relay etc.
- Enr, Enrtree
- devp2p tool for playing with enr/entree sync tree. Tutorial
Examples
Examples of usage of go-waku as a library can be found in the examples/
folder:
- basic2 - demonstrates how to send and receive messages
- chat2 - simple chat client using waku relay / lightpush + filter / store protocol to send/receive messages and retrieve message history
- filter2 - demonstrates how to use filter protocol
- c-bindings - simple program to demonstrate how to consume the go-waku library via C FFI
- waku-csharp - C# console application that uses the go-waku library via FFI
- android-kotlin - android app that uses a .jar generated by gomobile using kotlin
Contribution
Thank you for considering to help out with the source code! We welcome contributions from anyone on the internet, and are grateful for even the smallest of fixes!
If you'd like to contribute to go-waku, please fork, fix, commit and send a pull request. If you wish to submit more complex changes though, please check up with the core devs first to ensure those changes are in line with the general philosophy of the project and/or get some early feedback which can make both your efforts much lighter as well as our review and merge procedures quick and simple.
To build and test this repository, you need:
- Go (version 1.20)
- protoc
- protoc-gen-go
To enable the git hooks:
git config core.hooksPath hooks
Bugs, Questions & Features
If you encounter any bug or would like to propose new features, feel free to open an issue.
For more general discussion, help and latest news, join #go-waku on Vac Discord or Telegram.
License
Licensed and distributed under either of
- MIT license: LICENSE-MIT or http://opensource.org/licenses/MIT
or
- Apache License, Version 2.0, (LICENSE-APACHEv2 or http://www.apache.org/licenses/LICENSE-2.0)
at your option. These files may not be copied, modified, or distributed except according to those terms.