Giter VIP home page Giter VIP logo

js-abci's Introduction

Tendermint

UPDATE: TendermintCore featureset is frozen for LTS, see issue #9972
This is the latest stable release used by cosmoshub-4, version 0.34.24
The previous main branch (v0.38.xx) can now be found under "main_backup"

banner

Byzantine-Fault Tolerant State Machine Replication. Or Blockchain, for short.

Version API Reference Go version Discord chat License Sourcegraph

Branch Tests Linting
main Tests Lint

Tendermint Core is a Byzantine Fault Tolerant (BFT) middleware that takes a state transition machine - written in any programming language - and securely replicates it on many machines.

For protocol details, refer to the Tendermint Specification.

For detailed analysis of the consensus protocol, including safety and liveness proofs, read our paper, "The latest gossip on BFT consensus".

Documentation

Complete documentation can be found on the website.

Releases

Please do not depend on main as your production branch. Use releases instead.

Tendermint has been in the production of private and public environments, most notably the blockchains of the Cosmos Network. we haven't released v1.0 yet since we are making breaking changes to the protocol and the APIs. See below for more details about versioning.

In any case, if you intend to run Tendermint in production, we're happy to help. You can contact us over email or join the chat.

More on how releases are conducted can be found here.

Security

To report a security vulnerability, see our bug bounty program. For examples of the kinds of bugs we're looking for, see our security policy.

We also maintain a dedicated mailing list for security updates. We will only ever use this mailing list to notify you of vulnerabilities and fixes in Tendermint Core. You can subscribe here.

Minimum requirements

Requirement Notes
Go version Go 1.18 or higher

Install

See the install instructions.

Quick Start

Contributing

Please abide by the Code of Conduct in all interactions.

Before contributing to the project, please take a look at the contributing guidelines and the style guide. You may also find it helpful to read the specifications, and familiarize yourself with our Architectural Decision Records (ADRs) and Request For Comments (RFCs).

Versioning

Semantic Versioning

Tendermint uses Semantic Versioning to determine when and how the version changes. According to SemVer, anything in the public API can change at any time before version 1.0.0

To provide some stability to users of 0.X.X versions of Tendermint, the MINOR version is used to signal breaking changes across Tendermint's API. This API includes all publicly exposed types, functions, and methods in non-internal Go packages as well as the types and methods accessible via the Tendermint RPC interface.

Breaking changes to these public APIs will be documented in the CHANGELOG.

Upgrades

In an effort to avoid accumulating technical debt prior to 1.0.0, we do not guarantee that breaking changes (ie. bumps in the MINOR version) will work with existing Tendermint blockchains. In these cases you will have to start a new blockchain, or write something custom to get the old data into the new chain. However, any bump in the PATCH version should be compatible with existing blockchain histories.

For more information on upgrading, see UPGRADING.md.

Supported Versions

Because we are a small core team, we only ship patch updates, including security updates, to the most recent minor release and the second-most recent minor release. Consequently, we strongly recommend keeping Tendermint up-to-date. Upgrading instructions can be found in UPGRADING.md.

Resources

Libraries

Applications

Research

Join us!

Tendermint Core is maintained by Interchain GmbH. If you'd like to work full-time on Tendermint Core, we're hiring!

Funding for Tendermint Core development comes primarily from the Interchain Foundation, a Swiss non-profit. The Tendermint trademark is owned by Tendermint Inc., the for-profit entity that also maintains tendermint.com.

js-abci's People

Contributors

davebryson avatar mappum avatar siman avatar vrolland avatar zramsay avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

js-abci's Issues

Message handler concurrency

Currently we pass messages to the app serially, blocking until the handler has returned a response. In the future, we will want to be able to handle messages concurrently, e.g. for processing checkTx requests in parallel for performance gains.

counter.js breaks with fatal error when connected by tendermind

How to reproduce:

  1. checkout and build tendermint (current commit 1f8bb74bba0523aacdb76ed140339c48078c669b)
  2. checkout js-abci (current commit 7fbe690)
  3. start the counter.js example
    node example/counter.js
  4. start tendermint

