Giter Site home page Giter Site logo

kanocztomas / 01cnode Goto Github PK

View Code? Open in Web Editor NEW
55.0 7.0 16.0 840 KB

tool to monitor full bitcoin node bitcoind-web

License: Other

JavaScript 83.64% HTML 11.27% CSS 3.58% Dockerfile 0.16% Shell 1.34%
bitcoin nodejs angularjs raspberrypi mempool bitcoin-node realtime blockexplorer zeromq web-frontend

01cnode's Introduction

01C Node

This is a webfrontend for a full bitcoin node. Bitcoin-core is running as the backend and this little app allows you to see the status of the node through an easy graphical web frontend.

demo page

demo page can be found at http://node.ispol.sk

Implemented pages:

  • overview - shows basic info about the node like processor count, available memorry, active interfaces, connected peers, client version, number of blocks, synced state, etc. overview screenshot
  • mempool - page shows total mempool entries, size of the mempool, to how many blocks would the transactions roughly fit, transaction size, weight and if the transaction has a witness (is segwit). Shows the last 10 txes in realtime that the bitcoind client sent us through zeromq. mempool screenshot
  • block explorer - the 10 latest blocks are shown, their size, weight, timestamp blockexplorer screenshot
  • transaction explorer - details about a TX are shown once the hash is included in the search bar transactionexplorer screenshot

docker setup (Linux/macOS):

git clone https://github.com/KanoczTomas/01Cnode.git && cd 01Cnode
  • then run helper script:
./docker_build.sh

example output (note first time build takes some time and outputs much more logs):

 setup 01cnode for you?
y/N
y
which network to setup?
1) regtest
2) testnet
3) mainnet
default: testnet
3
configuring for mainnet
running docker for you
+ cp docker/config/default.mainnet.yaml config/default.yaml
+ set +x
Sending build context to Docker daemon  2.015MB
Step 1/9 : FROM node:8
 ---> 6a23819b932c
Step 2/9 : WORKDIR /bitcoin
 ---> Using cache
 ---> 7a589cde47ab
Step 3/9 : WORKDIR /opt/01cnode
 ---> Using cache
 ---> 5f2c70189f7d
Step 4/9 : COPY package*.json ./
 ---> Using cache
 ---> 32cc927f79c3
Step 5/9 : RUN npm install
 ---> Using cache
 ---> 3199aab4fd22
Step 6/9 : COPY . .
 ---> e8cbaa85ef78
Step 7/9 : RUN npm run build
 ---> Running in 994ac8ab90c5

> [email protected] build /opt/01cnode
> browserify js/app.js | uglifyjs -mc warnings=false > static/bundle.js

(node:17) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
Removing intermediate container 994ac8ab90c5
 ---> 16b123781738
Step 8/9 : CMD node server.js
 ---> Running in 4ad0028f9c3f
Removing intermediate container 4ad0028f9c3f
 ---> 3806d8867410
Step 9/9 : EXPOSE 5000
 ---> Running in cd842bbe15c7
Removing intermediate container cd842bbe15c7
 ---> 5b80bf6d54a5
Successfully built 5b80bf6d54a5
Successfully tagged 01cnode:latest

edit config/default.yaml to reflect your configuration
make sure you set the correct rpc username/password
type ./run.sh to start the container

done.
  • edit config/default.yaml rpc information. Change it to whatever you supplied to bitcoind. All other configuration options were prefilled for you. Do not change them unless you know what you are doing.
 rpc_username: secretuser
 rpc_password: secretpass

  • run the helper script that starts the container
./run.sh

example output:

user@host:~/bin/01Cnode$ ./run.sh 
logging to file: /opt/01cnode/server.log
server is now running on port 5000

a PR for a windows script that helps with docker setup is much appreciated!

manual setup:

  • download bitcoin-core

  • if building from source, build it with zeromq support (zeromq is needed for the mempool page to work, in case you do not want to see realtime tranasctions this step can be ommited). If you use the binary from the official site that has zeromq already in it!

  • make some extra bitcoin configuration to make the frontend work (note: turning on txindex will require to reindex the whole blockchain which takes a lot of time, you were warned :). You can ignore that setting, the TransactionExplorer page will only show your transactions in that case. ). I recommend running this frontend with bitcoin-core launched with -disablewallet (or add disablewallet=1 to bitcoin.conf) in case you did not read the source code of this tool fully - you should never trust anyone

