mirror of
https://github.com/vacp2p/mvds.git
synced 2026-01-09 14:47:59 -05:00
docs
This commit is contained in:
@@ -25,7 +25,8 @@ const (
|
||||
BATCH
|
||||
)
|
||||
|
||||
type calculateNextEpoch func(count uint64, epoch int64) int64
|
||||
// CalculateNextEpoch is a function used to calculate the next `SendEpoch` for a given message.
|
||||
type CalculateNextEpoch func(count uint64, epoch int64) int64
|
||||
|
||||
// Node represents an MVDS node, it runs all the logic like sending and receiving protocol messages.
|
||||
type Node struct {
|
||||
@@ -41,7 +42,7 @@ type Node struct {
|
||||
|
||||
payloads payloads
|
||||
|
||||
nextEpoch calculateNextEpoch
|
||||
nextEpoch CalculateNextEpoch
|
||||
|
||||
ID state.PeerID
|
||||
|
||||
@@ -56,7 +57,7 @@ func NewNode(
|
||||
ms store.MessageStore,
|
||||
st transport.Transport,
|
||||
ss state.SyncState,
|
||||
nextEpoch calculateNextEpoch,
|
||||
nextEpoch CalculateNextEpoch,
|
||||
currentEpoch int64,
|
||||
id state.PeerID,
|
||||
mode Mode,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
package state
|
||||
|
||||
// PeerID is the ID for a specific peer.
|
||||
type PeerID [65]byte
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Package state contains everything related to the synchronization state for MVDS.
|
||||
package state
|
||||
|
||||
// RecordType is the type for a specific record, either `OFFER`, `REQUEST` or `MESSAGE`.
|
||||
type RecordType int
|
||||
|
||||
const (
|
||||
@@ -9,6 +10,7 @@ const (
|
||||
MESSAGE
|
||||
)
|
||||
|
||||
// State is a struct used to store a records [state](https://github.com/status-im/bigbrother-specs/blob/master/data_sync/mvds.md#state).
|
||||
type State struct {
|
||||
Type RecordType
|
||||
SendCount uint64
|
||||
|
||||
Reference in New Issue
Block a user