Documentation ¶
Index ¶
- type ArkeoContract
- type ArkeoProvider
- type Block
- type BlockGap
- type DBConfig
- type DirectoryDB
- func (d *DirectoryDB) CloseContract(contractID int64, height int64) (*Entity, error)
- func (d *DirectoryDB) FindBlockGaps() ([]*BlockGap, error)
- func (d *DirectoryDB) FindContract(providerID int64, delegatePubkey string, height int64) (*ArkeoContract, error)
- func (d *DirectoryDB) FindContractByPubKeys(chain string, providerPubkey string, delegatePubkey string, height int64) (*ArkeoContract, error)
- func (d *DirectoryDB) FindContractsByPubKeys(chain string, providerPubkey string, delegatePubkey string) ([]*ArkeoContract, error)
- func (d *DirectoryDB) FindIndexerStatus(id int64) (*IndexerStatus, error)
- func (d *DirectoryDB) FindLatestBlock() (*Block, error)
- func (d *DirectoryDB) FindProvider(pubkey string, chain string) (*ArkeoProvider, error)
- func (d *DirectoryDB) GetArkeoNetworkStats() (*types.ArkeoStats, error)
- func (d *DirectoryDB) InsertBlock(b *Block) (*Entity, error)
- func (d *DirectoryDB) InsertBondProviderEvent(providerID int64, evt types.BondProviderEvent) (*Entity, error)
- func (d *DirectoryDB) InsertModProviderEvent(providerID int64, evt types.ModProviderEvent) (*Entity, error)
- func (d *DirectoryDB) InsertProvider(provider *ArkeoProvider) (*Entity, error)
- func (d *DirectoryDB) SearchProviders(criteria types.ProviderSearchParams) ([]*ArkeoProvider, error)
- func (d *DirectoryDB) UpdateIndexerStatus(indexerStatus *IndexerStatus) (*Entity, error)
- func (d *DirectoryDB) UpdateProvider(provider *ArkeoProvider) (*Entity, error)
- func (d *DirectoryDB) UpsertCloseContractEvent(contractID int64, evt types.CloseContractEvent) (*Entity, error)
- func (d *DirectoryDB) UpsertContract(providerID int64, evt types.OpenContractEvent) (*Entity, error)
- func (d *DirectoryDB) UpsertContractSettlementEvent(contractID int64, evt types.ContractSettlementEvent) (*Entity, error)
- func (d *DirectoryDB) UpsertIndexerStatus(indexerStatus *IndexerStatus) (*Entity, error)
- func (d *DirectoryDB) UpsertOpenContractEvent(contractID int64, evt types.OpenContractEvent) (*Entity, error)
- func (d *DirectoryDB) UpsertProviderMetadata(providerID int64, data sentinel.Metadata) (*Entity, error)
- func (d *DirectoryDB) UpsertValidatorPayoutEvent(evt types.ValidatorPayoutEvent) (*Entity, error)
- type Entity
- type IndexerStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArkeoContract ¶
type ArkeoContract struct { Entity ProviderID int64 `db:"provider_id"` DelegatePubkey string `db:"delegate_pubkey"` ClientPubkey string `db:"client_pubkey"` Height int64 `db:"height"` ContractType types.ContractType `db:"contract_type"` Duration int64 `db:"duration"` Rate int64 `db:"rate"` OpenCost int64 `db:"open_cost"` ClosedHeight int64 `db:"closed_height"` }
type ArkeoProvider ¶
type ArkeoProvider struct { Entity `json:"-"` Pubkey string `db:"pubkey"` Chain string `db:"chain"` // this is a DECIMAL type in the db Bond string `db:"bond"` MetadataURI string `db:"metadata_uri"` MetadataNonce uint64 `db:"metadata_nonce"` Status types.ProviderStatus `db:"status,text"` MinContractDuration int64 `db:"min_contract_duration"` MaxContractDuration int64 `db:"max_contract_duration"` SubscriptionRate int64 `db:"subscription_rate"` PayAsYouGoRate int64 `db:"paygo_rate"` }
type DirectoryDB ¶
type DirectoryDB struct {
// contains filtered or unexported fields
}
func New ¶
func New(config DBConfig) (*DirectoryDB, error)
func (*DirectoryDB) CloseContract ¶
func (d *DirectoryDB) CloseContract(contractID int64, height int64) (*Entity, error)
func (*DirectoryDB) FindBlockGaps ¶
func (d *DirectoryDB) FindBlockGaps() ([]*BlockGap, error)
func (*DirectoryDB) FindContract ¶
func (d *DirectoryDB) FindContract(providerID int64, delegatePubkey string, height int64) (*ArkeoContract, error)
func (*DirectoryDB) FindContractByPubKeys ¶
func (d *DirectoryDB) FindContractByPubKeys(chain string, providerPubkey string, delegatePubkey string, height int64) (*ArkeoContract, error)
func (*DirectoryDB) FindContractsByPubKeys ¶
func (d *DirectoryDB) FindContractsByPubKeys(chain string, providerPubkey string, delegatePubkey string) ([]*ArkeoContract, error)
func (*DirectoryDB) FindIndexerStatus ¶
func (d *DirectoryDB) FindIndexerStatus(id int64) (*IndexerStatus, error)
func (*DirectoryDB) FindLatestBlock ¶
func (d *DirectoryDB) FindLatestBlock() (*Block, error)
func (*DirectoryDB) FindProvider ¶
func (d *DirectoryDB) FindProvider(pubkey string, chain string) (*ArkeoProvider, error)
func (*DirectoryDB) GetArkeoNetworkStats ¶
func (d *DirectoryDB) GetArkeoNetworkStats() (*types.ArkeoStats, error)
func (*DirectoryDB) InsertBlock ¶
func (d *DirectoryDB) InsertBlock(b *Block) (*Entity, error)
func (*DirectoryDB) InsertBondProviderEvent ¶
func (d *DirectoryDB) InsertBondProviderEvent(providerID int64, evt types.BondProviderEvent) (*Entity, error)
func (*DirectoryDB) InsertModProviderEvent ¶
func (d *DirectoryDB) InsertModProviderEvent(providerID int64, evt types.ModProviderEvent) (*Entity, error)
func (*DirectoryDB) InsertProvider ¶
func (d *DirectoryDB) InsertProvider(provider *ArkeoProvider) (*Entity, error)
func (*DirectoryDB) SearchProviders ¶
func (d *DirectoryDB) SearchProviders(criteria types.ProviderSearchParams) ([]*ArkeoProvider, error)
func (*DirectoryDB) UpdateIndexerStatus ¶
func (d *DirectoryDB) UpdateIndexerStatus(indexerStatus *IndexerStatus) (*Entity, error)
func (*DirectoryDB) UpdateProvider ¶
func (d *DirectoryDB) UpdateProvider(provider *ArkeoProvider) (*Entity, error)
func (*DirectoryDB) UpsertCloseContractEvent ¶
func (d *DirectoryDB) UpsertCloseContractEvent(contractID int64, evt types.CloseContractEvent) (*Entity, error)
func (*DirectoryDB) UpsertContract ¶
func (d *DirectoryDB) UpsertContract(providerID int64, evt types.OpenContractEvent) (*Entity, error)
func (*DirectoryDB) UpsertContractSettlementEvent ¶
func (d *DirectoryDB) UpsertContractSettlementEvent(contractID int64, evt types.ContractSettlementEvent) (*Entity, error)
func (*DirectoryDB) UpsertIndexerStatus ¶
func (d *DirectoryDB) UpsertIndexerStatus(indexerStatus *IndexerStatus) (*Entity, error)
func (*DirectoryDB) UpsertOpenContractEvent ¶
func (d *DirectoryDB) UpsertOpenContractEvent(contractID int64, evt types.OpenContractEvent) (*Entity, error)
func (*DirectoryDB) UpsertProviderMetadata ¶
func (*DirectoryDB) UpsertValidatorPayoutEvent ¶
func (d *DirectoryDB) UpsertValidatorPayoutEvent(evt types.ValidatorPayoutEvent) (*Entity, error)
type Entity ¶
type Entity struct { ID int64 `db:"id"` Created time.Time `db:"created"` Updated time.Time `db:"updated"` }
base entity for db types
type IndexerStatus ¶
Click to show internal directories.
Click to hide internal directories.