daemon=1
rpcuser=<some user>
rpcpassword=<a very secret password>
server=1
rest=1
zmqpubhashtx=tcp://127.0.0.1:28332
zmqpubhashblock=tcp://127.0.0.1:28332
zmqpubrawblock=tcp://127.0.0.1:28332
zmqpubrawtx=tcp://127.0.0.1:28332
txindex=1
disablewallet=1
  • get this repo via git and edit the file config/default.yaml - the credentials should be the same as in your bitcoin.conf. Also adjust the host and port accordingly. Make sure you set your home dir if not the default in the config file.
RPC:
  host: localhost
  port: 8332
  rpc_username: <some username>
  rpc_password: <a very secret password>
  • then install the dependencies:
npm install
  • build the javascript bundle file
npm run build
  • and start the web frontend (please note it will run in a console, do not close it or your webserver will quit, still in developement, will be fixed later to deamonize)
node server.js
  • browse to http://localhost:5000 to view the page (assuming bitcoin-core and the web frontend are on the same node)

todos:

  • see issues page

donations:

please consider donating bitcoins if you like the project:

bitcoin:3Fomcsyhc2gb5vyJLitJC8FXovBAnfWuAK

bitcoin 3Fomcsyhc2gb5vyJLitJC8FXovBAnfWuAK

author

Tomas Kanocz

01cnode's People

Contributors

kanocztomas avatar michaltakac avatar shesek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

01cnode's Issues

TypeError - getmempoolentry for 'fee' (null)

joe@n1-standard-ubu1604:~/src/01Cnode$ node server.js
logging to file: /mnt/disks/sdb/joe_src/01Cnode/server.log
server is now running on port 3000

There was an error during getmempoolentry RPC
error is: TypeError: Cannot read property 'fee' of null
There was an error during getmempoolentry RPC
error is: TypeError: Cannot read property 'fee' of null
There was an error during getmempoolentry RPC
error is: TypeError: Cannot read property 'fee' of null
There was an error during getmempoolentry RPC
error is: TypeError: Cannot read property 'fee' of null
There was an error during getmempoolentry RPC
error is: TypeError: Cannot read property 'fee' of null
There was an error during getmempoolentry RPC
error is: TypeError: Cannot read property 'fee' of null
There was an error during getmempoolentry RPC
error is: TypeError: Cannot read property 'fee' of null
There was an error during getmempoolentry RPC
error is: TypeError: Cannot read property 'fee' of null
There was an error during getmempoolentry RPC
error is: TypeError: Cannot read property 'fee' of null
There was an error during getmempoolentry RPC
error is: TypeError: Cannot read property 'fee' of null
There was an error during getmempoolentry RPC
error is: TypeError: Cannot read property 'fee' of null
There was an error during getmempoolentry RPC
error is: TypeError: Cannot read property 'fee' of null
There was an error during getmempoolentry RPC
error is: TypeError: Cannot read property 'fee' of null
There was an error during getmempoolentry RPC
error is: TypeError: Cannot read property 'fee' of null
There was an error during getmempoolentry RPC
error is: TypeError: Cannot read property 'fee' of null

Setup on rasperberry pi

Hey Guys,

