Bitcoin Forum
November 02, 2024, 04:32:40 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 3 4 »  All
  Print  
Author Topic: PHP Bitcoin Node Status Page  (Read 10018 times)
CraigWatson (OP)
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile WWW
January 06, 2015, 11:52:47 PM
Last edit: January 14, 2017, 08:46:06 AM by CraigWatson
 #1

After setting up my VPS as a full node, I thought it would be nice if I had some way of displaying it to the world.

My Node

https://odin.vikingserv.net

GitHub Code: https://github.com/craigwatson/bitcoind-status
Travis CI: https://travis-ci.org/craigwatson/bitcoind-status

Donations

BTC donations are also graciously accepted both direct to 174N2KwMzKYvYkCSx1kezrzfSQuJQEZY9T and also via ChangeTip  Smiley

TL;DR - Main Features
  • List of connected nodes, with optional geolocation
  • Simple file-based cache system to limit RPC calls
  • Ships with two different CSS styles - "light" (default) and "dark"
  • Generates and displays a donation QR code for donations
  • IP-based whitelist for clearing/bypassing the cache
  • Displays historical number of connections (requires the use of a stats-collecting cron job)
  • Displays graph showing peer type breakdown over time (requires the use of another stats-collecting cron job)

Full Features List
  • Peer list is filterable - you can ignore a set list of peer IPs and also Tor peers
  • Extra agent strings can be added to the peer type graph
  • Fully responsive mobile design, including connected nodes table
  • Can bypass the file-based cache system entirely
  • Displays free disk space
  • Can either display the node's IP address via the PHP $_SERVER variable, or from the Bitcoin Daemon
  • Display if the node is running on testnet
  • Display the currently running Bitcoind version
  • Optionally display the remote port when listing connected peers.
  • IP-based geolocation flags for both node and peer IP addresses
  • Optional "Fork me on GitHub" ribbon (toggleable via config.php, enabled by default)
  • Testing includes PHP syntax checking and PEAR standards compliance

Please note that disabling the cache could overload your Bitcoind with RPC calls, and also cause geolocation errors (the current geolocation provider is rate-limited to 120 requests per minute). Please use with caution!

I'd really appreciate it if everyone could keep the ribbon enabled to try and boost exposure for the code Smiley

Contributions

Please feel free to comment, suggest (or better still, contribute!) new features or improvements.

Wanted - PHP Test Writers!

I'd like to get more test coverage of my code to make contributions even easier - if anyone has any experience in writing PHP tests (either PHPunit or something else), please reach out.
Remember remember the 5th of November
Legendary
*
Offline Offline

Activity: 1862
Merit: 1011

Reverse engineer from time to time


View Profile
January 07, 2015, 12:03:20 AM
 #2

I was about to suggest a cache, then I read your post again Cheesy

BTC:1AiCRMxgf1ptVQwx6hDuKMu4f7F27QmJC2
hamdi
Hero Member
*****
Offline Offline

Activity: 826
Merit: 500



View Profile
January 07, 2015, 12:04:03 AM
 #3

nice one
Taras
Legendary
*
Offline Offline

Activity: 1386
Merit: 1053


Please do not PM me loan requests!


View Profile WWW
January 07, 2015, 06:37:42 AM
 #4

Looks nice! I'll have a look, maybe put it on my node.
mrflibblehat
Sr. Member
****
Offline Offline

Activity: 350
Merit: 250

★YoBit.Net★ 350+ Coins Exchange & Dice


View Profile
January 07, 2015, 11:08:42 AM
 #5

Very Nice, It might be nice to show some Peer Info, Who is connected, What version of bitcoind they use etc.

I can fork your code and add this if you like, You are welcome to use it.

MrF

CraigWatson (OP)
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile WWW
January 07, 2015, 01:14:40 PM
 #6

Very Nice, It might be nice to show some Peer Info, Who is connected, What version of bitcoind they use etc.

I can fork your code and add this if you like, You are welcome to use it.

MrF

Just added this - bit of a hacky implementation as it's not responsive, but responsive tables are annoying as hell Smiley
mrflibblehat
Sr. Member
****
Offline Offline

Activity: 350
Merit: 250

★YoBit.Net★ 350+ Coins Exchange & Dice


View Profile
January 07, 2015, 01:36:02 PM
 #7

Very Nice, It might be nice to show some Peer Info, Who is connected, What version of bitcoind they use etc.

I can fork your code and add this if you like, You are welcome to use it.

