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: docs/getting-started/index.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,17 +35,17 @@ This command will fetch the `starport` binary and install it into `/usr/local/bi
35
35
36
36
### Creating a Blog-Chain
37
37
38
-
Starport comes with a number of scaffolding commands that are designed to make development easier by creating everything that's necessary to start working on a particular task. One of these tasks is a `scaffold app` command which provides you with a foundation of a fresh Cosmos SDK blockchain so that you don't have to write it yourself.
38
+
Starport comes with a number of scaffolding commands that are designed to make development easier by creating everything that's necessary to start working on a particular task. One of these tasks is a `scaffold scaffold chain` command which provides you with a foundation of a fresh Cosmos SDK blockchain so that you don't have to write it yourself.
39
39
40
40
To use this command, open a terminal, navigate to a directory where you have permissions to create files, and run:
41
41
42
42
```
43
-
starport app github.com/alice/blog
43
+
starport scaffold chain github.com/alice/blog
44
44
```
45
45
46
46
This will create a new Cosmos SDK blockchain called Blog in a `blog` directory. The source code inside the `blog` directory contains a fully functional ready-to-use blockchain. This new blockchain imports standard Cosmos SDK modules, such as [`staking`](https://docs.cosmos.network/v0.42/modules/staking/) (for delegated proof of stake), [`bank`](https://docs.cosmos.network/v0.42/modules/bank/) (for fungible token transfers between accounts), [`gov`](https://docs.cosmos.network/v0.42/modules/gov/) (for on-chain governance) and [other modules](https://docs.cosmos.network/v0.42/modules/).
47
47
48
-
Note: You can see all the command line options that Starport provides by running `starport app --help`.
48
+
Note: You can see all the command line options that Starport provides by running `starport scaffold chain --help`.
49
49
50
50
After you create the blockchain, switch to its directory:
51
51
@@ -76,7 +76,7 @@ To get started, let's get our blockchain up and running locally on a single node
76
76
You actually have a fully-functional blockchain already. To start it on your development machine, run the following command in the `blog` directory
77
77
78
78
```
79
-
starport serve
79
+
starport chain serve
80
80
```
81
81
82
82
This will download dependencies, compile the source code into a binary called `blogd` (by default Starport uses the name of the repo + `d`), use this binary to initialize a single validator node, and start the node.
@@ -96,7 +96,7 @@ In terms of workflow, developers usually work with proto files first to define C
`query` accepts a name of the query (in our case, `posts`), an optional list of request parameters (in our case, empty), and an optional comma-separated list of response fields with a `--response` flag (in our case, `body,title`).
Once the chain has been started, visit [http://localhost:1317/alice/blog/blog/posts](http://localhost:1317/alice/blog/blog/posts) and see our text displayed!
@@ -209,7 +209,7 @@ A Cosmos SDK message contains information that can trigger changes in the state
209
209
To create a message type and its handler, use the `message` command:
210
210
211
211
```go
212
-
starport message createPost title body
212
+
starport scaffold message createPost title body
213
213
```
214
214
215
215
The `message` command accepts message name (`createPost`) and a list of fields (`title` and `body`) as arguments.
We've implemented all the code necessary to create new posts and store them on chain. Now, when a transaction containing a message of type `MsgCreatePost` is broadcasted, Cosmos SDK will route the message to our blog module. `x/blog/handler.go` calls `k.CreatePost`, which in turn calls `AppendPost`. `AppendPost` gets the number of posts from the store, adds a post using the count as an ID, increments the count, and returns the ID.
412
412
413
-
Let's try it out! If the chain is yet not started, run `starport serve`. Create a post:
413
+
Let's try it out! If the chain is yet not started, run `starport chain serve`. Create a post:
Copy file name to clipboardExpand all lines: docs/run/index.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,19 +18,19 @@ Blockchains are decentralized applications.
18
18
Switch to the directory that contains a blockchain that was scaffolded with Starport. To start the blockchain node, run the following command:
19
19
20
20
```
21
-
starport serve
21
+
starport chain serve
22
22
```
23
23
24
24
This command initializes a chain, builds the code, starts a single validator node, and starts watching for file changes.
25
25
26
26
Whenever a file is changed, the chain is automatically reinitialized, rebuilt, and started again. The chain's state is preserved if the changes to the source code are compatible with the previous state. This state preservation is beneficial for development purposes.
27
27
28
-
Because the `starport serve` command is a development tool, it should not be used in a production environment. Read on to learn the process of running a blockchain in production.
28
+
Because the `starport chain serve` command is a development tool, it should not be used in a production environment. Read on to learn the process of running a blockchain in production.
29
29
30
-
## The Magic of `starport serve`
31
-
The `starport serve` command starts a fully operational blockchain.
30
+
## The Magic of `starport chain serve`
31
+
The `starport chain serve` command starts a fully operational blockchain.
32
32
33
-
The `starport serve` command performs the following tasks:
33
+
The `starport chain serve` command performs the following tasks:
34
34
35
35
- Installs dependencies
36
36
- Imports state, if possible
@@ -50,7 +50,7 @@ You can use flags to configure how the blockchain runs.
50
50
51
51
## Define How Your Blockchain Starts
52
52
53
-
Flags for the `starport serve` command determine how your blockchain starts. All flags are optional.
53
+
Flags for the `starport chain serve` command determine how your blockchain starts. All flags are optional.
54
54
55
55
`--config`, default is `config.yml`
56
56
@@ -78,7 +78,7 @@ Specify a custom home directory.
78
78
79
79
## Start a Blockchain Node in Production
80
80
81
-
The `starport serve` and `starport build` commands compile the source code of the chain in a binary file and install the binary in `~/go/bin`. By default, the binary name is the name of the repository appended with `d`. For example, if you scaffold a chain using `starport app github.com/alice/chain`, then the binary is named `chaind`.
81
+
The `starport chain serve` and `starport chain build` commands compile the source code of the chain in a binary file and install the binary in `~/go/bin`. By default, the binary name is the name of the repository appended with `d`. For example, if you scaffold a chain using `starport scaffold chain github.com/alice/chain`, then the binary is named `chaind`.
82
82
83
83
You can customize the binary name in `config.yml`:
0 commit comments