Skip to content

Commit

Permalink
cleanup README, comments in application.yml.sample
Browse files Browse the repository at this point in the history
  • Loading branch information
mhanne committed May 10, 2015
1 parent e8c256f commit 0f300a4
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 22 deletions.
30 changes: 19 additions & 11 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,34 @@ This application lets you browse the bitcoin blockchain database generated by a

A demo instance is running on http://webbtc.com.


== Requirements

* ruby 1.9.3
* ruby 2.1.5
* rubygems, bundler
* database adapter
* database adapter (postgres recommended)

== Setup

You need a postgres blockchain database built by bitcoin-ruby, for example
== Blockchain Database

bitcoin_node -n testnet3 -s archive::sqlite://test.db
To run your own block_browser instance, you need a bitcoin-ruby-blockchain[http://github.com/mhanne/bitcoin-ruby-blockchain] database. Use bitcoin-ruby-node[http://github.com/mhanne/bitcoin-ruby-node] to build it:

Copy +config/application.yml.sample+ to +config/application.yml+ and adjust it to your needs.
bitcoin_node -n testnet3 -s archive::postgres:/bitcoin

Also, enable the corresponding db library in the +Gemfile+:
(Or grab a dump from http://dumps.webbtc.com to speed up the import)


== Setup

# gem 'sequel'
gem 'sqlite3'
# gem 'pg'
Copy +config/application.yml.sample+ to +config/application.yml+ and adjust it to your needs.

Then install the required gems

bundle install


== Starting the server

And start the server

rails s
Expand All @@ -36,6 +40,9 @@ Start the websocket server that connects to the bitcoin node and pushes new bloc

rails runner lib/websocket.rb


== Collect stats / generate graphs

To collect the statistics used on /stats page

rails runner lib/stats.rb
Expand All @@ -44,6 +51,7 @@ To generate the graphs for /stats page

rails runner lib/graph.rb


== License

Copyright (c) 2011-2015 Marius Hanne <[email protected]>
Expand All @@ -57,4 +65,4 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

A copy of the license is included in {file:COPYING}, see
http://www.gnu.org/licenses/ for more details.
http://www.gnu.org/licenses/ for more details.
2 changes: 1 addition & 1 deletion app/views/api/address.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,5 @@
%h3 Example

.example
%pre= "curl http://webbtc.com/address/1Q2TWHE3GMdB6BZKafqwxXtWAWgFt5Jvm3.json"
%pre= "curl http://#{BB_CONFIG['domain']}/address/1Q2TWHE3GMdB6BZKafqwxXtWAWgFt5Jvm3.json"
%pre= render partial: "addr_1Q2TWHE3GMdB6BZKafqwxXtWAWgFt5Jvm3.json"
2 changes: 1 addition & 1 deletion app/views/api/block.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,5 @@
%h3 Example

.example
%pre= "curl http://webbtc.com/block/00000000d1145790a8694403d4063f323d499e655c83426834d4ce2f8dd4a2ee.json"
%pre= "curl http://#{BB_CONFIG['domain']}/block/00000000d1145790a8694403d4063f323d499e655c83426834d4ce2f8dd4a2ee.json"
%pre= render partial: "block_170.json"
2 changes: 1 addition & 1 deletion app/views/api/relay.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@
%h3 Example

#api_relay_example.example
%pre= 'curl http://test.webbtc.com/relay_tx.json -X POST -d "wait=10&tx=01000000012d57d1c110cf889ad672e624ff084b3e743203031b983cba28fc15a648a7192b000000008c493046022100e72836cba6fff6617d512f979099ef5136a0a8fdd9e368e723d9661b96dbc26e0221008d99e812c3b0b98bc40d8513b0745ee7a5d5f9809ba7c8008b79812925160a0501410401cb2ad43221c2aae6ec0a8abf10e9d28d6b4ba688a9f0414c2db883935726c95f3f2a67bbe8a981917392d7b77ed5570d58b622d654c989eb9f06e814e78796ffffffff02c0d45407000000001976a914b4b69e5f4e517afcba6a42cffc0ccea72483c4b088acc05ead33000000001976a9147768b30bc24d198e332ec6e62c73c56b511f93ac88ac00000000"'
%pre= 'curl http://' + BB_CONFIG['domain'] + '/relay_tx.json -X POST -d "wait=10&tx=01000000012d57d1c110cf889ad672e624ff084b3e743203031b983cba28fc15a648a7192b000000008c493046022100e72836cba6fff6617d512f979099ef5136a0a8fdd9e368e723d9661b96dbc26e0221008d99e812c3b0b98bc40d8513b0745ee7a5d5f9809ba7c8008b79812925160a0501410401cb2ad43221c2aae6ec0a8abf10e9d28d6b4ba688a9f0414c2db883935726c95f3f2a67bbe8a981917392d7b77ed5570d58b622d654c989eb9f06e814e78796ffffffff02c0d45407000000001976a914b4b69e5f4e517afcba6a42cffc0ccea72483c4b088acc05ead33000000001976a9147768b30bc24d198e332ec6e62c73c56b511f93ac88ac00000000"'
%pre= "{\n \"success\": true,\n \"hash\": \"5dd3213d18222db85dda31b7d3c1d7f1da5edfd4b9ed9aee4d9eef037f08d1df\",\n \"propagation\": {\n \"received\": 28,\n \"sent\": 1,\n \"percent\": 80.0\n }\n}"
2 changes: 1 addition & 1 deletion app/views/api/tx.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,5 @@
%h3 Example

.example
%pre= "curl http://webbtc.com/tx/f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16.json"
%pre= "curl http://#{BB_CONFIG['domain']}/tx/f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16.json"
%pre= render partial: "tx_170_1.json"
44 changes: 37 additions & 7 deletions config/application.yml.sample
Original file line number Diff line number Diff line change
@@ -1,19 +1,49 @@
# the network to use ("bitcoin", "namecoin", "testnet3", etc.)
network: bitcoin

# blockchain database (has to match the "network" setting)
database: "archive::postgres:/bitcoin"

# how to connect to the "command socket" of the bitcoin-ruby-node
command: "127.0.0.1:9999"
domain: "localhost"

# where the websocket server will be started / reachable by the clients
websocket: "127.0.0.1:8000"
database: "archive::postgres:/bitcoin"
donate: 1NqPo22Jhthd5Suget1rgs9EEoFGuDTZ9S


# page processing timeout
timeout: 30

# don't even try to display addresses with more outputs than this
max_addr_txouts: 100


# whether to display indexed p2sh script types
# (this also needs to be enabled in the bitcoin node / blockchain database!)
index_p2sh_scripts: true

# number of entries displayed in /scripts or /p2sh_scripts
script_list_limit: 20


# relay transactions to this many nodes
relay_send: 3

# default time to wait for relay propagation estimate
relay_wait_default: 3

# max time to wait for relay propagation estimate
relay_wait_max: 10
relay_send: 3

script_list_limit: 20
index_p2sh_scripts: true # disable for networks without p2sh support

# the domain of this instance (only used in /api documentation for now,
# but might become important in relation to the "networks" setting)
domain: "localhost"

# links to other instances for different networks
networks:
bitcoin: "http://webbtc.com"
namecoin: "http://namecoin.webbtc.com"
namecoin: "http://namecoin.webbtc.com"

# donation address displayed in the footer
donate: 1NqPo22Jhthd5Suget1rgs9EEoFGuDTZ9S

0 comments on commit 0f300a4

Please sign in to comment.