MrF

Just added this - bit of a hacky implementation as it's not responsive, but responsive tables are annoying as hell Smiley

No thats good, Looks really neat.

Good Job Smiley

Would be nice to have multiple themes Smiley I will use this for my full node.

Taras
Legendary
*
Offline Offline

Activity: 1386
Merit: 1053


Please do not PM me loan requests!


View Profile WWW
January 07, 2015, 03:48:34 PM
 #8

Submitted a pull request with some potential improvements just now Smiley
Just Magicmann
Sr. Member
****
Offline Offline

Activity: 377
Merit: 250


https://keybase.io/magicmann


View Profile WWW
January 08, 2015, 03:41:39 AM
 #9

This is fantastic. Likely going to fork it to use for a cryptocurrency I've been supporting and running nodes for.  Wink

Don't deal with me until I verify with Keybase.io.
CraigWatson (OP)
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile WWW
January 08, 2015, 12:03:37 PM
 #10

Just improved a few things, including handling errors from RPC and responsifying the peer information tables, check out the live copy here: https://loki.vikingserv.net

A full README is next on the list! Smiley

This is fantastic. Likely going to fork it to use for a cryptocurrency I've been supporting and running nodes for.  Wink

Thanks, much appreciated - please feel free to tip/donate if you find it useful Smiley

Submitted a pull request with some potential improvements just now Smiley

Pull request merged Smiley
Just Magicmann
Sr. Member
****
Offline Offline

Activity: 377
Merit: 250


https://keybase.io/magicmann


View Profile WWW
January 08, 2015, 01:56:35 PM
 #11

Would you consider adding something in the config files that would give users the option of displaying the connected user's IPs?

Don't deal with me until I verify with Keybase.io.
CraigWatson (OP)
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile WWW
January 08, 2015, 02:13:04 PM
 #12

Would you consider adding something in the config files that would give users the option of displaying the connected user's IPs?

It already exists, just flip the 'display_peer_info' switch to TRUE -  a full readme is on the way though Smiley Smiley

Reference: https://github.com/craigwatson/bitcoind-status/blob/master/php/config.php#L20
Just Magicmann
Sr. Member
****
Offline Offline

Activity: 377
Merit: 250


https://keybase.io/magicmann


View Profile WWW
January 08, 2015, 03:13:19 PM
 #13

Would you consider adding something in the config files that would give users the option of displaying the connected user's IPs?

It already exists, just flip the 'display_peer_info' switch to TRUE -  a full readme is on the way though Smiley Smiley

Reference: https://github.com/craigwatson/bitcoind-status/blob/master/php/config.php#L20


My bad, I meant to not display it, but I see I can just ensure that's set to false.

Don't deal with me until I verify with Keybase.io.
terrytibbs
Hero Member
*****
Offline Offline

Activity: 560
Merit: 501



View Profile
January 09, 2015, 12:05:51 PM
 #14

You need to sanitize the protocol subversion before displaying it to users.
CraigWatson (OP)
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile WWW
January 09, 2015, 12:06:26 PM
 #15

You need to sanitize the protocol subversion before displaying it to users.

Any particular reason?
terrytibbs
Hero Member
*****
Offline Offline

Activity: 560
Merit: 501



View Profile
January 09, 2015, 12:13:04 PM
 #16

You need to sanitize the protocol subversion before displaying it to users.

Any particular reason?
Nevermind, the client does it for you these days: https://github.com/bitcoin/bitcoin/commit/a946aa8d3ec7009ac670eeb65a525efe5eeb6e84

I haven't been around for a while.
Taras
Legendary
*
Offline Offline

Activity: 1386
Merit: 1053


Please do not PM me loan requests!


View Profile WWW
January 09, 2015, 12:46:52 PM
 #17

You need to sanitize the protocol subversion before displaying it to users.

Any particular reason?
Nevermind, the client does it for you these days: https://github.com/bitcoin/bitcoin/commit/a946aa8d3ec7009ac670eeb65a525efe5eeb6e84

I haven't been around for a while.

Welcome back Tongue
Gumbork
Hero Member
*****
Offline Offline

Activity: 583
Merit: 500



View Profile
January 09, 2015, 03:23:02 PM
 #18

something new, time to give it a shot.


              ▄
            ▄███▄
          ▄███████▄
   ▄▄▄    █
█████████
   ███
    ███████████▄
