Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Update docs guide v0.19.2 #2015

Merged
merged 5 commits into from
Jan 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions docs/guide/blog/connect-blockchain.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,11 @@ Create your `blogclient` directory first, change your current working directory,
mkdir blogclient
cd blogclient
go mod init github.com/cosmonaut/blogclient
touch main.go
```

The `go.mod` file is created inside your `blogclient` directory.

Create the `main.go` file and add the content as follows.

Your blockchain client has only two dependencies:

- The `blog` blockchain `types` for message types and a query client
Expand All @@ -49,7 +48,7 @@ go 1.17

require (
github.com/cosmonaut/blog v0.0.0-00010101000000-000000000000
github.com/tendermint/starport v0.18.0
github.com/tendermint/starport v0.19.2
)

replace github.com/cosmonaut/blog => ../blog
Expand Down Expand Up @@ -146,8 +145,6 @@ Make sure your blog blockchain is still running with `starport chain serve`.
Install dependencies for your `blogclient`:

```bash
cd blogclient

go mod tidy
```

Expand Down
6 changes: 3 additions & 3 deletions docs/guide/blog/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ message Post {
}
```

The contents of the `post.proto` file are fairly standard. The file defines a package name that is used to identify messages, among other things, specifies the Go package where new files are generated, and finally defines `message Post`.
The contents of the `post.proto` file are fairly standard. The file defines a package name that is used to identify messages, among other things, specifies the Go package where new files are generated, and finally defines `message Post`.

Each file save triggers an automatic rebuild. Now, after you build and start your chain with Starport, the `Post` type is available.

Expand All @@ -168,7 +168,7 @@ The next step is to define the `AppendPost` keeper method. Create the `x/blog/ke

To implement `AppendPost` you must first understand how the store works. You can think of a store as a key-value database where keys are lexicographically ordered. You can loop through keys and use `Get` and `Set` to retrieve and set values based on keys. To distinguish between different types of data that a module can keep in its store, you can use prefixes like `product-` or `post-`.

To keep a list of posts in what is essentially a key-value store, you need to keep track of the index of the posts you insert. Since both post values and post count (index) values are kept in the store, you can use different prefixes: `Post-value-` and `Post-count-`.
To keep a list of posts in what is essentially a key-value store, you need to keep track of the index of the posts you insert. Since both post values and post count (index) values are kept in the store, you can use different prefixes: `Post-value-` and `Post-count-`.

Add these prefixes to the `x/blog/types/keys.go` file:

Expand All @@ -179,7 +179,7 @@ const (
)
```

When a `Post` message is sent to the `AppendPost` function, four actions occur:
When a `Post` message is sent to the `AppendPost` function, four actions occur:

- Get the number of posts in the store (count)
- Add a post by using the count as an ID
Expand Down
6 changes: 3 additions & 3 deletions docs/guide/hello.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ This tutorial is a great place to start your journey into the Cosmos ecosystem.

In the previous chapter you've learned how to install [Starport](https://github.com/tendermint/starport), the tool that offers everything you need to build, test, and launch your blockchain with a decentralized worldwide community.

This series of tutorials is based on a specific version of Starport, so to install Starport v0.18.0 use the following command:
This series of tutorials is based on a specific version of Starport, so to install Starport v0.19.2 use the following command:

```bash
curl https://get.starport.network/starport@v0.18.0! | bash
curl https://get.starport.network/starport@v0.19.2! | bash
```

