#tendermint #abci #bft #consensus #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

36 releases

0.35.0 Mar 14, 2024
0.34.0 Oct 2, 2023
0.33.0 Jul 24, 2023
0.30.0 Mar 7, 2023
0.21.0 Jul 21, 2021

#169 in Magic Beans

Download history 65/week @ 2023-12-21 54/week @ 2023-12-28 64/week @ 2024-01-04 64/week @ 2024-01-11 66/week @ 2024-01-18 72/week @ 2024-01-25 77/week @ 2024-02-01 79/week @ 2024-02-08 98/week @ 2024-02-15 329/week @ 2024-02-22 141/week @ 2024-02-29 106/week @ 2024-03-07 258/week @ 2024-03-14 94/week @ 2024-03-21 161/week @ 2024-03-28 445/week @ 2024-04-04

976 downloads per month

Apache-2.0

525KB
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–3.5MB
~61K SLoC