Documentation
¶
Index ¶
- type Account
- type Block
- type BlockHeader
- type CoinProofs
- type Database
- func (d *Database) AddAccounts(a *[]Account) error
- func (d *Database) AddBlock(b *Block) error
- func (d *Database) AddEpoch(e *Epoch) error
- func (d *Database) AddSlot(s *Slot) error
- func (d *Database) AddValidators(v *[]Validator) error
- func (d *Database) Close()
- func (d *Database) GetRawBlock(hash chainhash.Hash) (*primitives.Block, uint64, error)
- func (d *Database) GetState() (state.State, chainhash.Hash, uint64, error)
- func (d *Database) MarkSlotProposed(s *Slot) error
- func (d *Database) Migrate() error
- func (d *Database) SetFinalized(e uint64) error
- func (d *Database) SetJustified(e uint64) error
- func (d *Database) StoreState(s state.State, lastBlock *chainindex.BlockRow) error
- type Deposit
- type DepositData
- type Epoch
- type Exit
- type PartialExit
- type Slot
- type State
- type Tx
- type Validator
- type Vote
- type VoteData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct {
Hash []byte `gorm:"primaryKey"`
Height uint64
Slot uint64
Header BlockHeader `gorm:"foreignKey:Hash"`
Txs []Tx
Deposits []Deposit
Votes []Vote
Exits []Exit
RawBlock []byte
}
func (*Block) DepositsGQL ¶
type BlockHeader ¶
type BlockHeader struct {
Hash []byte `gorm:"primaryKey"`
Version uint64
Nonce []byte
TxMerkleRoot []byte
TxMultiMerkleRoot []byte
VoteMerkleRoot []byte
DepositMerkleRoot []byte
ExitMerkleRoot []byte
VoteSlashingMerkleRoot []byte
RandaoSlashingMerkleRoot []byte
ProposerSlashingMerkleRoot []byte
GovernanceVotesMerkleRoot []byte
PreviousBlockHash []byte
Timestamp time.Time
Slot uint64
StateRoot []byte
FeeAddress []byte
}
func (*BlockHeader) ToGQL ¶
func (b *BlockHeader) ToGQL() *model.BlockHeader
type CoinProofs ¶
func (*CoinProofs) ToGQL ¶
func (c *CoinProofs) ToGQL() *model.CoinProofs
type Database ¶
Database represents an DB connection
func NewDB ¶
func NewDB(dbConnString string, log logger.Logger, wg *sync.WaitGroup, netParams *params.ChainParams) *Database
NewDB creates a db client
func (*Database) AddAccounts ¶
func (*Database) AddValidators ¶
func (*Database) GetRawBlock ¶
func (*Database) MarkSlotProposed ¶
func (*Database) SetFinalized ¶
func (*Database) SetJustified ¶
func (*Database) StoreState ¶
type Deposit ¶
type Deposit struct {
Hash []byte `gorm:"primaryKey"`
BlockHash []byte
PublicKey []byte
Data DepositData `gorm:"foreignKey:Hash"`
}
type DepositData ¶
type DepositData struct {
Hash []byte
PublicKey []byte `gorm:"primaryKey"`
ProofOfPossession []byte
WithdrawalAddress []byte
}
func (*DepositData) ToGQL ¶
func (d *DepositData) ToGQL() *model.DepositData
type Epoch ¶
type Exit ¶
type PartialExit ¶
type Slot ¶
type Tx ¶
type Validator ¶
Click to show internal directories.
Click to hide internal directories.