Bitcoin Forum
May 21, 2024, 03:44:49 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 3 4 »  All
  Print  
Author Topic: bitcoind-ncurses: Terminal front-end for bitcoind  (Read 11279 times)
azeteki (OP)
Member
**
Offline Offline

Activity: 96
Merit: 10

esotericnonsense


View Profile WWW
June 27, 2014, 11:11:26 PM
Last edit: July 11, 2014, 08:09:42 PM by azeteki
 #1

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Greetings,

I've been working on a Python front-end for bitcoind for the past few days.
The principal motivation was to give myself a reasonable way of monitoring my node without using CLI.

I thought it might be useful to others so I've made it available on GitHub: https://github.com/azeteki/bitcoind-ncurses

As it's been hacked together rapidly it is fairly limited on features and 'just about works' at present.
Best to treat it as a proof of concept for now, though it is perfectly usable for watching only.

As always, make sure you audit before running (I've tried to seperate out potentially vulnerable stuff like RPC calls as much as possible).

Regards,
Atelopus Zeteki
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQIcBAEBCgAGBQJTrfn2AAoJEOK9FOwsfUWPCykQAK2yBLXlg3iJ6D1OSGjKeh1r
YrsXHwODQ9vx92ucIdQEQ085+E3qKqVBOTv0hQHmKC7BSo7XoDfSvuCxYjzQEtWX
8Kpn+scIzi2GQXL+wRCVKVo72lLdzjr3r/nPNm36n63LmDqBE14HTe1rgnfsw6oH
CRe8Czdx6q12dicBaARvBxs07s8lARr/rIxxvB2SPyGLTkdNbg5jzhf28FiB8XyI
MrxdCt0OHYLPlArHDswJlUVwgu6/Us8aL3e3nxYvlEJPqM/dX/4rlMembl3eNTmJ
3JiKkNFIITcKvy3p8Z0jHHo5l8YwOjN4H4M70lhL4JAuJJCTYb+oqKuUoxcWObDG
XiXrWfx8/TRfBYDFmqys3hWz7gGm3ssTsobb5cdvywC00DrSfTUKGnNvzLDWID5A
yTek73cs6scgDOrdRZQr7sGUI+rKd80B2v/AxA2zGfgq7WQ7WKJbAwkJVnp6HhOG
XbQk91geG07XE/nQbxa2hfEUvNMQL3wfPWyvEc4oBMnJqheeptb5tpw30mq8+tpQ
gz7vUgBkJLiGi0P/zyi0YLDWCJxIFaCBj4BoFFFmpbMF1tO+XTSTlMhX81pO4vrw
2agjnMd/bI1S2MXH3LNgu9K1blio47rrPTsvDJX/MFkeAky7da2rj/POWeCE4j81
y8JclVhdbEHfO/DdoGFv
=84Pj
-----END PGP SIGNATURE-----

azeteki (OP)
Member
**
Offline Offline

Activity: 96
Merit: 10

esotericnonsense


View Profile WWW
June 27, 2014, 11:15:05 PM
Last edit: December 20, 2014, 09:31:08 PM by azeteki
 #2

Here are some screenshots of the various modes.


















gmaxwell
Moderator
Legendary
*
expert
Offline Offline

Activity: 4172
Merit: 8421



View Profile WWW
June 27, 2014, 11:53:19 PM
 #3

Very neat.  Perhaps to go with the bandwidth stats some mempool stats and a time since last received block?— for the latter we might need to adds something to the rpc, I don't think we expose what time we received a block.
azeteki (OP)
Member
**
Offline Offline

Activity: 96
Merit: 10

esotericnonsense


View Profile WWW
June 28, 2014, 10:23:48 AM
 #4

Very neat.  Perhaps to go with the bandwidth stats some mempool stats and a time since last received block?— for the latter we might need to adds something to the rpc, I don't think we expose what time we received a block.

Actually, the 'received ... ago' display is time since last received block (including verification time).
This is because at present it constantly (every 2 seconds or so) polls with getinfo.

If blockheight changes then it goes ahead and pushes a getblockhash/getblock combo to find timestamp and size.
My understanding is that there is no need to check getbestblockhash because the height should never reduce.

This fails for the first block on startup and just displays the time of first contact with bitcoind.

virtualx
Hero Member
*****
Offline Offline

Activity: 672
Merit: 507


LOTEO


View Profile
June 28, 2014, 11:33:15 AM
 #5

Looks very cool, I will look into this today.

Edit: good to see it needs Python 2.7

...loteo...
DIGITAL ERA LOTTERY


r

▄▄███████████▄▄
▄███████████████████▄
▄███████████████████████▄
▄██████████████████████████▄
▄██  ███████▌ ▐██████████████▄
▐██▌ ▐█▀  ▀█    ▐█▀   ▀██▀  ▀██▌
▐██  █▌ █▌ ██  ██▌ ██▌ █▌ █▌ ██▌
▐█▌ ▐█ ▐█ ▐█▌ ▐██  ▄▄▄██ ▐█ ▐██▌
▐█  ██▄  ▄██    █▄    ██▄  ▄███▌
▀████████████████████████████▀
▀██████████████████████████▀
▀███████████████████████▀
▀███████████████████▀
▀▀███████████▀▀
r

RPLAY NOWR
BE A MOON VISITOR!
[/center]
azeteki (OP)
Member
**
Offline Offline

Activity: 96
Merit: 10

esotericnonsense


View Profile WWW
June 28, 2014, 11:54:01 PM
 #6

Thank you both.
virtualx, it may work with older Python versions, 2.7 is all I've tested.

Pushed a few updates since the original post.
A lot more is event driven now.
The transaction and block browsers have scrolling support (tested with 200KB transactions with hundreds of inputs/outputs) and should be _much_ smoother.
Only remaining obstacle is the main updating view (called every second or so).
I intend to set up and test over SSH at some point to see if there are issues with redrawing.

If anyone has feature requests I will be glad to look into them as time allows.
Next is to add support for querying an arbitrary block, prev/next block and so on.

azeteki (OP)
Member
**
Offline Offline

Activity: 96
Merit: 10

esotericnonsense


View Profile WWW
July 09, 2014, 02:55:43 PM
 #7

A few updates:

Lots of speed improvements and eliminating needless queries.
Better error handling if commands fail or connection fails.
Various bug fixes.
The block viewer now supports browsing through older blocks and arbitrary block height or hash.
The genesis transaction would fail as bitcoind does not index it.
Formatting changes to monitor mode (age of transactions).
Difficulty, nethash and mempool transactions added to monitor mode.
A peer viewer has been added - currently listed is sync node status, incoming/outgoing status, node IP (if available), received and sent data.

I wanted to thank users again for making suggestions and testing so far.

dserrano5
Legendary
*
Offline Offline

Activity: 1974
Merit: 1029



View Profile
July 09, 2014, 04:42:29 PM
 #8

Nice piece of software! Bug report:

- Go to block 309951.
- Go to transaction 2. Don't view it, just move the cursor down.
- Go backwards to block 309950. There's only one tx in this block.
- Oops, cursor thinks it's still in tx 2. If you hit space to view it, the program dies.
azeteki (OP)
Member
**
Offline Offline

Activity: 96
Merit: 10

esotericnonsense


View Profile WWW
July 09, 2014, 05:05:26 PM
 #9

Nice piece of software! Bug report:

- Go to block 309951.
- Go to transaction 2. Don't view it, just move the cursor down.
- Go backwards to block 309950. There's only one tx in this block.
- Oops, cursor thinks it's still in tx 2. If you hit space to view it, the program dies.


Good catch.
This should now be fixed in latest github master.

azeteki (OP)
Member
**
Offline Offline

Activity: 96
Merit: 10

esotericnonsense


View Profile WWW
July 11, 2014, 12:05:51 PM
Last edit: July 12, 2014, 11:59:24 AM by azeteki
 #10

A wallet transaction view mode has been added.
Note that as of yet, bitcoind-ncurses does not implement unlocking the wallet, creating or signing transactions, or any other key-related functions.
This is simply for viewing historical/unconfirmed transactions that are relevant to your wallet (in listsinceblock).



It may break on odd forms of transactions.
If you want to try and break it and help me improve the checking, feel free to send me odd transactions on testnet.

mr19pWU5UbtFuNu4xxUEeNfeXLwjBggYzN

elebit
Sr. Member
****
Offline Offline

Activity: 441
Merit: 250


View Profile
July 12, 2014, 09:24:11 AM
 #11

The real time stats are mesmerizing! Thanks you for this!
azeteki (OP)
Member
**
Offline Offline

Activity: 96
Merit: 10

esotericnonsense


View Profile WWW
July 12, 2014, 11:58:39 AM
 #12

The real time stats are mesmerizing! Thanks you for this!

Indeed! Smiley

Added a feature to seek for block by timestamp.
It searches by estimating a 10 minute block interval and bouncing back and forth until it thinks it's close enough.
It gets within a few blocks in all the cases I've tested. Could be optimized more but it's good enough for now.

azeteki (OP)
Member
**
Offline Offline

Activity: 96
Merit: 10

esotericnonsense


View Profile WWW
July 13, 2014, 03:10:25 PM
 #13

A few more updates:

Changed the timestamp format to ~ISO standard (YYYY-MM-DD hh:mm:ss)
Already queried blocks are cached to improve the speed of block view mode seeking
Monitor mode now displays estimated fee information for latest block (it assumes block subsidy and fees are fully claimed by the miner)
Monitor mode now displays average size of transactions in latest block

JackH
Sr. Member
****
Offline Offline

Activity: 381
Merit: 255


View Profile
July 13, 2014, 08:10:12 PM
 #14

This is a pretty good project and certainly helps those of us that use BitcoinD and would like a better overview of things. Nice work, very nice work actually!

<helo> funny that this proposal grows the maximum block size to 8GB, and is seen as a compromise
<helo> oh, you don't like a 20x increase? well how about 8192x increase?
<JackH> lmao
azeteki (OP)
Member
**
Offline Offline

Activity: 96
Merit: 10

esotericnonsense


View Profile WWW
July 17, 2014, 10:43:25 PM
 #15

Added a 'verbose' mode for the transaction view.

It attempts to display corresponding previous outputs from the inputs.

It may be quite slow for transactions with many inputs. It's not enabled by default, though.

azeteki (OP)
Member
**
Offline Offline

Activity: 96
Merit: 10

esotericnonsense


View Profile WWW
July 18, 2014, 10:52:30 PM
 #16

It is now possible to resize vertically most of the views and have them scale dynamically.
So on a 50 row terminal you can show more inputs/outputs at once in the transaction view mode, for example.

Minimum size is now 75x12, down from 75x20.

azeteki (OP)
Member
**
Offline Offline

Activity: 96
Merit: 10

esotericnonsense


View Profile WWW
July 23, 2014, 04:51:51 AM
 #17

Textmode just wouldn't be textmode without...



Cheesy

spin
Sr. Member
****
Offline Offline

Activity: 362
Merit: 261


View Profile
July 23, 2014, 02:57:01 PM
 #18

Thanks for this.  Tested it out and it works well. 

I have disabled wallet on bitcoind.  Perhaps the app can detect that when going to the wallet screen?
The peer view could be more interesting with country of the peer?



If you liked this post buy me a beer.  Beers are quite cheap where I live!
bc1q707guwp9pc73r08jw23lvecpywtazjjk399daa
azeteki (OP)
Member
**
Offline Offline

Activity: 96
Merit: 10

esotericnonsense


View Profile WWW
July 23, 2014, 03:15:00 PM
 #19

Thanks for this.  Tested it out and it works well. 
I have disabled wallet on bitcoind.  Perhaps the app can detect that when going to the wallet screen?

What happens? Does it simply display nothing, or is there some sort of error/crash? I can't test right now.

virtualx
Hero Member
*****
Offline Offline

Activity: 672
Merit: 507


LOTEO


View Profile
July 23, 2014, 06:46:55 PM
 #20

Textmode just wouldn't be textmode without...



Cheesy

This looks pretty cool, it reminds me of the days of the old BBS. Wil you add soundblaster 16 sounds by any chance?  Smiley

...loteo...
DIGITAL ERA LOTTERY


r

▄▄███████████▄▄
▄███████████████████▄
▄███████████████████████▄
▄██████████████████████████▄
▄██  ███████▌ ▐██████████████▄
▐██▌ ▐█▀  ▀█    ▐█▀   ▀██▀  ▀██▌
▐██  █▌ █▌ ██  ██▌ ██▌ █▌ █▌ ██▌
▐█▌ ▐█ ▐█ ▐█▌ ▐██  ▄▄▄██ ▐█ ▐██▌
▐█  ██▄  ▄██    █▄    ██▄  ▄███▌
▀████████████████████████████▀
▀██████████████████████████▀
▀███████████████████████▀
▀███████████████████▀
▀▀███████████▀▀
r

RPLAY NOWR
BE A MOON VISITOR!
[/center]
Pages: [1] 2 3 4 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!