Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tomconte/solarchain-dashboard
This is a Bootstrap+jQuery dashboard using the web3 Ethereum JavaScript API to visualize activity in the SolarChain network.
https://github.com/tomconte/solarchain-dashboard
Last synced: 12 days ago
JSON representation
This is a Bootstrap+jQuery dashboard using the web3 Ethereum JavaScript API to visualize activity in the SolarChain network.
- Host: GitHub
- URL: https://github.com/tomconte/solarchain-dashboard
- Owner: tomconte
- Created: 2016-06-14T18:07:05.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-06-18T15:07:26.000Z (over 8 years ago)
- Last Synced: 2024-10-06T17:06:15.105Z (about 1 month ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 31
- Watchers: 3
- Forks: 28
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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:
``` sh
geth --networkid 42 --nodiscover --rpc --rpccorsdomain "*" console
```In order to allow the browser to communicate with the RPC API.
To build the project, run:
``` sh
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:
``` javascript
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 numberApolloTrade smart contract functions are called to display specific information:
- ApolloCoin balance
- Energy balanceThen 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.