██    ████    ████████▄
      ████    ██████████
  ████    ████▀██████████
  ████    ██▀   ▀█████████▄
      █████       █████████▄
      ███▀         ▀████████
  ██████▀           ▀███████
  █████▀             ▀█████
   ████ █▄▄▄     ▄▄▄█ ████
    ███ ▀███████████▀ ███
     ▀▀█▄ █████████ ▄█▀▀
        ▀▀▄▄ ▀▀▀ ▄▄▀▀
●●
●●
●●
●●
●●
●●
|●  facebook
●  reddit
●  ann thread
|
█ ██
█ ██ █
█ ██ █
█ ██ █
█ ██ █
█ ██ █
█ ██ █
█ ██ █
█ ██ █
█ ██ █
█ ██

██ █
█ ██ █
█ ██ █
█ ██ █
█ ██ █
█ ██ █
█ ██ █
█ ██ █
█ ██ █
█ ██ █
██ █
Nikinger
Full Member
***
Offline Offline

Activity: 141
Merit: 100



View Profile
January 10, 2015, 03:27:57 PM
 #19

You need to sanitize the protocol subversion before displaying it to users.

Any particular reason?
Nevermind, the client does it for you these days: https://github.com/bitcoin/bitcoin/commit/a946aa8d3ec7009ac670eeb65a525efe5eeb6e84

I haven't been around for a while.
This fix was made at version 0.9 (if I read it correctly). When doing a "getpeerlist" on my own client (or visiting CraigWatson's status page), I see some clients still having <0.9.
I think htmlspecialchars() shouldn't hurt. It's better than potentially endangering webmasters who integrates the status page on a <0.9 node.

1EwKrY5Bn3T47r4tYqSv6mMQkUyu7hZckV
Mitchell
Staff
Legendary
*
Offline Offline

Activity: 4102
Merit: 2299


Verified awesomeness ✔


View Profile WWW
January 11, 2015, 10:50:40 AM
Last edit: February 16, 2015, 07:27:03 PM by Mitchełł
 #20

Well, I just setup a Bitcoin node, just give this try this. I have always wanted to run a Bitcoin node so now I had a reason to do so. The status page can be found here: click. Bitcoind is still syncing blocks though and has been doing so for the last 12 hours.

.
Duelbits
            ▄████▄▄
          ▄█████████▄
        ▄█████████████▄
     ▄██████████████████▄
   ▄████▄▄▄█████████▄▄▄███▄
 ▄████▐▀▄▄▀▌████▐▀▄▄▀▌██

 ██████▀▀▀▀███████▀▀▀▀█████

▐████████████■▄▄▄■██████████▀
▐██████████████████████████▀
██████████████████████████▀
▀███████████████████████▀
  ▀███████████████████▀
    ▀███████████████▀
.
         ▄ ▄▄▀▀▀▀▄▄
         ▄▀▀▄      █
         █   ▀▄     █
       ▄█▄     ▀▄   █
      ▄▀ ▀▄      ▀█▀
    ▄▀     ▀█▄▄▄▀▀ ▀
  ▄▀  ▄▀  ▄▀

Live Games

   ▄▄▀▀▀▀▀▀▀▄▄
 ▄▀ ▄▄▀▀▀▀▀▄▄ ▀▄
▄▀ █ ▄  █  ▄ █ ▀▄
█ █   ▀   ▀   █ █  ▄▄▄
█ ▀▀▀▀▀▀▀▀▀▀▀▀▀ █ █   █
█▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█  █▄█
█ ▀▀█  ▀▀█  ▀▀█ █  █▄█

Slots
.
        ▄▀▀▀▀▀▀▀▀▀▀▀▀▀▄
        █         ▄▄  █
▄▀▀▀▀▀▀▀▀▀▀▀▀▀▄       █
█  ▄▄         █       █
█             █       █
█   ▄▀▀▄▀▀▄   █       █
█   ▀▄   ▄▀   █       █

Blackjack
|█▀▀▀▀▀█▄▄▄
       ▀████▄▄
         ██████▄
▄▄▄▄▄▄▄▄█▀    ▀▀█
████████▄        █
█████████▄        █
██████████▄     ▄██
█████████▀▀▀█▄▄████
▀▀███▀▀       ████
   █          ███
   █          █▀
▄█████▄▄▄ ▄▄▀▀
███████▀▀▀
.
                 NEW!                  
SPORTS BETTING 
|||
[ Đ ][ Ł ]
AVAILABLE NOW

Advertisements are not endorsed by me.
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!