Ignite CLI is a developer tool that simplifies building sovereign Cosmos SDK blockchains by providing automated scaffolding for chain creation, module development, and client generation, making blockchain development accessible to web developers and reducing the complexity of Cosmos SDK's verbose codebase through features like automatic code reloading, IBC compatibility, and TypeScript client generation.
Build a Cosmos Blockchain with Ignite CLI in 10 Minutes
Added:so uh my name is Dennis I uh started ignite two years ago and I'm now core contributor to ignite and I also work as blockchain engineer at Strange Love Ventures so what is ignite well ignite is a company and we specialize on um accelerating the development of the internet of blockchains and the way we do this this is by writing software uh specifically ignite CLI and we also have an accelerator program and ignite CLI is something I will be talking today about so ignite CLI started essentially because cosmos's Decay even though we love cosmoses Decay and it's a great piece of technology it was very difficult to start working with cosmoses Decay and start building applications I remember the time where there was no scaffold bu tooling at all there was one but it wasn't wasn't very good and the the blockchain It produced didn't didn't compile so you had to spend hours uh figuring it out so we were on a mission to improve developer experience of building cosmos's Decay blockchains and making it accessible to people who would otherwise maybe not even spend time um working uh on on blockchains right because uh very often people um start uh building blockchains on hackathons where you have very Li limited time and we wanted to make blockchain development accessible for web developers and basically anyone so we started working on ignite CLI 2 years ago and by now it has been used by uh dozens of chains in production uh hundreds upon hundreds of projects were built um uh has test projects tutorials and almost every day we have three to five new uh tutorial projects completed pushed to GitHub that were scaffolded uh with Ignite CLI so let's kind of look into the CLI in more detail it's a binary that you install in your machine and it gives you a set of commands that you can use well first of all to create a chain for example right ignite scaffold chain um planet and uh shortly you get a new Cosmos SDK blockchain then you can run another command and it will start a blockchain node locally with one validator but it's enough for you to start building so basically with just a few commands you get a full development setup running and you can modify your code and almost immediately see the changes because it automatically compiles your blockchain chain uh in a single binary and um you you can you can interact with it immediately so it also comes with a set of features that are useful for client developers because we know it's never just about writing the blockchain code you also want your web application to talk to your blockchain you want um maybe a mobile application so that's what ignite is built for so we already heard about Cosmos but I'm going to uh mentioned anyways right Cosmos is a huge ecosystem with over 50 blockchains um that interact with each other and the ecosystem as a whole secures billions of dollars worth of value and it's uh a very great ecosystem be to be part of and what I love about Cosmos on a personal level I guess it's the diversities right so there's no single chain that is better than others that is more important uh you can come up with an idea implement it and it will be part of Cosmos alongside other established projects so I think this is a very important idea it's a very simple one but um in Cosmos you build you can build a sovereign blockchain right and that's a distinguishing characteristic where in other ecosystems you have a single chain and you're building smart contracts on that chain in Cosmos you can build your own thing uh you don't even have to connect it to anyone uh to any other chain you don't have to pay anyone of course you you can do your own thing and of course you can also have Smart contracts but the fact that you can build your Sovereign chain and that's what Cosmos s DEC was was um built for that's for me is a defining characteristic and ignite yeah well before um before that that's how you can visualize um a cosmos blockchain um as Marco said it's a modular system where you have a bunch of standard modules that use each other's functionality and um each module has State and it has messages that trigger State Transitions and you have users that broadcast these messages that get routed well they broadcast transactions that contain messages that get routed to modules and of course you can build your own modules right ignite just helps you do that much much faster and uh without uh without you having to write that much boilerplate code so with a single command you you get a new chain and it uses the latest version of cosmos's Decay it comes with IBC so it comes with everything everything you need the next command will most likely what you want to do is create your own module uh many applications have three four however many modules because you want to separate the responsibility and um modularize your application you don't want to put it everything in one module right so you can do that you can if you want your if if you know that your module will be ABC compatible uh you can use a flagin and it will be uh generated with IBC compatibility and this is where ignite goes kind of further than that because uh what I wanted ignite to do from the very beginning is allow people to quickly get something up and running even if if it if it even if it wasn't for production just so that they can learn more about how Cosmos SDK works and to shorten the feedback loop right to make the feedback loop very very short so that person can just execute one command and he or she has a um a set of tools uh to interact with their chain so for example your chain uh might you might want to build a DEX for example but um the first blockchain you build will probably not be a DEX right we we take a simple concept like blog post and you um you run ignite scaffold list post uh and then you provide fields and what you get uh is a post type but also you get all the functionality to create read update and delete posts right and everyone knows how blog works now it's it's it's a Blog on a blockchain so you can map what you already know to what you don't know yet which is cosmoses DC and how it works and you can figure it out sometimes it's much easier than going through a tutorial because you uh you map the knowledge that you already have about a concept like a Blog to a new framework like cosmosis decay of course the same command can be used in production because the pattern is very popular and very widely used right that's how blockchain that's how databases would work right you you want to create data delete data and so on sometimes of course well most of the time probably you want to create code for individual messages because not all applications have follow the crud pattern um you can use ignite for that so um I think due to how verbose cosmoses DEC is each message you need like 300 lines of code for a message probably maybe maybe maybe less but in any case that's something you don't want to do your yourself right and uh for example I was working on a chain the other day and uh there were 12 messages so this really simplifies the and streamlines the development process uh it's important when you're building something for production but it's hugely important also when you're like just prototyping something and I'm going to show later on how it can be used um of course ignite doesn't know what exactly you want to do with when you write a comment in this example so you you have to fill in the blanks and write the custom logic that actually implements your business logic but yeah and then you can start your chain locally uh which just one command um if you use Cosmos as decay you need to execute many more commands you typically put it in the Shell file here you don't need to worry about any of that um ignite chain serve and you got a chain running locally for development purposes with um automatic code reloading which is very handy so ignite as I mentioned previously it's not only for building blockchain but it's also for for interacting with uh with blockchains right we have a cosmos client Library if you're building an application Ino you might want to use that if you're building a web application we have advanced typescript client generation so uh it automatically generates uh functions to broadcast transactions that contain messages specific to your blockchain it simplifies quering the chain so if you're building and most likely you are building a web app for your chain that's a great tool to use so yeah this is a very short example of of what you would write if you wanted to use Cosmos client very short and simple and uh you get you get um output on the right right very easy to uh broadcast a transaction for example for create post of course it's very useful to not only see the source code right but I'll also have a web application that interacts with with your chain some even if you're not planning on on using it for production it's useful because you can uh well play with your chain you can uh use it as a foundation for your production app but also a learning tool to know how how you can build one yourself so ignite comes with a front end template that you can use that comes out out of the box so yeah for generating a typescript client there's just one command you don't need to set up anything um it works with any Cosmos SDK chain if it doesn't it's a bug but yeah we're we're aiming to support all of the chains um so yeah so what's next for ignite uh well um there are so many things we can build and so many functionality so much functionality we can add to make development life developers life easier um I think importing external modules and making um so Cosmos SDK always claimed to be rubyan rails of blockchain development but was missing the the module installation part uh it it's notoriously hard well it's not hard but it's definitely difficult for a new newcomer developer to add a module and um hopefully that that will be um that will be improved and having multiv valat test Nets is something we want to add as well because um many people have to write Docker files and orchestrate launches of their own test net locally um the reason why it was done for a single node initially because that's kind of typically what you just need right you you only need one one validator locally you can unless your application is very specific in you want to test it uh with multiple validators uh it's much easier to do uh automatic code reloading and preservation of State because that's something you you might want have right so instead of pre populating state every time the state is preserved when you run a night chain serve so but multiv validator local test is nice and of course there are bunch of other things want but um yeah the next big feature is uh commands to Launch new network into production can't tell you more right now about this but this is this is coming in the future so yeah um thanks for your attention um if you want to know know more go to github.com ignite CLI visit our Discord we're very active people have questions we typically answer them very quickly and uh follow us on Twitter so that's the end of the presentation part now um Now demo demos live demos typically go very smoothly right they literally nothing can go wrong here so uh what I'm going to do is um first of all hopefully it's yeah it should be visible so ignite is just a single binary and we decided to put it in in a single binary long time ago because if um some some features require um no Js some features require protoc C and asking people to install um different programs different binaries um is a very bad developer experience whereas downloading a single binary is a good developer experience especially if you have a good connection to the internet which in our case we don't but you can imagine this slide slide this this progress bar goes to the end eventually but I have ignite already installed uh so I can show you how it works soite has a bunch of commands and we'll go through some of them um ignite scaffold chain and let's say we are using uh we want to build a an exchange so it takes a while to scaffold even though we're just spitting out a template because we also uh install dependencies and making sure that producy deel dependencies are there so um more than gift clone happens on the hood but yeah in just a couple of seconds you get a new blockchain you can can open up and yeah it's pretty standard Cosmos is DK blockchain um I'm not going to go of course through everything here but um if you run ignite chain serve using the air flag R flag to to start it from scratch just in case there was any state before and it install dependencies builds Proto files initializes the chain and yeah it's running so uh right now with just two commands you have a Lo local blockchain running and uh the cool thing is that you can modify it and it it's yours yours blockchain right it's uh um it's not Gaia it's not osmosis it's your blockchain that you can hack around uh it uses config file to initialize you can see Alice and Bob were uh were created as users has one validator and yeah you can customize the behavior of ignite with the simple config yaml file but that's not what we want to do right now what we want is um let's say you you want to add a feature to it so ignite scaffold I can just say s ignite scaffold list of pools so if it's an exchange it might have a pool uh liquidity pools right or even before this you have an exchange module but let's say you realized you wanted your module to be IBC compatible and some logic will be in the exchange module but you also want a DEX module so you can do that ignite scaold module Dex and uh with a flag IBC so this command modified the source code it created a DEX directory in the X directory X stands for modules confusingly enough but you get a new directory with boiler plate code so uh you could could have copied it from from Anywhere But Here the name is everywhere like the the module is Dex and it's also wired up to um T.O and you get Proto files so you get a bunch of functionality out out of the box here um okay so that's good if you go inside you can see that it's ABC compatible it has module abc. go now let's Commit This to get cont type module okay and now let's say you want to add some functionality to it so ignites careful list of pools and let's say each pool has an amount and amount is in coins and it might have a height I don't know what height will be for but um you can see it um you can specify a type you can skip that and this will assume that this is a string but yeah we can do that and uh say we want that in the module called Dex so this command command modified the Dex module and we'll go through what it what it did exactly so I when I when I look at Cosmos SDK blockchains what I like to do first is go inside the Proto directory because the Proto file describe types that your application deals with so it's very easy to understand what going going on if you just read Proto files right so we know that there's a type called pool and by convention in TX Proto all messages that your uh module supports are registered in the message service so you can kind of understand what this module is for right you can create update and delete pools and you can also query for them so that's that's like a table of contents for your blockchain and if you go inside your X directory inside the keeper method you will you will see message server file and this file essentially implements what happens to the state when the message is processed so when create pool message is processed this code gets executed and you can use that to actually learn how to build something like this right so it's sometimes it's very handy to just create um a test chain scaffold some stuff look how it works and then scaffold the same thing or something else in your chain that you're building for production so now let's yeah now let's scaffold the message because not everything fits this crowd pattern um we can this is probably the the functionality that is used more often um because you need need many messages if your blockchain is uh has a lot of features right so for each feature you probably have like a couple of messages at least so let's say uh there's a message called add liquidity and it might have um also an amount in coins and um denom it's going to be a string so we can you can use more Flags to customize how scaffolding happens and ignite of course complains that um we didn't commit changes to to get let's do that list of pools and run it again it's just convenient to see what which files were changed so we can see for a single message just a few changes happened right in X Proto add liquidity was automatically added to the message service which is very handy you don't need to do this yourself in the text module we have a new file and it doesn't have much inside but you kind of don't need to write that yourself which is Handy and uh now what we can do is start the chain again so this will rebuild everything and let you um play with your chain okay by the way we can uh we can change config file and uh let's add a new account called Frank and when you save it will automatically detect that the config file was changed so and does the same thing with the source code so you don't have to worry about re rerunning your chain again so now let's use exchange exchange D um that we have so the whole chain is compiled into a single binary and uh that's well that's Cosmos DEC feature um but we can if we type TX we can we can see all the modules and Dex and exchange are among those modules and we can see what kind of functionality we already have we have create pool delete date and we can use that all right so let's create a pool so it accepts an amount and height amount I know is in coins so let's say 100 stake and height is just nure and we need to provide two we're broadcasting this transaction from let's use one of the accounts we have in config file Alice and yeah that's how we created a pool I mean doesn't Implement any Dex functionality you would have to do that yourself but it provides all the wiring for you so if you now query for for pools you will see what you created l pool so yeah with just a few commands we already got we already have a skeleton of your application we can also um add liquidity use that command as well liquidity it's actually probably probably going to fail because the types are different anyway uh it's not going to do anything because the keeper method is empty but you I think you you can you get the point right you um you use ignite to create your chain then scaffold all the skeleton code you you need you don't want to write it yourself then you basically go into um into the keeper methods and actually implement the logic that that that you want so just kind of wrapping this up let's see what else so ignite generate lets you generate clients either um in a typescript U or we also have Dart um for mobile developers uh we already also have very extensive documentation so ignite scaffold help you can read about how how it all works and uh we also have a built-in relayer and um a set of tutorials so if you go to docs.
ignite.com you will find I think eight tutorials one of them is IBC so we included uh a relayer into the ignite distribution to make it easier for people to build IBC applications if that's what you want um you can scaffold queries messages IBC packets and um um so yeah that's pretty much it um I think we can um open for questions yeah thanks for the question the question was are we planning on doing something similar for smart contracts uh the same way we simplified and streamlined development of blockchains will we do something for smart contracts and this is a very good question uh because I think the future where we have thousands of blockchains is something we actually want right so um you can build smart contracts and deploy them to existing chains but you can also have your own chain for your application and this opens up many possibilities that you can't really get from a smart Contracting platform so it would have been a bleak future where we had thousands of blockchains if they weren't interconnected but since they are interconnected the difference is is big but in a way it is it is not that big because you can launch your application uh with shared security for example or you can launch even a sovereign if there are good tools you can launch your Sovereign chain and for end users it's it's not going to look all that different they eventually will not know where their applications are running whether they're contracts whether they're chains and um writing your own chain definitely gives you gives you more control so that's why ignite is focusing on cosmos's DEC uh we're not planning on focusing on smart contract because you can any any application you might want you might write uh with kmmi can do the same in cosmos's Decay and arguably it's easier um so but but what we want to do is of course cosm wasm is very popular there are other Solutions since many chains want cosm wasm we probably would rather integrate with other tools that are built specifically for for km wasm or other smart Contracting platforms and make it easier to include km wasm in your chain make it easier to use developer tooling for for that platform but I think like tools should should specialize and ignite definitely specializes on helping developers build their decentralized applications as Sovereign blockchains and give all the control to Developers any other questions yeah thank you the question was why build your own blockchain when you can build smart contract so some of the reasons are more on the technical side so of course we all know about idx and them moving to Cosmos and one of the reasons why they did what they did is as far as I understand is you can't really build an order book uh on on on the tech that they were um using like like they they hit limitations and they wanted to have in memory um uh the logic of the order book in memory which ten plus cosmos's Decay allows them to do this uh sometimes you you don't want to be limited by the mechanisms of the chain that you deployed your contract to maybe you want your own governance maybe you want your own token like from an economic point of view um most applications probably want their token and when you launch your chain as a sovereign chain you get the benefit of the utility of the token being for like you can use it for staking it's used for governance who you you get all these free use cases for your for your token which is good and um maybe you want to build a proof Authority chain maybe it's a private chain maybe you want a use um a different VM maybe you want to use a combination of things you want build some functionality in Cosmos Decay modules then you want to add cosm wasm and write contracts there maybe you want permission permission smart contracts so like you can lit you can literally do anything with with uh a framework like Cosmos is Decay but typically you are limited when you're choosing um to to build a smart contract I mean it's just a different Paradigm and the way I see it uh is smart contracts are like scripting right you you have a browser like you can build a browser or a slack uh application or figma right your own desktop application then you can add scripting capabilities to it but you don't necessarily want your whole applications like all applications to be just scripted applications I don't know there are definitely advantages to writing smart contracts upgradeability for example so if you want to if you want have an admin that has control over the upgradeability of a contract and not validators then that's something easier to achieve um by writing application as a smart contract um because at the end of the day if you're launching as a sovereign chain you will have a most likely decentralized community of validators and stakers right and they will be the ones who are deciding what's going to happen with the chain so yeah any other questions yeah so the question is like is the process slower if you have to have fine validators and have to worry about all of these things it is and um it's going to change it's going to become much more simpler and the the the difference between launching your chain and deploying a contract will be not as drastic as it is right now okay well uh thanks so much everyone then that's it I guess [Applause]
Up Next

The Cosmos Ecosystem Explained: Blockchain 3.0 and Interoperability
@CoinGecko
10.8K views•2022-02-22

Torrent File Format & Bencoding: A Technical Deep Dive
@AsliEngineering
12.5K views•2022-08-08

Operational Security Essentials: A Guide for Hacktivists (OPSEC)
@hitbsecconf
157.4K views•2012-11-26

Understanding Ethereum: A Comprehensive Beginner's Overview
@99Bitcoins
3.1M views•2018-06-26
Related Study Plans & Knowledge Roadmaps
Structured learning paths in Blockchain & Crypto





































