Code Monkey home page Code Monkey logo

eblocpoa's Introduction

Proof-of-Authority Private Ethereum Network (eBlocPOA)

Dashboard: http://ebloc.cmpe.boun.edu.tr:3015/

Explorer: http://ebloc.cmpe.boun.edu.tr:8000/

Preinstallations

Installation Instructions for Mac

Pre-requirements

sudo npm install npm pm2 -g
brew install go

Geth Installation building from source

git clone https://github.com/ethereum/go-ethereum
cd go-ethereum
make geth

⚠️ If something went wrong during building from source, install go-ethereum using Homebrew tap. ⚠️

Run the following commands to add the tap and install geth:

brew tap ethereum/ethereum
brew install ethereum

Installation Instructions for Linux

Node.js and Node Package Manager(npm) installation

sudo apt-get install nodejs
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo npm install pm2 -g
sudo ln -s /usr/bin/nodejs /usr/bin/node
sudo add-apt-repository ppa:gophers/archive
sudo apt-get update
sudo apt-get install golang-1.10-go
  • Put this line export PATH=$PATH:/usr/lib/go-1.10/bin into $HOME/.profile file and do source $HOME/.profile

Geth Installation

Pre-requirements
sudo apt-get install git
sudo apt-get install -y build-essential libgmp3-dev golang
Building from source
git clone https://github.com/ethereum/go-ethereum 
cd go-ethereum/
git pull
make geth

⚠️ If something went wrong during building from source install go-ethereum from PPA ⚠️

sudo apt-get install software-properties-common
sudo add-apt-repository -y ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install ethereum

Do following for both Linux and Mac

After go-ethereum is installed, copy geth located under go-ethereum/build/bin into /usr/local/bin:

$ ls go-ethereum/build/bin
geth
$ sudo cp build/bin/geth /usr/local/bin/
$ which geth
/usr/local/bin/geth

Please note that Geth version should be greater or equal than 1.8.15.

$ geth version|grep "Version: 1"
Version: 1.8.15-stable

Now you can jump to eBloc Setup on Linux and macOS.

Please note that to update geth, please enter into go-ethereum directory and do:
git pull
make geth
sudo cp build/bin/geth /usr/local/bin/

if you face with any merging issues please do following:

latestTag=$(git describe --tags)

git describe --tags #returns most recent tag
git checkout $latestTag
make geth

eBloc Setup on Linux and macOS

Downloading

cd $HOME 
git clone https://github.com/ebloc/eblocPOA.git

cd eblocPOA
git clone https://github.com/cubedro/eth-net-intelligence-api

cd eth-net-intelligence-api
npm install

Initialises a new genesis block and definition for the network

Navigate into eblocPOA directory.

⚠️ Do ./initialize.sh only once. You do not need to do it again ⚠️

./initialize.sh

Server run (Always run with sudo)

sudo ./server.sh
  • If you want to kill your server please do: sudo killall geth
  • You can keep track of output of your geth-server by running following: sudo tail -f gethServer.out 
$ sudo tail -f gethServer.out
Password:
INFO [02-12|16:22:34] Imported new chain segment               blocks=1  txs=0 mgas=0.000 elapsed=503.882µs mgasps=0.000  number=111203 hash=582a44…6e15dd
INFO [02-12|16:22:49] Imported new chain segment               blocks=1  txs=0 mgas=0.000 elapsed=491.377µs mgasps=0.000  number=111204 hash=b752ec…a0725d

Client run (geth console)

./client.sh

If you are successfully connected into eblocPOA network inside geth console; peerCount should return 1 or more, after running net command.


Create an Ethereum Account

Creating an account:

$ cd eblocPOA
$ eblocPath="$PWD"
$ geth --datadir="$eblocPath" account new
Your new account is locked with a password. Please give a password. Do not forget this password.
Passphrase:
Repeat passphrase:
Address: {a0a50a64cac0744dea5287d1025b8ef28aeff36e}

Your new account is locked with a password. Please give a password. Do not forget this password. Please enter a difficult passphrase for your account.

You should see your Keystore File (UTC / JSON)under keystore directory.

[~/eblocPOA]$ ls keystore
UTC--2018-02-14T10-46-54.423218000Z--a0a50a64cac0744dea5287d1025b8ef28aeff36e

On the console, use:

You can also create your Ethereum account inside your geth-client. Here your Keystore File will be created with root permission, eBlocWallet will not able to unlock it.

