Skip to content
This repository has been archived by the owner on Mar 11, 2021. It is now read-only.

Commit

Permalink
updated to latest TM 0.25.0. Added in protos, etc...
Browse files Browse the repository at this point in the history
  • Loading branch information
David Bryson committed Oct 5, 2018
1 parent 41e15e6 commit 90dad48
Show file tree
Hide file tree
Showing 13 changed files with 6,722 additions and 4,724 deletions.
4 changes: 1 addition & 3 deletions Cargo.toml
@@ -1,14 +1,12 @@
[package]
name = "abci"
version = "0.3.1"
version = "0.4.0"
authors = ["Adrian Brink <adrian@brink-holdings.com>", "Jackson Lewis <st.japa6@gmail.com>", "Dave Bryson"]
license = "MIT/Apache-2.0"
description = "Tendermint ABCI server for Rust"
homepage = "https://tendermint.com/docs/guides/app-development"
repository = "https://github.com/tendermint/rust-tsp"
#documentation = "https://docs.rs/tsp/0.2.3/tsp/"
keywords = ["abci", "tendermint", "blockchain", "rust"]
#categories = ["encoding"]
readme = "README.md"
include = ["src/**/*", "Cargo.toml"]

Expand Down
12 changes: 12 additions & 0 deletions Makefile
@@ -0,0 +1,12 @@
gogourl = https://raw.githubusercontent.com/gogo/protobuf/master/gogoproto/gogo.proto
gogooutput = protos/github.com/gogo/protobuf/gogoproto/gogo.proto

tmbaseurl = https://raw.githubusercontent.com/tendermint/tendermint/master
tmkv = protos/github.com/tendermint/tendermint/libs/common/common.proto

