feat: Waku v2 bridge

Issue #12610
This commit is contained in:
Michal Iskierko
2023-11-12 13:29:38 +01:00
parent 56e7bd01ca
commit 6d31343205
6716 changed files with 1982502 additions and 5891 deletions

View File

@@ -0,0 +1,58 @@
package protocol
import (
"github.com/ethereum/go-ethereum/p2p/enr"
)
type ResponseStatus uint
type MessageType uint64
const (
VERSION = "/rend/0.1.0"
REGISTER MessageType = iota
REGISTER_RESPONSE
DISCOVER
DISCOVER_RESPONSE
REMOTEIP
REMOTEIP_RESPONSE
OK ResponseStatus = 0
E_INVALID_NAMESPACE ResponseStatus = 100
E_INVALID_ENR ResponseStatus = 101
E_INVALID_TTL ResponseStatus = 102
E_INVALID_LIMIT ResponseStatus = 103
E_INVALID_CONTENT ResponseStatus = 104
E_NOT_AUTHORIZED ResponseStatus = 200
E_INTERNAL_ERROR ResponseStatus = 300
)
type Register struct {
Topic string
Record enr.Record
TTL uint64
}
type RegisterResponse struct {
Status ResponseStatus
Message string
}
type Discover struct {
Limit uint
Topic string
}
type DiscoverResponse struct {
Status ResponseStatus
Message string
Records []enr.Record
}
type RemoteIp struct {
}
type RemoteIpResponse struct {
Status ResponseStatus
IP string
}