Coder Social home page Coder Social logo

oxy-explorer's Introduction

OXYCOIN Blockchain Explorer

OXYCOIN Explorer version 1.1.1 works in conjunction with the OXYCOIN Core API. It uses Redis for caching data and Freegeoip to parse IP geo-location data.

Prerequisites

These programs and resources are required to install and run OXYCOIN Explorer

  • Nodejs v6.0.0 or higher (https://nodejs.org/) -- Nodejs serves as the underlying engine for code execution.

    curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
    sudo apt-get install -y nodejs
    
  • Redis (http://redis.io) -- Redis is used for caching parsed exchange data.

    sudo apt-get install -y redis-server

  • Freegeoip (https://github.com/fiorix/freegeoip) -- Freegeoip is used by the Network Monitor for IP address geo-location.

    wget https://github.com/fiorix/freegeoip/releases/download/v3.1.5/freegeoip-3.1.5-linux-amd64.tar.gz
    tar -zxf freegeoip-3.1.5-linux-amd64.tar.gz
    ln -s freegeoip-3.1.5-linux-amd64 freegeoip
    nohup ./freegeoip/freegeoip > ./freegeoip/freegeoip.log 2>&1 &
    
  • Bower (http://bower.io/) -- Bower helps to install required JavaScript dependencies.

    sudo npm install -g bower

  • Grunt.js (http://gruntjs.com/) -- Grunt is used to compile the frontend code and serves other functions.

    sudo npm install -g grunt

  • Forever (https://github.com/foreverjs/forever) -- Forever manages the node processes for the Explorer

    sudo npm install -g forever

  • Git (https://github.com/git/git) -- Used for cloning and updating the Explorer

    sudo apt-get install -y git

  • Tool chain components -- Used for compiling dependencies

    sudo apt-get install -y python build-essential automake autoconf libtool

Installation Steps

Clone the Oxycoin Explorer Repository:

git clone https://github.com/Oxycoin/oxy-explorer.git
cd oxy-explorer
npm install
bower install

Build Steps

Frontend

The frontend must be built with Grunt before starting Oxycoin Explorer. Run the following command to compile the frontend components:

grunt compile

Market Watcher

Candlestick data needs to be initialized prior to starting the Explorer. During runtime candlestick data is updated automatically.

To build candlestick data for each exchange run:

grunt candles:build

To update candlestick data manually run after initialization:

grunt candles:update

Configuration

The default config.js file contains all of the configuration settings for the Explorer. These options can be modified according to comments included in configuration file.

Top Accounts

To enable Top Accounts functionality, edit your client node config.json (not the explorer):

{
    "port": 9998,
    "address": "0.0.0.0",
    "version": "0.1.0",
    "fileLogLevel": "info",
    "logFileName": "logs/oxycoin.log",
    "consoleLogLevel": "info",
    "trustProxy": false,
    "topAccounts": false, <--- This line needs to be changed to read true

After the change is made the client node will need to be restarted. (Example):

bash /PATH_TO_NODE_DIR/oxy_manager.bash stop
bash /PATH_TO_NODE_DIR/oxy_manager.bash start

Managing Oxycoin Explorer

To test that Oxycoin Explorer is configured correctly, run the following command:

node app.js

Open: http://localhost:6040, or if its running on a remote system, switch localhost for the external IP Address of the machine.

Once the process is verified as running correctly, CTRL+C and start the process with forever. This will fork the process into the background and automatically recover the process if it fails.

forever start app.js

After the process is started its runtime status and log location can be found by issuing this statement:

forever list

To stop Explorer after it has been started with forever, issue the following command:

forever stop app.js

Tests

Before running any tests, please ensure the Explorer and your client node are configured to run on the same network (mainnet/testnet).

Replace config.js with config.test file from the test directory:

cp test/config.test ./config.js

Replace the config.json for the client node the corresponding file under the test directory:

cp test/config_lisk.json /PATH_TO_NODE_DIR/config.json

Then restart the client node (example):

bash /PATH_TO_NODE_DIR/oxy_manager.bash stop
bash /PATH_TO_NODE_DIR/oxy_manager.bash start

Launch the Explorer (runs on port 6040):

forever start app.js

Run the test suite:

npm test

Run individual tests:

npm test -- test/api/accounts.js
npm test -- test/api/transactions.js

Contributions

License

The MIT License (MIT)

Copyright (c) 2017 Oxycoin
Copyright (c) 2016 4miners.net
Copyright (c) 2016 Lisk
Copyright (c) 2015 Crypti

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.

oxy-explorer's People

Contributors

crypt0jan avatar vekexasia avatar

Watchers

James Cloos avatar Hugo Retief avatar

Forkers

dutchpool yazaihu

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.