Files
prysm/client/types/interfaces.go
Raul Jordan 92af8bc351 Rename Entire Project to Repo, Change Import Paths and Readmes (#298)
Former-commit-id: b7b8bbd10777012ae6f7d30eb6b05c3b1c3ec5d3 [formerly 06e1112fa0e1092a7137186d3a386972daa2effe]
Former-commit-id: ff2bc760c9dafb6250f056606eb2cbf96b6afa5b
2018-07-20 16:31:26 -05:00

38 lines
1.2 KiB
Go

package types
import (
"github.com/ethereum/go-ethereum/common"
)
// Node defines a a sharding-enabled Ethereum instance that provides
// full control and shared access of necessary components and services
// for a sharded Ethereum blockchain.
type Node interface {
Start()
Close()
}
// Actor refers to either a notary, proposer, or observer in the sharding spec.
type Actor interface {
Service
// TODO: will actors have actor-specific methods? To be decided.
}
// CollationFetcher defines functionality for a struct that is able to extract
// respond with collation information to the caller. Shard implements this interface.
type CollationFetcher interface {
CollationByHeaderHash(headerHash *common.Hash) (*Collation, error)
}
// Service is an individual protocol that can be registered into a node. Having a sharding
// node maintain a service registry allows for easy, shared-dependencies. For example,
// a proposer service might depend on a p2p server, a txpool, an smc client, etc.
type Service interface {
// Start is called after all services have been constructed to
// spawn any goroutines required by the service.
Start()
// Stop terminates all goroutines belonging to the service,
// blocking until they are all terminated.
Stop() error
}