Git Product home page Git Product logo

exonum-block-explorer's Introduction

WIP

Generic Block Explorer for Exonum-based blockchains

This guide will show you how to use this block explorer with Exonum-based blockchains.

Prerequisites

  1. Rust compiler,
  2. Node.js,
  3. An extension for your web-browser allowing to change CORS headers. This is required because we are going to make cross-domain requests. As of version 0.3, Exonum has no built-in mechanisms to configure Cross-Origin policy. Yo may use, for example, Moesif Origin & CORS Changer for Chrome.

An Exonum-based blockchain application

For the purpose of this example we are going to use a cryptocurrency built using Exonum.

  1. Get and run the cryptocurrency example:
git clone https://github.com/exonum/cryptocurrency.git
cd ./cryptocurrency
cargo run
  1. Go to the ./example,
  2. Send some transactions to the server:
curl -H "Content-Type: application/json" -X POST -d @create-wallet-1.json http://127.0.0.1:8000/api/services/cryptocurrency/v1/wallets

curl -H "Content-Type: application/json" -X POST -d @create-wallet-2.json http://127.0.0.1:8000/api/services/cryptocurrency/v1/wallets

curl -H "Content-Type: application/json" -X POST -d @transfer-funds.json http://127.0.0.1:8000/api/services/cryptocurrency/v1/wallets/transfer

You might want to pause a little between sending the transactions for them to end up in different blocks.

Block explorer

  1. Get and run the block explorer:
git clone https://github.com/nedap/exonum-block-explorer.git
cd ./exonum-block-explorer
npm install
npm start
  1. Navigate to localhost:8080,
  2. IMPORTANT Enable CORS changer (see Prerequisites, item 3),
  3. Refresh the page you must be able to see recent blocks and recent transactions,
  4. Explore!
  5. IMPORTANT Do disable CORS changer after you finished exploring.

Tools used

Vue 2.0, Vuetify

License

exonum-block-explorer is licensed under the MIT License. See LICENSE for details.

exonum-block-explorer's People

Stargazers

Harm Berntsen avatar  avatar

Watchers

Ivan Bohuslavskyi avatar Jasper Kremer avatar James Cloos avatar Harm Berntsen avatar Victor Ermolaev avatar

exonum-block-explorer's Issues

'npm start' failed

root@horizontalvol:~/exonum/exonum-block-explorer# npm start

> [email protected] start /root/exonum/exonum-block-explorer
> webpack-dev-server

/root/exonum/exonum-block-explorer/webpack.config.js:6
let cleanOptions = {
^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:374:25)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at requireConfig (/root/exonum/exonum-block-explorer/node_modules/webpack/bin/convert-argv.js:96:18)
    at /root/exonum/exonum-block-explorer/node_modules/webpack/bin/convert-argv.js:109:17
    at Array.forEach (native)

npm ERR! Linux 4.4.0-92-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "start"
npm ERR! node v4.2.6
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `webpack-dev-server`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script 'webpack-dev-server'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the exonum-block-explorer package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     webpack-dev-server
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs exonum-block-explorer
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls exonum-block-explorer
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /root/exonum/exonum-block-explorer/npm-debug.log

This site can't be reached

root@horizontalvol:~/exonum/exonum-block-explorer# npm start

> [email protected] start /root/exonum/exonum-block-explorer
> webpack-dev-server

Project is running at http://localhost:8080/
webpack output is served from /

ts-loader: Using [email protected] and /root/exonum/exonum-block-explorer/tsconfig.json
Hash: af70828f749354eb8b36
Version: webpack 2.7.0
Time: 21209ms
                                     Asset     Size  Chunks                    Chunk Names
./img/d087ee0e81e19237df4195ad2f012fc9.png  31.4 kB          [emitted]         
./img/6d8b58bec45a4ee344703df6edb1512a.png  71.6 kB          [emitted]         
./img/3b35be9d690e2cd34742dd0f9094b1db.png  56.8 kB          [emitted]         
./img/251ba19534de3eec2e262293aa57682f.png    25 kB          [emitted]         
./img/efc239cd23ca7b3c0caf2eb919ad0f7d.gif  43.3 kB          [emitted]         
                                  index.js  3.57 MB       0  [emitted]  [big]  app
chunk    {0} index.js (app) 1.34 MB [entry] [rendered]
    [1] ./~/vue/dist/vue.js 279 kB {0} [built]
   [22] ./src/index.ts 599 bytes {0} [built]
   [23] (webpack)-dev-server/client?http://localhost:8080 7.95 kB {0} [built]
   [53] ./~/loglevel/lib/loglevel.js 7.86 kB {0} [built]
   [60] ./~/strip-ansi/index.js 161 bytes {0} [built]
   [71] ./src/router.ts 890 bytes {0} [built]
   [72] ./src/store.ts 31 bytes {0} [built]
   [74] ./~/url/url.js 23.3 kB {0} [built]
   [76] ./src/components/Navigation.vue 1.85 kB {0} [built]
   [95] ./~/vuetify/dist/vuetify.js 507 kB {0} [built]
   [97] (webpack)-dev-server/client/overlay.js 3.73 kB {0} [built]
   [98] (webpack)-dev-server/client/socket.js 1.05 kB {0} [built]
  [100] (webpack)/hot nonrecursive ^\.\/log$ 160 bytes {0} [built]
  [101] (webpack)/hot/emitter.js 77 bytes {0} [built]
  [102] multi (webpack)-dev-server/client?http://localhost:8080 ./src/index.ts 40 bytes {0} [built]
     + 88 hidden modules
webpack: Compiled successfully.

I successfully started blockchain explorer. Then type http://x.x.x.x:8080/ (i.e. server ip, not localhost:8080) in browser and nothing happened (Chrome shows ERR_CONNECTION_REFUSED). Tried with both CORS enabled and disabled.

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.