PageSourceSearch

https://docs.ignite.com/assets/js/f1355bcf.86978f97.js

js ignite.com collected 2026-10-03 23:19:29 UTC 13,644 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunkmy_website=globalThis.webpackChunkmy_website||[]).push([[3566],{15680(e,n,t){t.d(n,{xA:()=>d,yg:()=>p});var o=t(96540);function a(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function i(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function r(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?i(Object(t),!0).forEach((function(n){a(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):i(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function c(e,n){if(null==e)return{};var t,o,a=function(e,n){if(null==e)return{};var t,o,a={},i=Object.keys(e);for(o=0;o<i.length;o++)t=i[o],n.indexOf(t)>=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)t=i[o],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var s=o.createContext({}),l=function(e){var n=o.useContext(s),t=n;return e&&(t="function"==typeof e?e(n):r(r({},n),e)),t},d=function(e){var n=l(e.components);return o.createElement(s.Provider,{value:n},e.children)},h={inlineCode:"code",wrapper:function(e){var n=e.children;return o.createElement(o.Fragment,{},n)}},u=o.forwardRef((function(e,n){var t=e.components,a=e.mdxType,i=e.originalType,s=e.parentName,d=c(e,["components","mdxType","originalType","parentName"]),u=l(t),p=a,f=u["".concat(s,".").concat(p)]||u[p]||h[p]||i;return t?o.createElement(f,r(r({ref:n},d),{},{components:t})):o.createElement(f,r({ref:n},d))}));function p(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var i=t.length,r=new Array(i);r[0]=u;var c={};for(var s in n)hasOwnProperty.call(n,s)&&(c[s]=n[s]);c.originalType=e,c.mdxType="string"==typeof e?e:a,r[1]=c;for(var l=2;l<i;l++)r[l]=t[l];return o.createElement.apply(null,r)}return o.createElement.apply(null,t)}u.displayName="MDXCreateElement"},92034(e,n,t){t.r(n),t.d(n,{assets:()=>s,contentTitle:()=>r,default:()=>h,frontMatter:()=>i,metadata:()=>c,toc:()=>l});var o=t(58168),a=(t(96540),t(15680));const i={sidebar_position:2},r="Introduction",c={unversionedId:"guide/introduction",id:"version-v30/guide/introduction",title:"Introduction",description:"In this guide, we will be using IGNITE\xae CLI to create a new blockchain. IGNITE\xae",source:"@site/versioned_docs/version-v30/02-guide/02-introduction.md",sourceDirName:"02-guide",slug:"/guide/introduction",permalink:"/guide/introduction",draft:!1,tags:[],version:"v30",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"Install IGNITE\xae CLI",permalink:"/welcome/install"},next:{title:"Hello World",permalink:"/guide/hello-world"}},s={},l=[{value:"Creating a new blockchain",id:"creating-a-new-blockchain",level:2},{value:"Directory structure",id:"directory-structure",level:2},{value:"Starting a blockchain node",id:"starting-a-blockchain-node",level:2}],d={toc:l};function h(e){let{components:n,...t}=e;return(0,a.yg)("wrapper",(0,o.A)({},d,t,{components:n,mdxType:"MDXLayout"}),(0,a.yg)("h1",{id:"introduction"},"Introduction"),(0,a.yg)("p",null,"In this guide, we will be using IGNITE\xae CLI to create a new blockchain. IGNITE\xae\nCLI is a command line interface that allows users to quickly and easily create\nblockchain networks. By using IGNITE\xae CLI, we can quickly create a new blockchain\nwithout having to manually set up all the necessary components."),(0,a.yg)("p",null,"Once we have created our blockchain with IGNITE\xae CLI, we will take a look at the\ndirectory structure and files that were created. This will give us an\nunderstanding of how the blockchain is organized and how the different\ncomponents of the blockchain interact with each other."),(0,a.yg)("p",null,"By the end of this guide, you will have a basic understanding of how to use\nIGNITE\xae CLI to create a new blockchain, and you will have a high-level\nunderstanding of the directory structure and files that make up a blockchain.\nThis knowledge will be useful as you continue to explore the world of blockchain\ndevelopment."),(0,a.yg)("p",null,"If you are looking for more tutorials and hands-on experience, check out our tutorials website:"),(0,a.yg)("p",null,(0,a.yg)("a",{parentName:"p",href:"https://tutorials.ignite.com"},"IGNITE\xae Tutorials")),(0,a.yg)("h2",{id:"creating-a-new-blockchain"},"Creating a new blockchain"),(0,a.yg)("p",null,"To create a new blockchain project with IGNITE\xae, you will need to run the\nfollowing command:"),(0,a.yg)("pre",null,(0,a.yg)("code",{parentName:"pre"},"ignite cosmos scaffold chain example\n")),(0,a.yg)("p",null,"The ",(0,a.yg)("inlineCode",{parentName:"p"},"ignite cosmos scaffold chain")," command will create a new blockchain in a new\ndirectory ",(0,a.yg)("inlineCode",{parentName:"p"},"example"),"."),(0,a.yg)("p",null,"The new blockchain is built using the Cosmos SDK framework and imports several\nstandard modules to provide a range of functionality. These modules include\n",(0,a.yg)("inlineCode",{parentName:"p"},"staking"),", which enables a delegated Proof-of-Stake consensus mechanism, ",(0,a.yg)("inlineCode",{parentName:"p"},"bank"),"\nfor facilitating fungible token transfers between accounts, and ",(0,a.yg)("inlineCode",{parentName:"p"},"gov")," for\non-chain governance. In addition to these modules, the blockchain also imports\nother modules from the Cosmos SDK framework."),(0,a.yg)("p",null,"The ",(0,a.yg)("inlineCode",{parentName:"p"},"example")," directory contains the generated files and directories that make\nup the structure of a Cosmos SDK blockchain. This directory includes files for\nthe chain's configuration, application logic, and tests, among others. It\nprovides a starting point for developers to quickly set up a new Cosmos SDK\nblockchain and build their desired functionality on top of it."),(0,a.yg)("p",null,"By default, IGNITE\xae creates a new empty custom module with the same name as the\nblockchain being created (in this case, ",(0,a.yg)("inlineCode",{parentName:"p"},"example"),") in the ",(0,a.yg)("inlineCode",{parentName:"p"},"x/")," directory. This\nmodule doesn't have any functionality by itself, but can serve as a starting\npoint for building out the features of your application. If you don't want to\ncreate this module, you can use the ",(0,a.yg)("inlineCode",{parentName:"p"},"--no-module")," flag to skip it."),(0,a.yg)("h2",{id:"directory-structure"},"Directory structure"),(0,a.yg)("p",null,"In order to understand what the IGNITE\xae CLI has generated for your project, you\ncan inspect the contents of the ",(0,a.yg)("inlineCode",{parentName:"p"},"example/")," directory."),(0,a.yg)("p",null,"The ",(0,a.yg)("inlineCode",{parentName:"p"},"app/")," directory contains the files that connect the different parts of the\nblockchain together. The most important file in this directory is ",(0,a.yg)("inlineCode",{parentName:"p"},"app.go"),",\nwhich includes the type definition of the blockchain and functions for creating\
1nand initializing it. This file is responsible for wiring together the various\ncomponents of the blockchain and defining how they will interact with each\nother."),(0,a.yg)("p",null,"The ",(0,a.yg)("inlineCode",{parentName:"p"},"cmd/")," directory contains the main package responsible for the command-line\ninterface (CLI) of the compiled binary. This package defines the commands that\ncan be run from the CLI and how they should be executed. It is an important part\nof the blockchain project as it provides a way for developers and users to\ninteract with the blockchain and perform various tasks, such as querying the\nblockchain state or sending transactions."),(0,a.yg)("p",null,"The ",(0,a.yg)("inlineCode",{parentName:"p"},"docs/")," directory is used for storing project documentation. By default,\nthis directory includes an OpenAPI specification file, which is a\nmachine-readable format for defining the API of a software project. The OpenAPI\nspecification can be used to automatically generate human-readable documentation\nfor the project, as well as provide a way for other tools and services to\ninteract with the API. The ",(0,a.yg)("inlineCode",{parentName:"p"},"docs/")," directory can be used to store any additional\ndocumentation that is relevant to the project."),(0,a.yg)("p",null,"The ",(0,a.yg)("inlineCode",{parentName:"p"},"proto/")," directory contains protocol buffer files, which are used to\ndescribe the data structure of the blockchain. Protocol buffers are a language-\nand platform-neutral mechanism for serializing structured data, and are often\nused in the development of distributed systems, such as blockchain networks. The\nprotocol buffer files in the ",(0,a.yg)("inlineCode",{parentName:"p"},"proto/")," directory define the data structures and\nmessages that are used by the blockchain, and are used to generate code for\nvarious programming languages that can be used to interact with the blockchain.\nIn the context of the Cosmos SDK, protocol buffer files are used to define the\nspecific types of data that can be sent and received by the blockchain, as well\nas the specific RPC endpoints that can be used to access the blockchain's\nfunctionality."),(0,a.yg)("p",null,"The ",(0,a.yg)("inlineCode",{parentName:"p"},"testutil/")," directory contains helper functions that are used for testing.\nThese functions provide a convenient way to perform common tasks that are needed\nwhen writing tests for the blockchain, such as creating test accounts,\ngenerating transactions, and checking the state of the blockchain. By using the\nhelper functions in the ",(0,a.yg)("inlineCode",{parentName:"p"},"testutil/")," directory, developers can write tests more\nquickly and efficiently, and can ensure that their tests are comprehensive and\neffective."),(0,a.yg)("p",null,"The ",(0,a.yg)("inlineCode",{parentName:"p"},"x/")," directory contains custom Cosmos SDK modules that have been added to\nthe blockchain. Standard Cosmos SDK modules are pre-built components that\nprovide common functionality for Cosmos SDK-based blockchains, such as support\nfor staking and governance. Custom modules, on the other hand, are modules that\nhave been developed specifically for the blockchain project and provide\nproject-specific functionality."),(0,a.yg)("p",null,"The ",(0,a.yg)("inlineCode",{parentName:"p"},"config.yml")," file is a configuration file that can be used to customize the\nblockchain during development. This file includes settings that control various\naspects of the blockchain, such as the network's ID, account balances, and the\nnode parameters."),(0,a.yg)("p",null,"The ",(0,a.yg)("inlineCode",{parentName:"p"},".github")," directory contains a GitHub Actions workflow that can be used to\nautomatically build and release a blockchain binary. GitHub Actions is a tool\nthat allows developers to automate their software development workflows,\nincluding building, testing, and deploying their projects. The workflow in the\n",(0,a.yg)("inlineCode",{parentName:"p"},".github")," directory is used to automate the process of building the blockchain\nbinary and releasing it, which can save time and effort for developers."),(0,a.yg)("p",null,"The ",(0,a.yg)("inlineCode",{parentName:"p"},"readme.md")," file is a readme file that provides an overview of the\nblockchain project. This file typically includes information such as the\nproject's name and purpose, as well as instructions on how to build and run the\nblockchain. By reading the ",(0,a.yg)("inlineCode",{parentName:"p"},"readme.md")," file, developers and users can quickly\nunderstand the purpose and capabilities of the blockchain project and get\nstarted using it."),(0,a.yg)("h2",{id:"starting-a-blockchain-node"},"Starting a blockchain node"),(0,a.yg)("p",null,"To start a blockchain node in development, you can run the following command:"),(0,a.yg)("pre",null,(0,a.yg)("code",{parentName:"pre"},"ignite cosmos chain serve\n")),(0,a.yg)("p",null,"The ",(0,a.yg)("inlineCode",{parentName:"p"}
1,"ignite cosmos chain serve")," command is used to start a blockchain node in\ndevelopment mode. It first compiles and installs the binary using the\n",(0,a.yg)("inlineCode",{parentName:"p"},"ignite cosmos chain build")," command, then initializes the blockchain's data directory\nfor a single validator using the ",(0,a.yg)("inlineCode",{parentName:"p"},"ignite cosmos chain init")," command. After that, it\nstarts the node locally and enables automatic code reloading so that changes to\nthe code can be reflected in the running blockchain without having to restart\nthe node. This allows for faster development and testing of the blockchain."),(0,a.yg)("p",null,(0,a.yg)("strong",{parentName:"p"},"Congratulations!")," \ud83e\udd73 You have successfully created a brand-new Cosmos blockchain\nusing the IGNITE\xae CLI. This blockchain uses the delegated proof of stake (DPoS)\nconsensus algorithm, and comes with a set of standard modules for token\ntransfers, governance, and inflation. Now that you have a basic understanding of\nyour Cosmos blockchain, it's time to start building custom functionality. In the\nfollowing tutorials, you will learn how to build custom modules and add new\nfeatures to your blockchain, allowing you to create a unique and powerful\ndecentralized application."))}h.isMDXComponent=!0}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.