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 MayachainBridge
- func (b *MayachainBridge) Broadcast(msgs ...stypes.Msg) (common.TxID, error)
- func (b *MayachainBridge) EnsureNodeWhitelisted() error
- func (b *MayachainBridge) EnsureNodeWhitelistedWithTimeout() error
- func (b *MayachainBridge) FetchNodeStatus() (stypes.NodeStatus, error)
- func (b *MayachainBridge) GetAsgards() (stypes.Vaults, error)
- func (b *MayachainBridge) GetBlockHeight() (int64, error)
- func (b *MayachainBridge) GetConfig() config.BifrostClientConfiguration
- func (b *MayachainBridge) GetConstants() (map[string]int64, error)
- func (b *MayachainBridge) GetContext() client.Context
- func (b *MayachainBridge) GetContractAddress() ([]PubKeyContractAddressPair, error)
- func (b *MayachainBridge) GetErrataMsg(txID common.TxID, chain common.Chain) sdk.Msg
- func (b *MayachainBridge) GetKeygenBlock(blockHeight int64, pk string) (types.KeygenBlock, error)
- func (b *MayachainBridge) GetKeygenStdTx(poolPubKey common.PubKey, blame stypes.Blame, inputPks common.PubKeys, ...) (sdk.Msg, error)
- func (b *MayachainBridge) GetKeysign(blockHeight int64, pk string) (types.TxOut, error)
- func (b *MayachainBridge) GetKeysignParty(vaultPubKey common.PubKey) (common.PubKeys, error)
- func (b *MayachainBridge) GetLastObservedInHeight(chain common.Chain) (int64, error)
- func (b *MayachainBridge) GetLastSignedOutHeight(chain common.Chain) (int64, error)
- func (b *MayachainBridge) GetMAYAName(name string) (stypes.MAYAName, error)
- func (b *MayachainBridge) GetMayachainVersion() (semver.Version, error)
- func (b *MayachainBridge) GetMimir(key string) (int64, error)
- func (b *MayachainBridge) GetNodeAccount(thorAddr string) (*types.NodeAccount, error)
- func (b *MayachainBridge) GetObservationsStdTx(txIns stypes.ObservedTxs) ([]cosmos.Msg, error)
- func (b *MayachainBridge) GetPools() (stypes.Pools, error)
- func (b *MayachainBridge) GetPubKeys() ([]PubKeyContractAddressPair, error)
- func (b *MayachainBridge) GetSolvencyMsg(height int64, chain common.Chain, pubKey common.PubKey, coins common.Coins) sdk.Msg
- func (b *MayachainBridge) IsCatchingUp() (bool, error)
- func (b *MayachainBridge) PostKeysignFailure(blame stypes.Blame, height int64, memo string, coins common.Coins, ...) (common.TxID, error)
- func (b *MayachainBridge) PostNetworkFee(height int64, chain common.Chain, transactionSize, transactionRate uint64) (common.TxID, error)
- func (b *MayachainBridge) RagnarokInProgress() (bool, error)
- func (b *MayachainBridge) WaitToCatchUp() error
- type PoolManager
- type PoolMgr
- type PubKeyContractAddressPair
- type QueryKeysign
Constants ¶
const ( AuthAccountEndpoint = "/auth/accounts" BroadcastTxsEndpoint = "/" KeygenEndpoint = "/mayachain/keygen" KeysignEndpoint = "/mayachain/keysign" LastBlockEndpoint = "/mayachain/lastblock" NodeAccountEndpoint = "/mayachain/node" SignerMembershipEndpoint = "/mayachain/vaults/%s/signers" StatusEndpoint = "/status" AsgardVault = "/mayachain/vaults/asgard" PubKeysEndpoint = "/mayachain/vaults/pubkeys" MayachainConstants = "/mayachain/constants" RagnarokEndpoint = "/mayachain/ragnarok" MimirEndpoint = "/mayachain/mimir" ChainVersionEndpoint = "/mayachain/version" InboundAddressesEndpoint = "/mayachain/inbound_addresses" PoolsEndpoint = "/mayachain/pools" MAYANameEndpoint = "/mayachain/mayaname/%s" )
Endpoint urls
Variables ¶
var ErrNotFound = 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
Types ¶
type Keys ¶
type Keys struct {
// contains filtered or unexported fields
}
Keys manages all the keys used by mayachain
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 MayachainBridge ¶
type MayachainBridge struct {
// contains filtered or unexported fields
}
MayachainBridge will be used to send tx to BASEChain
func NewMayachainBridge ¶
func NewMayachainBridge(cfg config.BifrostClientConfiguration, m *metrics.Metrics, k *Keys) (*MayachainBridge, error)
NewMayachainBridge create a new instance of MayachainBridge
func (*MayachainBridge) EnsureNodeWhitelisted ¶
func (b *MayachainBridge) EnsureNodeWhitelisted() error
EnsureNodeWhitelisted will call to mayachain to check whether the observer had been whitelist or not
func (*MayachainBridge) EnsureNodeWhitelistedWithTimeout ¶
func (b *MayachainBridge) EnsureNodeWhitelistedWithTimeout() error
EnsureNodeWhitelistedWithTimeout check node is whitelisted with timeout retry
func (*MayachainBridge) FetchNodeStatus ¶
func (b *MayachainBridge) FetchNodeStatus() (stypes.NodeStatus, error)
FetchNodeStatus get current node status from mayachain
func (*MayachainBridge) GetAsgards ¶
func (b *MayachainBridge) GetAsgards() (stypes.Vaults, error)
GetAsgards retrieve all the asgard vaults from mayachain
func (*MayachainBridge) GetBlockHeight ¶
func (b *MayachainBridge) GetBlockHeight() (int64, error)
GetBlockHeight returns the current height for mayachain blocks
func (*MayachainBridge) GetConfig ¶
func (b *MayachainBridge) GetConfig() config.BifrostClientConfiguration
GetConfig return the configuration
func (*MayachainBridge) GetConstants ¶
func (b *MayachainBridge) GetConstants() (map[string]int64, error)
GetConstants from thornode
func (*MayachainBridge) GetContext ¶
func (b *MayachainBridge) GetContext() client.Context
GetContext return a valid context with all relevant values set
func (*MayachainBridge) GetContractAddress ¶
func (b *MayachainBridge) GetContractAddress() ([]PubKeyContractAddressPair, error)
GetContractAddress retrieve the contract address from asgard
func (*MayachainBridge) GetErrataMsg ¶
GetErrataMsg get errata tx from params
func (*MayachainBridge) GetKeygenBlock ¶
func (b *MayachainBridge) GetKeygenBlock(blockHeight int64, pk string) (types.KeygenBlock, error)
GetKeygenBlock retrieves keygen request for the given block height from mayachain
func (*MayachainBridge) GetKeygenStdTx ¶
func (b *MayachainBridge) 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 (*MayachainBridge) GetKeysign ¶
GetKeysign retrieves txout from this block height from mayachain
func (*MayachainBridge) GetKeysignParty ¶
GetKeysignParty call into mayachain to get the node accounts that should be join together to sign the message
func (*MayachainBridge) GetLastObservedInHeight ¶
func (b *MayachainBridge) GetLastObservedInHeight(chain common.Chain) (int64, error)
GetLastObservedInHeight returns the lastobservedin value for the chain past in
func (*MayachainBridge) GetLastSignedOutHeight ¶
func (b *MayachainBridge) GetLastSignedOutHeight(chain common.Chain) (int64, error)
GetLastSignedOutHeight returns the lastsignedout value for mayachain
func (*MayachainBridge) GetMAYAName ¶
func (b *MayachainBridge) GetMAYAName(name string) (stypes.MAYAName, error)
GetMAYAName get MAYAName from BASEChain
func (*MayachainBridge) GetMayachainVersion ¶
func (b *MayachainBridge) GetMayachainVersion() (semver.Version, error)
GetMayachainVersion retrieve mayachain version
func (*MayachainBridge) GetMimir ¶
func (b *MayachainBridge) GetMimir(key string) (int64, error)
GetMimir - get mimir settings
func (*MayachainBridge) GetNodeAccount ¶
func (b *MayachainBridge) GetNodeAccount(thorAddr string) (*types.NodeAccount, error)
GetNodeAccount retrieves node account for this address from mayachain
func (*MayachainBridge) GetObservationsStdTx ¶
func (b *MayachainBridge) GetObservationsStdTx(txIns stypes.ObservedTxs) ([]cosmos.Msg, error)
GetObservationsStdTx get observations tx from txIns
func (*MayachainBridge) GetPools ¶
func (b *MayachainBridge) GetPools() (stypes.Pools, error)
GetPools get pools from BASEChain
func (*MayachainBridge) GetPubKeys ¶
func (b *MayachainBridge) GetPubKeys() ([]PubKeyContractAddressPair, error)
GetPubKeys retrieve asgard vaults and yggdrasil vaults , and it's relevant smart contracts
func (*MayachainBridge) GetSolvencyMsg ¶
func (b *MayachainBridge) GetSolvencyMsg(height int64, chain common.Chain, pubKey common.PubKey, coins common.Coins) sdk.Msg
GetSolvencyMsg create MsgSolvency from the given parameters
func (*MayachainBridge) IsCatchingUp ¶
func (b *MayachainBridge) IsCatchingUp() (bool, error)
IsCatchingUp returns bool for if mayachain is catching up to the rest of the nodes. Returns yes, if it is, false if it is caught up.
func (*MayachainBridge) PostKeysignFailure ¶
func (b *MayachainBridge) 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 (*MayachainBridge) PostNetworkFee ¶
func (b *MayachainBridge) PostNetworkFee(height int64, chain common.Chain, transactionSize, transactionRate uint64) (common.TxID, error)
PostNetworkFee send network fee message to THORNode
func (*MayachainBridge) RagnarokInProgress ¶
func (b *MayachainBridge) RagnarokInProgress() (bool, error)
RagnarokInProgress is to query mayachain to check whether ragnarok had been triggered
func (*MayachainBridge) WaitToCatchUp ¶
func (b *MayachainBridge) WaitToCatchUp() error
WaitToCatchUp wait for mayachain to catch up
type PoolManager ¶
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 ¶
type PoolMgr struct {
// contains filtered or unexported fields
}
PoolMgr implement PoolManager interface
func NewPoolMgr ¶
func NewPoolMgr(bridge *MayachainBridge) *PoolMgr
NewPoolMgr create a new instance of PoolMgr
type PubKeyContractAddressPair ¶
type PubKeyContractAddressPair struct { PubKey common.PubKey Contracts map[common.Chain]common.Address }
PubKeyContractAddressPair is an entry to map pubkey and contract addresses