Documentation ¶
Index ¶
- Constants
- Variables
- func EnsureDatabase(user, password, host, database, ssl string) error
- func EnsureSchema(pg *sql.DB, database, rouser, ropassword string) error
- func FetchGenesis(ctx context.Context, c *TendermintClient) (*starname.GenesisState, error)
- func FetchLcdData(ctx context.Context, urlLCD string, queries *[]*LcdRequestData, height int64) (*[]*LcdResponseData, error)
- func Sync(ctx context.Context, tmc *TendermintClient, st *Store, denom string, ...) (uint, error)
- type ABCIInfo
- type Block
- type Configuration
- type LcdRequestData
- type LcdResponseData
- type QueryError
- type StarnameResponse
- type Store
- func (st *Store) AddAccountCertificates(ctx context.Context, msg *types.MsgAddAccountCertificates, height int64) (int64, error)
- func (st *Store) BatchBegin(ctx context.Context) error
- func (st *Store) BatchCommit(ctx context.Context) error
- func (st *Store) BatchRollback() error
- func (st *Store) DeleteAccount(ctx context.Context, msg *types.MsgDeleteAccount, height int64) (int64, error)
- func (st *Store) DeleteAccountCerts(ctx context.Context, msg *types.MsgDeleteAccountCertificate, height int64) (int64, error)
- func (st *Store) DeleteDomain(ctx context.Context, msg *types.MsgDeleteDomain, height int64) (int64, error)
- func (st *Store) HandleLcdData(ctx context.Context, queries *[]*LcdRequestData, responses *[]*LcdResponseData, ...) error
- func (st *Store) InsertBlock(ctx context.Context, b Block) error
- func (st *Store) InsertGenesis(ctx context.Context, tmc *TendermintClient) error
- func (st *Store) LastNBlock(ctx context.Context, limit, after int) ([]*Block, error)
- func (st *Store) LatestBlock(ctx context.Context) (*Block, error)
- func (st *Store) RegisterAccount(ctx context.Context, msg *types.MsgRegisterAccount, height int64) (int64, error)
- func (st *Store) RegisterDomain(ctx context.Context, msg *types.MsgRegisterDomain, height int64) (int64, error)
- func (st *Store) RenewAccount(ctx context.Context, msg *types.MsgRenewAccount, height int64) (int64, error)
- func (st *Store) RenewDomain(ctx context.Context, msg *types.MsgRenewDomain, height int64) (int64, error)
- func (st *Store) ReplaceAccountMetadata(ctx context.Context, msg *types.MsgReplaceAccountMetadata, height int64) (int64, error)
- func (st *Store) ReplaceAccountResources(ctx context.Context, msg *types.MsgReplaceAccountResources, height int64) (int64, error)
- func (st *Store) TransferAccount(ctx context.Context, msg *types.MsgTransferAccount, height int64) (int64, error)
- func (st *Store) TransferDomain(ctx context.Context, msg *types.MsgTransferDomain, height int64) (int64, error)
- type TendermintBlock
- type TendermintClient
- type TendermintCommit
Constants ¶
View Source
const ModuleName = "block-metrics"
Variables ¶
View Source
var ( ErrNotImplemented = errors.Register(ModuleName, 1, "not implemented") ErrFailedResponse = errors.Register(ModuleName, 2, "failed response") ErrConflict = errors.Register(ModuleName, 3, "conflict") ErrLimit = errors.Register(ModuleName, 4, "limit") ErrNotFound = errors.Register(ModuleName, 5, "not found") ErrDenom = errors.Register(ModuleName, 6, "denomination not supported") )
View Source
var ModuleCdc *codec.Codec
Functions ¶
func EnsureDatabase ¶ added in v0.9.7
func FetchGenesis ¶
func FetchGenesis(ctx context.Context, c *TendermintClient) (*starname.GenesisState, error)
func FetchLcdData ¶ added in v0.9.7
func FetchLcdData(ctx context.Context, urlLCD string, queries *[]*LcdRequestData, height int64) (*[]*LcdResponseData, error)
func Sync ¶
func Sync(ctx context.Context, tmc *TendermintClient, st *Store, denom string, urlLCD string) (uint, error)
Sync uploads to local store all blocks that are not present yet, starting with the blocks with the lowest height first. It always returns the number of blocks inserted, even if returning an error.
Types ¶
type Configuration ¶
type Configuration struct { // database DBHost string DBName string DBSSL string // Read-write user DBUser string DBPass string // Read-only user DBROUser string DBROPass string // Denomination of the fee coin, eg uiov FeeDenom string // Tendermint light client daemon URL TendermintLcdUrl string // Tendermint websocket URI TendermintWsURI string }
type LcdRequestData ¶ added in v0.9.7
type LcdRequestData struct { // accounts.id AccountID int64 // URL encoded parameters to narrow the query on /txs as much as possible Params map[string]string }
LcdRequestData is the data required to populate the product_fees table
type LcdResponseData ¶ added in v0.9.7
type LcdResponseData struct { TxResponse *types.TxResponse TxError *error StarnameResponse *StarnameResponse StarnameError *error }
type QueryError ¶
func (*QueryError) Error ¶
func (e *QueryError) Error() string
type StarnameResponse ¶ added in v0.9.7
type StarnameResponse struct { Height string `json:"height"` Result struct { Account starnametypes.Account `json:"account"` } `json:"result"` }
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) AddAccountCertificates ¶
func (*Store) BatchRollback ¶ added in v0.9.7
func (*Store) DeleteAccount ¶
func (*Store) DeleteAccountCerts ¶
func (*Store) DeleteDomain ¶
func (*Store) HandleLcdData ¶ added in v0.9.7
func (st *Store) HandleLcdData(ctx context.Context, queries *[]*LcdRequestData, responses *[]*LcdResponseData, height int64, denom string) error
func (*Store) InsertGenesis ¶
func (st *Store) InsertGenesis(ctx context.Context, tmc *TendermintClient) error
func (*Store) LastNBlock ¶
func (*Store) RegisterAccount ¶
func (*Store) RegisterDomain ¶
func (*Store) RenewAccount ¶ added in v0.9.7
func (*Store) RenewDomain ¶ added in v0.9.7
func (*Store) ReplaceAccountMetadata ¶
func (*Store) ReplaceAccountResources ¶
func (*Store) TransferAccount ¶
func (*Store) TransferDomain ¶
type TendermintBlock ¶
type TendermintBlock struct { Height int64 Time time.Time Transactions []*auth.StdTx TransactionHashes [][32]byte }
func FetchBlock ¶
func FetchBlock(ctx context.Context, c *TendermintClient, height int64) (*TendermintBlock, error)
type TendermintClient ¶
type TendermintClient struct {
// contains filtered or unexported fields
}
func DialTendermint ¶
func DialTendermint(websocketURL string) (*TendermintClient, error)
DialTendermint returns a client that is maintains a websocket connection to tendermint API. The websocket is used instead of standard HTTP connection to lower the latency, bypass throttling and to allow subscription requests.
func (*TendermintClient) Close ¶
func (c *TendermintClient) Close() error
func (*TendermintClient) Do ¶
func (c *TendermintClient) Do(method string, dest interface{}, args ...interface{}) error
Do makes a jsonrpc call. This method is safe for concurrent calls.
Use API as described in https://tendermint.com/rpc/
Click to show internal directories.
Click to hide internal directories.