-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
9,305 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "third_party/nwaku"] | ||
path = third_party/nwaku | ||
url = https://github.com/waku-org/nwaku |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Waku Common | ||
|
||
[See here](../README.md#common) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright 2019 The Waku Library Authors. | ||
// | ||
// The Waku library is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU Lesser General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// The Waku library is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty off | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU Lesser General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Lesser General Public License | ||
// along with the Waku library. If not, see <http://www.gnu.org/licenses/>. | ||
// | ||
// This software uses the go-ethereum library, which is licensed | ||
// under the GNU Lesser General Public Library, version 3 or any later. | ||
|
||
package common | ||
|
||
// Waku protocol parameters | ||
const ( | ||
TopicLength = 4 // in bytes | ||
AESKeyLength = 32 // in bytes | ||
KeyIDSize = 32 // in bytes | ||
|
||
DefaultMaxMessageSize = uint32(1 << 20) // DefaultMaximumMessageSize is 1mb. | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// Copyright 2019 The Waku Library Authors. | ||
// | ||
// The Waku library is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU Lesser General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// The Waku library is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty off | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU Lesser General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Lesser General Public License | ||
// along with the Waku library. If not, see <http://www.gnu.org/licenses/>. | ||
// | ||
// This software uses the go-ethereum library, which is licensed | ||
// under the GNU Lesser General Public Library, version 3 or any later. | ||
|
||
package common | ||
|
||
import ( | ||
"github.com/ethereum/go-ethereum/common" | ||
"github.com/ethereum/go-ethereum/p2p/enode" | ||
) | ||
|
||
// EventType used to define known waku events. | ||
type EventType string | ||
|
||
const ( | ||
// EventEnvelopeSent fires when envelope was sent to a peer. | ||
EventEnvelopeSent EventType = "envelope.sent" | ||
|
||
// EventEnvelopeExpired fires when envelop expired | ||
EventEnvelopeExpired EventType = "envelope.expired" | ||
|
||
// EventEnvelopeReceived is sent once envelope was received from a peer. | ||
// EventEnvelopeReceived must be sent to the feed even if envelope was previously in the cache. | ||
// And event, ideally, should contain information about peer that sent envelope to us. | ||
EventEnvelopeReceived EventType = "envelope.received" | ||
|
||
// EventBatchAcknowledged is sent when batch of envelopes was acknowledged by a peer. | ||
EventBatchAcknowledged EventType = "batch.acknowledged" | ||
|
||
// EventEnvelopeAvailable fires when envelop is available for filters | ||
EventEnvelopeAvailable EventType = "envelope.available" | ||
) | ||
|
||
// EnvelopeEvent represents an envelope event. | ||
type EnvelopeEvent struct { | ||
Event EventType | ||
Topic TopicType | ||
Hash common.Hash | ||
Batch common.Hash | ||
Peer enode.ID | ||
Data interface{} | ||
} |
Oops, something went wrong.