You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
632 B
19 lines
632 B
6 years ago
|
package p2p
|
||
|
|
||
|
import (
|
||
|
"github.com/dedis/kyber"
|
||
|
)
|
||
|
|
||
|
// StreamHandler handles incoming p2p message.
|
||
|
type StreamHandler func(Stream)
|
||
|
|
||
|
// Peer is the object for a p2p peer (node)
|
||
|
type Peer struct {
|
||
|
IP string // IP address of the peer
|
||
|
Port string // Port number of the peer
|
||
|
PubKey kyber.Point // Public key of the peer
|
||
|
Ready bool // Ready is true if the peer is ready to join consensus.
|
||
|
ValidatorID int // -1 is the default value, means not assigned any validator ID in the shard
|
||
|
// TODO(minhdoan, rj): use this Ready to not send/broadcast to this peer if it wasn't available.
|
||
|
}
|