Skip to content

Commit

Permalink
feat: Merge pull request #1218 from tendermint/release/v0.16.1
Browse files Browse the repository at this point in the history
feat: release/v0.16.1
  • Loading branch information
ilgooz authored May 31, 2021
2 parents 47b795d + 561379f commit 795a994
Show file tree
Hide file tree
Showing 20 changed files with 114 additions and 60 deletions.
6 changes: 3 additions & 3 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# CODEOWNERS: https://help.github.com/articles/about-codeowners/

# Primary repo maintainers
* @fadeev @ilgooz @lubtd @dshulyak

# Docs
*.md @barriebyron

# Primary repo maintainers
* @fadeev @ilgooz @lubtd @dshulyak
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ format:
lint:
@golangci-lint run --out-format=tab --issues-exit-code=0

ui:
@rm -rf starport/ui/app/dist
-@which npm 1>/dev/null && cd starport/ui/app && npm install 1>/dev/null && npm run build 1>/dev/null


.DEFAULT_GOAL := install
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## `v0.16.1`

### Features:

- Ensure that CLI operates fine even if the installation directory (bin) of Go programs is not configured properly.

## `v0.16.0`

### Features:
Expand Down
4 changes: 4 additions & 0 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ module.exports = {
{
title: "Resources",
children: [
{
title: "Starport on Github",
path: "https://github.com/tendermint/starport",
},
{
title: "Tutorials",
path: "https://tutorials.cosmos.network",
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Introduction to Starport

Starport offers everything you need to build, test, and launch your blockchain with a decentralized worldwide community. Starport is built on top of [Cosmos SDK](https://docs.cosmos.network), the world’s most popular blockchain framework. Starport accelerates chain development by scaffolding everything you need so you can focus on business logic.
[Starport](https://github.com/tendermint/starport) offers everything you need to build, test, and launch your blockchain with a decentralized worldwide community. Starport is built on top of [Cosmos SDK](https://docs.cosmos.network), the world’s most popular blockchain framework. Starport accelerates chain development by scaffolding everything you need so you can focus on business logic.

## What is Starport?

Expand Down
66 changes: 38 additions & 28 deletions docs/configure/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ Only a default set of parameters is provided. If more nuanced configuration is r

A list of user accounts created during genesis of the blockc

Key | Required | Type | Description
-------- | -------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------
name | Y | String | Local name of a key pair. An account name must be listed to gain access to the account tokens after the blockchain is launched.
coins | Y | List of Strings | Initial coins with denominations. For example, "1000token"
address | N | String | Account address in Bech32 address format
mnemonic | N | String | Mnemonic used to generate an account. This field is ignored if `address` is specified
| Key | Required | Type | Description |
| -------- | -------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| name | Y | String | Local name of a key pair. An account name must be listed to gain access to the account tokens after the blockchain is launched. |
| coins | Y | List of Strings | Initial coins with denominations. For example, "1000token" |
| address | N | String | Account address in Bech32 address format |
| mnemonic | N | String | Mnemonic used to generate an account. This field is ignored if `address` is specified |

**accounts example**

Expand All @@ -35,9 +35,9 @@ accounts:
## `build`

Key | Required | Type | Description
------ | -------- | ------ | --------------------------------------------------------------
binary | N | String | Name of the node binary that is built, typically ends with `d`
| Key | Required | Type | Description |
| ------ | -------- | ------ | -------------------------------------------------------------- |
| binary | N | String | Name of the node binary that is built, typically ends with `d` |

**build example**

Expand All @@ -48,33 +48,45 @@ build:

## `build.proto`

Key | Required | Type | Description
----------------- | -------- | --------------- | ------------------------------------------------------------------------------------------
path | N | String | Path to protocol buffer files. Default: `"proto"`
third_party_paths | N | List of Strings | Path to thid-party protocol buffer files. Default: `["third_party/proto", "proto_vendor"]`
| Key | Required | Type | Description |
| ----------------- | -------- | --------------- | ------------------------------------------------------------------------------------------ |
| path | N | String | Path to protocol buffer files. Default: `"proto"` |
| third_party_paths | N | List of Strings | Path to thid-party protocol buffer files. Default: `["third_party/proto", "proto_vendor"]` |

## `client`

Configures and enables client code generation. To prevent Starport from regenerating the client, remove the `client` property.

```
### `client.vuex`

```yaml
client:
vuex:
path: "vue/src/store"
```

Generates TypeScript/Vuex client for the blockchain in `path` on `serve` and `build` commands.
`client.vuex` generates TypeScript/Vuex client for the blockchain in `path` on `serve` and `build` commands.

### `client.openapi`

```yaml
client:
openapi:
path: "docs/static/openapi.yml"
```

`client.openapi` generates OpenAPI YAML file in `path`. By default this file is embedded into the node's binary.

## `faucet`

The faucet service sends tokens to addresses. The default address for the web user interface is <http://localhost:4500>.

Key | Required | Type | Description
--------- | -------- | --------------- | -----------------------------------------------------------
name | Y | String | Name of a key pair. `name` must be in `accounts`
coins | Y | List of Strings | One or more coins with denominations sent per request
coins_max | N | List of Strings | One or more maximum amounts of tokens sent for each address
host | N | String | Host and port number. Default: `:4500`
| Key | Required | Type | Description |
| --------- | -------- | --------------- | ----------------------------------------------------------- |
| name | Y | String | Name of a key pair. `name` must be in `accounts` |
| coins | Y | List of Strings | One or more coins with denominations sent per request |
| coins_max | N | List of Strings | One or more maximum amounts of tokens sent for each address |
| host | N | String | Host and port number. Default: `:4500` |

**faucet example**

Expand All @@ -90,10 +102,10 @@ faucet:

A blockchain requires one or more validators.

Key | Required | Type | Description
------ | -------- | ------ | -----------------------------------------------------------------------------------------------
name | Y | String | The account that is used to initialize the validator. The `name` key pair must be in `accounts`
staked | Y | String | Amount of coins to bond. Must be less than or equal to the amount of coins in the account
| Key | Required | Type | Description |
| ------ | -------- | ------ | ----------------------------------------------------------------------------------------------- |
| name | Y | String | The account that is used to initialize the validator. The `name` key pair must be in `accounts` |
| staked | Y | String | Amount of coins to bond. Must be less than or equal to the amount of coins in the account |

**validator example**

Expand Down Expand Up @@ -142,15 +154,13 @@ Configuration of host names and ports for processes started by Starport:

**host example**

```
```yaml
host:
rpc: ":26659"
p2p: ":26658"
prof: ":6061"
grpc: ":9091"
api: ":1318"
frontend: ":8081"
dev-ui: ":12346"
```

## `genesis`
Expand Down
2 changes: 1 addition & 1 deletion docs/intro/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ The `type` command scaffolds functionality a custom type.
## Learn more

- [Configure a Blockchain](../configure/index.md)
- [Run a Blockchain](../run/start.md)
- [Run a Blockchain](../run/index.md)
- [Starport repo in GitHub](https://github.com/tendermint/starport)
- [Cosmos SDK Documentation](https://docs.cosmos.network)
- [Cosmos SDK Tutorials](https://tutorials.cosmos.network)
Expand Down
16 changes: 14 additions & 2 deletions docs/intro/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,20 @@ You can run Starport in a web-based Gitpod IDE or you can install Starport on yo

## Prerequisite

Starport is written in the Go programming language. To use Starport on a local installation, Go must be installed and running:
Starport is written in the Go programming language. To use Starport on a local installation, [Go](https://golang.org/doc/install) (**version 1.16** or higher) must be installed.

- [Golang >=1.16](https://golang.org/)
## Upgrading Your Starport Installation

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

To remove the current Starport installation:

1. On your terminal window, press `Ctrl+C` to stop the chain that you started with `starport serve`.
1. Remove the Starport binary with `rm $(which starport)`.
Depending on your user permissions, run the command with or without `sudo`.
1. Repeat this step until all `starport` installations are removed from your system.

After all existing Starport installations are removed, follow the [Installing Starport with cURL](#installing-starport-with-curl) instructions. For details on version features and changes, see the [changelog.md](https://github.com/tendermint/starport/blob/develop/changelog.md) in the repo.

## Installing Starport with cURL

Expand Down Expand Up @@ -55,3 +66,4 @@ cd starport && make install
- To setup a local development environment, install Starport locally on your computer.
- Install Starport by fetching the binary using cURL, Homebrew, or by building from source.
- The latest version is installed by default. You can install previous versions of the precompiled `starport` binary.
- Stop the chain and remove existing versions before installing a new version.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ require (
github.com/gorilla/mux v1.8.0
github.com/gorilla/rpc v1.2.0
github.com/iancoleman/strcase v0.1.3
github.com/ilgooz/openapiconsole v0.0.0-20210521063533-567a97c7c7e9
github.com/imdario/mergo v0.3.11
github.com/jpillora/chisel v1.7.3
github.com/kr/pretty v0.1.0
Expand All @@ -42,6 +41,7 @@ require (
github.com/spf13/cobra v1.1.3
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.7.0
github.com/tendermint/spm v0.0.0-20210524110815-6d7452d2dc4a
github.com/tendermint/spn v0.0.0-20210406123257-decaff8dcaf9
github.com/tendermint/tendermint v0.34.9
github.com/tendermint/vue v0.1.49
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,6 @@ github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmK
github.com/iancoleman/strcase v0.1.3 h1:dJBk1m2/qjL1twPLf68JND55vvivMupZ4wIzE8CTdBw=
github.com/iancoleman/strcase v0.1.3/go.mod h1:SK73tn/9oHe+/Y0h39VT4UCxmurVJkR5NA7kMEAOgSE=
github.com/ilgooz/analytics-go v3.1.1-0.20200723195510-acde4190c655+incompatible/go.mod h1:36xDpOWfOEZLx5a4Qra2Ntu7by75m/qwZZx9/YrPrtY=
github.com/ilgooz/openapiconsole v0.0.0-20210521063533-567a97c7c7e9 h1:ZDSezyPtsgJdIlGFqmH4QEITF9MUyqwd/foAtNMBVdU=
github.com/ilgooz/openapiconsole v0.0.0-20210521063533-567a97c7c7e9/go.mod h1:Cs2TNeb8t3Txy1Ro0eRtH62q6rmyyQ/+mnJ/DDgU3sY=
github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/imdario/mergo v0.3.11 h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA=
github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
Expand Down Expand Up @@ -886,6 +884,8 @@ github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 h1:hqAk8riJvK4RM
github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15/go.mod h1:z4YtwM70uOnk8h0pjJYlj3zdYwi9l03By6iAIF5j/Pk=
github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E=
github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME=
github.com/tendermint/spm v0.0.0-20210524110815-6d7452d2dc4a h1:zy/l4N++BcIAqcZYR42BhUnl8XE8RcyjWS71Ujl0BU0=
github.com/tendermint/spm v0.0.0-20210524110815-6d7452d2dc4a/go.mod h1:Cu18wgpxjFMnVwQA1xBpHE75CfVrle8s1UxuchfzBF0=
github.com/tendermint/spn v0.0.0-20201215081711-b9ec9286ed83/go.mod h1:OfG8YK8yabQk08QLpneLSMf/FN0d+DmFcQfijTJalA8=
github.com/tendermint/spn v0.0.0-20210406123257-decaff8dcaf9 h1:rSY6/WFoTIj5GoiBPBh3zGyEPJ+ygjGqb/toBF/70oE=
github.com/tendermint/spn v0.0.0-20210406123257-decaff8dcaf9/go.mod h1:baJaa8BnakMVpYWhNY9YA01IU03td3ykrqE3wj2ixgA=
Expand Down
10 changes: 5 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
Starport is the easiest way to build a blockchain. It is a developer-friendly interface to the [Cosmos SDK](https://github.com/cosmos/cosmos-sdk), the world's most widely-used blockchain application framework. Starport generates boilerplate code for you, so you can focus on writing business logic.

* [**Build a blockchain with Starport in a web-based IDE** (stable)](https://gitpod.io/#https://github.com/tendermint/starport/tree/master) or use [nightly version](https://gitpod.io/#https://github.com/tendermint/starport/)
* [Check out the latest features in v0.15](https://www.youtube.com/watch?v=NmytpuD33lY)
* [Check out the latest features in v0.16](https://www.youtube.com/watch?v=-AuExRijtrA)

## Quick start

Open Starport [in your browser](https://gitpod.io/#https://github.com/tendermint/starport/tree/master), or [install it](https://docs.starport.network/intro/install). Then:
Open Starport [in your browser](https://gitpod.io/#https://github.com/tendermint/starport/tree/master), or [install it](https://docs.starport.network/intro/install). Create and start a blockchain:

```
starport app github.com/foo/mychain
starport app github.com/alice/chain
cd mychain
cd chain
starport serve
```
Expand All @@ -25,7 +25,7 @@ To learn more about building a JavaScript frontend for your Cosmos SDK blockchai

## Questions

For questions and support please join the #starport channel in the [Cosmos Community Discord](https://discord.com/invite/W8trcGV). The issue list of this repo is exclusively for bug reports and feature requests.
For questions and support please join the `cosmos-sdk-starport` channel in the [Cosmos Community Discord](https://discord.com/invite/W8trcGV). The issue list of this repo is exclusively for bug reports and feature requests.

## Contributing

Expand Down
4 changes: 4 additions & 0 deletions starport/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
flag "github.com/spf13/pflag"
"github.com/tendermint/starport/starport/pkg/clispinner"
"github.com/tendermint/starport/starport/pkg/events"
"github.com/tendermint/starport/starport/pkg/goenv"
"github.com/tendermint/starport/starport/services/chain"
"github.com/tendermint/starport/starport/services/networkbuilder"
)
Expand All @@ -28,6 +29,9 @@ func New() *cobra.Command {
Short: "A developer tool for building Cosmos SDK blockchains",
SilenceUsage: true,
SilenceErrors: true,
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
return goenv.ConfigurePath()
},
}
c.AddCommand(NewDocs())
c.AddCommand(NewApp())
Expand Down
4 changes: 1 addition & 3 deletions starport/pkg/cmdrunner/cmdrunner.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,7 @@ func (r *Runner) newCommand(step *step.Step) Executor {
command.Stderr = stderr
command.Dir = dir
command.Env = append(os.Environ(), step.Env...)
command.Env = append(command.Env, os.ExpandEnv(
fmt.Sprintf("PATH=$PATH:%s", goenv.GetGOBIN()),
))
command.Env = append(command.Env, fmt.Sprintf("PATH=%s", goenv.Path()))

// If a custom stdin is provided it will be as the stdin for the command
if stdin != nil {
Expand Down
2 changes: 1 addition & 1 deletion starport/pkg/cosmosfaucet/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"net/http"

"github.com/gorilla/mux"
"github.com/ilgooz/openapiconsole"
"github.com/rs/cors"
"github.com/tendermint/spm/openapiconsole"
)

// ServeHTTP implements http.Handler to expose the functionality of Faucet.Transfer() via HTTP.
Expand Down
27 changes: 24 additions & 3 deletions starport/pkg/goenv/goenv.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
package goenv

import (
"fmt"
"go/build"
"os"
"path/filepath"
Expand All @@ -10,12 +11,32 @@ import (
const (
// GOBIN is the env var for GOBIN.
GOBIN = "GOBIN"

// GOPATH is the env var for GOPATH.
GOPATH = "GOPATH"
)

// GetGOBIN returns the path of where Go binaries are installed.
func GetGOBIN() string {
const (
binDir = "bin"
)

// Bin returns the path of where Go binaries are installed.
func Bin() string {
if binPath := os.Getenv(GOBIN); binPath != "" {
return binPath
}
return filepath.Join(build.Default.GOPATH, "bin")
if goPath := os.Getenv(GOPATH); goPath != "" {
return filepath.Join(goPath, binDir)
}
return filepath.Join(build.Default.GOPATH, binDir)
}

// Path returns $PATH with correct go bin configuration set.
func Path() string {
return os.ExpandEnv(fmt.Sprintf("$PATH:%s", Bin()))
}

// ConfigurePath configures the env with correct $PATH that has go bin setup.
func ConfigurePath() error {
return os.Setenv("PATH", Path())
}
4 changes: 2 additions & 2 deletions starport/pkg/localfs/save.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ func SaveTemp(f fs.FS) (path string, cleanup func(), err error) {
}

// SaveBytesTemp saves data bytes to a temporary file location at path.
func SaveBytesTemp(data []byte, perm os.FileMode) (path string, cleanup func(), err error) {
f, err := os.CreateTemp("", "")
func SaveBytesTemp(data []byte, prefix string, perm os.FileMode) (path string, cleanup func(), err error) {
f, err := os.CreateTemp("", prefix)
if err != nil {
return
}
Expand Down
5 changes: 3 additions & 2 deletions starport/pkg/nodetime/nodetime.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,14 @@ func Binary() []byte {

// Command setups the nodetime binary and returns the command needed to execute c.
func Command(c CommandName) (command []string, cleanup func(), err error) {
path, cleanup, err := localfs.SaveBytesTemp(Binary(), 0755)
cs := string(c)
path, cleanup, err := localfs.SaveBytesTemp(Binary(), cs, 0755)
if err != nil {
return nil, nil, err
}
command = []string{
path,
string(c),
cs,
}
return command, cleanup, nil
}
2 changes: 1 addition & 1 deletion starport/pkg/protoc/protoc.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func Generate(ctx context.Context, outDir, protoPath string, includePaths, proto
}

// setup protoc and global protos.
protocPath, cleanup, err := localfs.SaveBytesTemp(binary, 0755)
protocPath, cleanup, err := localfs.SaveBytesTemp(binary, "protoc", 0755)
if err != nil {
return err
}
Expand Down
Loading

0 comments on commit 795a994

Please sign in to comment.