Scaffold a chain
ignite scaffold chain command scaffolds a new Cosmos SDK blockchain project.
Build a blockchain app
To build the planet application:
ignite scaffold chain planet
ignite scaffold chain planet command creates a directory called
planet that contains all the files for your project and initializes a local git repository. The
planet argument is a string that is used for the Go module path. The repository name (
planet, in this case) is used as the project's name.
The project directory structure:
app: files that wire the blockchain together
cmd: binary for the blockchain node
openapi.ymlAPI doc for the blockchain node
proto: protocol buffer files for custom modules
vue: scaffolded web application (optional)
config.yml: configuration file
Most of the logic of your application-specific blockchain is written in custom modules. Each module effectively encapsulates an independent piece of functionality. Following the Cosmos SDK convention, custom modules are stored inside the
x directory. By default,
ignite scaffold chain scaffolds a module with a name that matches the name of the project. In this example, the module name is
Every Cosmos SDK module has protocol buffer files that define data structures, messages, queries, RPCs, and so on. The
proto directory contains a directory with proto files for each custom module in the
Global changes to your blockchain are defined in files inside the
app directory. These changes include importing third-party modules, defining relationships between modules, and configuring blockchain-wide settings.
config.yml file contains configuration options that Ignite CLI uses to build, initialize, and start your blockchain node in development.
Account addresses on Cosmos SDK-based blockchains have string prefixes. For example, the Cosmos Hub blockchain uses the default
cosmos prefix, so that addresses look like this:
Change prefix on new blockchains
When you create a new blockchain, pass a prefix as a value to the
ignite scaffold chain planet --address-prefix moonlight
moonlight prefix, account addresses on your blockchain look like this:
Change prefix on existing blockchains
To change the prefix after the blockchain has been scaffolded, modify the
AccountAddressPrefix in the
Cosmos SDK version
By default, the
ignite scaffold chain command creates a Cosmos SDK blockchain using the latest stable version of the Cosmos SDK.