Skip to content

Commit

Permalink
docs: change knowledge base and CLI docs to scaffold using single nam…
Browse files Browse the repository at this point in the history
…es (ignite#2752)

* docs: change CLI docs to use single names
* fix: guides to use single names
* docs: change knowledge base docs to use single names
* review: fix code blocks and change syntax tags to be consistent
* feat: add support for proto buffers and go module syntax
* fix: replace "proto" by the "protobuf" tag in code block

Co-authored-by: Alex Johnson <[email protected]>
  • Loading branch information
jeronimoalbi and Alex Johnson authored Aug 17, 2022
1 parent 74ee3ab commit 4a7d6dc
Show file tree
Hide file tree
Showing 30 changed files with 162 additions and 146 deletions.
16 changes: 10 additions & 6 deletions docs/docs/07-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ test, build, and launch your blockchain.

To get started, create a blockchain:

ignite scaffold chain github.com/username/mars
```
ignite scaffold chain mars
```

**Options**

Expand Down Expand Up @@ -678,14 +680,16 @@ Create a new application-specific Cosmos SDK blockchain.

For example, the following command will create a blockchain called "hello" in the "hello/" directory:

ignite scaffold chain hello
```bash
ignite scaffold chain hello
```

A project name can be a simple name or a URL. The name will be used as the Go module path for the project. Examples of project names:

ignite scaffold chain foo
ignite scaffold chain foo/bar
ignite scaffold chain example.org/foo
ignite scaffold chain github.com/username/foo
- ignite scaffold chain foo
- ignite scaffold chain foo/bar
- ignite scaffold chain example.org/foo
- ignite scaffold chain github.com/username/foo

A new directory with source code files will be created in the current directory. To use a different path use the "--path" flag.

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/contributing/02-technical-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ The Z shell, also known as zsh, is a UNIX shell that is built on top of the macO

1. Edit your `~/.zshrc` file to add the plugins to load on startup:

```sh
```
plugins=(
git
zsh-autosuggestions
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/contributing/templates/01-concept_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ This is `inline code`. Use it for referencing package names and commands.
Here's a command someone types on a command line:
```command
```bash
which go
```
Expand Down
12 changes: 6 additions & 6 deletions docs/docs/contributing/templates/02-tutorial-template.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ Finally...

To verify the version of Ignite CLI that is installed, run the following command:

```sh
```bash
ignite --version
```

You'll see release details like the following output:

```bash
```
Ignite version: v0.19.6
Ignite CLI build date: 2021-12-18T05:56:36Z
Ignite CLI source hash: -
Expand All @@ -105,8 +105,8 @@ When showing the contents of a file, try to show only the relevant parts and exp

Modify the title by changing the contents of the `<title>` tag:

```js
...
```protobuf
// ...
message Post {
string creator = 1;
Expand All @@ -121,7 +121,7 @@ message MsgCreatePost {
string body = 3;
}
...
// ...
```

Now transition to the next step by telling the user what's next.
Expand Down Expand Up @@ -160,7 +160,7 @@ This is `inline code`. Use single tick marks for filenames and commands.
Here's a command you can type on a command line:
```sh
```bash
which go
```
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/guide/01-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Ignite CLI is written in the Go programming language. To use Ignite CLI on a loc

To verify the version of Ignite CLI you have installed, run the following command:

```sh
```bash
ignite version
```

Expand Down
14 changes: 8 additions & 6 deletions docs/docs/guide/02-hello.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ git commit -am "Scaffolded a hello query with Ignite CLI"

In the `proto/hello/query.proto` file, the `Hello` rpc has been added to the `Query` service.

```proto
```protobuf
service Query {
rpc Hello(QueryHelloRequest) returns (QueryHelloResponse) {
option (google.api.http).get = "/hello/hello/hello";
Expand All @@ -173,7 +173,7 @@ Here's how the `Hello` rpc for the `Query` service works:

Now, take a look at the following request and response types:

```proto
```protobuf
message QueryHelloRequest {
}
Expand Down Expand Up @@ -239,10 +239,12 @@ Make the required changes to the `x/hello/module.go` file.

```go
import (
"encoding/json"
"fmt"
//...
// ...

"context"

// ...
)
```

Do not save the file yet, you need to continue with these modifications.
Expand All @@ -259,7 +261,7 @@ Make the required changes to the `x/hello/module.go` file.

2. After the chain has been started, visit [http://localhost:1317/hello/hello/hello](http://localhost:1317/hello/hello/hello) and see your text displayed:

```go
```json
{
"text": "Hello, Ignite CLI!",
}
Expand Down
18 changes: 9 additions & 9 deletions docs/docs/guide/03-blog/00-build-blog.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ The `message` command accepts message name (`createPost`) and a list of fields (

The `message` command has created and modified several files:

```bash
```
modify proto/blog/tx.proto
modify x/blog/client/cli/tx.go
create x/blog/client/cli/tx_create_post.go
Expand All @@ -85,7 +85,7 @@ create x/blog/types/message_create_post_test.go

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

```go
```protobuf
message MsgCreatePost {
string creator = 1;
string title = 2;
Expand Down Expand Up @@ -165,7 +165,7 @@ When you define the `Post` type in a proto file, Ignite CLI (with the help of `p

Create the `proto/blog/post.proto` file and define the `Post` message:

```go
```protobuf
syntax = "proto3";
package blog.blog;
Expand Down Expand Up @@ -202,7 +202,7 @@ Then, add these prefixes to the `x/blog/types/keys.go` file in the `const` and a

```go
const (
//...
// ...

// Keep track of the index of posts
PostKey = "Post-value-"
Expand Down Expand Up @@ -338,13 +338,13 @@ To define the types in proto files, make the following updates in `proto/blog/qu

1. Add the `import`:

```go
```protobuf
import "blog/post.proto";
```

2. Add pagination to the post request:

```go
```protobuf
message QueryPostsRequest {
// Adding pagination to request
cosmos.base.query.v1beta1.PageRequest pagination = 1;
Expand Down Expand Up @@ -430,7 +430,7 @@ In the `x/blog/module.go` file:
import (
"context"

// ... other imports
// ...
)
```

Expand Down Expand Up @@ -469,7 +469,7 @@ blogd tx blog create-post foo bar --from alice

The transaction is output to the terminal. You are prompted to confirm the transaction:

```bash
```
{"body":{"messages":[{"@type":"/blog.blog.MsgCreatePost","creator":"blog1ctxp3pfdtr3sw9udz2ptuh59ce9z0eaa2zvv6w","title":"foo","body":"bar"}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":[]}
confirm transaction before signing and broadcasting [y/N]: y
Expand All @@ -489,7 +489,7 @@ blogd q blog posts

The result:

```bash
```yaml
Post:
- body: bar
creator: blog1ctxp3pfdtr3sw9udz2ptuh59ce9z0eaa2zvv6w
Expand Down
Loading

0 comments on commit 4a7d6dc

Please sign in to comment.