./build/tendermint start

Swith to the counte.js tab, It breaks with the error:

listening on port 26658
/home/paceto/proj/tendermint/js-abci/node_modules/protobufjs/src/reader.js:13
    return RangeError("index out of range: " + reader.pos + " + " + (writeLength || 1) + " > " + reader.len);
           ^

RangeError: index out of range: 4 + 58 > 37
    at indexOutOfRange (/home/paceto/proj/tendermint/js-abci/node_modules/protobufjs/src/reader.js:13:12)
    at BufferReader.skip (/home/paceto/proj/tendermint/js-abci/node_modules/protobufjs/src/reader.js:334:19)
    at BufferReader.Reader.skipType (/home/paceto/proj/tendermint/js-abci/node_modules/protobufjs/src/reader.js:360:18)
    at Function.decode (/home/paceto/proj/tendermint/js-abci/node_modules/abci/types.js:841:28)
    at Function.decode (/home/paceto/proj/tendermint/js-abci/node_modules/abci/types.js:241:61)
    at Connection.maybeReadNextMessage (/home/paceto/proj/tendermint/js-abci/node_modules/abci/src/connection.js:55:27)
    at Connection.onData (/home/paceto/proj/tendermint/js-abci/node_modules/abci/src/connection.js:32:10)
    at Socket.emit (node:events:365:28)
    at addChunk (node:internal/streams/readable:314:12)
    at readableAddChunk (node:internal/streams/readable:289:9)

[0.35.2] RangeError: index out of range: 11 + 1 > 11

While building my own ABCI I was attempting to look at this official JS ABCI but ran into an issue with the proto files. Initially it was caused by them being outdated because I run 0.35.2 locally. I went ahead and updated them to the files from the v0.35.2 branch of the https://github.com/tendermint?type=source repository but that still didn't yield any better results.

Have any of the message encodings recently changed so that the whole message handling before the protobuf parsing in this ABCI has to be updated?

Changes
https://github.com/faustbrian/js-abci/commit/e59b391efac5c6b72b4884544747f09c4776d65c

Reproduction

git clone [email protected]:faustbrian/js-abci.git
cd js-abci
npm install
node examples/counter.js
tendermint unsafe-reset-all && tendermint init validator && tendermint start

Error

/Users/devjs-abci/node_modules/protobufjs/src/reader.js:13
    return RangeError("index out of range: " + reader.pos + " + " + (writeLength || 1) + " > " + reader.len);
           ^

RangeError: index out of range: 11 + 1 > 11
    at indexOutOfRange (/Users/devjs-abci/node_modules/protobufjs/src/reader.js:13:12)
    at BufferReader.readLongVarint (/Users/devjs-abci/node_modules/protobufjs/src/reader.js:140:23)
    at BufferReader.read_uint64 [as uint64] (/Users/devjs-abci/node_modules/protobufjs/src/reader.js:389:35)
    at Function.decode (/Users/devjs-abci/types.js:1159:55)
    at Function.decode (/Users/devjs-abci/types.js:286:74)
    at Connection.maybeReadNextMessage (/Users/devjs-abci/src/connection.js:55:27)
    at Connection.onData (/Users/devjs-abci/src/connection.js:32:10)
    at Socket.emit (node:events:390:28)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:289:9)

logs: Method not implemented

Counter app in Javascript
new connection from ::ffff:127.0.0.1:38260
new connection from ::ffff:127.0.0.1:38262
new connection from ::ffff:127.0.0.1:38264
Method not implemented: initChain
Method not implemented: beginBlock
Method not implemented: endBlock
Method not implemented: beginBlock
Method not implemented: endBlock

Inconsistencies between docs and js-abci

