github.com/prysmaticlabs/prysm@v1.4.4/beacon-chain/rpc/prysm/v1alpha1/beacon/server.go (about) 1 // Package beacon defines a gRPC beacon service implementation, providing 2 // useful endpoints for checking fetching chain-specific data such as 3 // blocks, committees, validators, assignments, and more. 4 package beacon 5 6 import ( 7 "context" 8 "time" 9 10 "github.com/prysmaticlabs/prysm/beacon-chain/blockchain" 11 "github.com/prysmaticlabs/prysm/beacon-chain/cache/depositcache" 12 blockfeed "github.com/prysmaticlabs/prysm/beacon-chain/core/feed/block" 13 "github.com/prysmaticlabs/prysm/beacon-chain/core/feed/operation" 14 statefeed "github.com/prysmaticlabs/prysm/beacon-chain/core/feed/state" 15 "github.com/prysmaticlabs/prysm/beacon-chain/db" 16 "github.com/prysmaticlabs/prysm/beacon-chain/operations/attestations" 17 "github.com/prysmaticlabs/prysm/beacon-chain/operations/slashings" 18 "github.com/prysmaticlabs/prysm/beacon-chain/p2p" 19 "github.com/prysmaticlabs/prysm/beacon-chain/powchain" 20 "github.com/prysmaticlabs/prysm/beacon-chain/state/stategen" 21 "github.com/prysmaticlabs/prysm/beacon-chain/sync" 22 pbp2p "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1" 23 ethpb "github.com/prysmaticlabs/prysm/proto/eth/v1alpha1" 24 ) 25 26 // Server defines a server implementation of the gRPC Beacon Chain service, 27 // providing RPC endpoints to access data relevant to the Ethereum beacon chain. 28 type Server struct { 29 BeaconDB db.ReadOnlyDatabase 30 Ctx context.Context 31 ChainStartFetcher powchain.ChainStartFetcher 32 HeadFetcher blockchain.HeadFetcher 33 CanonicalFetcher blockchain.CanonicalFetcher 34 FinalizationFetcher blockchain.FinalizationFetcher 35 DepositFetcher depositcache.DepositFetcher 36 BlockFetcher powchain.POWBlockFetcher 37 GenesisTimeFetcher blockchain.TimeFetcher 38 StateNotifier statefeed.Notifier 39 BlockNotifier blockfeed.Notifier 40 AttestationNotifier operation.Notifier 41 Broadcaster p2p.Broadcaster 42 AttestationsPool attestations.Pool 43 SlashingsPool slashings.PoolManager 44 CanonicalStateChan chan *pbp2p.BeaconState 45 ChainStartChan chan time.Time 46 ReceivedAttestationsBuffer chan *ethpb.Attestation 47 CollectedAttestationsBuffer chan []*ethpb.Attestation 48 StateGen stategen.StateManager 49 SyncChecker sync.Checker 50 }