# Start your application
Get started by creating a new app, we will be using the lvl-1 app which is provided by the scaffold tool.
You can fill in
user with your Github username and
repo with the name of the repo you are creating.
app.go it is defined what the application does when it receives a transaction. But first, it needs to be able to receive transactions in the correct order. This is the role of the Tendermint consensus engine.
Links to godocs for each module and package imported:
log: Tendermint's logger.
authmodule for the Cosmos SDK.
dbm: Code for working with the Tendermint database.
baseapp: See below
A couple of the packages here are
tendermint packages. Tendermint passes transactions from the network to the application through an interface called the ABCI. If you look at the architecture of the blockchain node you are building, it looks like the following:
Fortunately, you do not have to implement the ABCI interface. The Cosmos SDK provides a boilerplate implementation of it in the form of
Here is what
- Decode transactions received from the Tendermint consensus engine.
- Extract messages from transactions and do basic sanity checks.
- Route the message to the appropriate module so that it can be processed. Note that
baseapphas no knowledge of the specific modules you want to use. It is your job to declare such modules in
app.go, as you will see later in this tutorial.
baseapponly implements the core routing logic that can be applied to any module.
- Commit if the ABCI message is
CheckTxchanges are not persistent).
- Help set up
Endblock, two messages that enable you to define logic executed at the beginning and end of each block. In practice, each module implements its own
EndBlocksub-logic, and the role of the app is to aggregate everything together (Note: you won't be using these messages in your application).
- Help initialize your state.
- Help set up queries.
Now you need to rename the
newApp types to the name of your app. In this case you can use
nameServiceApp. This type will embed
baseapp (embedding in Go similar to inheritance in other languages), meaning it will have access to all of
Great! You now have the start of your application. Currently you have a working blockchain, but we will customize it throughout this tutorial.
baseapp has no knowledge of the routes or user interactions you want to use in your application. The primary role of your application is to define these routes. Another role is to define the initial state. Both these things require that you add modules to your application.
As you have seen in the application design section, you need a few modules for your nameservice:
nameservice. The first five already exist, but not the last! The
nameservice module will define the bulk of your state machine. The next step is to build it.