Public | Automated Build

Last pushed: a year ago
Short Description
Ethereum testnet miner container. Simple, efficient and also the smallest (92MB)
Full Description

= Docker container: Ethereum testnet miner
Chevdor chevdor@gmail.com
v1.5.0, 2016-04-30
:toc:
:source-highlighter: pygments // coderay, highlightjs, prettify, and pygments.
:doctype: Article

NOTE: If you read this from Docker Hub, you will find reading from https://github.com/chevdor/ethereum-testnet-miner as +asciidoc+ is better supported there.

NOTE: You can find this docker container on Docker Hub: https://hub.docker.com/r/chevdor/ethereum-testnet-miner/

== In a rush or impatient ?

In a rush and just want to 'see it work' ? Run that:

[source,shell,numbered]

docker run -it \
   -v /Users/<yourname>/ethdatadir/:/ethdata/datadir \
   chevdor/ethereum-testnet-miner:stable

If you already have a testnet datadir, you can copy it into +/Users/<yourname>/ethdatadir/+ before you start. That will speed up things a lot. If not, first you will have to wait for the download of the testnet blockchain. That can take a while. To that, you will have to wait between 5 and 10 minutes depdending on your machine, until the DAG is built. So be patient...

[Intro]
== Intro
If you want to test or develop with the Ethereum network, you will probably want to get some Ether (ETH or Ξ) on the testnet and run your testing there.
Mining on the testnet does not require a GPU and you can min all fine with a regular CPU.

WARNING: Testnet Ether has no value. It cannot be sold/bought.

This docker container provides an easy way to get started. The only requirement is a working internet connection. You may run the container without any option and it will run fine. However, you probably want to provide at least the 2 following parameters:

. A volume where the blockchain will be stored. If you don´t, the blockchain will be lost when you destroy the contaniner.
. Your testnet Account/Contract address in order to receive your testnet Ether.

All the other parameters are optional.

== Environment Variables

. THREADS
. ETHERBASE
. EXTRADATA
. BLOCKCHAINDL

=== THREADS

Optional.
The more the better. The default value is 8.

[source,shell,numbered]

docker run -it \
   -e THREADS=4 \
   chevdor/ethereum-testnet-miner:stable

=== ETHERBASE

Optional but recommended to be set!
This is the address that receives the rewards in Ether for your miner.

WARNING: Don´t forget to provide it otherwise you will mine on an address controlled by me. This is not a big issue and you are free to do this to test but you will not be able to use this Ether for your testing.

[source,shell,numbered]

docker run -it \
   -e ETHERBASE=0x1077c862ed6484C5756ec6A7549BFb570024995C \
   chevdor/ethereum-testnet-miner:stable

=== EXTRADATA

Optional.
You may pass extra data to your miner. See https://github.com/ethereum/go-ethereum/wiki/JavaScript-Console#minersetextra

[source,shell,numbered]

docker run -it \
   -e EXTRADATA="docker eth miner" \
   chevdor/ethereum-testnet-miner:stable

=== BLOCKCHAINDL

Optional. This value is important and can save you time. If you made a backup of the blockchain (a zip that contains the chaindata folder), you may provide it here. This will save you some time for the first start.

Sample use:
[source,shell,numbered]

docker run -it \
   -e BLOCKCHAINDL=http://www.example.com/chaindata.zip \
   chevdor/ethereum-testnet-miner:stable

You can create a proper chaindata backup from the Ethereum datadir folder with the following command:

zip -r -9 chaindata.zip chaindata/

As of may 2016, you will get a zip file that is a little over 1GB.

[Volumes and Folders]
== Volumes & folders

All the data we should care about is located inside the +/ethdata+ folder in the container. it contains mainly 3 interesting sub-folders:

. ipc
. datadir
. ethash

=== /ethdata/ipc
NOTE: The +/ethdata/ipc+ is internal and not exposed as Volume. It contains +geth.ipc+

=== /ethdata/datadir

This is the main data folder. If you do not attach a volume, the whole blockchain will be downloaded from scratch every time. That will take a lonnng time.

WARNING: While not attaching this volume is valid, it is highly recommended to map it to a local folder in order to persist your blockchain.

=== /ethdata/ethash

This folder contains one or more big files required to mine. You are free to mount this folder as volume or not.
If you mount it, you will save it. Not mounting it will 'cost' you 5 to 15 minutes until the DAG can be rebuilt.
I saw around 8min with 8 cores, 15min with 4 cores...

See also https://github.com/ethereum/wiki/wiki/Ethash-DAG

WARNING: DO NOT MOUNT THIS VOLUME FOR NOW. THERE IS A KNOWN ISSUE AT THE MOMENT, MOUNTING IT WILL CRASH WHEN THE DAG IS CREATED. See https://github.com/ethereum/go-ethereum/issues/1572

Docker Pull Command
Owner
chevdor
Source Repository

Comments (0)