2021-06-02 21:19:52 +00:00
|
|
|
package pubsub
|
|
|
|
|
|
|
|
import "github.com/libp2p/go-libp2p-core/peer"
|
|
|
|
|
|
|
|
type PubSubMessageType int
|
|
|
|
|
|
|
|
const (
|
|
|
|
UnknownMessageType = iota
|
|
|
|
PrePrepareMessageType
|
|
|
|
PrepareMessageType
|
|
|
|
CommitMessageType
|
|
|
|
NewTxMessageType
|
|
|
|
NewBlockMessageType
|
|
|
|
)
|
|
|
|
|
2021-06-03 21:15:32 +00:00
|
|
|
type GenericMessage struct {
|
2021-06-02 21:19:52 +00:00
|
|
|
Type PubSubMessageType
|
|
|
|
From peer.ID `cbor:"-"`
|
2021-06-03 21:15:32 +00:00
|
|
|
Payload interface{}
|
|
|
|
}
|
|
|
|
|
|
|
|
type PubSubMessage struct {
|
|
|
|
Type PubSubMessageType
|
2021-06-02 21:19:52 +00:00
|
|
|
Payload []byte
|
|
|
|
}
|