#tendermint #abci #consensus #bft #blockchain #key-value-store

bin+lib tendermint-abci

tendermint-abci provides a simple framework with which to build low-level applications on top of Tendermint

37 releases (17 breaking)

0.36.0 Apr 25, 2024
0.35.0 Mar 14, 2024
0.34.1 Feb 22, 2024
0.34.0 Oct 2, 2023
0.21.0 Jul 21, 2021

#201 in Magic Beans

Download history 68/week @ 2024-01-24 75/week @ 2024-01-31 85/week @ 2024-02-07 88/week @ 2024-02-14 280/week @ 2024-02-21 198/week @ 2024-02-28 99/week @ 2024-03-06 262/week @ 2024-03-13 100/week @ 2024-03-20 125/week @ 2024-03-27 172/week @ 2024-04-03 478/week @ 2024-04-10 102/week @ 2024-04-17 274/week @ 2024-04-24 87/week @ 2024-05-01 82/week @ 2024-05-08

556 downloads per month

Apache-2.0

535KB
11K SLoC

tendermint-abci

Crate Docs Build Status Audit Status Apache 2.0 Licensed Rust Stable

ABCI framework for building low-level applications for Tendermint in Rust.

Requirements

  • The latest stable version of Rust

API

At present, this crate only exposes a synchronous, blocking API based on Rust's standard library's networking capabilities. async client/server support is planned in future updates.

The primary trait to be implemented by an ABCI application is the Application trait. One of the core ideas here is that an ABCI application must be able to be cloned for use in different threads, since Tendermint opens 4 connections to the ABCI server. See the spec for details.

Examples

See src/application for some example applications written using this crate.

To run the key/value store example application, from the tendermint-abci crate's directory:

# Set your logging level through RUST_LOG (e.g. RUST_LOG=info)
# Binds to 127.0.0.1:26658
RUST_LOG=debug cargo run --bin kvstore-rs --features binary,kvstore-app

# Reset and run your Tendermint node (binds RPC to 127.0.0.1:26657 by default)
tendermint unsafe_reset_all && tendermint start

# Submit a key/value pair (set "somekey" to "somevalue")
curl 'http://127.0.0.1:26657/broadcast_tx_async?tx="somekey=somevalue"'

#{
#  "jsonrpc": "2.0",
#  "id": -1,
#  "result": {
#    "code": 0,
#    "data": "",
#    "log": "",
#    "codespace": "",
#    "hash": "17ED61261A5357FEE7ACDE4FAB154882A346E479AC236CFB2F22A2E8870A9C3D"
#  }
#}

# Query for the value we just submitted ("736f6d656b6579" is the hex
# representation of "somekey")
curl 'http://127.0.0.1:26657/abci_query?data=0x736f6d656b6579'

#{
#  "jsonrpc": "2.0",
#  "id": -1,
#  "result": {
#    "response": {
#      "code": 0,
#      "log": "exists",
#      "info": "",
#      "index": "0",
#      "key": "c29tZWtleQ==",
#      "value": "c29tZXZhbHVl",
#      "proofOps": null,
#      "height": "189",
#      "codespace": ""
#    }
#  }
#}

License

Copyright © 2021 Informal Systems

Licensed under the Apache License, Version 2.0 (the "License"); you may not use the files in this repository except in compliance with the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Dependencies

~2–3MB
~58K SLoC