Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChainHeight ¶
ChainHeight is used to cache the chain height of the current node which is being updated each time the node sends an event of EventNewBlockHeader. It starts a goroutine to subscribe to blockchain new block event and update the cached height.
func (*ChainHeight) GetChainHeight ¶
func (ch *ChainHeight) GetChainHeight() (int64, error)
GetChainHeight returns the last chain height available.
type OracleClient ¶
type OracleClient struct {
Logger zerolog.Logger
ChainID string
TMRPC string
RPCTimeout time.Duration
OracleAddr sdk.AccAddress
OracleAddrString string
Keyring cosmkeyring.Keyring
ValidatorAddrString string
Encoding params.EncodingConfig
GasPrices string
GasAdjustment float64
GRPCEndpoint string
ChainHeight *ChainHeight
Fees string
}
OracleClient defines a structure that interfaces with the persistence node.
func NewOracleClient ¶
func NewOracleClient( ctx context.Context, logger zerolog.Logger, chainID string, keyringBackend string, keyringDir string, keyringPass string, keyPrivHex string, keyMnemonic string, tmRPC string, rpcTimeout time.Duration, oracleAddrString string, validatorAddrString string, grpcEndpoint string, gasAdjustment float64, fees string, ) (OracleClient, error)
func (OracleClient) BroadcastTx ¶
func (oc OracleClient) BroadcastTx(ctx context.Context, nextBlockHeight, timeoutHeight int64, msgs ...sdk.Msg) error
BroadcastTx attempts to broadcast a signed transaction. If it fails, a few re-attempts will be made until the transaction succeeds or ultimately times out or fails.
Click to show internal directories.
Click to hide internal directories.