prysm-pulse/shared/types.go
Nishant Das cddae7a306
Implement RPC Messaging Between Validators (#475)
* Adding Proto files

* Move to shared package

* adding attestation sub

* gazelle

* attestation check

* proposal finished

* Add in attesters responsibilities

* fixing dependency issues

* adding topics

* refactoring tests

* Adding more tests

* adding more changes

* gazelle

* removing attester p2p

* remove mock

* changing to new proposer model

* changing tests

* making changes

* gazelle

* adding gomock

* adding rpc methods, reverting changes to other proto files

* gazelle and test changes

* adding tests

* adding mocks and tests

* gazelle

* fixing merge issues

* lint

* lint
2018-09-16 09:12:36 +08:00

25 lines
722 B
Go

package shared
import (
"github.com/ethereum/go-ethereum/event"
"github.com/golang/protobuf/proto"
"github.com/prysmaticlabs/prysm/shared/p2p"
)
// Service is a struct that can be registered into a ServiceRegistry for
// easy dependency management.
type Service interface {
// Start spawns any goroutines required by the service.
Start()
// Stop terminates all goroutines belonging to the service,
// blocking until they are all terminated.
Stop() error
}
// P2P defines a struct that can subscribe to feeds, request data, and broadcast data.
type P2P interface {
Subscribe(msg proto.Message, channel chan p2p.Message) event.Subscription
Send(msg proto.Message, peer p2p.Peer)
Broadcast(msg proto.Message)
}