mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-10 07:58:22 -05:00
Former-commit-id: b7b8bbd10777012ae6f7d30eb6b05c3b1c3ec5d3 [formerly 06e1112fa0e1092a7137186d3a386972daa2effe] Former-commit-id: ff2bc760c9dafb6250f056606eb2cbf96b6afa5b
38 lines
1.2 KiB
Go
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
|
|
}
|