Code Monkey home page Code Monkey logo

solarchain-dashboard's Introduction

Ethereum blockchain dashboard

This is a simple visualization project for my ApolloChain demo/prototype.

It is based on web3.js and communicates directly with the local Ethereum node running on your machine. You should run your node with parameters like those:

geth --networkid 42 --nodiscover --rpc --rpccorsdomain "*" console

In order to allow the browser to communicate with the RPC API.

To build the project, run:

browserify viz.js -o main.js

Setup

You need to change the account variable to your account address, and contractAddress to the address of the ApolloTrade smart contract deployed on your blockchain.

If your Ethereum client's RPC port is different than the default, change the following line:

var web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));

abi.js contains the ABI for the smart contract.

How it works

The web3 API is used to display some information about the account:

  • Ether balance
  • Current block number

ApolloTrade smart contract functions are called to display specific information:

  • ApolloCoin balance
  • Energy balance

Then a filter is set up to scan all new blocks for transactions and display their contents.

getFunctionHashes() and findFunctionByHash() are used to decode the function hash found in the input parameter for the transaction. Then, web3's SolidityCoder internal class is used to decode the parameters for the function. This allows us to display the details of the ApolloTrade smart contract functions.

solarchain-dashboard's People

Contributors

tomconte 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

Watchers

 avatar  avatar  avatar

solarchain-dashboard's Issues

Command for "Build a project" is not working

Hi Team,

The command for building project i.e. browserify viz.js -o main.js is not working.

When executing it in geth console, it is throwing error [Line 1:12 Unexpected identifier (and 1 more errors) ].
Uploading Command.PNG…
Uploading Issue.PNG…
Uploading Command.PNG…
Uploading Issue.PNG…

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.