Hi
I've been following these instructions:
https://github.com/ethereum/cpp-ethereum/wiki/Building-on-UbuntuAll the commands up until "Start your client" have worked, apart from "export CMAKE_PREFIX_PATH=/opt/Qt/5.5/gcc_64" which did nothing, so I skipped it and carried on. It did loads of downloading, building files etc. But when I type in:
cd ~/cpp-ethereum/build/eth
./eth
It says "No such file or directory".
I get the same message if I try:
cd cpp-ethereum/build/alethzero
./alethzero
I thought having done all the previous commands that those files are there and it's just not finding them for some reason. Or have I missed something?
I then tried going here:
https://github.com/ethereum/cpp-ethereum/wiki/Installing-clientsand put in:
sudo add-apt-repository ppa:ethereum/ethereum-qt
sudo add-apt-repository ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install cpp-ethereum
but that doesn't seem to get things started. I want to try sending eth from one address to another and then see if I can figure out mining
Typing eth says command not found...
So close but yet so far!
Can anyone help?
Thanks
-codingpractice
Comments
On the develop (default) branch of cpp-ethereum git the eth folder seems to be missing. You have to checkout the master branch of the repository
cd cpp-ethereum && git checkout master
Remove the old build folder (try with sudo if you don't have permissions):
rm -rf build/
Build cpp-ethereum
mkdir build && cd build && cmake .. && make -j2
You should now have eth available in
~/cpp-ethereum/build/eth
Below you have everything to build cpp-ethereum from scratch on Ubuntu 14.04 including eth
mkdir build && cd build && cmake .. && make -j2
23%] Building CXX object libevmasm/CMakeFiles/evmasm.dir/Assembly.cpp.o
virtual memory exhausted: Cannot allocate memory
make[2]: *** [libdevcrypto/CMakeFiles/devcrypto.dir/WordList.cpp.o] Error 1
make[1]: *** [libdevcrypto/CMakeFiles/devcrypto.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 23%] Building CXX object libevmasm/CMakeFiles/evmasm.dir/ControlFlowGraph.cpp.o
[ 24%] Building CXX object libevmasm/CMakeFiles/evmasm.dir/AssemblyItem.cpp.o
[ 24%] Building CXX object libevmasm/CMakeFiles/evmasm.dir/ExpressionClasses.cpp.o
[ 24%] Building CXX object libevmasm/CMakeFiles/evmasm.dir/KnownState.cpp.o
[ 24%] Building CXX object libevmasm/CMakeFiles/evmasm.dir/GasMeter.cpp.o
[ 24%] Building CXX object libevmasm/CMakeFiles/evmasm.dir/PathGasMeter.cpp.o
[ 25%] Building CXX object libevmasm/CMakeFiles/evmasm.dir/BlockDeduplicator.cpp.o
[ 25%] Building CXX object libevmasm/CMakeFiles/evmasm.dir/ConstantOptimiser.cpp.o
[ 25%] Building CXX object libevmasm/CMakeFiles/evmasm.dir/CommonSubexpressionEliminator.cpp.o
[ 25%] Building CXX object libevmasm/CMakeFiles/evmasm.dir/SemanticInformation.cpp.o
Linking CXX shared library libevmasm.so
[ 25%] Built target evmasm
make: *** [all] Error 2
I doubled the RAM (using digital ocean VPS) but got the same error again. Also
rm -rf build/ doesn't seem to do anything.
If I paste in your full set of instructions I get the same memory exhaustion error.
Any help would be much appreciated thanks!
the
rm -rf ~/cpp-ethereum/build
should remove the old build directory.Now you can try again, with a clean, non-existent build directory and run the following from inside your cpp-ethereum folder:
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DETHASHCL=1 -DEVMJIT=0 -DTESTS=0
and after this
make install
Also, for the virtual memory exhausted issue, you should check out this tutorial from digitalocean:
https://digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04
https://github.com/ethereum/cpp-ethereum/wiki/Building-on-Ubuntu
Grabbed the source for:
git clone https://github.com/ethereum/cpp-ethereum-cmake
git clone https://github.com/ethereum/cpp-ethereum
Then followed your instructions:
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DETHASHCL=1 -DEVMJIT=0 -DTESTS=0
make install
Make install got all the way though 100% (rather than getting stuck at 23% with the memory problem). So it seems to have worked, except when I go back to these instructions https://github.com/ethereum/cpp-ethereum/wiki/Building-on-Ubuntu
And try starting the client with:
cd ~/cpp-ethereum/build/eth
./eth
It still says, no such file or directory. From my terminal window:
[email protected]:~/cpp-ethereum/build# cd ~/cpp-ethereum/build/eth
-bash: cd: /root/cpp-ethereum/build/eth: No such file or directory
Should I have entered:
git checkout master
from within ~/cpp-ethereum/
before entering?:
mkdir build && cd build
Try again from the ethereum-cpp folder and after
git checkout master
typels eth
If you have a list of files as the output then you're ok and you should proceed with the build, but if you have
ls: cannot access [something]
then you're not on the right track.Ok, so created pw, got transaction signer, mining beneficiary
One thing it has said:
12:17:47|p2p UPnP device not found.
If I try following these
https://github.com/ethereum/cpp-ethereum/wiki/Using-Ethereum-CLI-Client
typing:
eth
nothing happens, or typing:
--import-presale < file >
(replacing the word "file" with the filename) doesn't do anything either.
How to get these commands working?
Thank you!
Edit: Hold up, pasted in [OPTIONS] and getting a load of stuff spat out. hmmm
do I need to type in the full:
Usage eth [OPTIONS] < remote-host >
replacing remote-host with my IP?
eth
[OPTIONS]
ℹ 12:26:04|eth SLOW IMPORT: #d3f3c877… # 59679
ℹ 12:26:04|eth Import took: 1.34127
ℹ 12:26:04|eth preliminaryChecks: 0.000199
ℹ 12:26:04|eth enactment: 0.000613
ℹ 12:26:04|eth collation: 3e-06
ℹ 12:26:04|eth writing: 1.4e-05
ℹ 12:26:04|eth checkBest: 1.34024
ℹ 12:26:04|eth 0 transactions
ℹ 12:26:04|eth 0 gas used
⚡ 12:26:04|eth Block import 59679 1341 ms
ℹ 12:26:21|eth SLOW IMPORT: #aa68283e… # 60588
ℹ 12:26:21|eth Import took: 2.73518
ℹ 12:26:21|eth preliminaryChecks: 0.00017
ℹ 12:26:21|eth enactment: 0.000445
ℹ 12:26:21|eth collation: 2.1e-05
ℹ 12:26:21|eth writing: 1.4e-05
ℹ 12:26:21|eth checkBest: 2.73418
ℹ 12:26:21|eth 0 transactions
ℹ 12:26:21|eth 0 gas used
⚡ 12:26:21|eth Block import 60588 2736 ms
ℹ 12:26:32|eth SLOW IMPORT: #bffd7911… # 61046
ℹ 12:26:32|eth Import took: 11.0567
ℹ 12:26:32|eth preliminaryChecks: 0.000117
ℹ 12:26:32|eth enactment: 0.000314
ℹ 12:26:32|eth collation: 2e-06
ℹ 12:26:32|eth writing: 1.4e-05
ℹ 12:26:32|eth checkBest: 11.0556
ℹ 12:26:32|eth 0 transactions
ℹ 12:26:32|eth 0 gas used
⚡ 12:26:32|eth Block import 61046 11057 ms
--import-presale < ethereum_wallet_backup.json>
-h
eth
✘ 12:32:33|verifier0 BlockQueue missing our job: was there a GM?
--import-presale < ethereum_wallet_backup.json>
eth
--import-presale < ethereum_wallet_backup.json>
doesn't respond to any commands, I'm stumped.
UPnP device not found
means usually that you haven't got an UPnP compliant exit node (router/gateway etc) or that you are using a direct connection to the Internet.First of all eth is an application to which you pass some variables or options, as described in the documentation and it has a sort of dual purpose: on one hand it is a node on its own and can act like a wallet, make transactions, hold the blockchain and so on... but it also acts like a miner that does work with the machine's resources. And in fact this is how you solo mine.
GPUs with less then 2GB of memory are not recommended for mining ethereum
Regardless of what i'm describing below, you should have screen installed because it's helpful to run background services, so:
sudo apt-get install screen -y
First of all enter the following and let the blockchain sync:
~/cpp-ethereum/build/eth/eth -b --frontier --mining off -v 3
When the SLOW IMPORT or the current blockNumber (#somenumber) that you will see onscreen reaches the current blockNumber ( you can check with https://etherchain.org ) you can exit eth by pressing
CTRL + C
up-to 5 consecutive times. Now you can start the mining procedure.GPU / Solo mining
with n GPUs (replace n with your actual GPU count, ex: 2 if you have 2 ATI Video Cards) If the above is working for your needs you can now run close eth and restart it in screen: and view the current status of the app by runningscreen -x eth
you can detach from screen by pressing
CTRL + a
thend
to quit screen and close the app runing inside, instead of detaching, press
CTRL + C
CPU / Solo mining
If the above is working for your needs you can now run close eth and restart it in screen: and view the current status of the app by runningscreen -x eth
you can detach from screen by pressing
CTRL + a
thend
to quit screen and close the app runing inside, instead of detaching, press
CTRL + C
When you have multiple miners and want them all to mine in a local or remote farm then you should have a central node running eth but with no mining ( for the examples below i will use X.X.X.X as the IP address of the node, but you will have to use your own and make sure no firewall is giving you trouble with the 8545 port ) : and view the current status of the app by running
screen -x ethnode
you can detach from screen by pressing
CTRL + a
thend
to quit screen and close the app runing inside, instead of detaching, press
CTRL + C
We will now use ethminer for mining
~/cpp-ethereum/build/ethminer/ethminer
GPU Solo mining on a FARM
with n GPUs (replace n with your actual GPU count, ex: 2 if you have 2 ATI Video Cards) :CPU Solo mining on a FARM
View the current status of the app by runningscreen -x ethminer
you can detach from screen by pressing
CTRL + a
thend
to quit screen and close the app runing inside, instead of detaching, press
CTRL + C
On the other side of the fence you have pooled mining (this is great if you don't have a lot of hashpower because it uses a PPLNS payment system and it's similar to the FARM mode described above)
GPU / Pooled mining
with n GPUs (replace n with your actual GPU count, ex: 2 if you have 2 ATI Video Cards) :CPU / Pooled mining
View the current status of the app by runningscreen -x ethminer
you can detach from screen by pressing
CTRL + a
thend
to quit screen and close the app runing inside, instead of detaching, press
CTRL + C
If your hashrate is > 0.1 MHs, you can pool mine and get payouts.NOTE: If you are GPU mining and the machine is a dedicated miner, then you should type this before you start mining, so that you can get the most out of your card (careful with the temperatures):
export GPU_MAX_ALLOC_PERCENT=95
Sorry if I missed anything, but you should have all you need to start mining and then some
Lots of luck,
If I enter the command before starting the client and entering the frontier, I get:
[email protected]:~# eth -b --frontier --mining off -v 3
eth: error while loading shared libraries: libweb3jsonrpc.so: cannot open shared object file: No such file or directory
If I start the client I get the same problem as previously - nothing happens after entering a command:
[email protected]:~# cd ~/cpp-ethereum/build/eth
[email protected]:~/cpp-ethereum/build/eth# ./eth
(++)Ethereum
Beware. You're entering the Frontier!
ℹ 20:17:43|eth Reading /root/.web3/keys/7f25faf6-efa8-543a-8e32-3359ac70c0f9.json
ℹ 20:17:44|eth Opened blockchain DB. Latest: #04f0fb29… (rebuild not needed)
ℹ 20:17:44|eth Opened state DB.
Please enter your MASTER password:
Ethereum (++) 0.9.41
Code by Gav Wood et al, (c) 2013, 2014, 2015.
Transaction Signer: stringofnumbersremovedforthispost
(stringofnumbersremovedforthispost)
Mining Beneficiary: stringofnumbersremovedforthispost (stringofnumbersremovedforthispost)
Foundation: stringofnumbersremovedforthispost (stringofnumbersremovedforthispost)
ℹ 20:18:08|p2p UPnP device not found.
Node ID: enode://acf1d9789045ae22a74671891cdec60b1b3ca70707b7effc1ab8a09225d26c5c4[email protected]0.0.0.0:0
eth -b --frontier --mining off -v 3
☍ ℹ 20:37:00|eth Imported and best 784979965175564786 (# 205523 ). Has 0 siblings. Route: [#2c6ec07b…, #19fe16ec…]
⧫ ℹ 20:37:00|eth 1 blocks imported in 2 ms ( 343.407 blocks/s)
~/cpp-ethereum/build/eth/eth -b --frontier --mining on -G -t n -F http://127.0.0.1:8545 -v 3
^C^C ⚡ 20:38:06|eth Stop worker 407 ms
ℹ 20:38:06|eth Closing blockchain DB
ℹ 20:38:06|eth Closing state DB
⚡ 20:38:06|ethsync Worker stopping 442 ms
⚡ 20:38:06|p2p Worker stopping 442 ms
[email protected]:~/cpp-ethereum/build/eth# ^C
[email protected]:~/cpp-ethereum/build/eth# ~/cpp-ethereum/build/eth/eth -b --frontier --mining on -G -t n -F http://127.0.0.1:8545 -v 3
Bad -t option: n
terminate called after throwing an instance of 'boost::exception_detail::clone_impl'
what(): std::exception
Aborted (core dumped)
I've got 2GB RAM on the VPS btw. Thought I'd get it going trying GPU mining and then once working, resize the droplet.
So replace the n
Thanks for the help anyway, it was educational and hopefully useful to others here too.
JSON-RPC problem. Probably couldn't connect. Retrying in 1...
miner 16:10:00|eth Getting work package...
✘ 16:10:00|eth Failed to submit hashrate.
✘ 16:10:00|eth Dynamic exception type: N7jsonrpc16JsonRpcExceptionE
std::exception::what: Exception -32003 : Client connector error: libcurl error: 7 -> Could not connect to http://127.0.0.1:8545