I want to install this project on my raspberry pi. (PI Setup Guide by Stadicus: https://github.com/Stadicus/guides/tree/master/raspibolt)

OS: Raspbian Stretch Lite
Bitcoin Full Node : 17.0

I followed the instructions. I stuck at npm install cmd.

Log output:

Succesfully build libzmq on Fri Apr 19 2019 15:00:50 GMT+0200 (Central European Summer Time)
make: Entering directory '/home/admin/bitcoin-dashboard/node_modules/zeromq/build'
  CXX(target) Release/obj.target/zmq/binding.o
In file included from ../../nan/nan.h:192:0,
                 from ../binding.cc:40:
../../nan/nan_maybe_43_inl.h: In function ‘Nan::Maybe<bool> Nan::ForceSet(v8::Local<v8::Object>, v8::Local<v8::Value>, v8::Local<v8::Value>, v8::PropertyAttribute)’:
../../nan/nan_maybe_43_inl.h:112:15: error: ‘class v8::Object’ has no member named ‘ForceSet’
   return obj->ForceSet(isolate->GetCurrentContext(), key, value, attribs);
               ^~~~~~~~
In file included from ../../nan/nan_new.h:189:0,
                 from ../../nan/nan.h:198,
                 from ../binding.cc:40:
../../nan/nan_implementation_12_inl.h: In static member function ‘static Nan::imp::FactoryBase<v8::StringObject>::return_t Nan::imp::Factory<v8::StringObject>::New(v8::Local<v8::String>)’:
../../nan/nan_implementation_12_inl.h:337:37: warning: ‘static v8::Local<v8::Value> v8::StringObject::New(v8::Local<v8::String>)’ is deprecated: Use Isolate* version [-Wdeprecated-declarations]
   return v8::StringObject::New(value).As<v8::StringObject>();
                                     ^
In file included from /home/admin/.node-gyp/11.14.0/include/node/v8.h:26:0,
                 from ../binding.cc:24:
/home/admin/.node-gyp/11.14.0/include/node/v8.h:5242:37: note: declared here
                 static Local<Value> New(Local<String> value));
                                     ^
/home/admin/.node-gyp/11.14.0/include/node/v8config.h:326:3: note: in definition of macro ‘V8_DEPRECATE ’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
In file included from ../binding.cc:40:0:
../../nan/nan.h: In function ‘v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*)’:
../../nan/nan.h:835:60: warning: ‘v8::Local<v8::Value> node::MakeCallback(v8::Isolate*, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*)’ is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
         v8::Isolate::GetCurrent(), target, func, argc, argv);
                                                            ^
In file included from ../binding.cc:25:0:
/home/admin/.node-gyp/11.14.0/include/node/node.h:174:50: note: declared here
                 NODE_EXTERN v8::Local<v8::Value> MakeCallback(
                                                  ^
/home/admin/.node-gyp/11.14.0/include/node/node.h:93:42: note: in definition of macro ‘NODE_DEPRECATED’
     __attribute__((deprecated(message))) declarator
                                          ^~~~~~~~~~
In file included from ../binding.cc:40:0:
../../nan/nan.h: In function ‘v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object>, v8::Local<v8::String>, int, v8::Local<v8::Value>*)’:
../../nan/nan.h:850:62: warning: ‘v8::Local<v8::Value> node::MakeCallback(v8::Isolate*, v8::Local<v8::Object>, v8::Local<v8::String>, int, v8::Local<v8::Value>*)’ is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
         v8::Isolate::GetCurrent(), target, symbol, argc, argv);
                                                              ^
In file included from ../binding.cc:25:0:
/home/admin/.node-gyp/11.14.0/include/node/node.h:167:50: note: declared here
                 NODE_EXTERN v8::Local<v8::Value> MakeCallback(
                                                  ^
/home/admin/.node-gyp/11.14.0/include/node/node.h:93:42: note: in definition of macro ‘NODE_DEPRECATED’
     __attribute__((deprecated(message))) declarator
                                          ^~~~~~~~~~
In file included from ../binding.cc:40:0:
../../nan/nan.h: In function ‘v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object>, const char*, int, v8::Local<v8::Value>*)’:
../../nan/nan.h:865:62: warning: ‘v8::Local<v8::Value> node::MakeCallback(v8::Isolate*, v8::Local<v8::Object>, const char*, int, v8::Local<v8::Value>*)’ is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
         v8::Isolate::GetCurrent(), target, method, argc, argv);
                                                              ^