I discovered a few inconsistencies between the docs ( https://tendermint.readthedocs.io/en/master/getting-started.html ) and the latest version of this repo

  1. The tutorial references example/app.js, when this repo has example/counter.js
  2. Tendermint, as started in the way specified in the example (tendermint init, tendermint node) seems to expect the example to run on port 26658 rather than 46658 (also referenced here: #18)
  3. Not really an inconsistency, but couldn't figure out why it's so: require('abci') is not going to work in examples/counterjs, unless abci is linked as a module; perhaps it should be require('..') so it can run for people who are trying to follow the tutorial?

EDIT: For some reason I thought abci was not on npmjs, that was my mistake; I still think that the tutorial should "work" when you follow it step by step, so this should be addressed in some way; perhaps add npm link in the tutorial or something

Update js-abci to make it compatible with tendermint 0.19

Hi everyone!

We have been using tendermint along with js-abci for some internal PoCs and we think it's really great. However, js-abci doesn't work with the latest tendermint (0.19). So, we ended up using tendermint 0.13 + js-abci.

Can this be updated to work with the latest tendermint? I am also aware of lotion.js which works with the latest tendermint, but I really like the low-level controls/functionalities that js-abci offers.

Thanks for building tendermint and js-abci. ๐Ÿ‘

Add LICENSE file

package.json says MIT, would be nice with a LICENSE file as well.

js-abci (4.0.2) does not support Tendermint v0.26

Changes to message types (and presumably their encodings) introduced in Tendermint v0.26 broke compatibility with js-abci. I was using js-abci with Tendermint v0.25 with no issues.

Output log below is from running my ABCI application using js-abci with Tendermint v0.26. These errors are not present using the v0.25 binary. Logs include Tendermint logs piped through stdout.

I[3126-12-03|17:14:20.327] Starting socketClient                        module=abci-client connection=mempool impl=socketClient
I[3126-12-03|17:14:20.328] Starting socketClient                        module=abci-client connection=consensus impl=socketClient
I[3126-12-03|17:14:20.333] ABCI Handshake App Info                      module=consensus height=0 hash= software-version=0.4.0 protocol-version=0
I[3126-12-03|17:14:20.333] ABCI Replay Blocks                           module=consensus appHeight=0 storeHeight=0 stateHeight=0
(node:16424) UnhandledPromiseRejectionWarning: Error: invalid wire type 4 at offset 80
    at BufferReader.Reader.skipType (/Users/hen/GitHub/ParadigmCore/node_modules/protobufjs/src/reader.js:373:19)
    at Function.decode (/Users/hen/GitHub/ParadigmCore/node_modules/abci/types.js:1472:28)
    at Function.decode (/Users/hen/GitHub/ParadigmCore/node_modules/abci/types.js:250:69)
    at Connection.maybeReadNextMessage (/Users/hen/GitHub/ParadigmCore/node_modules/abci/src/connection.js:55:27)
    at Connection.onData (/Users/hen/GitHub/ParadigmCore/node_modules/abci/src/connection.js:32:10)
    at Socket.emit (events.js:182:13)
    at addChunk (_stream_readable.js:283:12)
    at readableAddChunk (_stream_readable.js:264:11)
    at Socket.Readable.push (_stream_readable.js:219:10)
    at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)

I am happy to assist supporting the latest version, but would require some guidance as to where this issue originates from. I expect new protobuf definitions need to be created for the latest TM release, but please correct me if this is incorrect. Thanks!

js-tmsp package needs to be updated

npm install installs a version incompatible with tendermint master

(but if I overwrite the node_modules/js-tmsp with the latest js-tmsp things work fine)

npm install fails using node 12.5

When I clone the repository and try to run npm install using node version 12.5 I get the following error:

> [email protected] preinstall /home/andy/Development/js-abci/node_modules/tendermint-node
> rm -f ./bin/tendermint && touch ./bin/tendermint


> [email protected] install /home/andy/Development/js-abci/node_modules/tendermint-node
> node ./bin/download.js

fs.js:27
const { Math, Object } = primordials;
                         ^

ReferenceError: primordials is not defined
    at fs.js:27:26
    at req_ (/home/andy/Development/js-abci/node_modules/natives/index.js:143:24)
    at Object.req [as require] (/home/andy/Development/js-abci/node_modules/natives/index.js:55:10)
    at Object.<anonymous> (/home/andy/Development/js-abci/node_modules/fstream/node_modules/graceful-fs/fs.js:1:37)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:643:32)
    at Function.Module._load (internal/modules/cjs/loader.js:556:12)
    at Module.require (internal/modules/cjs/loader.js:683:19)
    at require (internal/modules/cjs/helpers.js:16:16)

