2020-10-05 00:15:27 +00:00
|
|
|
// Package beaconv1 defines a gRPC beacon service implementation,
|
|
|
|
// following the official API standards https://ethereum.github.io/eth2.0-APIs/#/.
|
|
|
|
// This package includes the beacon and config endpoints.
|
|
|
|
package beaconv1
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/prysmaticlabs/prysm/beacon-chain/blockchain"
|
|
|
|
"github.com/prysmaticlabs/prysm/beacon-chain/cache/depositcache"
|
|
|
|
blockfeed "github.com/prysmaticlabs/prysm/beacon-chain/core/feed/block"
|
|
|
|
"github.com/prysmaticlabs/prysm/beacon-chain/core/feed/operation"
|
|
|
|
statefeed "github.com/prysmaticlabs/prysm/beacon-chain/core/feed/state"
|
|
|
|
"github.com/prysmaticlabs/prysm/beacon-chain/db"
|
|
|
|
"github.com/prysmaticlabs/prysm/beacon-chain/operations/attestations"
|
|
|
|
"github.com/prysmaticlabs/prysm/beacon-chain/operations/slashings"
|
2021-02-24 15:29:25 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/beacon-chain/operations/voluntaryexits"
|
2020-10-05 00:15:27 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/beacon-chain/p2p"
|
|
|
|
"github.com/prysmaticlabs/prysm/beacon-chain/powchain"
|
2021-03-22 15:19:38 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/beacon-chain/rpc/statefetcher"
|
2020-10-05 00:15:27 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/beacon-chain/state/stategen"
|
|
|
|
"github.com/prysmaticlabs/prysm/beacon-chain/sync"
|
|
|
|
pbp2p "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Server defines a server implementation of the gRPC Beacon Chain service,
|
|
|
|
// providing RPC endpoints to access data relevant to the Ethereum 2.0 phase 0
|
|
|
|
// beacon chain.
|
|
|
|
type Server struct {
|
|
|
|
BeaconDB db.ReadOnlyDatabase
|
|
|
|
Ctx context.Context
|
|
|
|
ChainStartFetcher powchain.ChainStartFetcher
|
2020-10-15 18:00:49 +00:00
|
|
|
ChainInfoFetcher blockchain.ChainInfoFetcher
|
2020-10-05 00:15:27 +00:00
|
|
|
DepositFetcher depositcache.DepositFetcher
|
|
|
|
BlockFetcher powchain.POWBlockFetcher
|
|
|
|
GenesisTimeFetcher blockchain.TimeFetcher
|
|
|
|
BlockReceiver blockchain.BlockReceiver
|
|
|
|
StateNotifier statefeed.Notifier
|
|
|
|
BlockNotifier blockfeed.Notifier
|
|
|
|
AttestationNotifier operation.Notifier
|
|
|
|
Broadcaster p2p.Broadcaster
|
|
|
|
AttestationsPool attestations.Pool
|
2021-02-23 15:17:07 +00:00
|
|
|
SlashingsPool slashings.PoolManager
|
2021-02-24 15:29:25 +00:00
|
|
|
VoluntaryExitsPool voluntaryexits.PoolManager
|
2020-10-05 00:15:27 +00:00
|
|
|
CanonicalStateChan chan *pbp2p.BeaconState
|
|
|
|
ChainStartChan chan time.Time
|
2021-02-11 21:08:36 +00:00
|
|
|
StateGenService stategen.StateManager
|
2020-10-05 00:15:27 +00:00
|
|
|
SyncChecker sync.Checker
|
2021-03-29 21:04:35 +00:00
|
|
|
StateFetcher statefetcher.StateProvider
|
2020-10-05 00:15:27 +00:00
|
|
|
}
|