{"id":13414422,"url":"https://github.com/mappum/js-tendermint","last_synced_at":"2025-05-07T07:18:43.686Z","repository":{"id":44741804,"uuid":"78687072","full_name":"mappum/js-tendermint","owner":"mappum","description":"A JS light client for Tendermint blockchains","archived":false,"fork":false,"pushed_at":"2022-12-09T08:57:47.000Z","size":979,"stargazers_count":72,"open_issues_count":24,"forks_count":26,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-05-07T07:18:37.591Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mappum.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-11T22:49:56.000Z","updated_at":"2024-11-21T23:07:47.000Z","dependencies_parsed_at":"2023-01-25T20:46:30.733Z","dependency_job_id":null,"html_url":"https://github.com/mappum/js-tendermint","commit_stats":null,"previous_names":["mappum/js-tendermint","nomic-io/js-tendermint"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mappum%2Fjs-tendermint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mappum%2Fjs-tendermint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mappum%2Fjs-tendermint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mappum%2Fjs-tendermint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mappum","download_url":"https://codeload.github.com/mappum/js-tendermint/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252831271,"owners_count":21810784,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T21:00:20.937Z","updated_at":"2025-05-07T07:18:43.662Z","avatar_url":"https://github.com/mappum.png","language":"JavaScript","funding_links":[],"categories":["Language bundles"],"sub_categories":["Javascript bundle"],"readme":"# tendermint\n\nA light client for Tendermint blockchains which works in Node.js and browsers.\n\nSupports Tendermint v0.33.\n\n**NOTICE:** This library has not undergone any kind of security review, so think twice before using it to secure any real value.\n\n### Usage\n```\nnpm install tendermint\n```\n\n**Light Node**\n\nRequests data over RPC and verifies blockchain headers\n\n```js\nlet Tendermint = require('tendermint')\n\n// some full node's RPC port\nlet peer = 'ws://localhost:26657'\n\n// `state` contains a part of the chain we know to be valid. If it's\n// too old, we cannot safely verify the chain and need to get a newer\n// state out-of-band.\nlet state = {\n  // a header, in the same format as returned by RPC\n  // (see http://localhost:26657/commit, under `\"header\":`)\n  header: { ... },\n\n  // the valdiator set for this header, in the same format as returned by RPC\n  // (see http://localhost:26657/validators)\n  validators: [ ... ],\n\n  // the commit (validator signatures) for this header, in the same format as\n  // returned by RPC (see http://localhost:26657/commit, under `\"commit\":`)\n  commit: { ... }\n}\n\n// options\nlet opts = {\n  // the maximum age of a state to be safely accepted,\n  // e.g. the unbonding period\n  // (in seconds)\n  maxAge: 1728000 // defaults to 30 days\n}\n\n// instantiate client. will automatically start syncing to the latest state of\n// the blockchain\nlet node = Tendermint(peer, state, opts)\n\n// make sure to handle errors\nnode.on('error', (err) =\u003e { ... })\n// emitted once we have caught up to the current chain tip\nnode.on('synced', () =\u003e { ... })\n// emitted every time we have verified a new part of the blockchain\nnode.on('update', () =\u003e { ... })\n\n// returns the height of the most recent header we have verified\nnode.height()\n\n// returns the state object ({ header, validators, commit }) of the most recently\n// verified header, should be stored and used to instantiate the light client\n// the next time the user runs the app\nnode.state()\n```\n\n**RPC Client**\n\nSimple client to make RPC requests to nodes\n\n```js\nlet { RpcClient } = require('tendermint')\n\nlet client = RpcClient('ws://localhost:26657')\n\n// request a block\nclient.block({ height: 100 })\n  .then((res) =\u003e console.log(res))\n```\n\nThe following RPC methods are available:\n\n```\n- subscribe\n- unsubscribe\n- status\n- netInfo\n- dialSeeds\n- blockchain\n- genesis\n- block\n- validators\n- dumpConsensusState\n- broadcastTxCommit\n- broadcastTxAsync\n- broadcastTxSync\n- unconfirmedTxs\n- numUnconfirmedTxs\n- abciQuery\n- abciInfo\n- abciProof\n- unsafeFlushMempool\n- unsafeSetConfig\n- unsafeStartCpuProfiler\n- unsafeStopCpuProfiler\n- unsafeWriteHeapProfile\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmappum%2Fjs-tendermint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmappum%2Fjs-tendermint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmappum%2Fjs-tendermint/lists"}