@ -40,7 +40,7 @@ Please refer to [the Oracle's guide for installing JDK](https://www.oracle.com/t
Verify that you have installed Java successfully:
Verify that you have installed Java successfully:
```sh
```ba sh
$ java -version
$ java -version
java version "12.0.2" 2019-07-16
java version "12.0.2" 2019-07-16
Java(TM) SE Runtime Environment (build 12.0.2+10)
Java(TM) SE Runtime Environment (build 12.0.2+10)
@ -52,7 +52,7 @@ This guide is written using Java SE Development Kit 12.
Make sure you have `$JAVA_HOME` environment variable set:
Make sure you have `$JAVA_HOME` environment variable set:
```sh
```ba sh
$ echo $JAVA_HOME
$ echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk-12.0.2.jdk/Contents/Home
/Library/Java/JavaVirtualMachines/jdk-12.0.2.jdk/Contents/Home
```
```
@ -63,7 +63,7 @@ For Gradle installation, please refer to [their official guide](https://gradle.o
We'll start by creating a new Gradle project.
We'll start by creating a new Gradle project.
```sh
```ba sh
$ export KVSTORE_HOME=~/kvstore
$ export KVSTORE_HOME=~/kvstore
$ mkdir $KVSTORE_HOME
$ mkdir $KVSTORE_HOME
$ cd $KVSTORE_HOME
$ cd $KVSTORE_HOME
@ -71,13 +71,13 @@ $ cd $KVSTORE_HOME
Inside the example directory run:
Inside the example directory run:
```sh
```ba sh
gradle init --dsl groovy --package io.example --project-name example --type java-application --test-framework junit
gradle init --dsl groovy --package io.example --project-name example --type java-application --test-framework junit
```
```
This will create a new project for you. The tree of files should look like:
This will create a new project for you. The tree of files should look like:
```sh
```ba sh
$ tree
$ tree
.
.
|-- build.gradle
|-- build.gradle
@ -105,7 +105,7 @@ $ tree
When run, this should print "Hello world." to the standard output.
When run, this should print "Hello world." to the standard output.
```sh
```ba sh
$ ./gradlew run
$ ./gradlew run
> Task :run
> Task :run
Hello world.
Hello world.
@ -166,7 +166,7 @@ Now we should be ready to compile the `*.proto` files.
Copy the necessary `.proto` files to your project:
Copy the necessary `.proto` files to your project:
```sh
```ba sh
mkdir -p \
mkdir -p \
$KVSTORE_HOME/src/main/proto/github.com/tendermint/tendermint/abci/types \
$KVSTORE_HOME/src/main/proto/github.com/tendermint/tendermint/abci/types \
$KVSTORE_HOME/src/main/proto/github.com/tendermint/tendermint/crypto/merkle \
$KVSTORE_HOME/src/main/proto/github.com/tendermint/tendermint/crypto/merkle \
@ -195,13 +195,13 @@ dependencies {
To generate all protobuf-type classes run:
To generate all protobuf-type classes run:
```sh
```ba sh
./gradlew generateProto
./gradlew generateProto
```
```
To verify that everything went smoothly, you can inspect the `build/generated/` directory:
To verify that everything went smoothly, you can inspect the `build/generated/` directory:
```sh
```ba sh
$ tree build/generated/
$ tree build/generated/
build/generated/
build/generated/
|-- source
|-- source
@ -534,7 +534,7 @@ 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.
Tendermint Core.
```sh
```ba sh
$ rm -rf /tmp/example
$ rm -rf /tmp/example
$ cd $GOPATH/src/github.com/tendermint/tendermint
$ cd $GOPATH/src/github.com/tendermint/tendermint
$ make install
$ make install
@ -551,7 +551,7 @@ Feel free to explore the generated files, which can be found at
We are ready to start our application:
We are ready to start our application:
```sh
```ba sh
./gradlew run
./gradlew run
gRPC server started, listening on 26658
gRPC server started, listening on 26658
@ -560,7 +560,7 @@ gRPC server started, listening on 26658
Then we need to start Tendermint Core and point it to our application. Staying
Then we need to start Tendermint Core and point it to our application. Staying
within the application directory execute:
within the application directory execute:
```sh
```ba sh
$ TMHOME="/tmp/example" tendermint node --abci grpc --proxy_app tcp://127.0.0.1:26658
$ TMHOME="/tmp/example" tendermint node --abci grpc --proxy_app tcp://127.0.0.1:26658
I[2019-07-28|15:44:53.632] Version info module=main software=0.32.1 block=10 p2p=7
I[2019-07-28|15:44:53.632] Version info module=main software=0.32.1 block=10 p2p=7
@ -572,7 +572,7 @@ I[2019-07-28|15:44:54.814] Committed state module=s
Now open another tab in your terminal and try sending a transaction:
Now open another tab in your terminal and try sending a transaction:
```sh
```ba sh
$ curl -s 'localhost:26657/broadcast_tx_commit?tx="tendermint=rocks"'
$ curl -s 'localhost:26657/broadcast_tx_commit?tx="tendermint=rocks"'
{
{
"jsonrpc": "2.0",
"jsonrpc": "2.0",
@ -591,7 +591,7 @@ Response should contain the height where this transaction was committed.
Now let's check if the given key now exists and its value:
Now let's check if the given key now exists and its value:
```sh
```ba sh
$ curl -s 'localhost:26657/abci_query?data="tendermint"'
$ curl -s 'localhost:26657/abci_query?data="tendermint"'
{
{
"jsonrpc": "2.0",
"jsonrpc": "2.0",