All Projects → curvegrid → Toy Block Explorer

curvegrid / Toy Block Explorer

Licence: mit
A blockchain explorer written in Go to learn about building server-side applications that work with the Ethereum blockchain.

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Toy Block Explorer

Awesome Blockchain
⚡️Curated list of resources for the development and applications of blockchain.
Stars: ✭ 937 (+2502.78%)
Mutual labels:  blockchain, ethereum
Ethereum book
精通以太坊 (中文版)
Stars: ✭ 875 (+2330.56%)
Mutual labels:  blockchain, ethereum
Token Core Ios
a blockchain private key management library on iOS
Stars: ✭ 850 (+2261.11%)
Mutual labels:  blockchain, ethereum
Blockchain Anchor
A Node.js library for anchoring data onto the Bitcoin blockchain and confirming anchored data on Bitcoin and Ethereum.
Stars: ✭ 32 (-11.11%)
Mutual labels:  blockchain, ethereum
Go Ethereum
Official Go implementation of the Ethereum protocol
Stars: ✭ 34,169 (+94813.89%)
Mutual labels:  blockchain, ethereum
Gdai.io
gDAI - Gas less DAI transfers by using GSN, Fulcrum and KyberNetwork
Stars: ✭ 26 (-27.78%)
Mutual labels:  blockchain, ethereum
Stromdao Businessobject
Abstract BusinessObject for StromDAO Energy Blockchain. Abstraction layer between blockchain technology and business logic providing energy market related entities and use cases.
Stars: ✭ 10 (-72.22%)
Mutual labels:  blockchain, ethereum
Wavevote
Voting system based on Ethereum
Stars: ✭ 22 (-38.89%)
Mutual labels:  blockchain, ethereum
Blockscout
Blockchain explorer for Ethereum based network and a tool for inspecting and analyzing EVM based blockchains.
Stars: ✭ 913 (+2436.11%)
Mutual labels:  blockchain, ethereum
Ethereumdb
Stars: ✭ 21 (-41.67%)
Mutual labels:  blockchain, ethereum
Aeternity
æternity: solving scalability problems by making sense of state-channels
Stars: ✭ 923 (+2463.89%)
Mutual labels:  blockchain, ethereum
Eth Hodler
A simple DApp & ERC20 token written in Solidity running on the Ethereum blockchain www.hdao.org
Stars: ✭ 31 (-13.89%)
Mutual labels:  blockchain, ethereum
Node
Stampery API for NodeJS. Notarize all your data using the blockchain
Stars: ✭ 23 (-36.11%)
Mutual labels:  blockchain, ethereum
Multy Back
Back-end of the Multy - mobile multy-blockchain wallet.
Stars: ✭ 26 (-27.78%)
Mutual labels:  blockchain, ethereum
Etgate
Ethereum-Tendermint token sending gateway
Stars: ✭ 23 (-36.11%)
Mutual labels:  blockchain, ethereum
Burrow
https://wiki.hyperledger.org/display/burrow
Stars: ✭ 851 (+2263.89%)
Mutual labels:  blockchain, ethereum
Emerald Vault Archive
ARCHIVE. CODE MOVED TO:
Stars: ✭ 18 (-50%)
Mutual labels:  blockchain, ethereum
Blockchain
블록체인 공부 중입니다.
Stars: ✭ 22 (-38.89%)
Mutual labels:  blockchain, ethereum
Weiwallet Android
Wei Wallet is an open source Ethereum wallet for Android
Stars: ✭ 20 (-44.44%)
Mutual labels:  blockchain, ethereum
Privatekeyvault
Make Instructions: Airgapped raspberry pi computer for working with blockchains featuring LUKS full disk encryption and using qr-codes to pass encrypted files and offline transaction instructions across the airgap.
Stars: ✭ 29 (-19.44%)
Mutual labels:  blockchain, ethereum

toy-block-explorer

A blockchain explorer written in Go to learn about building server-side applications that work with the Ethereum blockchain.

