From 11efdfb0641d79e87a68c462a20100b0cfd97716 Mon Sep 17 00:00:00 2001 From: LEVI_104 <108803001+chen4903@users.noreply.github.com> Date: Wed, 20 Nov 2024 19:09:42 +0800 Subject: [PATCH] docs(blog): fix pointer type and add build steps (#4412) * update tutorial * update tutorial * fix comment --- .../version-v28/02-guide/04-blog.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/docs/versioned_docs/version-v28/02-guide/04-blog.md b/docs/versioned_docs/version-v28/02-guide/04-blog.md index df8b1e6522..2f0cb412d9 100644 --- a/docs/versioned_docs/version-v28/02-guide/04-blog.md +++ b/docs/versioned_docs/version-v28/02-guide/04-blog.md @@ -111,7 +111,7 @@ Add the `PostKey` and `PostCountKey` functions to the `x/blog/types/keys.go` fil ```go title="x/blog/types/keys.go" // PostKey is used to uniquely identify posts within the system. - // It will be used as the beginning of the key for each post, followed bei their unique ID + // It will be used as the beginning of the key for each post, followed by their unique ID PostKey = "Post/value/" // This key will be used to keep track of the ID of the latest post added to the store. @@ -220,7 +220,7 @@ ignite scaffold message delete-post id:uint This command enables the deletion of posts by their ID. 2. **Delete Logic:** - + Implement RemovePost in `x/blog/keeper/post.go` to delete posts from the store. ```go title="x/blog/keeper/post.go" @@ -301,7 +301,7 @@ func (k Keeper) ShowPost(goCtx context.Context, req *types.QueryShowPostRequest) return nil, sdkerrors.ErrKeyNotFound } - return &types.QueryShowPostResponse{Post: post}, nil + return &types.QueryShowPostResponse{Post: &post}, nil } ``` @@ -366,6 +366,18 @@ message QueryListPostResponse { } ``` +Build the blockchain: + +``` +ignite chain build +``` + +Start the blockchain: + +``` +ignite chain serve +``` + **Interacting with the Blog** 1. **Create a Post:**