Block Viewer visualizes the Bitcoin block chain by building an ownership network on top of the underlying transaction network and presents a web-enabled user interface to display the visualization results.
In order to create what is seen at http://blockviewer.com, Block Viewer performs the following:
Each component of the graph represents the following:
Several command line arguments are passed into blockviewer. To let it build a full, application ready use as seen at blockviewer.com, the backend server would use:
java -jar -Xmx2048m BlockViewer.jar -dbPath ../graph.db/ -configPath ../neo4j.properties -validate false -low -high -scraper -exporter
where:
The client only needs to be passed:
java -jar -Xmx2048m BlockViewer.jar -dbPath graph.db/ -configPath neo4j.properties -client
where
In order to run the BlockViewer application that builds the graph, the following must happen:
Backend: 0) Java needs to be installed 1) You need to run the Neo4j coordinator application separately because this program is using the high availability database. If you are running windows, you need to download and execute this program before starting the jar: /neo4j-enterprise-1.8-windows/neo4j-enterprise-1.8/bin/Neo4jCoordinator.bat This can be downloaded from the Neo4j website! 2) Once that is running, you need to seed the genesis block. Put this file in the directory where the BlockViewer.jar resides: http://blockchain.info/rawblock/000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f Save it as: "1.json". You have to do this because of a known bug that I wish I had more time to fix, but if you are so inclined, please check out latestDiskBlockIndex() function in GraphBuilder.java 3) Finally, run the application itself: java -jar -Xmx6g BlockViewer.jar -dbPath ../graph.db/ -configPath ../neo4j.properties -validate false -low -high (There are several more flags that can be set... an easy way to test that things are working is to use the -client flag so no building happens but just starts the database). 4) If you are going to be exporting the visualizations, you need to have a mysql database setup. Also, look at the export code to determine what stuff you actually want exported (pdf, gexf, png, etc). It loads it as a LONGBLOB into a mysql table.
Frontend: If you are interested in running the frontend application that allows visualization in the browser, it requires a few environment variables to be set: 0) Nodejs needs to be installed and its dependencies (npm install) // Since you are hosting a website, this makes it so you can run a website on port 80 without having to do it as root by running it on 8080 sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080 // It has a logger from http://loggly.com/ if you are interested in loging frontend activity export logsubdomain=??? export loguser=??? export logpass=??? export logtoken=??? // It requires a mysql server export sqlhost=10.0.0.1 export sqluser=root export sqlpass=??? export sqldatabase=blockviewer
Known Issue: Gephi toolkit has a known problem when casting the ID's to Long datatypes. I reported and have been working with them for some time in getting it resolved: https://github.com/gephi/gephi/issues/707 They just now got around to fixing it, but my dirty hack is being used in the meantime. There is a memory leak when exporting graph visualizations. It is occuring in the Neo4jImporter importDatabase function. I modified the source code of the importer so it doesn't have to close the database connection and repoen it upon each import. By keeping it open, when i clear the graph workspace, some kind of memory is not being released. Over time, the memory fills up and eventually results in an OutOfMemoryError exception. The unmodified, original importer (which also doesn't allow users to traverse through time which I added), can be found here -> https://github.com/gephi/gephi-plugins/blob/neo4j-plugin/Neo4jPlugin/src/org/gephi/neo4j/plugin/impl/Neo4jImporterImpl.java#L96 Relationships between the owner nodes are only being expressed with one transaction - even if there are more interactions between owners. This process takes place in the relinkOwners function under GraphBuilder.java
Issues are being tracked in Github.
I'm here to answer any and all questions and ideas. If you would like to contribute to this project, please let me know! It's very much in its infancy, there is lots of room for improvement.
MIT License
Author 2012 - John Russell
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.