The Status module that consumes go-ethereum https://status.im
Go to file
Andrea Maria Piana aa7f591587 Move networking code for waku under `v0` namespace
Why make the change?

As discussed previously, the way we will move across versions is to maintain completely separate
codebases and eventually remove those that are not supported anymore.

This has the drawback of some code duplication, but the advantage is that is more
explicit what each version requires, and changes in one version will not
impact the other, so we won't pile up backward compatible code.
This is the same strategy used by `whisper` in go ethereum and is influenced by
https://www.youtube.com/watch?v=oyLBGkS5ICk .

All the code that is used for the networking protocol is now under `v0/`.
Some of the common parts might still be refactored out.
The main namespace `waku` deals with `host`->`waku` interactions (through RPC),
while `v0` deals with `waku`->`remote-waku` interactions.

In order to support `v1`, the namespace `v0` will be copied over, and changed to
support `v1`. Once `v0` will be not used anymore, the whole namespace will be removed.

This PR does not actually implement `v1`, I'd rather get things looked over to
make sure the structure is what we would like before implementing the changes.

What has changed?

- Moved all code for the common parts under `waku/common/` namespace
- Moved code used for bloomfilters in `waku/common/bloomfilter.go`
- Removed all version specific code from `waku/common/const` (`ProtocolVersion`, status-codes etc)
- Added interfaces for `WakuHost` and `Peer` under `waku/common/protocol.go`

Things still to do

Some tests in `waku/` are still testing by stubbing components of a particular version (`v0`).
I started moving those tests to instead of stubbing using the actual component, which increases
the testing surface. Some other tests that can't be easily ported should be likely moved under
`v0` instead. Ideally no version specif code should be exported from a version namespace (for
example the various codes, as those might change across versions). But this will be a work-in-progress.

Some code that will be common in `v0`/`v1` could still be extract to avoid duplication, and duplicated only
when implementations diverge across versions.
2020-04-27 14:58:02 +02:00
.dependabot Move to monorepo structure (#1684) 2019-11-21 17:19:22 +01:00
.github Move to monorepo structure (#1684) 2019-11-21 17:19:22 +01:00
.vscode Add go.formatFlags to VS Code settings 2020-01-16 13:18:36 +01:00
_assets expose the mailserver metrics port by default 2020-04-08 17:08:49 +02:00
_examples Explain how to run Waku node in README (#1921) 2020-04-09 18:33:53 +02:00
account Remove protocol and eth-node submodules (#1835) 2020-02-10 12:22:37 +01:00
api Make sure WakuEnabled is respected on upgrade 2020-03-30 15:28:16 +02:00
appdatabase Add replies to messages 2020-04-16 15:51:28 +02:00
bridge Move networking code for waku under `v0` namespace 2020-04-27 14:58:02 +02:00
build/bin add .gitkeep to build/bin so it always exists 2019-03-05 14:22:00 +01:00
cmd Fix listen flag (#1897) 2020-03-10 13:40:35 +01:00
config update rendezvous nodes in configs 2020-03-17 15:47:07 +01:00
contracts Use goimports instead of gofmt 2020-01-06 10:17:23 +01:00
db Use goimports instead of gofmt 2020-01-06 10:17:23 +01:00
discovery Use goimports instead of gofmt 2020-01-06 10:17:23 +01:00
eth-node Move networking code for waku under `v0` namespace 2020-04-27 14:58:02 +02:00
exportlogs Upgrade geth to 1.9.5 and Whisper (#1617) 2019-10-04 17:21:24 +02:00
extkeys Upgrade extkeys (#1878) 2020-03-04 09:30:31 +01:00
lib Clarify situation between lib and mobile (#1909) 2020-03-24 11:22:55 +01:00
logutils Integrate Whisper-Waku bridge in status-go (#1854) 2020-02-18 12:21:01 +01:00
mailserver Move networking code for waku under `v0` namespace 2020-04-27 14:58:02 +02:00
metrics Ignore full node flag when in topic mode 2020-03-23 15:10:07 +01:00
mobile Clarify situation between lib and mobile (#1909) 2020-03-24 11:22:55 +01:00
multiaccounts Enable waku node default 2020-03-30 10:52:30 +02:00
node Move networking code for waku under `v0` namespace 2020-04-27 14:58:02 +02:00
notifier Notifier package to interact with gorush notifications (#910) 2018-05-08 16:30:03 +02:00
params Fix listen flag (#1897) 2020-03-10 13:40:35 +01:00
peers Use goimports instead of gofmt 2020-01-06 10:17:23 +01:00
profiling Add profiling with pprof (#754) 2018-03-23 14:58:40 +01:00
protocol Set chat active on being re-invited 2020-04-23 11:04:50 +02:00
rpc Nimbus node support 2020-01-20 13:15:17 +01:00
rtt rewrite mailserver systemd setup to a Makefile 2019-12-04 13:44:05 +01:00
services Move networking code for waku under `v0` namespace 2020-04-27 14:58:02 +02:00
signal Split shhext into shhext and wakuext (#1803) 2020-01-20 21:56:06 +01:00
sqlite Add persistent datasync, use single database and handle negotiated filters (#1580) 2019-08-27 14:04:15 +02:00
static Add replies to messages 2020-04-16 15:51:28 +02:00
t Add statusUpdate code (#1861) 2020-02-21 15:48:53 +01:00
timesource Nimbus node support 2020-01-20 13:15:17 +01:00
transactions Upgrade deps (#1892) 2020-03-09 08:55:58 +01:00
vendor Update go-ethereum to v1.9.5-status.9 (#1898) 2020-03-12 13:05:12 +01:00
waku Move networking code for waku under `v0` namespace 2020-04-27 14:58:02 +02:00
whisper Refactor/waku.doc (#1950) 2020-04-23 20:54:24 +01:00
.codeclimate.yml add multi-account support (#1500) 2019-07-24 20:59:15 +02:00
.dockerignore Ignore *.test files from all folders (#635) 2018-02-08 14:23:08 +02:00
.gitignore Added IDE file to gitignore 2020-04-21 10:40:39 +02:00
.golangci.yml Remove protocol and eth-node submodules (#1835) 2020-02-10 12:22:37 +01:00
.travis.yml migrate to go 1.12 and go modules 2019-06-12 13:12:00 +02:00
BOOTNODE.md docs: clarify purpose and describe ports 2020-02-06 18:44:23 +01:00
CONTRIBUTING.md Update team collaboration forum (#1946) 2020-04-21 08:12:01 +01:00
LICENSE.md Create LICENSE.md 2016-09-21 10:00:29 +08:00
MAILSERVER.md expose the mailserver metrics port by default 2020-04-08 17:08:49 +02:00
Makefile Fix setup-dev target (#1926) 2020-04-06 09:54:06 +02:00
README.md Explain how to run Waku node in README (#1921) 2020-04-09 18:33:53 +02:00
RELEASING.md update RELEASING docs links to CI (#1506) 2019-06-28 10:37:34 +02:00
VERSION Move networking code for waku under `v0` namespace 2020-04-27 14:58:02 +02:00
WAKU.md Create WAKU.md with spec support (#1855) 2020-02-21 17:56:15 +08:00
go.mod Update go-ethereum to v1.9.5-status.9 (#1898) 2020-03-12 13:05:12 +01:00
go.sum Move networking code for waku under `v0` namespace 2020-04-27 14:58:02 +02:00