Starport comes with a number of scaffolding commands that are designed to make development easier by creating everything that's required to start working on a particular task.
Expand Down Expand Up @@ -200,7 +200,7 @@ Save the file to restart your chain. Visit the [posts endpoint](http://localhost

## Register Query Handlers

Make the required changes to the `x/hello/module.go` file.
Make the required changes to the `x/hello/module.go` file.

As shown in the following example, add `"context"` to the list of packages in the import statement, search for `RegisterGRPCGatewayRoutes`, and register the query handlers:

Expand Down
14 changes: 7 additions & 7 deletions docs/guide/ibc.md
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,8 @@ starport relayer configure -a \
--target-gaslimit 300000
```

After you hit enter, it will ask for the `Source Account` and `Target Account`. Use default for both accounts.

The output looks like:

```bash
Expand Down Expand Up @@ -429,19 +431,17 @@ starport relayer connect
Results:

```bash
🔌 Linked chains with 1 paths.
---------------------------------------------
Chains by paths
---------------------------------------------
------
Paths
------
earth-mars:
earth > (port: blog) (channel: channel-0)
mars > (port: blog) (channel: channel-0)
---------------------------------------------
------
Listening and relaying packets between chains...
---------------------------------------------
------
```

### Send packets
Expand Down
16 changes: 7 additions & 9 deletions docs/guide/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@ description: Steps to install Starport on your local computer.
- [Build from source](#build-from-source)
- [Summary](#summary)


# Install Starport

You can run [Starport](https://github.com/tendermint/starport) in a web-based Gitpod IDE or you can install Starport on your local computer.

You can run [Starport](https://github.com/tendermint/starport) in a web-based Gitpod IDE or you can install Starport on your local computer.

## Prerequisites

Be sure you have met the prerequisites before you install and use Starport.
Be sure you have met the prerequisites before you install and use Starport.

### Operating Systems

Expand All @@ -32,14 +30,14 @@ Starport is supported for the following operating systems:
- macOS
- Windows Subsystem for Linux (WSL)

### Go
### Go

Starport is written in the Go programming language. To use Starport on a local system:

- Install [Go](https://golang.org/doc/install) (**version 1.16** or higher)
- Ensure the Go environment variables are [set properly](https://golang.org/doc/gopath_code#GOPATH) on your system

## Verify Your Starport Version
## Verify Your Starport Version

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

Expand Down Expand Up @@ -75,7 +73,7 @@ sudo mv starport /usr/local/bin/

## Upgrading Your Starport Installation

Before you install a new version of Starport, remove all existing Starport installations.
Before you install a new version of Starport, remove all existing Starport installations.

To remove the current Starport installation:

Expand All @@ -88,13 +86,13 @@ After all existing Starport installations are removed, follow the [Installing St

## Installing Starport on macOS with Homebrew

Using brew to install Starport is supported only for macOS machines without the M1 chip.
Using brew to install Starport is supported only for macOS machines without the M1 chip.

```bash
brew install tendermint/tap/starport
```

To install Starport on macOS machines with the M1 chip, use the `curl` command as described in [Installing Starport](#installing-starport).
To install Starport on macOS machines with the M1 chip, use the `curl` command as described in [Installing Starport](#installing-starport).

## Build from source

Expand Down
1 change: 0 additions & 1 deletion docs/guide/nameservice/02-messages.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ You need a message so that an end user can delete a name that belongs to them.

To create the `MsgDeleteName` for the nameservice module:


```bash
starport scaffold message delete-name name
```
Expand Down
12 changes: 6 additions & 6 deletions docs/guide/nameservice/03-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ order: 3
description: Implement types and methods that operate on the state.
---

# Implement Types
# Implement Types

Now that you've defined messages that trigger state transitions, it's time to implement types and methods that operate on the state.

> The Cosmos SDK relies on keepers. A keeper is an abstraction that lets your blockchain app interact with the state. Functions like create, read, update, and delete (CRUD) are defined as keeper methods.
> The Cosmos SDK relies on keepers. A keeper is an abstraction that lets your blockchain app interact with the state. Functions like create, read, update, and delete (CRUD) are defined as keeper methods.
For the nameservice blockchain, define a `whois` type and the create and delete methods.

Expand All @@ -19,7 +19,7 @@ Because Starport does the heavy lifting for you, choose from several [starport s

## Add the whois Type

Use the `starport scaffold map` command to scaffold the `whois` type and create the code that implements CRUD functionality to create, read, update, and delete information about names.
Use the `starport scaffold map` command to scaffold the `whois` type and create the code that implements CRUD functionality to create, read, update, and delete information about names.

In this example, the `whois` type is stored in a map-like data structure:

Expand All @@ -32,8 +32,8 @@ where:
- whois is the type
- name is the name the user sets
- value is the name that name resolves to
- price is the bid
- `--no-message` flag skips message creation
- price is the bid
- `--no-message` flag skips message creation

By default, generic CRUD messages are scaffolded. However, you've already created messages specifically for this blockchain, so you can skip message creation with the `--no-message` flag.

Expand Down Expand Up @@ -99,7 +99,7 @@ The `starport scaffold map whois name value price --no-message` command created

## Keeper Package

In the `x/nameservice/keeper/whois.go` file, take at a look at the keeper package.
In the `x/nameservice/keeper/whois.go` file, take at a look at the keeper package.

- `SetWhois` uses a key-value store with a prefix for the `Whois` type and uses a `store.Set` method to write a `Whois` into the store.

Expand Down