Documentation
¶
Index ¶
- type Account
- type AccountBalanceNotify
- type Block
- type BlockHeader
- type CoinProofs
- type Database
- func (d *Database) AddAccountBalanceNotifier(account string, u uuid.UUID, n *AccountBalanceNotify)
- func (d *Database) AddAccounts(a []Account) error
- func (d *Database) AddBlock(b *Block) error
- func (d *Database) AddEpoch(e *Epoch) error
- func (d *Database) AddHeader(h *BlockHeader) error
- func (d *Database) AddSlot(s *Slot) error
- func (d *Database) AddSlotVoteInclusions(s uint64, votes int) error
- func (d *Database) AddTipNotifier(u uuid.UUID, n *TipNotify)
- func (d *Database) AddValidators(v *[]Validator) error
- func (d *Database) Close()
- func (d *Database) GetEpochParticipation(e int) (string, error)
- func (d *Database) GetLastSlot() (uint64, error)
- 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) RemoveAccountBalanceNotifier(account string, u uuid.UUID)
- func (d *Database) RemoveTipNotifier(u uuid.UUID)
- 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 TipNotify
- 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 AccountBalanceNotify ¶
type AccountBalanceNotify struct {
// contains filtered or unexported fields
}
func NewAccountBalanceNotify ¶
func NewAccountBalanceNotify(account string, channel chan *model.Account, db *Database) *AccountBalanceNotify
func (*AccountBalanceNotify) Notify ¶
func (a *AccountBalanceNotify) Notify()
type Block ¶
type Block struct {
Hash []byte `gorm:"primaryKey"`
Height uint64
Slot uint64
Txs []Tx
Deposits []Deposit
Votes []Vote
Exits []Exit
RawBlock []byte
Timestamp uint64
}
func (*Block) DepositsGQL ¶
type BlockHeader ¶
type BlockHeader struct {
Hash []byte `gorm:"primaryKey"`
Version uint64
Nonce []byte
Timestamp time.Time
Slot uint64
FeeAddress []byte
PreviousBlockHash []byte
VotesMerkleRoot []byte
DeposistMerkleRoot []byte
ExitsMerkleRoot []byte
PartialExitsMerkleRoot []byte
CoinProofsMerkleRoot []byte
ExecutionsMerkleRoot []byte
TxsMerkleRoot []byte
VoteSlashingMerkleRoot []byte
RandaoSlashingMerkleRoot []byte
ProposerSlashingMerkleRoot []byte
GovernanceVotesMerkleRoot []byte
MultiSignatureTxsMerkleRoot []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) AddAccountBalanceNotifier ¶
func (d *Database) AddAccountBalanceNotifier(account string, u uuid.UUID, n *AccountBalanceNotify)
func (*Database) AddAccounts ¶
func (*Database) AddHeader ¶
func (d *Database) AddHeader(h *BlockHeader) error
func (*Database) AddSlotVoteInclusions ¶
func (*Database) AddValidators ¶
func (*Database) GetEpochParticipation ¶
func (*Database) GetLastSlot ¶
func (*Database) GetRawBlock ¶
func (*Database) MarkSlotProposed ¶
func (*Database) RemoveAccountBalanceNotifier ¶
func (*Database) RemoveTipNotifier ¶
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.