Doing some research found the link below suggesting to downgrade Node version. Downgrading node to version 11.15.0 it works

https://stackoverflow.com/questions/55921442/how-to-fix-referenceerror-primordials-is-not-defined-in-node

install

Im using: git clone https://github.com/tendermint/js-abci

Then: npm install abci

And i get an error message:
npm ERR! Refusing to install package with name "abci" under a package
npm ERR! also called "abci". Did you name your project the same
npm ERR! as the dependency you're installing?

Could someone please help?

Error in Installing the abci module

When I run the command 'npm install abci' it's throwing an error saying Refusing to install package with name "abci" under a package also called "abci". Did you name your project the same as the dependency you're installing?
Screenshot (89)

Facing error while posting a transaction

i am facing this issues again and again while posting a transaction to tendermint RPC endpoint
I am using self written js-abci with abci in node modules.
request:
method: 'POST',
headers: headers,
json: true,
body: {jsonrpc: "2.0", method: "broadcast_tx_commit", params: {tx: transaction}, id: "abc"}

error_log.txt

Stopping abci.socketClient for error: unexpected *types.Response_BeginBlock when response to *types.Request_CheckTx expected module=abci-client

Now I was tracing a following step.
https://docs.tendermint.com/master/app-dev/abci-cli.html#counter-another-example

A native abci-cli in tendermint works fine.
But this js-abci doesn't work as the document expects.

# case that work fine

tendermint version
    v0.34.8

abci-cli version
    0.17.0

abci-cli counter

tendermint init
tendermint start --proxy_app kvstore

abci-cli console
	check_tx 0x00
		code: OK

abci said:
	I[2021-03-27|11:20:35.125] Accepted a new connection                    module=abci-server
	I[2021-03-27|11:20:35.126] Waiting for new connection...                module=abci-server
	E[2021-03-27|11:20:38.014] Connection was closed by client              module=abci-server

Ctrl+c

# case that don't work fine
# ( I also referred https://github.com/tendermint/js-abci/issues/38 )

node --version
    v10.16.3

git clone https://github.com/tendermint/js-abci.git
cd js-abci/example/
npm install
cd ../
npm install
node example/counter.js

tendermint unsafe_reset_all
tendermint start --proxy_app kvstore

abci-cli console
	check_tx 0x00
		E[2021-03-27|11:25:08.260] Stopping abci.socketClient for error: unexpected *types.Response_BeginBlock when response to *types.Request_CheckTx expected module=abci-client

abci said:
	events.js:174
	      throw er; // Unhandled 'error' event
	      ^
	Error: write EPIPE
	    at WriteWrap.afterWrite [as oncomplete] (net.js:788:14)
	Emitted 'error' event at:
	    at Connection.error (/home/hirata/projects/cosmos/js-abci/src/connection.js:26:10)
	    at Socket.emit (events.js:198:13)
	    at errorOrDestroy (internal/streams/destroy.js:107:12)
	    at onwriteError (_stream_writable.js:436:5)
	    at onwrite (_stream_writable.js:461:5)
	    at _destroy (internal/streams/destroy.js:49:7)
	    at Socket._destroy (net.js:613:3)
	    at Socket.destroy (internal/streams/destroy.js:37:8)
	    at WriteWrap.afterWrite [as oncomplete] (net.js:790:10)

What am I doing wrong?
Or could you tell me how it can be solved?
Thank you.

Request data decoding error for quickstart example

Hitting this error when I attempt to send ay transaction:
RangeError: index out of range: 6 + 114 > 35

The call to

    let message = Request.decode(messageBytes)

in connection js appears to be throwing it.
I'm running tendermet version 0.30.4 - could this be an issue with the new update?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.