docs: little fixes
This commit is contained in:
@@ -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:
|
||||
|
||||
|
||||
+11
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user