In file included from ../binding.cc:25:0:
/home/admin/.node-gyp/11.14.0/include/node/node.h:160:50: note: declared here
                 NODE_EXTERN v8::Local<v8::Value> MakeCallback(
                                                  ^
/home/admin/.node-gyp/11.14.0/include/node/node.h:93:42: note: in definition of macro ‘NODE_DEPRECATED’
     __attribute__((deprecated(message))) declarator
                                          ^~~~~~~~~~
In file included from ../binding.cc:40:0:
../../nan/nan.h: In constructor ‘Nan::Utf8String::Utf8String(v8::Local<v8::Value>)’:
../../nan/nan.h:911:53: warning: ‘v8::Local<v8::String> v8::Value::ToString() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
       v8::Local<v8::String> string = from->ToString();
                                                     ^
In file included from ../binding.cc:24:0:
/home/admin/.node-gyp/11.14.0/include/node/v8.h:10251:15: note: declared here
 Local<String> Value::ToString() const {
               ^~~~~
In file included from ../binding.cc:40:0:
../../nan/nan.h:921:74: warning: ‘int v8::String::WriteUtf8(char*, int, int*, int) const’ is deprecated: Use Isolate* version [-Wdeprecated-declarations]
         length_ = string->WriteUtf8(str_, static_cast<int>(len), 0, flags);
                                                                          ^
In file included from /home/admin/.node-gyp/11.14.0/include/node/v8.h:26:0,
                 from ../binding.cc:24:
/home/admin/.node-gyp/11.14.0/include/node/v8.h:2754:21: note: declared here
                 int WriteUtf8(char* buffer, int length = -1,
                     ^
/home/admin/.node-gyp/11.14.0/include/node/v8config.h:326:3: note: in definition of macro ‘V8_DEPRECATE ’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
In file included from ../binding.cc:40:0:
../../nan/nan.h: In member function ‘v8::Local<v8::Value> Nan::Callback::Call_(v8::Isolate*, v8::Local<v8::Object>, int, v8::Local<v8::Value>*) const’:
../../nan/nan.h:1479:5: warning: ‘v8::Local<v8::Value> node::MakeCallback(v8::Isolate*, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*)’ is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
     ));
     ^
In file included from ../binding.cc:25:0:
/home/admin/.node-gyp/11.14.0/include/node/node.h:174:50: note: declared here
                 NODE_EXTERN v8::Local<v8::Value> MakeCallback(
                                                  ^
/home/admin/.node-gyp/11.14.0/include/node/node.h:93:42: note: in definition of macro ‘NODE_DEPRECATED’
     __attribute__((deprecated(message))) declarator
                                          ^~~~~~~~~~
zmq.target.mk:99: recipe for target 'Release/obj.target/zmq/binding.o' failed
make: *** [Release/obj.target/zmq/binding.o] Error 1
make: Leaving directory '/home/admin/bitcoin-dashboard/node_modules/zeromq/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:193:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:255:12)
gyp ERR! System Linux 4.14.70-v7+
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/admin/bitcoin-dashboard/node_modules/zeromq
gyp ERR! node -v v11.14.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"arm"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node scripts/prebuild-install.js || (node scripts/preinstall.js && node-gyp rebuild)`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Nodejs Stuff:

~ $ node -v
11.14.0

$ npm -v
v6.7.0

Can someone help me?

Best regards.

create txbuilder tab

It should be active only on testnet and should have all the opcodes available to make learning about scripting more straightforward. It should visualise the stack as well the end result (although that might be difficult as one would have to run the script, not sure what I want :))

transaction explorer enhancement

The explorer backend should send just the tx.hex and let the client parse stuff with bitcoinjs. The communication would be less data hungry + we get nice parsing with bitcoinjs and can get potentially more info than from the RPC.

make several backends for bitcoind

create more backend alternatives for the users ro choose, there are some who do not like js, etc. the backend can be any http proxying bitcoind ... have an option to directly communicate withnbitcoind from client ...

add block explorer page

  • ability to search blocks
  • view latest x blocks (with time ago info)
  • view block sizes
  • view block txes
  • view fees collected
  • update on new block right away

getinfo will be depricated in 0.16

change getinfo calls (in overview page) ...
deprication message from core:
"deprecation-warning": "WARNING: getinfo is deprecated and will be fully removed in 0.16. Projects should transition to using getblockchaininfo, getnetworkinfo, and getwalletinfo before upgrading to 0.16",

add mempool size

add mempool size in memory, amount of btc in utxo, number of utxos, fees (average) .. oldest transaction and such ...

add hashrate estimation

let the user decie the period to estimate the hashrate (24h, 36h, etc, or even start and end date)

add average block size calculation

In the mempool page a backlog in the form of blocks that need to be generated to empty the mempool is shown. This uses a hardcoded 1MB block. The hardcoded version should be replaced by block size calculated from the last X blocks.

create overview panel

  • create overview panel with system information, with dynamic uptime and other system info
  • create active interfaces list
  • create peer list

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.