Toy Block Explorer

Pre-requisites

You will need to install the following to build and work with this project:

  • Go (also called 'golang') a programming language. Advanced macOS users will probably want to install via Homebrew.
  • Git, a package management system. For macOS users, we again recommend Homebrew. For Windows users, at this point it would be prudent to install Cygwin, which gives you access to many Unix commands, including Git. You will need to ensure that Git is selected during the Cygwin installation process.
  • Geth, the official Ethereum node and command line interface (CLI) tool.
  • This repository and its submodules, which you can install by running:
$ git clone https://github.com/curvegrid/toy-block-explorer.git
$ cd toy-block-explorer
$ git submodule init
$ git submodule update --recursive

Optional components and setup steps include:

  • The go-ethereum libraries are also a pre-requisite, but the included build.sh command will run the required go get command to pull these in for you.
  • abigen and solc are required if you wish to regenerate the erc20.go file from its ERC20Interface.sol source.

How to use this tutorial

This tutorial is broken down into several stages, separated by git branches. The default master branch contains a bare bones web application. Subsequent intermediate branches, step-1, step-2, etc. contain more and more of the block explorer functionality filled in. The complete explorer is in the branch step-final.

The idea is for you to start will the bare bones web application, and build the complete block explorer yourself. If you get stuck, you can always skip ahead of examine the next step's branch for hints or help. Of course, it's up to you, so feel free to start with step-final and work backwards!

You can checkout a specific branch with:

$ git checkout -b step-N

Learn more about working with Git here.

Setting up a local blockchain node for testing purposes

We use the full Geth Ethereum node running in a development mode, since it most closely mimics the operation of a production blockchain node. We've included the Easy Geth Dev Mode set of scripts as a submodule, along with a sample chaindata folder pre-populated with a few transactions, to get you started.

First, ensure the Easy Geth Dev Mode submodule was pulled in correctly:

$ git submodule init
$ git submodule update --recursive

Copy the sample chaindata folder into the submodule:

$ cp -R geth/sample-chaindata geth/easy-geth-dev-mode/chaindata

Run Geth:

$ cd geth/easy-geth-dev-mode
$ ./launch43.sh --ipcdisable --startrpc

A local version of Geth is now running with a JSON RPC endpoint exposed at http://localhost:8545

If you receive an error, geth may still be running. You can check this with:

ps -ef | grep geth

If you still have trouble running geth in this manner, try ./stop43.sh and then ./launch43.sh --ipcdisable --startrpc a few times. You can also try:

geth --dev --datadir ./chaindata --rpc console

You may need to manually send some transactions. For example:

eth.sendTransaction({from: eth.accounts[0], to: eth.accounts[1], value: web3.toWei(300, "ether")})

Once you're finished with Geth, be sure to stop it:

$ ./stop43.sh

Building and running the project

Run the build script:

$ ./build.sh

This will generate a toy-block-explorer executable:

$ ./toy-block-explorer 
2018/06/08 15:02:50 Connecting to Ethereum node at http://localhost:8545
2018/06/08 15:02:50 Web server started on :8080

Try browsing to http://localhost:8080

The toy block explorer has a number of command line options:

$ ./toy-block-explorer -h
Usage of ./toy-block-explorer:
  -ethendpoint string
    	Ethereum node endpoint (default "http://localhost:8545")
  -host string
    	Hostname to bind web server to
  -port int
    	Port to bind web server to (default 8080)
  -templates string
    	Templates glob (default "templates/*")
  -www string
    	Directory to serve (default "www")

If you want to connect it to the Ethereum mainnet, sign up for an Infura account and have the block explorer connect to it instead of your local Geth dev node:

$ ./toy-block-explorer -ethendpoint https://mainnet.infura.io/<API key here>

Licence

MIT

Copyright and credits

Go source files copyright (c) 2018 Curvegrid Inc.

Portions of the HTML based on Bootstrap's samples.

ERC20 Solidity interface based on The Ethereum Wiki's ERC20 Standard page.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].