Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/maxidev/btcli

BTCli aims to be a dev-friendly, simple Bitcoin terminal explorer to easly check for address balance, transaction information, UTXOs and more.
https://github.com/maxidev/btcli

bitcoin blockchain cli explorer

Last synced: about 2 months ago
JSON representation

BTCli aims to be a dev-friendly, simple Bitcoin terminal explorer to easly check for address balance, transaction information, UTXOs and more.

Awesome Lists containing this project

README

        

[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]



BTCli - A Simple Bitcoin command-line explorer



Report Bug
·
Request Feature

Table of Contents




  1. About The Project




  2. Getting Started


  3. Usage

  4. Roadmap

  5. Contributing

  6. License

  7. Contact

  8. Acknowledgements

## About The Project
BTCli aims to be a dev-friendly, simple Bitcoin terminal explorer to easly check for address balance, transaction information, UTXOs and more.
It actually supports Bitcoin Mainnet and Testnet, and different web explorer can be chosen to preset the terminal links.

*BTCli is NOT a wallet!*

See examples below.

### Built With

* [ElectrumX](https://electrumx.readthedocs.io/en/latest/protocol-basics.html)
* [NodeJS](https://nodejs.org)

### Not a Wallet

BTCli aims to be a useful command line tool for quick checking Bitcoin blockchain address and transactions. BTCli is not a wallet, for a good wallet experience we recommend to use one of the following:

* [Specter Wallet](https://github.com/cryptoadvance/specter-desktop) (Great MultiSig focused wallet that interacts directly with Bitcoin Core)
* [Blue Wallet](https://github.com/BlueWallet/BlueWallet) (User friendly and multisig capable Mobile wallet for Android and iOS)

## Getting Started

To run BTCli in your local machine directly from this repository
### Clone the project
```sh
git clone [email protected]:maxidev/btcli.git
```

### Install dependencies

nodejs/npm version 10+

```sh
npm i
```

Now you can just run:

```sh
node ./bin/btcli.js
```

### To bind the binary and use directly on the terminal

```js
//This will bind btcli commandline to js entry point
sudo npm link
```

Then you can just run:

```sh
btcli
```

### To generate a .deb (Debian/Ubuntu) package

First install dependencies by running

```sh
sudo npm install -g node-deb
sudo apt-get install jq
```
Then

```
npm run generate:deb
```

This will trigger script to generate btcli_0.0.1_all.deb for easily installation, on Debian/Ubuntu systems:

```
sudo dpkg -i btcli_0.0.1_all.deb
```

Alternatively pre-generated deb package can be found in our Github release page

[btcli_0.1.0.deb](https://github.com/maxidev/btcli/releases/download/v0.1.0/btcli_0.1.0.deb)

To install directly from NPM:

### Install as a global package
```sh
npm install -g btcli
```

### Once installed, just run it from command line

```
btcli help

Usage: btcli [options] [command]

BTCli - A simple command line Bitcoin explorer

Options:
-v, --version Output the current version
-e, --explorer , Web Explorer to link (choices: "blockchair", "blockchain-info", "blockstream", "btc")
--tojson [filename] JSON Output
-V, --verbose Verbose output
-t, --testnet Set Bitcoin testnet network
-h, --help display help for command

Commands:
addr

Bitcoin Address to check legacy/bech32 supported
block Bitcoin block information
tx Bitcoin transaction
help [command] display help for command
```

## Usage

btcli _addr_ command usage

[![asciicast](https://asciinema.org/a/389942.svg)](https://asciinema.org/a/389942)

btcli _tx_ command usage

[![asciicast](https://asciinema.org/a/389946.svg)](https://asciinema.org/a/389946)

Testnet
btcli testnet option usage

[![asciicast](https://asciinema.org/a/389944.svg)](https://asciinema.org/a/389944)

JSON Format
btcli _tojson_ option usage

[![asciicast](https://asciinema.org/a/389947.svg)](https://asciinema.org/a/389947)

### Commands

- `addr

` Bitcoin Address to check legacy P2PKH/P2SH/P2WPKH (SegWit Bech32) supported.
- `block ` Bitcoin block information (under development)
- `tx ` Bitcoin transaction.

### Options

- `--verbose` Output reloaded.
- `--explorer ` Web explorer to link.
- `--tojson ` Output logs in json.
- `--testnet` Set tesnet chain for querying servers

### Examples

```js
// Simple Bitcoin mainnet legacy address balance check
btcli addr 12pPx8Frg5wTQmprxBLoi8R3mdmFYjmCfv
```

```js
// Transaction inspect with verbose option to output inputs/outputs info
btcli tx aafe3d76554df980482ec092630ba957dda6458c40178dab54fa44443706808c --verbose
```

```js
// Inspect transaction changing the default web-explorer for output links
btcli tx aafe3d76554df980482ec092630ba957dda6458c40178dab54fa44443706808c -e blockstream
```

```js
// Address balance check with verbose option to out scripts and changing default web explorer
btcli addr 12pPx8Frg5wTQmprxBLoi8R3mdmFYjmCfv --explorer blockchain-info
```

```js
// Exporting the transaction inspect to my_tx JSON file.
btcli tx aafe3d76554df980482ec092630ba957dda6458c40178dab54fa44443706808c --tojson my_tx
```

```js
// Inspecting testnet address with verbose output
btcli addr tb1qxp7yuclrt65cvawfnpvgg3u8p2nf8qhx7k9jzf --verbose --testnet
```

## Roadmap

We have lots of ideas to convert BTCli into a swiss-army knife tool for devs and enthusiast alike. This is a side project and collaboration is much needed. Feel free to open some issue to propose a new feature.

See the [open issues](https://github.com/maxidev/btcli/issues) for a list of proposed features (and known issues).

## Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.

1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

## License

Distributed under the MIT License. See `LICENSE` for more information.

## Contact

Maxi Dev - [@op_hash160](https://twitter.com/op_hash160)

Agustin Fiorenza - [@agufiorenza](https://twitter.com/agufiorenza)

Project Link: [https://github.com/maxidev/btcli](https://github.com/maxidev/btcli)

## Acknowledgements

This project heavily relies on [ElectrumX](https://electrumx.readthedocs.io/en/latest/protocol-basics.html) public [servers](https://1209k.com/bitcoin-eye/ele.php?chain=btc)
Consider running your own sever or donate to public server maintainers.
We purposely left the ElectrumX Public Server connection banner on BTCli to support server owner.

## Support us!

Consider buying us a coffee if you find BTCli useful

[bc1qldcc5k2zaz4f4d79m07zgh9nc2gr7mf0nr0g8t](https://blockchair.com/bitcoin/address/bc1qldcc5k2zaz4f4d79m07zgh9nc2gr7mf0nr0g8t)

[contributors-shield]: https://img.shields.io/github/contributors/maxidev/btcli.svg?style=for-the-badge
[contributors-url]: https://github.com/maxidev/btcli/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/maxidev/btcli.svg?style=for-the-badge
[forks-url]: https://github.com/maxidev/btcli/network/members
[stars-shield]: https://img.shields.io/github/stars/maxidev/btcli.svg?style=for-the-badge
[stars-url]: https://github.com/maxidev/btcli/stargazers
[issues-shield]: https://img.shields.io/github/issues/maxidev/btcli.svg?style=for-the-badge
[issues-url]: https://github.com/maxidev/btcli/issues
[license-shield]: https://img.shields.io/github/license/maxidev/btcli.svg?style=for-the-badge
[license-url]: https://github.com/maxidev/btcli/blob/master/LICENSE.txt
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555