Documentation ¶
Index ¶
- Constants
- Variables
- func GetKeyringKeybase(chainHomeFolder, signerName, password string) (ckeys.Keyring, ckeys.Info, error)
- func MakeCodec() codec.ProtoCodecMarshaler
- func MakeLegacyCodec() *codec.LegacyAmino
- type Keys
- type PoolManager
- type PoolMgr
- type PubKeyContractAddressPair
- type QueryKeysign
- type ThorchainBridge
- func (b *ThorchainBridge) Broadcast(msgs ...stypes.Msg) (common.TxID, error)
- func (b *ThorchainBridge) EnsureNodeWhitelisted() error
- func (b *ThorchainBridge) EnsureNodeWhitelistedWithTimeout() error
- func (b *ThorchainBridge) FetchNodeStatus() (stypes.NodeStatus, error)
- func (b *ThorchainBridge) GetAsgards() (stypes.Vaults, error)
- func (b *ThorchainBridge) GetBlockHeight() (int64, error)
- func (b *ThorchainBridge) GetConfig() config.ClientConfiguration
- func (b *ThorchainBridge) GetConstants() (map[string]int64, error)
- func (b *ThorchainBridge) GetContext() client.Context
- func (b *ThorchainBridge) GetContractAddress() ([]PubKeyContractAddressPair, error)
- func (b *ThorchainBridge) GetErrataMsg(txID common.TxID, chain common.Chain) sdk.Msg
- func (b *ThorchainBridge) GetKeygenBlock(blockHeight int64, pk string) (types.KeygenBlock, error)
- func (b *ThorchainBridge) GetKeygenStdTx(poolPubKey common.PubKey, blame stypes.Blame, inputPks common.PubKeys, ...) (sdk.Msg, error)
- func (b *ThorchainBridge) GetKeysign(blockHeight int64, pk string) (types.TxOut, error)
- func (b *ThorchainBridge) GetKeysignParty(vaultPubKey common.PubKey) (common.PubKeys, error)
- func (b *ThorchainBridge) GetLastObservedInHeight(chain common.Chain) (int64, error)
- func (b *ThorchainBridge) GetLastSignedOutHeight(chain common.Chain) (int64, error)
- func (b *ThorchainBridge) GetMimir(key string) (int64, error)
- func (b *ThorchainBridge) GetNodeAccount(thorAddr string) (*types.NodeAccount, error)
- func (b *ThorchainBridge) GetObservationsStdTx(txIns stypes.ObservedTxs) ([]cosmos.Msg, error)
- func (b *ThorchainBridge) GetPools() (stypes.Pools, error)
- func (b *ThorchainBridge) GetPubKeys() ([]PubKeyContractAddressPair, error)
- func (b *ThorchainBridge) GetSolvencyMsg(height int64, chain common.Chain, pubKey common.PubKey, coins common.Coins) sdk.Msg
- func (b *ThorchainBridge) GetTHORName(name string) (stypes.THORName, error)
- func (b *ThorchainBridge) GetThorchainVersion() (semver.Version, error)
- func (b *ThorchainBridge) IsCatchingUp() (bool, error)
- func (b *ThorchainBridge) PostKeysignFailure(blame stypes.Blame, height int64, memo string, coins common.Coins, ...) (common.TxID, error)
- func (b *ThorchainBridge) PostNetworkFee(height int64, chain common.Chain, transactionSize, transactionRate uint64) (common.TxID, error)
- func (b *ThorchainBridge) RagnarokInProgress() (bool, error)
- func (b *ThorchainBridge) WaitToCatchUp() error
Constants ¶
const ( AuthAccountEndpoint = "/auth/accounts" BroadcastTxsEndpoint = "/" KeygenEndpoint = "/thorchain/keygen" KeysignEndpoint = "/thorchain/keysign" LastBlockEndpoint = "/thorchain/lastblock" NodeAccountEndpoint = "/thorchain/node" SignerMembershipEndpoint = "/thorchain/vaults/%s/signers" StatusEndpoint = "/status" AsgardVault = "/thorchain/vaults/asgard" PubKeysEndpoint = "/thorchain/vaults/pubkeys" ThorchainConstants = "/thorchain/constants" RagnarokEndpoint = "/thorchain/ragnarok" MimirEndpoint = "/thorchain/mimir" ChainVersionEndpoint = "/thorchain/version" InboundAddressesEndpoint = "/thorchain/inbound_addresses" PoolsEndpoint = "/thorchain/pools" THORNameEndpoint = "/thorchain/thorname/%s" )
Endpoint urls
Variables ¶
var ErrNotFound error = fmt.Errorf("not found")
Functions ¶
func GetKeyringKeybase ¶
func GetKeyringKeybase(chainHomeFolder, signerName, password string) (ckeys.Keyring, ckeys.Info, error)
GetKeyringKeybase return keyring and key info
func MakeCodec ¶
func MakeCodec() codec.ProtoCodecMarshaler
func MakeLegacyCodec ¶ added in v0.41.0
func MakeLegacyCodec() *codec.LegacyAmino
MakeLegacyCodec creates codec
Types ¶
type Keys ¶
type Keys struct {
// contains filtered or unexported fields
}
Keys manages all the keys used by thorchain
func NewKeysWithKeybase ¶
NewKeysWithKeybase create a new instance of Keys
func (*Keys) GetPrivateKey ¶
func (k *Keys) GetPrivateKey() (cryptotypes.PrivKey, error)
GetPrivateKey return the private key
func (*Keys) GetSignerInfo ¶
GetSignerInfo return signer info
type PoolManager ¶ added in v0.41.0
type PoolManager interface {
GetValue(source, target common.Asset, amount cosmos.Uint) (cosmos.Uint, error)
}
PoolManager provide all the functionalities need to deal with pool
type PoolMgr ¶ added in v0.41.0
type PoolMgr struct {
// contains filtered or unexported fields
}
PoolMgr implement PoolManager interface
func NewPoolMgr ¶ added in v0.41.0
func NewPoolMgr(bridge *ThorchainBridge) *PoolMgr
NewPoolMgr create a new instance of PoolMgr
type PubKeyContractAddressPair ¶ added in v0.41.0
type PubKeyContractAddressPair struct { PubKey common.PubKey Contracts map[common.Chain]common.Address }
PubKeyContractAddressPair is an entry to map pubkey and contract addresses
type QueryKeysign ¶
type ThorchainBridge ¶
type ThorchainBridge struct {
// contains filtered or unexported fields
}
ThorchainBridge will be used to send tx to THORChain
func NewThorchainBridge ¶
func NewThorchainBridge(cfg config.ClientConfiguration, m *metrics.Metrics, k *Keys) (*ThorchainBridge, error)
NewThorchainBridge create a new instance of ThorchainBridge
func (*ThorchainBridge) EnsureNodeWhitelisted ¶
func (b *ThorchainBridge) EnsureNodeWhitelisted() error
EnsureNodeWhitelisted will call to thorchain to check whether the observer had been whitelist or not
func (*ThorchainBridge) EnsureNodeWhitelistedWithTimeout ¶
func (b *ThorchainBridge) EnsureNodeWhitelistedWithTimeout() error
EnsureNodeWhitelistedWithTimeout check node is whitelisted with timeout retry
func (*ThorchainBridge) FetchNodeStatus ¶
func (b *ThorchainBridge) FetchNodeStatus() (stypes.NodeStatus, error)
FetchNodeStatus get current node status from thorchain
func (*ThorchainBridge) GetAsgards ¶
func (b *ThorchainBridge) GetAsgards() (stypes.Vaults, error)
GetAsgards retrieve all the asgard vaults from thorchain
func (*ThorchainBridge) GetBlockHeight ¶
func (b *ThorchainBridge) GetBlockHeight() (int64, error)
GetBlockHeight returns the current height for thorchain blocks
func (*ThorchainBridge) GetConfig ¶
func (b *ThorchainBridge) GetConfig() config.ClientConfiguration
GetConfig return the configuration
func (*ThorchainBridge) GetConstants ¶
func (b *ThorchainBridge) GetConstants() (map[string]int64, error)
GetConstants from thornode
func (*ThorchainBridge) GetContext ¶ added in v0.41.0
func (b *ThorchainBridge) GetContext() client.Context
GetContext return a valid context with all relevant values set
func (*ThorchainBridge) GetContractAddress ¶ added in v0.41.0
func (b *ThorchainBridge) GetContractAddress() ([]PubKeyContractAddressPair, error)
GetContractAddress retrieve the contract address from asgard
func (*ThorchainBridge) GetErrataMsg ¶ added in v0.41.0
GetErrataMsg get errata tx from params
func (*ThorchainBridge) GetKeygenBlock ¶
func (b *ThorchainBridge) GetKeygenBlock(blockHeight int64, pk string) (types.KeygenBlock, error)
GetKeygenBlock retrieves keygen request for the given block height from thorchain
func (*ThorchainBridge) GetKeygenStdTx ¶
func (b *ThorchainBridge) GetKeygenStdTx(poolPubKey common.PubKey, blame stypes.Blame, inputPks common.PubKeys, keygenType stypes.KeygenType, chains common.Chains, height, keygenTime int64) (sdk.Msg, error)
GetKeygenStdTx get keygen tx from params
func (*ThorchainBridge) GetKeysign ¶
GetKeysign retrieves txout from this block height from thorchain
func (*ThorchainBridge) GetKeysignParty ¶
GetKeysignParty call into thorchain to get the node accounts that should be join together to sign the message
func (*ThorchainBridge) GetLastObservedInHeight ¶
func (b *ThorchainBridge) GetLastObservedInHeight(chain common.Chain) (int64, error)
GetLastObservedInHeight returns the lastobservedin value for the chain past in
func (*ThorchainBridge) GetLastSignedOutHeight ¶
func (b *ThorchainBridge) GetLastSignedOutHeight(chain common.Chain) (int64, error)
GetLastSignedOutHeight returns the lastsignedout value for thorchain
func (*ThorchainBridge) GetMimir ¶
func (b *ThorchainBridge) GetMimir(key string) (int64, error)
GetMimir - get mimir settings
func (*ThorchainBridge) GetNodeAccount ¶
func (b *ThorchainBridge) GetNodeAccount(thorAddr string) (*types.NodeAccount, error)
GetNodeAccount retrieves node account for this address from thorchain
func (*ThorchainBridge) GetObservationsStdTx ¶
func (b *ThorchainBridge) GetObservationsStdTx(txIns stypes.ObservedTxs) ([]cosmos.Msg, error)
GetObservationsStdTx get observations tx from txIns
func (*ThorchainBridge) GetPools ¶ added in v0.41.0
func (b *ThorchainBridge) GetPools() (stypes.Pools, error)
GetPools get pools from THORChain
func (*ThorchainBridge) GetPubKeys ¶
func (b *ThorchainBridge) GetPubKeys() ([]PubKeyContractAddressPair, error)
GetPubKeys retrieve asgard vaults and yggdrasil vaults , and it's relevant smart contracts
func (*ThorchainBridge) GetSolvencyMsg ¶ added in v0.63.0
func (b *ThorchainBridge) GetSolvencyMsg(height int64, chain common.Chain, pubKey common.PubKey, coins common.Coins) sdk.Msg
GetSolvencyMsg create MsgSolvency from the given parameters
func (*ThorchainBridge) GetTHORName ¶ added in v0.58.0
func (b *ThorchainBridge) GetTHORName(name string) (stypes.THORName, error)
GetTHORName get THORName from THORChain
func (*ThorchainBridge) GetThorchainVersion ¶ added in v0.41.0
func (b *ThorchainBridge) GetThorchainVersion() (semver.Version, error)
GetThorchainVersion retrieve thorchain version
func (*ThorchainBridge) IsCatchingUp ¶
func (b *ThorchainBridge) IsCatchingUp() (bool, error)
IsCatchingUp returns bool for if thorchain is catching up to the rest of the nodes. Returns yes, if it is, false if it is caught up.
func (*ThorchainBridge) PostKeysignFailure ¶
func (b *ThorchainBridge) PostKeysignFailure(blame stypes.Blame, height int64, memo string, coins common.Coins, pubkey common.PubKey) (common.TxID, error)
PostKeysignFailure generate and post a keysign fail tx to thorchan
func (*ThorchainBridge) PostNetworkFee ¶
func (b *ThorchainBridge) PostNetworkFee(height int64, chain common.Chain, transactionSize, transactionRate uint64) (common.TxID, error)
PostNetworkFee send network fee message to THORNode
func (*ThorchainBridge) RagnarokInProgress ¶
func (b *ThorchainBridge) RagnarokInProgress() (bool, error)
RagnarokInProgress is to query thorchain to check whether ragnarok had been triggered
func (*ThorchainBridge) WaitToCatchUp ¶
func (b *ThorchainBridge) WaitToCatchUp() error
WaitToCatchUp wait for thorchain to catch up