Browse Source

docs: specify TM version in go tutorials (#5427)

Closes https://github.com/tendermint/tendermint/issues/5425
pull/5434/head
Anton Kaliaev 4 years ago
committed by GitHub
parent
commit
01c32c62e8
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 47 additions and 23 deletions
  1. +24
    -11
      docs/tutorials/go-built-in.md
  2. +23
    -12
      docs/tutorials/go.md

+ 24
- 11
docs/tutorials/go-built-in.md View File

@ -40,14 +40,7 @@ Verify that you have the latest version of Go installed:
```bash ```bash
$ go version $ go version
go version go1.13.1 darwin/amd64
```
Make sure you have `$GOPATH` environment variable set:
```bash
$ echo $GOPATH
/Users/melekes/go
go version go1.15.1 darwin/amd64
``` ```
## 1.2 Creating a new Go project ## 1.2 Creating a new Go project
@ -585,17 +578,37 @@ We are going to use [Go modules](https://github.com/golang/go/wiki/Modules) for
dependency management. dependency management.
```bash ```bash
export GO111MODULE=on
go mod init github.com/me/example go mod init github.com/me/example
go build
``` ```
This should build the binary.
This should create a `go.mod` file. The current tutorial only works with
tendermint > v0.34, so let's make sure we're using the latest version:
```go
module github.com/me/example
go 1.15
require (
github.com/dgraph-io/badger v1.6.2
github.com/tendermint/tendermint v0.34.0-rc4
)
```
Now we can build the binary:
```bash
go build
```
To create a default configuration, nodeKey and private validator files, let's To create a default configuration, nodeKey and private validator files, let's
execute `tendermint init`. But before we do that, we will need to install execute `tendermint init`. But before we do that, we will need to install
Tendermint Core. Please refer to [the official Tendermint Core. Please refer to [the official
guide](https://docs.tendermint.com/master/introduction/install.html). If you're guide](https://docs.tendermint.com/master/introduction/install.html). If you're
installing from source, don't forget to checkout the latest release (`git checkout vX.Y.Z`).
installing from source, don't forget to checkout the latest release (`git
checkout vX.Y.Z`). Don't forget to check that the application uses the same
major version.
```bash ```bash
$ rm -rf /tmp/example $ rm -rf /tmp/example


+ 23
- 12
docs/tutorials/go.md View File

@ -43,14 +43,7 @@ Verify that you have the latest version of Go installed:
```bash ```bash
$ go version $ go version
go version go1.14.x darwin/amd64
```
Make sure you have `$GOPATH` environment variable set:
```bash
echo $GOPATH
/Users/melekes/go
go version go1.15.1 darwin/amd64
``` ```
## 1.2 Creating a new Go project ## 1.2 Creating a new Go project
@ -254,7 +247,6 @@ func (app *KVStoreApplication) BeginBlock(req abcitypes.RequestBeginBlock) abcit
app.currentBatch = app.db.NewTransaction(true) app.currentBatch = app.db.NewTransaction(true)
return abcitypes.ResponseBeginBlock{} return abcitypes.ResponseBeginBlock{}
} }
``` ```
Here we create a batch, which will store block's transactions. Here we create a batch, which will store block's transactions.
@ -444,16 +436,35 @@ dependency management.
```bash ```bash
export GO111MODULE=on export GO111MODULE=on
go mod init github.com/me/example go mod init github.com/me/example
go build
``` ```
This should build the binary.
This should create a `go.mod` file. The current tutorial only works with
tendermint > v0.34, so let's make sure we're using the latest version:
```go
module github.com/me/example
go 1.15
require (
github.com/dgraph-io/badger v1.6.2
github.com/tendermint/tendermint v0.34.0-rc4
)
```
Now we can build the binary:
```bash
go build
```
To create a default configuration, nodeKey and private validator files, let's To create a default configuration, nodeKey and private validator files, let's
execute `tendermint init`. But before we do that, we will need to install execute `tendermint init`. But before we do that, we will need to install
Tendermint Core. Please refer to [the official Tendermint Core. Please refer to [the official
guide](https://docs.tendermint.com/master/introduction/install.html). If you're guide](https://docs.tendermint.com/master/introduction/install.html). If you're
installing from source, don't forget to checkout the latest release (`git checkout vX.Y.Z`).
installing from source, don't forget to checkout the latest release (`git
checkout vX.Y.Z`). Don't forget to check that the application uses the same
major version.
```bash ```bash
rm -rf /tmp/example rm -rf /tmp/example


Loading…
Cancel
Save