Skip to content

Commit 00aced5

Browse files
author
nashqueue
committed
Minor Tutorial Upgrades
1 parent f351495 commit 00aced5

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

β€Žtutorial.mdβ€Ž

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Build a blog
1+
# Build a Blog
22

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.
44

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:
66

77
- [Install Ignite CLI](../01-install.md)
88
- [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
2727
curl https://get.ignite.com/[email protected]! | bash
2828
```
2929

30-
## Create your blog chain
30+
## Create your Blog Chain
3131

3232
First, create a new blockchain.
3333

@@ -39,13 +39,13 @@ ignite scaffold chain blog
3939

4040
The `blog` directory is created with the default directory structure.
4141

42-
## High-level transaction review
42+
## High-level Transaction Review
4343

4444
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.
4545

4646
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.
4747

48-
## Create message types
48+
## Create Message Types
4949

5050
A Cosmos SDK message contains information that can trigger changes in the state of a blockchain.
5151

@@ -58,7 +58,7 @@ Now, you are ready to implement these Cosmos SDK messages to achieve the desired
5858
- `voteOnPost`
5959
Allow useres to upvote and downvote on posts.
6060

61-
### Add the createPost Message
61+
### Add the CreatePost Message
6262

6363
First, change into the `blog` directory:
6464

@@ -91,7 +91,7 @@ create x/blog/types/message_create_post_test.go
9191
πŸŽ‰ Created a message `createPost`.
9292
```
9393

94-
### Add the updatePost Message
94+
### Add the UpdatePost Message
9595

9696

9797
To create the `updatePost` message for the blog module use:
@@ -106,9 +106,9 @@ where:
106106
- index is the post which the user wants to change
107107
- body is the new text of the post
108108

109-
This `ignite scaffold message` command modifies and creates the same set of files as the `ignite scaffold message` command.
109+
This `ignite scaffold message` command modifies and creates the same set of files as the previous scaffold.
110110

111-
### Add the voteOnPost Message
111+
### Add the VoteOnPost Message
112112

113113

114114
To create the `voteOnPost` message for the blog module use:
@@ -120,13 +120,13 @@ ignite scaffold message voteOnPost index upvotes downvotes
120120
where:
121121

122122
- voteOnPost is the message name
123-
- index is the post on which the user want to vote
123+
- index is the post on which the user wants to vote
124124
- upvotes is the amount of upvotes the post gets form the user
125125
- downvotes is the amount of downvotes the post gets form the user
126126

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.
128128

129-
## Updating the proto file
129+
## Updating the Proto File
130130

131131
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`:
132132

@@ -158,7 +158,7 @@ message MsgVoteOnPostResponse {
158158
}
159159
```
160160

161-
## Review the message code
161+
## Review the Message Code
162162

163163
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:
164164

@@ -371,7 +371,7 @@ func (k Keeper) AppendPost(ctx sdk.Context, post types.Post) uint64 {
371371

372372
Use the `ignite chain build` command to compile your newly implemented keeper.
373373

374-
´´´
374+
´´´bash
375375
ignite chain build
376376
´´´
377377

@@ -497,7 +497,7 @@ func (k Keeper) SetPost(ctx sdk.Context, post types.Post) {
497497

498498
Use the `ignite chain build` command to compile your newly implemented keeper.
499499

500-
´´´
500+
´´´bash
501501
ignite chain build
502502
´´´
503503

@@ -508,7 +508,7 @@ In the newly scaffolded `x/blog/keeper/msg_server_vote_on_post.go` file, you can
508508
You need to do two things:
509509

510510
- Check if the index already exists.
511-
- Add the new upvotes and downvotes on the post
511+
- Add the new upvotes and downvotes to the post
512512

513513
```go
514514
package keeper
@@ -565,12 +565,12 @@ func (k msgServer) VoteOnPost(goCtx context.Context, msg *types.MsgVoteOnPost) (
565565

566566
Use the `ignite chain build` command to compile your newly implemented keeper.
567567

568-
´´´
568+
´´´bash
569569
ignite chain build
570570
´´´
571571

572572

573-
## Display posts
573+
## Display Posts
574574

575575
Now that you have added the functionality to create posts and broadcast them to our chain, you can add querying.
576576
To display posts, use the `ignite query message` command to scaffold a new query for your module.
@@ -673,7 +673,7 @@ func (k Keeper) Posts(c context.Context, req *types.QueryPostsRequest) (*types.Q
673673
}
674674
```
675675

676-
## Add gRPC to the module handler
676+
## Add gRPC to the Module Handler
677677

678678
In the `x/blog/module.go` file:
679679

@@ -729,7 +729,7 @@ confirm transaction before signing and broadcasting [y/N]: y
729729

730730
Type `y` to sign and broadcast the transaction.
731731

732-
Congratulations, you used the `blogd` binary CLI to create a blog post.
732+
πŸŽ‰Congratulations, you used the `blogd` binary CLI to create a blog post.
733733

734734
## Use the CLI to Query Posts
735735

@@ -767,7 +767,7 @@ where:
767767
- blog is the module name
768768
- update-post is the message name
769769
- 0 is the index of the post that gets the body changed
770-
- newbody is the new body
770+
- newbody is the updated body
771771
- alice is the account that updates the post. If bob tries to update a post from alice an error occurs.
772772

773773
The transaction is output to the terminal. You are prompted to confirm the transaction:
@@ -799,7 +799,7 @@ pagination:
799799
next_key: null
800800
total: "1"
801801
```
802-
Congratulations, you just used the `blogd` binary CLI to update a blog post and see the result with a query.
802+
πŸŽ‰Congratulations, you just used the `blogd` binary CLI to update a blog post and see the result with a query.
803803

804804
## Use the CLI to Vote on a Post and Query the Result
805805

@@ -847,11 +847,11 @@ pagination:
847847
next_key: null
848848
total: "1"
849849
```
850-
Congratulations, you just used the `blogd` binary CLI to vote on a blog post and see the result with a query.
850+
πŸŽ‰Congratulations, you just used the `blogd` binary CLI to vote on a blog post and see the result with a query.
851851

852852
## Conclusion
853853

854-
Congratulations. You have built a blog blockchain!
854+
πŸŽ‰πŸŽ‰πŸŽ‰CongratulationsπŸŽ‰πŸŽ‰πŸŽ‰. You have built a blog blockchain!
855855

856856
You have successfully completed these steps:
857857

0 commit comments

Comments
Β (0)