> personal.newAccount()
Passphrase:
Repeat passphrase:
"0x7d334606c71417f944ff8ba5c09e3672066244f8"
> eth.accounts
["0x7d334606c71417f944ff8ba5c09e3672066244f8"]

Now you should see your Keystore File (UTC / JSON)under private/keystore directory.

[~/eblocPOA]$ ls private/keystore
UTC--2018-02-14T11-00-59.995395000Z--7d334606c71417f944ff8ba5c09e3672066244f8

To give open acccess to the keystore file:

sudo chown -R $(whoami) private/keystore/UTC--...

How to attach to eBloc Network Status

You can see your node on eBloc Network Status (http://ebloc.cmpe.boun.edu.tr:3015). Setup is done when you run ./initialize.sh. If you face with any issue please see the guide.

To Run

  • Please open stats.sh file under eblocPOAdirectory. Write your unique name instead of mynameis.

  • ⚠️ Change DATADIR variable with path for eth-net-intelligence-api directory ⚠️

  • ⚠️ geth-server should be running on the background ⚠️

Finally you should run following command

./stats.sh
  • sudo pm2 show app should return some output starting with "status │ online".

Now, you should see your node on http://ebloc.cmpe.boun.edu.tr:3015.


Access your Ethereum Account using eBlocWallet

In order to use eBlocWallet, first sudo ./server.sh should be executed, hence geth-server should run on the background.

Later, open (http://ebloc.cmpe.boun.edu.tr:3002). Then on the right top corner press:

(), => Add Custom Node => Save & Use Custom Node.

Now if the read warning message is removed, your eBlocWallet is connected to your geth-server.

Send Ether and Tokes => Select Keystore File (UTC / JSON)=>SELECT WALLET FILE (Your wallet is located under eblocPOA/keystore name starting with UTC) => Unlock

screen shot 2018-02-12 at 13 29 13

Later you should see your account information (balance, account, etc).

screen shot 2018-02-12 at 13 38 48


Helpful commands on geth client

Please try following commands on your geth-client console.

Welcome to the Geth JavaScript console!

instance: Geth/v1.7.3-stable/darwin-amd64/go1.9.2
 modules: admin:1.0 clique:1.0 debug:1.0 eth:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 txpool:1.0 web3:1.0

> net
{
  listening: true,
  peerCount: 1,
  version: "23422",
  getListening: function(callback),
  getPeerCount: function(callback),
  getVersion: function(callback)
}

# How to check list of accounts
> eth.accounts
["0x3b027ff2d229dd1c7918910dee32048f5f65b70d", "0x472eea7de6a43b6e55d8be84d5d29879df42a46c"]

> sender=eth.accounts[0]
"0x3b027ff2d229dd1c7918910dee32048f5f65b70d"

> reciever=eth.accounts[1]
"0x472eea7de6a43b6e55d8be84d5d29879df42a46c"

# How to check your balance
> web3.fromWei(eth.getBalance(sender))
100

# How to unlock your Ethereum account
> personal.unlockAccount(sender)
Unlock account 0x3b027ff2d229dd1c7918910dee32048f5f65b70d
Passphrase:
true

# How to send ether to another account
> eth.sendTransaction({from:sender, to:reciever, value: web3.toWei(0.00001, "ether")})
"0xf92c11b6bd80ab12d5d63f7c6909ac7fc45a6b8052c29256dd28bd97b6375f1b"  #This is your transaction receipt.

# How to get receipt of your transaction
> eth.getTransactionReceipt("0xf92c11b6bd80ab12d5d63f7c6909ac7fc45a6b8052c29256dd28bd97b6375f1b")
{
  blockHash: "0x17325837f38ff84c0337db87f13b9496f546645366ebd94c7e78c6a4c0cb5a87",
  blockNumber: 111178,
  contractAddress: null,
  cumulativeGasUsed: 21000,
  from: "0x3b027ff2d229dd1c7918910dee32048f5f65b70d",
  gasUsed: 21000,
  logs: [],
  logsBloom: "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  status: "0x1",
  to: "0x472eea7de6a43b6e55d8be84d5d29879df42a46c",
  transactionHash: "0xf92c11b6bd80ab12d5d63f7c6909ac7fc45a6b8052c29256dd28bd97b6375f1b",
  transactionIndex: 0
}

Some helpful links

eblocpoa's People

Contributors

avatar-lavventura avatar

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.