I am following this guide:
How to Build a Private Ethereum Blockchain
Live data about Ethereum appears, as shown below. When I did it (6-12-17), Ethers were worth $390 each, with a total market capitalization around $36 B. This makes Ethereum the second largest cryptocurrency--only Bitcoin is larger, with a market cap of about $47 B.
In the etherscan.io page, in the top center, hover the mouse over BLOCKCHAIN and click "View Pending Txns".
A list of pending transactions appears, as shown below. When I did it in July, 2016, there were typically 9 pending transactions, and none more than 30 seconds old.
As you can see, Ethereum is far more active now, with hundreds of pending transactions
In the etherscan.io page, in the top right, click CHARTS.
On the next page, scroll down and click "Block Count and Rewards Chart".
A chart appears, as shown below. As you can see, Ethereum has approximately 6000 blocks per day -- approximately one every 30 seconds.
sudo apt-get update
Execute this command
to install C and Go compilers.
sudo apt-get install -y build-essential
wget https://storage.googleapis.com/golang/go1.12.1.linux-amd64.tar.gz
tar -xvf go1.12.1.linux-amd64.tar.gz
sudo mv go /usr/local
Execute this command
to automatically
set some environment variables
on each login.
nano ~/.profile
At the end of this file, add these three lines,
as shown below.
export GOROOT=/usr/local/go
export GOPATH=$HOME
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
Save the file with Ctrl+X, Y, Enter.
Execute this command to actually set the variables:
source ~/.profile
Execute these commands to clone the Ethereum
source code and compile it.
cd
git clone https://github.com/ethereum/go-ethereum
cd go-ethereum
make geth
~/go-ethereum/build/bin/geth version
You should see information about
geth, as shown below.
Execute this command:
~/go-ethereum/build/bin/geth account new
You need to enter a passphrase twice.
For this project, I recommend using
P@ssw0rd
Obviously, if you get real Ether worth real money, you need to use a more secure passphrase.
You see an Address, as shown below. This is your account's public key.
cd
mkdir eth-test
cd eth-test
nano genesis.json
Paste in this code. Replace the address in the line
beginning with "alloc" with your own Address.
{
"config": {
"chainId": 13,
"homesteadBlock": 0,
"eip155Block": 0,
"eip158Block": 0
},
"difficulty": "200000",
"gasLimit": "2100000",
"alloc": {
"554a6f4c0aac072ab5a5b90d1a815dc0cc877742": { "balance": "100000000" }
}
}
Save the file with Ctrl+X, Y, Enter.
~/go-ethereum/build/bin/geth init genesis.json
You see messages, ending with
"Successfully wrote genesis state",
as shown
below.
cd
ls -al
You see a hidden folder named
.ethereum,
as shown below.
Execute these commands to move into the .ethereum directory and see what's there.
cd .ethereum
ls -al
Two folders are here: geth and
keystore.
Execute these commands to move into the keystore directory and see what's there.
cd keystore
ls -al
There's only one file here,
as shown below.
cat that file to see its contents. This is where your account is stored. The "address" value matches the value you saw earlier when you created this account. The private key is here, encrypted with your passphrase.
Execute these commands to move into the geth directory and see what's there.
cd ../geth
ls -al
These folders contain blockchain data.
These folders will grow when blocks are
mined and the blockchain gets
longer.
To start mining, execute this command:
~/go-ethereum/build/bin/geth --mine --nodiscover --maxpeers 0 --networkid 13 -rpc -rpccorsdomain "*" --miner.threads 4
Here's a description of those command-line
arguments, from
How to Build a Private Ethereum Blockchain
.
Geth starts, as shown below. It begins creating a "DAG". The DAG is a 1 GB file used for "proof of work", as explained here.
THIS CAN TAKE HOURS TO COMPLETE
First it counts up from 0% to 100% fairly quickly, as shown below.
Wait for the DAG to be built. When it's done, your server will start mining blocks, as shown below.
This is now a functioning blockchain, mining and listening for RPC commands.
Leave this window open.
Capture a full-screen image.
YOU MUST SUBMIT A FULL-SCREEN IMAGE FOR FULL CREDIT!
Save the image with the filename "YOUR NAME Proj 11a", replacing "YOUR NAME" with your real name.
In the new window, execute this command:
curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":67}' http://localhost:8545
This shows you the version of geth you
are using,
as shown below.
curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":83}' http://localhost:8545
The "result" shows the current block
number on the blockchain.
Wait 15-30 seconds and repeat the command.
You should see the block number increasing, as shown below. In my case, the block number increased from 0x8d to 0x8f.
Geth will automatically adjust the mining difficulty to make the mining rate stay near 15 seconds per block.
curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0x8f", true],"id":1}' http://localhost:8545
The reply shows many details about that
block, including the "difficulty",
as shown below. (Your difficulty will
probably be different--it is automatically
adjusted.)
curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0x1", true],"id":1}' http://localhost:8545
The "difficulty" of this block was probably
different from the more recent block,
as shown below.
curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0x554a6f4c0aac072ab5a5b90d1a815dc0cc877742", "latest"],"id":1}' http://localhost:8545
Your balance appears, as a large hexadecimal value,
as outlined in green in the image below.
Capture a full-screen image.
YOU MUST SUBMIT A FULL-SCREEN IMAGE FOR FULL CREDIT!
Save the image with the filename "YOUR NAME Proj 11b", replacing "YOUR NAME" with your real name.
1 ether = 10^18 wei.
In the unused Terminal window, execute these commands, inserting your balance in the second line:
python
0x456391824ae9e100 / 10**18
exit()
Your balance appears,
as shown below. Mine was 365 Ether. Yours
may be different--you earn 5 Ether for each
block you mine.