docs: little fixes
This commit is contained in:
parent
6f173a44a9
commit
5cfc96676a
16
README.md
16
README.md
|
@ -15,18 +15,28 @@ WARNING: Currently uses plain-text private keys for transactions and is otherwis
|
|||
|
||||
## Installation
|
||||
|
||||
We use glide for dependency management. The prefered way of compiling from source is the following:
|
||||
On a good day, basecoin can be installed like a normal Go program:
|
||||
|
||||
```
|
||||
go get -u github.com/tendermint/basecoin/cmd/basecoin
|
||||
```
|
||||
|
||||
In some cases, if that fails, or if another branch is required,
|
||||
we use `glide` for dependency management.
|
||||
|
||||
The guaranteed correct way of compiling from source, assuming you've already
|
||||
run `go get` or otherwise cloned the repo, is:
|
||||
|
||||
```
|
||||
go get -u github.com/tendermint/basecoin
|
||||
cd $GOPATH/src/github.com/tendermint/basecoin
|
||||
git checkout develop # (until we release v0.9)
|
||||
git checkout develop # (until we release tendermint v0.9)
|
||||
make get_vendor_deps
|
||||
make install
|
||||
```
|
||||
|
||||
This will create the `basecoin` binary in `$GOPATH/bin`.
|
||||
|
||||
|
||||
## Command Line Interface
|
||||
|
||||
The basecoin CLI can be used to start a stand-alone basecoin instance (`basecoin start`),
|
||||
|
|
|
@ -166,8 +166,6 @@ but are necessary boilerplate.
|
|||
Your plugin may have additional requirements that utilize these other methods.
|
||||
Here's what's relevant for us:
|
||||
|
||||
**TODO** make `StateKey` `stateKey`? No need to expose this outside the package.
|
||||
|
||||
```
|
||||
type ExamplePluginState struct {
|
||||
Counter int
|
||||
|
@ -278,7 +276,7 @@ if len(stateBytes) > 0 {
|
|||
}
|
||||
```
|
||||
|
||||
Note the state is stored under `ep.StateKey()`, which is defined above as `ExamplePlugin.State`. Also note, that we do nothing if there is no existing state data. Is that a bug? No, we just make use of go's variable initialization, that `pluginState` will contain a `Counter` value of 0. If your app needs more initialization than empty variables, then do this logic here in an `else` block.
|
||||
Note the state is stored under `ep.StateKey()`, which is defined above as `ExamplePlugin.State`. Also note, that we do nothing if there is no existing state data. Is that a bug? No, we just make use of Go's variable initialization, that `pluginState` will contain a `Counter` value of 0. If your app needs more initialization than empty variables, then do this logic here in an `else` block.
|
||||
|
||||
Finally, we can update the state's `Counter`, and save the state back to the store:
|
||||
|
||||
|
|
|
@ -1,9 +1,18 @@
|
|||
# Install
|
||||
|
||||
We use glide for dependency management. The prefered way of compiling from source is the following:
|
||||
On a good day, basecoin can be installed like a normal Go program:
|
||||
|
||||
```
|
||||
go get -u github.com/tendermint/basecoin/cmd/basecoin
|
||||
```
|
||||
|
||||
In some cases, if that fails, or if another branch is required,
|
||||
we use `glide` for dependency management.
|
||||
|
||||
The correct way of compiling from source, assuming you've already
|
||||
run `go get` or otherwise cloned the repo, is:
|
||||
|
||||
```
|
||||
go get -u github.com/tendermint/basecoin
|
||||
cd $GOPATH/src/github.com/tendermint/basecoin
|
||||
git checkout develop # (until we release v0.9)
|
||||
make get_vendor_deps
|
||||
|
|
Loading…
Reference in New Issue