thorclient

package
v0.17.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2021 License: MIT Imports: 35 Imported by: 18

Documentation

Index

Constants

View Source
const (
	AuthAccountEndpoint      = "/auth/accounts"
	BroadcastTxsEndpoint     = "/txs"
	KeygenEndpoint           = "/thorchain/keygen"
	KeysignEndpoint          = "/thorchain/keysign"
	LastBlockEndpoint        = "/thorchain/lastblock"
	NodeAccountEndpoint      = "/thorchain/nodeaccount"
	ValidatorsEndpoint       = "/thorchain/validators"
	SignerMembershipEndpoint = "/thorchain/vaults/%s/signers"
	StatusEndpoint           = "/status"
	AsgardVault              = "/thorchain/vaults/asgard"
	PubKeysEndpoint          = "/thorchain/vaults/pubkeys"
	ThorchainConstants       = "/thorchain/constants"
	RagnarokEndpoint         = "/thorchain/ragnarok"
	MimirEndpoint            = "/thorchain/mimir"
)

Endpoint urls

Variables

View Source
var ErrNotFound error = fmt.Errorf("not found")

Functions

func GetKeyringKeybase

func GetKeyringKeybase(chainHomeFolder, signerName, password string) (ckeys.Keybase, ckeys.Info, error)

NewKeys create a new instance of keys

func MakeCodec

func MakeCodec() *codec.Codec

MakeCodec creates codec

Types

type KeySignPartyMgr

type KeySignPartyMgr struct {
	// contains filtered or unexported fields
}

KeySignPartyMgr is to cache the keysign party locally

func NewKeySignPartyMgr

func NewKeySignPartyMgr(bridge *ThorchainBridge) *KeySignPartyMgr

NewKeySignPartyMgr create a new instance of KeySignPartyMgr

func (*KeySignPartyMgr) GetKeySignParty

func (mgr *KeySignPartyMgr) GetKeySignParty(poolPubKey common.PubKey) (common.PubKeys, error)

GetKeySignParty is going to return a keysign party for the given pool pubkey it check internal cache first , if it is available then user the cached version when cache is not available, then it will make a call to thorchain

func (*KeySignPartyMgr) RemoveKeySignParty

func (mgr *KeySignPartyMgr) RemoveKeySignParty(poolPubKey common.PubKey)

RemoveKeySignParty remove the cached keysign party that match given pool pubkey from memory

func (*KeySignPartyMgr) SaveKeySignParty

func (mgr *KeySignPartyMgr) SaveKeySignParty(poolPubKey common.PubKey, keySignParty common.PubKeys)

SaveKeySignParty is going to save the keysign party to local cache

type Keys

type Keys struct {
	// contains filtered or unexported fields
}

Keys manages all the keys used by thorchain

func NewKeysWithKeybase

func NewKeysWithKeybase(kb ckeys.Keybase, signerInfo ckeys.Info, password string) *Keys

NewKeysWithKeybase create a new instance of Keys

func (*Keys) GetKeybase

func (k *Keys) GetKeybase() ckeys.Keybase

GetKeybase return the keybase

func (*Keys) GetPrivateKey

func (k *Keys) GetPrivateKey() (crypto.PrivKey, error)

GetPrivateKey return the private key

func (*Keys) GetSignerInfo

func (k *Keys) GetSignerInfo() ckeys.Info

GetSignerInfo return signer info

type QueryKeysign

type QueryKeysign struct {
	Keysign   types.TxOut `json:"keysign"`
	Signature string      `json:"signature"`
}

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) Broadcast

func (b *ThorchainBridge) Broadcast(stdTx authtypes.StdTx, mode types.TxMode) (common.TxID, error)

Broadcast Broadcasts tx to thorchain

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

GetConfig return the configuration

func (*ThorchainBridge) GetConstants

func (b *ThorchainBridge) GetConstants() (map[string]int64, error)

GetConstants from thornode

func (*ThorchainBridge) GetErrataStdTx

func (b *ThorchainBridge) GetErrataStdTx(txID common.TxID, chain common.Chain) (*authtypes.StdTx, error)

GetErrataStdTx get errata tx from params

func (*ThorchainBridge) GetKeygenBlock

func (b *ThorchainBridge) GetKeygenBlock(blockHeight int64, pk string) (types.KeygenBlock, error)

GetKeygen retrieves keygen request for the given block height from thorchain

func (*ThorchainBridge) GetKeygenStdTx

func (b *ThorchainBridge) GetKeygenStdTx(poolPubKey common.PubKey, blame blame.Blame, inputPks common.PubKeys, keygenType stypes.KeygenType, chains common.Chains, height int64) (*authtypes.StdTx, error)

GetKeygenStdTx get keygen tx from params

func (*ThorchainBridge) GetKeysign

func (b *ThorchainBridge) GetKeysign(blockHeight int64, pk string) (types.TxOut, error)

GetKeysign retrieves txout from this block height from thorchain

func (*ThorchainBridge) GetKeysignParty

func (b *ThorchainBridge) GetKeysignParty(vaultPubKey common.PubKey) (common.PubKeys, error)

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() (int64, error)

GetLastSignedOutHeight returns the lastsignedout value for thorchain

func (*ThorchainBridge) GetMimir

func (b *ThorchainBridge) GetMimir(key string) (int64, error)

Mimir - 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) (*authtypes.StdTx, error)

GetObservationsStdTx get observations tx from txIns

func (*ThorchainBridge) GetPubKeys

func (b *ThorchainBridge) GetPubKeys() (common.PubKeys, error)

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 blame.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 int64, transactionRate sdk.Uint) (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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL