Documentation
¶
Index ¶
- Constants
- Variables
- func AddOrReplace(appName, keyname string) (string, error)
- func CompareSemVer(v1, v2 string) bool
- func CreateOPChildUpdateParamsMsg(filePath string, params OPChildParams) error
- func DeleteKey(appName, keyname string) error
- func DownloadPolkachuAddrBook(chainType registry.ChainType, dest string) error
- func FetchPolkachuPersistentPeers(chainType registry.ChainType) (string, error)
- func FetchPolkachuSnapshotDownloadURL(chainSlug string) (string, error)
- func FetchPolkachuStateSyncPeers(chainType registry.ChainType) (string, error)
- func FetchPolkachuStateSyncURL(chainType registry.ChainType) (string, error)
- func GetAddressFromMnemonic(appName, mnemonic string) (string, error)
- func GetBinaryVersion(appName string) (string, error)
- func GetInitiaBinaryPath(version string) (string, error)
- func GetInitiaBinaryUrlFromLcd(httpClient *client.HTTPClient, rest string) (string, string, error)
- func GetLatestMinitiaVersion(vm string) (string, string, error)
- func GetLatestOPInitBotVersion() (string, string, error)
- func GetLatestRapidRelayerVersion() (string, error)
- func GetLatestWeaveVersion() (string, string, error)
- func GetMinitiadBinaryPath(vm, version string) (string, error)
- func GetMinitiadBinaryUrlFromLcd(httpClient *client.HTTPClient, rest string) (vm string, version string, url string, err error)
- func InstallCosmovisor(version string) (string, error)
- func InstallInitiaBinary(version, url, binaryPath string) error
- func InstallMinitiadBinary(vm, version, url, binaryPath string) error
- func KeyExists(appName, keyname string) bool
- func OPInitAddOrReplace(appName, keyname string, isCelestia bool, opInitHome string) (string, error)
- func OPInitGetAddressForKey(appName, keyname, opInitHome string) (string, error)
- func OPInitGrantOracle(appName, address, opInitHome string) error
- func OPInitKeyExist(appName, keyname, opInitHome string) bool
- func OPInitRecoverKeyFromMnemonic(appName, keyname, mnemonic string, isCelestia bool, opInitHome string) (string, error)
- func QueryChannels(addresses []string) (params types.ChannelsResponse, err error)
- func QueryCreateBridgeHeight(client *client.GraphQLClient, bridgeId string) (int, error)
- func QueryLatestDepositHeight(client *client.GraphQLClient, bridgeId, sequence string) (int, error)
- func RecoverKeyFromMnemonic(appName, keyname, mnemonic string) (string, error)
- func RecoverKeyFromMnemonicWithCoinType(appName, keyname, mnemonic string, coinType int) (string, error)
- func SetSymlink(targetPath string) error
- func SortVersions(versions BinaryVersionWithDownloadURL) []string
- type BinaryRelease
- type BinaryVersionWithDownloadURL
- type BlockResponse
- type Coin
- type Coins
- type DecCoin
- type DecCoins
- type HashResponse
- type InitiadBankBalancesQueryResponse
- type InitiadQuerier
- type InitiadTxExecutor
- type InitiadTxResponse
- type JsonPayload
- type KeyInfo
- type Message
- type MinimalRPCTxResponse
- type MinimalTxResponse
- type MinitiadQuerier
- type MinitiadTxExecutor
- type MsgUpdateParams
- type NodeInfoResponse
- type OPChildBridgeInfoQueryResponse
- type OPChildNextL1SequenceResponse
- type OPChildParams
- type OPChildParamsResponse
- type PolkachuChainAPIResponse
- type PolkachuPeersAPIResponse
- type StateSyncInfo
- type TransactionEventsResponse
Constants ¶
const ( DefaultMinitiadQuerierAppName string = "minitiad" DefaultMinitiadQuerierVM string = "evm" )
const ( DefaultGasAdjustment = "1.4" TmpKeyName = "weave.clitx.executor" )
const ( PolkachuBaseURL string = "https://www.polkachu.com" PolkachuSnapshotURL = PolkachuBaseURL + "/%s" PolkachuChainAPI = PolkachuBaseURL + "/api/v2/chains/%s" PolkachuPeersAPI = PolkachuBaseURL + "/api/v2/chains/%s/live_peers" PolkachuAddrBookAPI = "https://snapshots.polkachu.com/%saddrbook/%s/addrbook.json" DefaultInitiaPolkachuName string = "initia" DefaultSnapshotFileExtension string = ".tar.lz4" )
const (
NoBalancesText string = "No Balances"
)
Variables ¶
var (
MaxIntPadding = strconv.Itoa(math.MaxInt)
)
Functions ¶
func AddOrReplace ¶
AddOrReplace adds or replaces a key using `initiad keys add <keyname> --keyring-backend test` with 'y' confirmation
func CompareSemVer ¶
CompareSemVer compares two semantic version strings and returns true if v1 is greater than v2. Examples:
- CompareSemVer("v2.0.0", "v1.0.0") returns true
- CompareSemVer("v1.2.0", "v1.1.0") returns true
- CompareSemVer("v1.0.0", "v1.0.0-beta") returns true
- CompareSemVer("v1.0.0-beta.2", "v1.0.0-beta.1") returns true
- CompareSemVer("v1.0.0", "v2.0.0") returns false
func CreateOPChildUpdateParamsMsg ¶
func CreateOPChildUpdateParamsMsg(filePath string, params OPChildParams) error
func DownloadPolkachuAddrBook ¶ added in v0.1.2
func FetchPolkachuPersistentPeers ¶ added in v0.1.0
func GetAddressFromMnemonic ¶
func GetBinaryVersion ¶
func GetInitiaBinaryPath ¶
func GetLatestOPInitBotVersion ¶ added in v0.1.6
func GetLatestRapidRelayerVersion ¶ added in v0.3.4
GetLatestRapidRelayerVersion fetches the latest release tag from the rapid-relayer GitHub repository. Returns only the tag name (e.g., "v1.0.7") since rapid-relayer is distributed as a Docker image.
func GetLatestWeaveVersion ¶ added in v0.1.6
func GetMinitiadBinaryPath ¶ added in v0.3.4
func GetMinitiadBinaryUrlFromLcd ¶ added in v0.3.4
func InstallCosmovisor ¶
func InstallInitiaBinary ¶
func InstallMinitiadBinary ¶ added in v0.3.4
func OPInitAddOrReplace ¶
func OPInitAddOrReplace(appName, keyname string, isCelestia bool, opInitHome string) (string, error)
OPInitAddOrReplace adds or replaces a key using `opinitd keys add <keyname> --keyring-backend test` with 'y' confirmation
func OPInitGetAddressForKey ¶
OPInitGetAddressForKey retrieves the address for a given key using opinitd.
func OPInitGrantOracle ¶
OPInitGrantOracle grants oracle permissions to a specific address.
func OPInitKeyExist ¶
func OPInitRecoverKeyFromMnemonic ¶
func OPInitRecoverKeyFromMnemonic(appName, keyname, mnemonic string, isCelestia bool, opInitHome string) (string, error)
OPInitRecoverKeyFromMnemonic recovers or replaces a key using a mnemonic phrase If the key already exists, it will replace the key and confirm with 'y' before adding the mnemonic
func QueryChannels ¶ added in v0.3.0
func QueryChannels(addresses []string) (params types.ChannelsResponse, err error)
func QueryCreateBridgeHeight ¶
func QueryCreateBridgeHeight(client *client.GraphQLClient, bridgeId string) (int, error)
func QueryLatestDepositHeight ¶
func QueryLatestDepositHeight(client *client.GraphQLClient, bridgeId, sequence string) (int, error)
func RecoverKeyFromMnemonic ¶
RecoverKeyFromMnemonic recovers or replaces a key using a mnemonic phrase If the key already exists, it will replace the key and confirm with 'y' before adding the mnemonic Uses default coin type: 60 for gas station keys, 118 for others
func RecoverKeyFromMnemonicWithCoinType ¶ added in v0.3.6
func RecoverKeyFromMnemonicWithCoinType(appName, keyname, mnemonic string, coinType int) (string, error)
RecoverKeyFromMnemonicWithCoinType recovers or replaces a key using a mnemonic phrase with specified coin type If the key already exists, it will replace the key and confirm with 'y' before adding the mnemonic coinType must be explicitly provided (60 or 118), 0 is not allowed
func SetSymlink ¶
SetSymlink sets a symbolic link in the parent directory pointing to the target binary.
func SortVersions ¶
func SortVersions(versions BinaryVersionWithDownloadURL) []string
SortVersions sorts the versions based on semantic versioning, including pre-release handling
Types ¶
type BinaryRelease ¶
type BinaryVersionWithDownloadURL ¶
func GetOPInitVersions ¶
func GetOPInitVersions() (BinaryVersionWithDownloadURL, string, error)
func ListBinaryReleases ¶
func ListBinaryReleases(url string) (BinaryVersionWithDownloadURL, error)
func ListWeaveReleases ¶
func ListWeaveReleases(url string) (BinaryVersionWithDownloadURL, error)
type BlockResponse ¶
type BlockResponse struct {
Result struct {
Block struct {
Header struct {
Height string `json:"height"`
} `json:"header"`
} `json:"block"`
} `json:"result"`
}
type HashResponse ¶
type HashResponse struct {
Result struct {
BlockID struct {
Hash string `json:"hash"`
} `json:"block_id"`
} `json:"result"`
}
type InitiadBankBalancesQueryResponse ¶
type InitiadBankBalancesQueryResponse struct {
Balances Coins `json:"balances"`
}
type InitiadQuerier ¶
type InitiadQuerier struct {
// contains filtered or unexported fields
}
func NewInitiadQuerier ¶
func NewInitiadQuerier(rest string) (*InitiadQuerier, error)
func (*InitiadQuerier) QueryBankBalances ¶
func (iq *InitiadQuerier) QueryBankBalances(address, rpc string) (*Coins, error)
type InitiadTxExecutor ¶
type InitiadTxExecutor struct {
// contains filtered or unexported fields
}
func NewInitiadTxExecutor ¶
func NewInitiadTxExecutor(rest string) (*InitiadTxExecutor, error)
func (*InitiadTxExecutor) BroadcastMsgSend ¶
func (te *InitiadTxExecutor) BroadcastMsgSend(senderMnemonic, recipientAddress, amount, gasPrices, rpc, chainId string, coinType int) (*InitiadTxResponse, error)
type InitiadTxResponse ¶
type InitiadTxResponse struct {
Height string `json:"height"`
TxHash string `json:"txhash"`
Codespace string `json:"codespace"`
Code int `json:"code"`
Data string `json:"data"`
RawLog string `json:"raw_log"`
Logs *[]interface{} `json:"logs"`
Info string `json:"info"`
GasWanted string `json:"gas_wanted"`
GasUsed string `json:"gas_used"`
Tx *[]interface{} `json:"tx"`
Timestamp string `json:"timestamp"`
Events *[]interface{} `json:"events"`
}
type JsonPayload ¶
type JsonPayload struct {
Messages []Message `json:"messages"`
}
type KeyInfo ¶
type KeyInfo struct {
Name string `json:"name"`
Type string `json:"type"`
Address string `json:"address"`
PubKey string `json:"pubkey"`
Mnemonic string `json:"mnemonic"`
}
func GenerateNewKeyInfo ¶
func UnmarshalKeyInfo ¶
type Message ¶
type Message struct {
Type string `json:"@type"`
Authority string `json:"authority"`
Params OPChildParams `json:"params"`
}
type MinimalRPCTxResponse ¶ added in v0.2.1
type MinimalTxResponse ¶
type MinitiadQuerier ¶
type MinitiadQuerier struct {
// contains filtered or unexported fields
}
func NewMinitiadQuerier ¶
func NewMinitiadQuerier() (*MinitiadQuerier, error)
func (*MinitiadQuerier) QueryOPChildBridgeInfo ¶
func (mq *MinitiadQuerier) QueryOPChildBridgeInfo(rpc string) (*types.Bridge, error)
func (*MinitiadQuerier) QueryOPChildNextL1Sequence ¶
func (mq *MinitiadQuerier) QueryOPChildNextL1Sequence(rpc string) (string, error)
type MinitiadTxExecutor ¶ added in v0.3.4
type MinitiadTxExecutor struct {
// contains filtered or unexported fields
}
func NewMinitiadTxExecutor ¶ added in v0.3.4
func NewMinitiadTxExecutor(rest string) (*MinitiadTxExecutor, error)
func (*MinitiadTxExecutor) BroadcastMsgSend ¶ added in v0.3.4
func (te *MinitiadTxExecutor) BroadcastMsgSend(senderMnemonic, recipientAddress, amount, gasPrices, rpc, chainId string, coinType int) (*InitiadTxResponse, error)
type MsgUpdateParams ¶
type MsgUpdateParams struct {
Authority string `json:"authority"`
Params OPChildParams `json:"params"`
}
type NodeInfoResponse ¶
type NodeInfoResponse struct {
ApplicationVersion struct {
Version string `json:"version"`
} `json:"application_version"`
}
func QueryNodeInfo ¶ added in v0.3.0
func QueryNodeInfo(addresses []string) (response NodeInfoResponse, err error)
type OPChildBridgeInfoQueryResponse ¶
type OPChildBridgeInfoQueryResponse struct {
BridgeInfo struct {
BridgeId string `json:"bridge_id"`
} `json:"bridge_info"`
}
type OPChildNextL1SequenceResponse ¶
type OPChildNextL1SequenceResponse struct {
NextL1Sequence string `json:"next_l1_sequence"`
}
type OPChildParams ¶
type OPChildParams struct {
// max_validators is the maximum number of validators.
MaxValidators uint32 `protobuf:"varint,1,opt,name=max_validators,json=maxValidators,proto3" json:"max_validators,omitempty" yaml:"max_validators"`
// historical_entries is the number of historical entries to persist.
HistoricalEntries uint32 `` /* 139-byte string literal not displayed */
MinGasPrices DecCoins `` /* 167-byte string literal not displayed */
// the account address of bridge executor who can execute permissioned bridge
// messages.
BridgeExecutors []string `` /* 130-byte string literal not displayed */
// the account address of admin who can execute permissioned cosmos messages.
Admin string `protobuf:"bytes,5,opt,name=admin,proto3" json:"admin,omitempty" yaml:"admin"`
// the list of addresses that are allowed to pay zero fee.
FeeWhitelist []string `protobuf:"bytes,6,rep,name=fee_whitelist,json=feeWhitelist,proto3" json:"fee_whitelist,omitempty" yaml:"fee_whitelist"`
// Max gas for hook execution of `MsgFinalizeTokenDeposit`
HookMaxGas string `protobuf:"varint,7,opt,name=hook_max_gas,json=hookMaxGas,proto3" json:"hook_max_gas,omitempty" yaml:"hook_max_gas"`
}
Params defines the set of opchild parameters.
func QueryOPChildParams ¶
func QueryOPChildParams(addresses []string) (params OPChildParams, err error)
type OPChildParamsResponse ¶
type OPChildParamsResponse struct {
Params OPChildParams `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"`
}
type PolkachuChainAPIResponse ¶ added in v0.1.0
type PolkachuPeersAPIResponse ¶ added in v0.1.0
type StateSyncInfo ¶
func GetStateSyncInfo ¶
func GetStateSyncInfo(url string) (*StateSyncInfo, error)