Documentation ¶
Index ¶
- Constants
- Variables
- type Account
- type App
- type CannotBuildAppError
- type CannotStartAppError
- type Chain
- func (c *Chain) AbsBinaryPath() (string, error)
- func (c *Chain) AppTOMLPath() (string, error)
- func (c *Chain) Binary() (string, error)
- func (c *Chain) Build(ctx context.Context, cacheStorage cache.Storage, buildTags []string, ...) (binaryName string, err error)
- func (c *Chain) BuildRelease(ctx context.Context, cacheStorage cache.Storage, buildParams []string, ...) (releasePath string, err error)
- func (c *Chain) ClientTOMLPath() (string, error)
- func (c *Chain) Commands(ctx context.Context) (chaincmdrunner.Runner, error)
- func (c *Chain) Config() (*chainconfig.Config, error)
- func (c *Chain) ConfigPath() string
- func (c *Chain) ConfigTOMLPath() (string, error)
- func (c Chain) Configure(homePath string, cfg *chainconfig.Config) error
- func (c *Chain) DefaultGentxPath() (string, error)
- func (c *Chain) DefaultHome() (string, error)
- func (c *Chain) Faucet(ctx context.Context) (cosmosfaucet.Faucet, error)
- func (c *Chain) Generate(ctx context.Context, cacheStorage cache.Storage, target GenerateTarget, ...) error
- func (c *Chain) GenesisPath() (string, error)
- func (c Chain) Gentx(ctx context.Context, runner chaincmdrunner.Runner, v Validator) (path string, err error)
- func (c *Chain) GentxsPath() (string, error)
- func (c *Chain) Home() (string, error)
- func (c *Chain) ID() (string, error)
- func (c *Chain) Init(ctx context.Context, args InitArgs) error
- func (c *Chain) InitAccounts(ctx context.Context, cfg *chainconfig.Config) error
- func (c *Chain) InitChain(ctx context.Context, initConfiguration, initGenesis bool) error
- func (c *Chain) IsInitialized() (bool, error)
- func (c Chain) IssueGentx(ctx context.Context, v Validator) (string, error)
- func (c *Chain) KeyringBackend() (chaincmd.KeyringBackend, error)
- func (c *Chain) Name() string
- func (c *Chain) RPCPublicAddress() (string, error)
- func (c *Chain) Serve(ctx context.Context, cacheStorage cache.Storage, options ...ServeOption) error
- func (c *Chain) SetHome(home string)
- func (c *Chain) Simulate(ctx context.Context, options ...SimappOption) error
- func (c Chain) Start(ctx context.Context, runner chaincmdrunner.Runner, cfg *chainconfig.Config) error
- func (c Chain) UpdateGenesisFile(data map[string]interface{}) error
- type GenerateTarget
- type InitArgs
- type Option
- func CheckCosmosSDKVersion() Option
- func CheckDependencies() Option
- func CollectEvents(ev events.Bus) Option
- func ConfigFile(configFile string) Option
- func HomePath(path string) Option
- func ID(id string) Option
- func KeyringBackend(keyringBackend chaincmd.KeyringBackend) Option
- func PrintGeneratedPaths() Option
- func WithOutputer(s uilog.Outputer) Option
- type ServeOption
- type SimappOption
- type Validator
Constants ¶
const (
// EvtGroupPath is the group to use for path related events.
EvtGroupPath = "path"
)
Variables ¶
var ( // ErrFaucetIsNotEnabled is returned when faucet is not enabled in the config.yml. ErrFaucetIsNotEnabled = errors.New("faucet is not enabled in the config.yml") // ErrFaucetAccountDoesNotExist returned when specified faucet account in the config.yml does not exist. ErrFaucetAccountDoesNotExist = errors.New("specified account (faucet.name) does not exist") )
var ( // InitArgsAll performs all initialization for the chain. InitArgsAll = InitArgs{ InitAccounts: true, InitConfiguration: true, InitGenesis: true, } // InitArgsNone performs minimal initialization for the chain by only initializing a node. InitArgsNone = InitArgs{ InitAccounts: false, InitConfiguration: false, InitGenesis: false, } )
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { Name string Address string Mnemonic string `json:"mnemonic"` CoinType string Coins string }
Account represents an account in the chain.
type App ¶
App keeps info about chain.
type CannotBuildAppError ¶
type CannotBuildAppError struct {
Err error
}
func (*CannotBuildAppError) Error ¶
func (e *CannotBuildAppError) Error() string
func (*CannotBuildAppError) Unwrap ¶
func (e *CannotBuildAppError) Unwrap() error
type CannotStartAppError ¶
func (*CannotStartAppError) Error ¶
func (e *CannotStartAppError) Error() string
func (*CannotStartAppError) ParseStartError ¶
func (e *CannotStartAppError) ParseStartError() string
ParseStartError parses the error into a clear error string. The error logs from Cosmos SDK application are too extensive to be directly printed. If the error is not recognized, returns an empty string.
func (*CannotStartAppError) Unwrap ¶
func (e *CannotStartAppError) Unwrap() error
type Chain ¶
Chain provides programmatic access and tools for a Cosmos SDK blockchain.
func (*Chain) AbsBinaryPath ¶ added in v0.26.0
AbsBinaryPath returns the absolute path to the app's binary. Returned path includes the binary name.
func (*Chain) AppTOMLPath ¶
AppTOMLPath returns app.toml path of the app.
func (*Chain) Build ¶
func (c *Chain) Build( ctx context.Context, cacheStorage cache.Storage, buildTags []string, output string, skipProto, debug bool, ) (binaryName string, err error)
Build builds and installs app binaries.
func (*Chain) BuildRelease ¶
func (c *Chain) BuildRelease( ctx context.Context, cacheStorage cache.Storage, buildParams []string, output, prefix string, targets ...string, ) (releasePath string, err error)
BuildRelease builds binaries for a release. targets is a list of GOOS:GOARCH when provided. It defaults to your system when no targets provided. prefix is used as prefix to tarballs containing each target.
func (*Chain) ClientTOMLPath ¶
ClientTOMLPath returns client.toml path of the app.
func (*Chain) Config ¶
func (c *Chain) Config() (*chainconfig.Config, error)
Config returns the config of the chain.
func (*Chain) ConfigPath ¶
ConfigPath returns the config path of the chain. Empty string means that the chain has no defined config.
func (*Chain) ConfigTOMLPath ¶
ConfigTOMLPath returns config.toml path of the app.
func (Chain) Configure ¶ added in v0.26.0
func (c Chain) Configure(homePath string, cfg *chainconfig.Config) error
Configure sets the runtime configurations files for a chain (app.toml, client.toml, config.toml).
func (*Chain) DefaultGentxPath ¶
DefaultGentxPath returns default gentx.json path of the app.
func (*Chain) DefaultHome ¶
DefaultHome returns the blockchain node's default home dir when not specified in the app.
func (*Chain) Faucet ¶
Faucet returns the faucet for the chain or an error if the faucet configuration is wrong or not configured (not enabled) at all.
func (*Chain) Generate ¶
func (c *Chain) Generate( ctx context.Context, cacheStorage cache.Storage, target GenerateTarget, additionalTargets ...GenerateTarget, ) error
Generate makes code generation from proto files for given target and additionalTargets.
func (*Chain) GenesisPath ¶
GenesisPath returns genesis.json path of the app.
func (Chain) Gentx ¶ added in v0.26.0
func (c Chain) Gentx(ctx context.Context, runner chaincmdrunner.Runner, v Validator) (path string, err error)
Gentx wraps the "testd gentx" command for generating a gentx for a validator. Returns path of generated gentx.
func (*Chain) GentxsPath ¶
GentxsPath returns the directory where gentxs are stored for the app.
func (*Chain) InitAccounts ¶
InitAccounts initializes the chain accounts and creates validator gentxs.
func (*Chain) IsInitialized ¶
IsInitialized checks if the chain is initialized. The check is performed by checking if the gentx dir exists in the config.
func (Chain) IssueGentx ¶
IssueGentx generates a gentx from the validator information in chain config and imports it in the chain genesis.
func (*Chain) KeyringBackend ¶
func (c *Chain) KeyringBackend() (chaincmd.KeyringBackend, error)
KeyringBackend returns the keyring backend chosen for the chain.
func (*Chain) RPCPublicAddress ¶
RPCPublicAddress points to the public address of Tendermint RPC, this is shared by other chains for relayer related actions.
func (*Chain) Serve ¶
func (c *Chain) Serve(ctx context.Context, cacheStorage cache.Storage, options ...ServeOption) error
Serve serves an app.
func (*Chain) Simulate ¶
func (c *Chain) Simulate(ctx context.Context, options ...SimappOption) error
func (Chain) Start ¶ added in v0.26.0
func (c Chain) Start(ctx context.Context, runner chaincmdrunner.Runner, cfg *chainconfig.Config) error
Start wraps the "appd start" command to begin running a chain from the daemon.
func (Chain) UpdateGenesisFile ¶ added in v0.26.0
UpdateGenesisFile updates the chain genesis with a generic map of data. Updates are made using an override merge strategy.
type GenerateTarget ¶
type GenerateTarget func(*generateOptions)
GenerateTarget is a target to generate code for from proto files.
func GenerateComposables ¶ added in v0.26.0
func GenerateComposables(path string) GenerateTarget
GenerateComposables enables generating proto based Typescript Client and Vue 3 composables.
func GenerateGo ¶
func GenerateGo() GenerateTarget
GenerateGo enables generating proto based Go code needed for the chain's source code.
func GenerateHooks ¶ added in v0.26.0
func GenerateHooks(path string) GenerateTarget
GenerateHooks enables generating proto based Typescript Client and React composables.
func GenerateOpenAPI ¶
func GenerateOpenAPI() GenerateTarget
GenerateOpenAPI enables generating OpenAPI spec for your chain.
func GenerateTSClient ¶ added in v0.24.0
func GenerateTSClient(path string, useCache bool) GenerateTarget
GenerateTSClient enables generating proto based Typescript Client. The path assigns the output path to use for the generated Typescript client overriding the configured or default path. Path can be an empty string.
func GenerateVuex ¶
func GenerateVuex(path string) GenerateTarget
GenerateVuex enables generating proto based Typescript Client and Vuex Stores.
type InitArgs ¶ added in v0.26.0
InitArgs represents argument to add additional initialization for the chain. InitAccounts initializes chain accounts from the Ignite config. InitConfiguration initializes node configuration from the Ignite config. InitGenesis initializes genesis state for the chain from Ignite config.
type Option ¶
type Option func(*Chain)
Option configures Chain.
func CheckCosmosSDKVersion ¶ added in v0.27.0
func CheckCosmosSDKVersion() Option
CheckCosmosSDKVersion checks that the app was scaffolded with a version of the Cosmos SDK that is supported by Ignite CLI.
func CheckDependencies ¶ added in v0.24.0
func CheckDependencies() Option
CheckDependencies checks that cached Go dependencies of the chain have not been modified since they were downloaded. Dependencies are checked by running `go mod verify`.
func CollectEvents ¶ added in v0.25.0
CollectEvents collects events from the chain.
func ConfigFile ¶
ConfigFile specifies a custom config file to use.
func KeyringBackend ¶
func KeyringBackend(keyringBackend chaincmd.KeyringBackend) Option
KeyringBackend specifies the keyring backend to use for the chain command.
func PrintGeneratedPaths ¶ added in v0.26.0
func PrintGeneratedPaths() Option
PrintGeneratedPaths prints the output paths of the generated code.
func WithOutputer ¶ added in v0.25.0
WithOutputer sets the CLI outputer for the chain.
type ServeOption ¶
type ServeOption func(*serveOptions)
ServeOption provides options for the serve command.
func BuildTags ¶ added in v0.27.0
func BuildTags(buildTags ...string) ServeOption
BuildTags set the build tags for the go build.
func GenerateClients ¶ added in v0.26.0
func GenerateClients() ServeOption
GenerateClients enables client code generation.
func QuitOnFail ¶ added in v0.25.0
func QuitOnFail() ServeOption
QuitOnFail exits the serve immediately if an error occurs.
func ServeForceReset ¶
func ServeForceReset() ServeOption
ServeForceReset allows to force reset of the state when the chain is served and on every source change.
func ServeResetOnce ¶
func ServeResetOnce() ServeOption
ServeResetOnce allows to reset of the state when the chain is served once.
func ServeSkipProto ¶ added in v0.24.0
func ServeSkipProto() ServeOption
ServeSkipProto allows to serve the app without generate Go from proto.
type SimappOption ¶
type SimappOption func(*simappOptions)
SimappOption provides options for the simapp command.
func SimappWithConfig ¶
func SimappWithConfig(config simulation.Config) SimappOption
SimappWithConfig allows to add a simulation config.
func SimappWithGenesisTime ¶
func SimappWithGenesisTime(genesisTime int64) SimappOption
SimappWithGenesisTime allows overriding genesis UNIX time instead of using a random UNIX time.
func SimappWithPeriod ¶
func SimappWithPeriod(period uint) SimappOption
SimappWithPeriod allows running slow invariants only once every period assertions.
func SimappWithVerbose ¶
func SimappWithVerbose(verbose bool) SimappOption
SimappWithVerbose enable the verbose mode.