You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tutorial.md
+25-25Lines changed: 25 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
-
# Build a blog
1
+
# Build a Blog
2
2
3
-
In this tutorial, you create a blockchain with a module that lets you write to and read data from the blockchain. This module implements create, read and update functionalities for a blog-like application. The end user will be able to submit new blog posts and show a list of blog posts on the blockchain. Furthermore will the user be able to upvote and downvote the post.
3
+
In this tutorial, you create a blockchain with a module that lets you write to and read data from the blockchain. This module implements create, read and update functionalities for a blog-like application. The end user will be able to submit new blog posts and show a list of blog posts on the blockchain. Furthermore will the user be able to upvote and downvote the posts.
4
4
5
-
This tutorial builds on knowlege and skills developed in the earlier tutorials in the Ignite CLI Developer Tutorials. Before you start this building your nameservice app, we recommend that you complete these foundational tutorials:
5
+
This tutorial builds on knowlege and skills developed in the earlier tutorials in the Ignite CLI Developer Tutorials. Before you start this building your blog chain, we recommend that you complete these foundational tutorials:
6
6
7
7
-[Install Ignite CLI](../01-install.md)
8
8
-[Hello, World](../02-hello.md)
@@ -27,7 +27,7 @@ This series of blog tutorials is based on a specific version of Ignite CLI, so t
The `blog` directory is created with the default directory structure.
41
41
42
-
## High-level transaction review
42
+
## High-level Transaction Review
43
43
44
44
So far, you have learned how to modify proto files to define a new API endpoint and modify a keeper query function to return static data back to the user. Of course, a keeper can do more than return a string of data. Its purpose is to manage access to the state of the blockchain.
45
45
46
46
You can think of the state as being a collection of key-value stores. Each module is responsible for its own store. Changes to the store are triggered by transactions that are signed and broadcasted by users. Each transaction contains Cosmos SDK messages (not to be confused with proto `message`). When a transaction is processed, each message gets routed to its module. A module has message handlers that process messages. Processing a message can trigger changes in the state.
47
47
48
-
## Create message types
48
+
## Create Message Types
49
49
50
50
A Cosmos SDK message contains information that can trigger changes in the state of a blockchain.
51
51
@@ -58,7 +58,7 @@ Now, you are ready to implement these Cosmos SDK messages to achieve the desired
- index is the post on which the user want to vote
123
+
- index is the post on which the user wants to vote
124
124
- upvotes is the amount of upvotes the post gets form the user
125
125
- downvotes is the amount of downvotes the post gets form the user
126
126
127
-
This `ignite scaffold message` command modifies and creates the same set of files as the `createPost` and `updatePost` command.
127
+
This `ignite scaffold message` command modifies and creates the same set of files as the previous scaffolds.
128
128
129
-
## Updating the proto file
129
+
## Updating the Proto File
130
130
131
131
As always, start with a proto file. Inside the `proto/blog/tx.proto` file, the `MsgCreatePost` message has been created. Edit the file to add the line that defines the `id` for `message MsgCreatePostResponse`:
In the same file `proto/blog/tx.proto` review the Cosmos SDK message type with proto `message`. The `MsgCreatePost` has three fields: creator, title, and body. Since the purpose of the `MsgCreatePost` message is to create new posts in the store, the only thing the message needs to return is an ID of a created post. The `CreatePost` rpc was already added to the `Msg` service. The same goes for the `UpdatePost` and `VoteOnPost` rpc:
0 commit comments