0.21.1 • Published 5 years ago

@nervosnetwork/ckb-cli v0.21.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

ckb-cli

@nervosnetwork/ckb-cli is a command line package based on @nervosnetwork/ckb-sdk-core, used to start a Node.js runtime, which has an object named core injected. The core is the instance of @nervosnetwork/ckb-sdk-core.

This project is still under very rapid development, all contributions are welcome.

Installation

Install the package with yarn:

$ yarn global add @nervosnetwork/ckb-cli

Or install the package with npm:

$ npm install -g @nervosnetwork/ckb-cli

Usage

REPL

$ ckb-cli i <url to the node>
ckb => connected to <url to the node>
ckb => await core.rpc.getTipBlockNumber()
'6905'
ckb => await core.rpc.getBlockHash('6905')
'0x89de946313839a8a77749b6218d4d7ab3513910c5ed86040e5f38efd41e566d7'
ckb => await core.rpc.getBlock('0x89de946313839a8a77749b6218d4d7ab3513910c5ed86040e5f38efd41e566d7')
{ header:
   { parentHash:
      '0xc5e11f1e5bcf589a99b94d9eaeffdccb51e3fbdc3c39561dfc49e6d42740f400',
     transactionsRoot:
      '0x993b28a820cea9297da82654c18e99e6469e08c1a14425724e71ed271d0aac0e',
     proposalsHash:
      '0x0000000000000000000000000000000000000000000000000000000000000000',
     witnessesRoot:
      '0x0000000000000000000000000000000000000000000000000000000000000000',
     unclesHash:
      '0x0000000000000000000000000000000000000000000000000000000000000000',
     unclesCount: 0,
     difficulty: '0x1000',
     epoch: '4',
     hash:
      '0x89de946313839a8a77749b6218d4d7ab3513910c5ed86040e5f38efd41e566d7',
     number: 6905,
     nonce: '17168453808346374945',
     timestamp: '1557653980138',
     version: 0 },
  uncles: [],
  transactions:
   [ { cellDeps: [],
       inputs: [Array],
       outputs: [Array],
       hash:
        '0x993b28a820cea9297da82654c18e99e6469e08c1a14425724e71ed271d0aac0e',
       version: 0,
       witnesses: [] } ],
  proposals: [] }
ckb =>

Dashboard

$ ckb-cli d <url to the node>
0.21.1

5 years ago

0.21.0

5 years ago

0.20.0

5 years ago

0.19.1

5 years ago

0.19.0

5 years ago

0.18.0

5 years ago

0.17.1

5 years ago

0.17.0

5 years ago

0.16.0

5 years ago

0.15.1

5 years ago

0.15.0

5 years ago

0.14.0

5 years ago

0.13.0

5 years ago

0.12.1

5 years ago

0.12.0

5 years ago

0.11.0

5 years ago

0.11.0-alpha.0

5 years ago

0.10.2

5 years ago

0.10.1

5 years ago

0.10.0

5 years ago

0.9.0

5 years ago

0.8.0

5 years ago

0.7.0

5 years ago

0.0.1-alpha.3

5 years ago

0.0.1-alpha.2

5 years ago

0.0.1-alpha.1

5 years ago

0.0.1-alpha.0

5 years ago