Documentation
¶
Index ¶
- Constants
- Variables
- func CustomizeConfig(engineCfg *config.Config)
- func EventActionQuery(msgType string) string
- func EventModuleQuery(module string) string
- func GenGenesis(cdc *codec.Codec, kb *Keybase, defaultGenesisŚtate map[string]json.RawMessage, ...) (*tmtypes.GenesisDoc, error)
- func GenesisExist(genesisFile string) bool
- func LoadGenesis(genesisFile string) (*tmtypes.GenesisDoc, error)
- func NewNode(app *bam.BaseApp, cfg *tmconfig.Config, genesis *types.GenesisDoc) (*node.Node, error)
- type Client
- func (c *Client) BuildAndBroadcastMsg(msg sdktypes.Msg) (*abci.ResponseDeliverTx, error)
- func (c *Client) CreateAndSignTx(msgs []sdktypes.Msg) (tenderminttypes.Tx, error)
- func (c *Client) GetAccount() (authExported.Account, error)
- func (c *Client) QueryJSON(path string, qdata, ptr interface{}) error
- func (c *Client) QueryWithData(path string, data []byte) ([]byte, int64, error)
- func (c *Client) Stream(ctx context.Context, query string) (chan hash.Hash, chan error, error)
- type FilterRunner
- type GenesisValidator
- type Keybase
- func (kb *Keybase) CloseDB()
- func (kb *Keybase) CreateAccount(name, mnemonic, bip39Passwd, encryptPasswd, hdPath string, ...) (keys.Info, error)
- func (kb *Keybase) CreateLedger(name string, algo keys.SigningAlgo, hrp string, account, index uint32) (keys.Info, error)
- func (kb *Keybase) CreateMnemonic(name string, language keys.Language, passwd string, algo keys.SigningAlgo) (keys.Info, string, error)
- func (kb *Keybase) CreateMulti(name string, pubkey crypto.PubKey) (keys.Info, error)
- func (kb *Keybase) CreateOffline(name string, pubkey crypto.PubKey, algo keys.SigningAlgo) (keys.Info, error)
- func (kb *Keybase) Delete(name, passphrase string, skipPass bool) error
- func (kb *Keybase) Exist(name string) (bool, error)
- func (kb *Keybase) Export(name string) (armor string, err error)
- func (kb *Keybase) ExportPrivKey(name, decryptPassphrase, encryptPassphrase string) (armor string, err error)
- func (kb *Keybase) ExportPrivateKeyObject(name string, passphrase string) (crypto.PrivKey, error)
- func (kb *Keybase) ExportPubKey(name string) (armor string, err error)
- func (kb *Keybase) Get(name string) (keys.Info, error)
- func (kb *Keybase) GetByAddress(address types.AccAddress) (keys.Info, error)
- func (kb *Keybase) Import(name, armor string) error
- func (kb *Keybase) ImportPrivKey(name, armor, passphrase string) error
- func (kb *Keybase) ImportPubKey(name, armor string) (err error)
- func (kb *Keybase) List() ([]keys.Info, error)
- func (kb *Keybase) NewMnemonic() (string, error)
- func (kb *Keybase) Sign(name, passphrase string, msg []byte) ([]byte, crypto.PubKey, error)
- func (kb *Keybase) SupportedAlgos() []keys.SigningAlgo
- func (kb *Keybase) SupportedAlgosLedger() []keys.SigningAlgo
- func (kb *Keybase) Update(name, oldpass string, getNewpass func() (string, error)) error
- type ModuleClient
- func (mc *ModuleClient) CreateExecution(req *api.CreateExecutionRequest) (*executionpb.Execution, error)
- func (mc *ModuleClient) CreateProcess(req *api.CreateProcessRequest) (*processpb.Process, error)
- func (mc *ModuleClient) CreateRunner(req *api.CreateRunnerRequest) (*runnerpb.Runner, error)
- func (mc *ModuleClient) CreateService(req *api.CreateServiceRequest) (*servicepb.Service, error)
- func (mc *ModuleClient) DeleteProcess(req *api.DeleteProcessRequest) error
- func (mc *ModuleClient) DeleteRunner(req *api.DeleteRunnerRequest) error
- func (mc *ModuleClient) ExistService(hash hash.Hash) (bool, error)
- func (mc *ModuleClient) GetExecution(hash hash.Hash) (*executionpb.Execution, error)
- func (mc *ModuleClient) GetInstance(hash hash.Hash) (*instancepb.Instance, error)
- func (mc *ModuleClient) GetProcess(hash hash.Hash) (*processpb.Process, error)
- func (mc *ModuleClient) GetRunner(hash hash.Hash) (*runnerpb.Runner, error)
- func (mc *ModuleClient) GetService(hash hash.Hash) (*servicepb.Service, error)
- func (mc *ModuleClient) HashService(req *api.CreateServiceRequest) (hash.Hash, error)
- func (mc *ModuleClient) ListExecution() ([]*executionpb.Execution, error)
- func (mc *ModuleClient) ListInstance(req *api.ListInstanceRequest) ([]*instancepb.Instance, error)
- func (mc *ModuleClient) ListOwnership() ([]*ownershippb.Ownership, error)
- func (mc *ModuleClient) ListProcess() ([]*processpb.Process, error)
- func (mc *ModuleClient) ListRunner(f *FilterRunner) ([]*runnerpb.Runner, error)
- func (mc *ModuleClient) ListService() ([]*servicepb.Service, error)
- func (mc *ModuleClient) StreamExecution(ctx context.Context, req *api.StreamExecutionRequest) (chan *executionpb.Execution, chan error, error)
- func (mc *ModuleClient) UpdateExecution(req *api.UpdateExecutionRequest) (*executionpb.Execution, error)
Constants ¶
const (
AttributeKeyHash = "hash"
)
common attribute keys.
const ( // DefaultAlgo for create account. DefaultAlgo = keys.Secp256k1 )
Variables ¶
var EventHashType = sdktypes.EventTypeMessage + "." + AttributeKeyHash
EventHashType is a message with resource hash
Functions ¶
func CustomizeConfig ¶ added in v0.18.1
CustomizeConfig customizes the cosmos application like addresses prefixes and coin type
func EventActionQuery ¶ added in v0.17.0
EventActionQuery returns tendermint query which matches given message type.
func EventModuleQuery ¶ added in v0.17.0
EventModuleQuery returns tendermint query which matches given module.
func GenGenesis ¶ added in v0.16.0
func GenGenesis(cdc *codec.Codec, kb *Keybase, defaultGenesisŚtate map[string]json.RawMessage, chainID, initialBalances, validatorDelegationCoin, genesisFile string, validators []GenesisValidator) (*tmtypes.GenesisDoc, error)
GenGenesis generates a new genesis and save it.
func GenesisExist ¶ added in v0.16.0
GenesisExist returns true if the genesis file already exists.
func LoadGenesis ¶ added in v0.16.0
func LoadGenesis(genesisFile string) (*tmtypes.GenesisDoc, error)
LoadGenesis loads a genesis from a file.
Types ¶
type Client ¶
Client is a tendermint client with helper functions.
func NewClient ¶
func NewClient(client rpcclient.Client, cdc *codec.Codec, kb keys.Keybase, chainID, accName, accPassword, minGasPrices string) (*Client, error)
NewClient returns a rpc tendermint client.
func (*Client) BuildAndBroadcastMsg ¶
BuildAndBroadcastMsg builds and signs message and broadcast it to node.
func (*Client) CreateAndSignTx ¶ added in v0.20.0
CreateAndSignTx build and sign a msg with client account.
func (*Client) GetAccount ¶ added in v0.18.0
func (c *Client) GetAccount() (authExported.Account, error)
GetAccount returns the local account.
func (*Client) QueryJSON ¶ added in v0.19.0
QueryJSON is abci.query wrapper with errors check and decode data.
func (*Client) QueryWithData ¶
QueryWithData performs a query to a Tendermint node with the provided path and a data payload. It returns the result and height of the query upon success or an error if the query fails.
type FilterRunner ¶ added in v0.19.0
FilterRunner to apply while listing runners.
type GenesisValidator ¶ added in v0.16.0
GenesisValidator holds the info of a specific validator to use to generate a genesis.
func NewGenesisValidator ¶ added in v0.16.0
func NewGenesisValidator(kb *Keybase, name, password, privValidatorKeyFile, privValidatorStateFile, nodeKeyFile string) (GenesisValidator, error)
NewGenesisValidator creates a new validator with an cosmos account, validator and node identity.
type Keybase ¶
type Keybase struct {
// contains filtered or unexported fields
}
Keybase is a standard cosmos keybase.
func NewKeybase ¶
NewKeybase initializes a filesystem keybase at a particular dir.
func (*Keybase) CloseDB ¶ added in v0.18.0
func (kb *Keybase) CloseDB()
CloseDB is a lock protected version of keys.CloseDB
func (*Keybase) CreateAccount ¶ added in v0.18.0
func (kb *Keybase) CreateAccount(name, mnemonic, bip39Passwd, encryptPasswd, hdPath string, algo keys.SigningAlgo) (keys.Info, error)
CreateAccount is a lock protected version of keys.CreateAccount
func (*Keybase) CreateLedger ¶ added in v0.18.0
func (kb *Keybase) CreateLedger(name string, algo keys.SigningAlgo, hrp string, account, index uint32) (keys.Info, error)
CreateLedger is a lock protected version of keys.CreateLedger
func (*Keybase) CreateMnemonic ¶ added in v0.18.0
func (kb *Keybase) CreateMnemonic(name string, language keys.Language, passwd string, algo keys.SigningAlgo) (keys.Info, string, error)
CreateMnemonic is a lock protected version of keys.CreateMnemonic
func (*Keybase) CreateMulti ¶ added in v0.18.0
CreateMulti is a lock protected version of keys.CreateMulti
func (*Keybase) CreateOffline ¶ added in v0.18.0
func (kb *Keybase) CreateOffline(name string, pubkey crypto.PubKey, algo keys.SigningAlgo) (keys.Info, error)
CreateOffline is a lock protected version of keys.CreateOffline
func (*Keybase) ExportPrivKey ¶ added in v0.18.0
func (kb *Keybase) ExportPrivKey(name, decryptPassphrase, encryptPassphrase string) (armor string, err error)
ExportPrivKey is a lock protected version of keys.ExportPrivKey
func (*Keybase) ExportPrivateKeyObject ¶ added in v0.18.0
ExportPrivateKeyObject is a lock protected version of keys.ExportPrivateKeyObject
func (*Keybase) ExportPubKey ¶ added in v0.18.0
ExportPubKey is a lock protected version of keys.ExportPubKey
func (*Keybase) GetByAddress ¶ added in v0.18.0
GetByAddress is a lock protected version of keys.GetByAddress
func (*Keybase) ImportPrivKey ¶ added in v0.18.0
ImportPrivKey is a lock protected version of keys.ImportPrivKey
func (*Keybase) ImportPubKey ¶ added in v0.18.0
ImportPubKey is a lock protected version of keys.ImportPubKey
func (*Keybase) NewMnemonic ¶ added in v0.15.0
NewMnemonic returns a new mnemonic phrase.
func (*Keybase) Sign ¶ added in v0.18.0
Sign is a lock protected version of keys.Sign it also keeps the last private key used in memory for the time set in `keepPrivTime` for performance improvement.
func (*Keybase) SupportedAlgos ¶ added in v0.19.0
func (kb *Keybase) SupportedAlgos() []keys.SigningAlgo
SupportedAlgos returns a list of signing algorithms supported by the keybase
func (*Keybase) SupportedAlgosLedger ¶ added in v0.19.0
func (kb *Keybase) SupportedAlgosLedger() []keys.SigningAlgo
SupportedAlgosLedger returns a list of signing algorithms supported by the keybase's ledger integration
type ModuleClient ¶ added in v0.19.0
type ModuleClient struct {
*Client
}
ModuleClient handles all communication with every module.
func NewModuleClient ¶ added in v0.19.0
func NewModuleClient(c *Client) *ModuleClient
NewModuleClient creates new module client.
func (*ModuleClient) CreateExecution ¶ added in v0.19.0
func (mc *ModuleClient) CreateExecution(req *api.CreateExecutionRequest) (*executionpb.Execution, error)
CreateExecution creates a new execution.
func (*ModuleClient) CreateProcess ¶ added in v0.19.0
func (mc *ModuleClient) CreateProcess(req *api.CreateProcessRequest) (*processpb.Process, error)
CreateProcess creates a new process.
func (*ModuleClient) CreateRunner ¶ added in v0.19.0
func (mc *ModuleClient) CreateRunner(req *api.CreateRunnerRequest) (*runnerpb.Runner, error)
CreateRunner creates a new runner.
func (*ModuleClient) CreateService ¶ added in v0.19.0
func (mc *ModuleClient) CreateService(req *api.CreateServiceRequest) (*servicepb.Service, error)
CreateService creates a new service from definition.
func (*ModuleClient) DeleteProcess ¶ added in v0.19.0
func (mc *ModuleClient) DeleteProcess(req *api.DeleteProcessRequest) error
DeleteProcess deletes the process by hash.
func (*ModuleClient) DeleteRunner ¶ added in v0.19.0
func (mc *ModuleClient) DeleteRunner(req *api.DeleteRunnerRequest) error
DeleteRunner deletes an existing runner.
func (*ModuleClient) ExistService ¶ added in v0.19.0
func (mc *ModuleClient) ExistService(hash hash.Hash) (bool, error)
ExistService returns if a service already exists.
func (*ModuleClient) GetExecution ¶ added in v0.19.0
func (mc *ModuleClient) GetExecution(hash hash.Hash) (*executionpb.Execution, error)
GetExecution returns the execution that matches given hash.
func (*ModuleClient) GetInstance ¶ added in v0.19.0
func (mc *ModuleClient) GetInstance(hash hash.Hash) (*instancepb.Instance, error)
GetInstance returns the instance that matches given hash.
func (*ModuleClient) GetProcess ¶ added in v0.19.0
GetProcess returns the process that matches given hash.
func (*ModuleClient) GetRunner ¶ added in v0.19.0
GetRunner returns the runner that matches given hash.
func (*ModuleClient) GetService ¶ added in v0.19.0
GetService returns the service that matches given hash.
func (*ModuleClient) HashService ¶ added in v0.19.0
func (mc *ModuleClient) HashService(req *api.CreateServiceRequest) (hash.Hash, error)
HashService returns the calculate hash of a service.
func (*ModuleClient) ListExecution ¶ added in v0.19.0
func (mc *ModuleClient) ListExecution() ([]*executionpb.Execution, error)
ListExecution returns all executions.
func (*ModuleClient) ListInstance ¶ added in v0.19.0
func (mc *ModuleClient) ListInstance(req *api.ListInstanceRequest) ([]*instancepb.Instance, error)
ListInstance returns all instances.
func (*ModuleClient) ListOwnership ¶ added in v0.19.0
func (mc *ModuleClient) ListOwnership() ([]*ownershippb.Ownership, error)
ListOwnership returns all ownerships.
func (*ModuleClient) ListProcess ¶ added in v0.19.0
func (mc *ModuleClient) ListProcess() ([]*processpb.Process, error)
ListProcess returns all processes.
func (*ModuleClient) ListRunner ¶ added in v0.19.0
func (mc *ModuleClient) ListRunner(f *FilterRunner) ([]*runnerpb.Runner, error)
ListRunner returns all runners.
func (*ModuleClient) ListService ¶ added in v0.19.0
func (mc *ModuleClient) ListService() ([]*servicepb.Service, error)
ListService returns all services.
func (*ModuleClient) StreamExecution ¶ added in v0.19.0
func (mc *ModuleClient) StreamExecution(ctx context.Context, req *api.StreamExecutionRequest) (chan *executionpb.Execution, chan error, error)
StreamExecution returns execution that matches given hash.
func (*ModuleClient) UpdateExecution ¶ added in v0.19.0
func (mc *ModuleClient) UpdateExecution(req *api.UpdateExecutionRequest) (*executionpb.Execution, error)
UpdateExecution updates a execution.