update-proto:
curl $(gogourl) > $(gogooutput)
curl $(tmbaseurl)/abci/types/types.proto > src/types.proto
curl $(tmbaseurl)/libs/common/types.proto > $(tmkv)
@echo " ~ NOTE ~ "
@echo "**** Rename common/types.proto to common/common.proto in src/types.proto!! ****"
7 changes: 5 additions & 2 deletions README.md
Expand Up @@ -22,9 +22,12 @@ Here you can find more information about [Tendermint](https://github.com/tenderm

For a real life example of an ABCI application you can checkout [Ethermint](https://github.com/tendermint/ethermint) or [Basecoin](https://github.com/tendermint/basecoin).


----

## Tendermint version support
Tested against Tendermint 0.25.0

----

## Dependencies
Make sure that you have Rust and Cargo installed. The easiest way is to follow the instructions on [rustup](https://rustup.rs/).
Expand All @@ -40,7 +43,7 @@ The `empty_app` example, found under the `examples` folder, is a good demonstrat
To use this library to build your own ABCI apps in rust you have to include the following in your `Cargo.toml` file.
```toml
[dependencies]
abci = "0.3.1"
abci = "0.4.0"
```

## Running the examples
Expand Down
14 changes: 12 additions & 2 deletions build.rs
@@ -1,11 +1,21 @@
extern crate protobuf_codegen_pure;

fn main() {
protobuf_codegen_pure::run(protobuf_codegen_pure::Args {
out_dir: "src",
input: &["protos/github.com/tendermint/tendermint/libs/common/common.proto"],
includes: &["protos"],
customize: protobuf_codegen_pure::Customize {
..Default::default()
},
}).expect("protoc");

protobuf_codegen_pure::run(protobuf_codegen_pure::Args {
out_dir: "src",
input: &["src/types.proto"],
includes: &[""],
includes: &["src", "protos"],
customize: protobuf_codegen_pure::Customize {
..Default::default()
},
}).expect("protoc");
}
}
142 changes: 142 additions & 0 deletions protos/github.com/gogo/protobuf/gogoproto/gogo.proto
@@ -0,0 +1,142 @@
// Protocol Buffers for Go with Gadgets
//
// Copyright (c) 2013, The GoGo Authors. All rights reserved.
// http://github.com/gogo/protobuf
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

syntax = "proto2";
package gogoproto;

import "google/protobuf/descriptor.proto";

option java_package = "com.google.protobuf";
option java_outer_classname = "GoGoProtos";
option go_package = "github.com/gogo/protobuf/gogoproto";

extend google.protobuf.EnumOptions {
optional bool goproto_enum_prefix = 62001;
optional bool goproto_enum_stringer = 62021;
optional bool enum_stringer = 62022;
optional string enum_customname = 62023;
optional bool enumdecl = 62024;
}

extend google.protobuf.EnumValueOptions {
optional string enumvalue_customname = 66001;
}

extend google.protobuf.FileOptions {
optional bool goproto_getters_all = 63001;
optional bool goproto_enum_prefix_all = 63002;
optional bool goproto_stringer_all = 63003;
optional bool verbose_equal_all = 63004;
optional bool face_all = 63005;
optional bool gostring_all = 63006;
optional bool populate_all = 63007;
optional bool stringer_all = 63008;
optional bool onlyone_all = 63009;

optional bool equal_all = 63013;
optional bool description_all = 63014;
optional bool testgen_all = 63015;
optional bool benchgen_all = 63016;
optional bool marshaler_all = 63017;
optional bool unmarshaler_all = 63018;
optional bool stable_marshaler_all = 63019;

optional bool sizer_all = 63020;

optional bool goproto_enum_stringer_all = 63021;
optional bool enum_stringer_all = 63022;

optional bool unsafe_marshaler_all = 63023;
optional bool unsafe_unmarshaler_all = 63024;

optional bool goproto_extensions_map_all = 63025;
optional bool goproto_unrecognized_all = 63026;
optional bool gogoproto_import = 63027;
optional bool protosizer_all = 63028;
optional bool compare_all = 63029;
optional bool typedecl_all = 63030;
optional bool enumdecl_all = 63031;

optional bool goproto_registration = 63032;
optional bool messagename_all = 63033;

optional bool goproto_sizecache_all = 63034;
optional bool goproto_unkeyed_all = 63035;
}

extend google.protobuf.MessageOptions {
optional bool goproto_getters = 64001;
optional bool goproto_stringer = 64003;
optional bool verbose_equal = 64004;
optional bool face = 64005;
optional bool gostring = 64006;
optional bool populate = 64007;
optional bool stringer = 67008;
optional bool onlyone = 64009;

optional bool equal = 64013;
optional bool description = 64014;
optional bool testgen = 64015;
optional bool benchgen = 64016;
optional bool marshaler = 64017;
optional bool unmarshaler = 64018;
optional bool stable_marshaler = 64019;

optional bool sizer = 64020;

optional bool unsafe_marshaler = 64023;
optional bool unsafe_unmarshaler = 64024;

optional bool goproto_extensions_map = 64025;
optional bool goproto_unrecognized = 64026;

optional bool protosizer = 64028;
optional bool compare = 64029;

optional bool typedecl = 64030;

optional bool messagename = 64033;

optional bool goproto_sizecache = 64034;
optional bool goproto_unkeyed = 64035;
}

extend google.protobuf.FieldOptions {
optional bool nullable = 65001;
optional bool embed = 65002;
optional string customtype = 65003;
optional string customname = 65004;
optional string jsontag = 65005;
optional string moretags = 65006;
optional string casttype = 65007;
optional string castkey = 65008;
optional string castvalue = 65009;

optional bool stdtime = 65010;
optional bool stdduration = 65011;
}
28 changes: 28 additions & 0 deletions protos/github.com/tendermint/tendermint/libs/common/common.proto
@@ -0,0 +1,28 @@
syntax = "proto3";
package common;

import "github.com/gogo/protobuf/gogoproto/gogo.proto";

option (gogoproto.marshaler_all) = true;
option (gogoproto.unmarshaler_all) = true;
option (gogoproto.sizer_all) = true;
option (gogoproto.goproto_registration) = true;
// Generate tests
option (gogoproto.populate_all) = true;
option (gogoproto.equal_all) = true;
option (gogoproto.testgen_all) = true;

//----------------------------------------
// Abstract types

// Define these here for compatibility but use tmlibs/common.KVPair.
message KVPair {
bytes key = 1;
bytes value = 2;
}

// Define these here for compatibility but use tmlibs/common.KI64Pair.
message KI64Pair {
bytes key = 1;
int64 value = 2;
}

0 comments on commit 90dad48

Please sign in to comment.