Compare commits
7
Commits
feat-store-v3
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0751e39289 | ||
|
|
eb17d5032f | ||
|
|
b7c681bc79 | ||
|
|
8943c3f86d | ||
|
|
712a497bb7 | ||
|
|
25e892291f | ||
|
|
6a89c52065 |
@@ -1,18 +1,48 @@
|
||||
ifneq (, $(shell which tput))
|
||||
GREEN := $(shell tput -Txterm setaf 2)
|
||||
YELLOW := $(shell tput -Txterm setaf 3)
|
||||
WHITE := $(shell tput -Txterm setaf 7)
|
||||
CYAN := $(shell tput -Txterm setaf 6)
|
||||
RESET := $(shell tput -Txterm sgr0)
|
||||
endif
|
||||
|
||||
# Git
|
||||
GIT_VERSION ?= $(shell git describe --abbrev=6 --always --tags)
|
||||
GIT_REMOTE_URL ?= $(shell git remote get-url origin | sed 's|git@github.com:|https://github.com/|')
|
||||
|
||||
# Buf.build
|
||||
BUF=buf
|
||||
|
||||
ifeq (, $(shell which $(BUF)))
|
||||
$(error "No buf command in $$PATH, see: https://buf.build/docs/installation/#install-the-buf-cli")
|
||||
endif
|
||||
|
||||
|
||||
.DEFAULT_GOAL := all
|
||||
|
||||
all: lint breaking
|
||||
|
||||
## Buf
|
||||
format:
|
||||
@buf format -w
|
||||
$(BUF) format -w
|
||||
|
||||
lint:
|
||||
@echo "Running buf lint"
|
||||
@buf lint
|
||||
lint: ## Run buf.build lint
|
||||
$(BUF) lint
|
||||
|
||||
breaking:
|
||||
@echo "Running buf breaking changes checks"
|
||||
@buf breaking --against="https://github.com/vacp2p/waku.git#branch=main"
|
||||
breaking: ## Run buf.build breaking changes checks
|
||||
$(BUF) breaking --against="${GIT_REMOTE_URL}#branch=main"
|
||||
|
||||
build:
|
||||
@echo "Running buf compilation"
|
||||
@buf build
|
||||
build: ## Run buf.build compilation
|
||||
$(BUF) build
|
||||
|
||||
## Help:
|
||||
help: ## Show this help
|
||||
@echo ''
|
||||
@echo 'Usage:'
|
||||
@echo ' ${YELLOW}make${RESET} ${GREEN}<target>${RESET}'
|
||||
@echo ''
|
||||
@echo 'Targets:'
|
||||
@awk 'BEGIN {FS = ":.*?## "} { \
|
||||
if (/^[a-zA-Z_-]+:.*?##.*$$/) {printf " ${YELLOW}%-20s${GREEN}%s${RESET}\n", $$1, $$2} \
|
||||
else if (/^## .*$$/) {printf " ${CYAN}%s${RESET}\n", substr($$1,4)} \
|
||||
}' $(MAKEFILE_LIST)
|
||||
|
||||
@@ -6,3 +6,10 @@ environments. At a high level, Waku v2 implements a Pub/Sub messaging pattern ov
|
||||
capabilities to it.
|
||||
|
||||
[Learn more about Waku](https://waku.org/)
|
||||
|
||||
## Requirements
|
||||
|
||||
- GNU Make
|
||||
- [Buf CLI](https://docs.buf.build/installation)
|
||||
- [Protobuf Compiler (protoc)](https://grpc.io/docs/protoc-installation/) (Optional)
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
syntax = "proto3";
|
||||
|
||||
// 12/WAKU2-FILTER rfc: https://rfc.vac.dev/spec/12/
|
||||
package waku.filter.v2;
|
||||
|
||||
import "waku/message/v1/message.proto";
|
||||
|
||||
// Protocol identifier: /vac/waku/filter-subscribe/2.0.0-beta1
|
||||
message FilterSubscribeRequest {
|
||||
enum FilterSubscribeType {
|
||||
SUBSCRIBER_PING = 0;
|
||||
SUBSCRIBE = 1;
|
||||
UNSUBSCRIBE = 2;
|
||||
UNSUBSCRIBE_ALL = 3;
|
||||
}
|
||||
|
||||
string request_id = 1;
|
||||
FilterSubscribeType filter_subscribe_type = 2;
|
||||
|
||||
// Filter criteria
|
||||
optional string pubsub_topic = 10;
|
||||
repeated string content_topics = 11;
|
||||
}
|
||||
|
||||
message FilterSubscribeResponse {
|
||||
string request_id = 1;
|
||||
uint32 status_code = 10;
|
||||
optional string status_desc = 11;
|
||||
}
|
||||
|
||||
// Protocol identifier: /vac/waku/filter-push/2.0.0-beta1
|
||||
message MessagePush {
|
||||
waku.message.v1.WakuMessage waku_message = 1;
|
||||
optional string pubsub_topic = 2;
|
||||
}
|
||||
@@ -8,5 +8,7 @@ message WakuMessage {
|
||||
string content_topic = 2;
|
||||
optional uint32 version = 3;
|
||||
optional sint64 timestamp = 10;
|
||||
optional bytes meta = 11;
|
||||
optional bool ephemeral = 31;
|
||||
optional bytes rate_limit_proof = 21;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
syntax = "proto3";
|
||||
|
||||
// rfc: https://rfc.vac.dev/spec/66/
|
||||
package waku.metadata.v1;
|
||||
|
||||
message WakuMetadataRequest {
|
||||
optional uint32 cluster_id = 1;
|
||||
repeated uint32 shards = 2;
|
||||
}
|
||||
|
||||
message WakuMetadataResponse {
|
||||
optional uint32 cluster_id = 1;
|
||||
repeated uint32 shards = 2;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
syntax = "proto3";
|
||||
|
||||
// 34/WAKU2-PEER-EXCHANGE rfc: https://rfc.vac.dev/spec/34/
|
||||
// Protocol identifier: /vac/waku/peer-exchange/2.0.0-alpha1
|
||||
package waku.peer_exchange.v2alpha1;
|
||||
|
||||
message PeerInfo {
|
||||
bytes enr = 1;
|
||||
}
|
||||
|
||||
message PeerExchangeQuery {
|
||||
uint64 num_peers = 1;
|
||||
}
|
||||
|
||||
message PeerExchangeResponse {
|
||||
repeated PeerInfo peer_infos = 1;
|
||||
}
|
||||
|
||||
message PeerExchangeRPC {
|
||||
PeerExchangeQuery query = 1;
|
||||
PeerExchangeResponse response = 2;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
syntax = "proto3";
|
||||
|
||||
// rfc: https://rfc.vac.dev/spec/17/
|
||||
package waku.rln.v1;
|
||||
|
||||
message RateLimitProof {
|
||||
bytes proof = 1;
|
||||
bytes merkle_root = 2;
|
||||
bytes epoch = 3;
|
||||
bytes share_x = 4;
|
||||
bytes share_y = 5;
|
||||
bytes nullifier = 6;
|
||||
bytes rln_identifier = 7;
|
||||
}
|
||||
@@ -14,13 +14,13 @@ message Index {
|
||||
}
|
||||
|
||||
message PagingInfo {
|
||||
optional uint64 page_size = 1;
|
||||
optional Index cursor = 2;
|
||||
uint64 page_size = 1;
|
||||
Index cursor = 2;
|
||||
enum Direction {
|
||||
BACKWARD = 0;
|
||||
FORWARD = 1;
|
||||
}
|
||||
optional Direction direction = 3;
|
||||
Direction direction = 3;
|
||||
}
|
||||
|
||||
message ContentFilter {
|
||||
@@ -29,9 +29,9 @@ message ContentFilter {
|
||||
|
||||
message HistoryQuery {
|
||||
// The first field is reserved for future use
|
||||
optional string pubsub_topic = 2;
|
||||
string pubsub_topic = 2;
|
||||
repeated ContentFilter content_filters = 3;
|
||||
optional PagingInfo paging_info = 4;
|
||||
PagingInfo paging_info = 4;
|
||||
optional sint64 start_time = 5;
|
||||
optional sint64 end_time = 6;
|
||||
}
|
||||
@@ -39,16 +39,18 @@ message HistoryQuery {
|
||||
message HistoryResponse {
|
||||
// The first field is reserved for future use
|
||||
repeated waku.message.v1.WakuMessage messages = 2;
|
||||
optional PagingInfo paging_info = 3;
|
||||
PagingInfo paging_info = 3;
|
||||
enum Error {
|
||||
NONE = 0;
|
||||
INVALID_CURSOR = 1;
|
||||
TOO_MANY_REQUESTS = 429;
|
||||
SERVICE_UNAVAILABLE = 503;
|
||||
}
|
||||
Error error = 4;
|
||||
}
|
||||
|
||||
message HistoryRPC {
|
||||
string request_id = 1;
|
||||
optional HistoryQuery query = 2;
|
||||
optional HistoryResponse response = 3;
|
||||
HistoryQuery query = 2;
|
||||
HistoryResponse response = 3;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user