ethereum virtual mining

I’m writing a series of posts on the Blockchain Stack, giving simple but fully coded, step by step examples of how each of the element work both independently and collaboratively.This is the second post in the series (1st: Blockchain stack #0: Distributed stack vs LAMP) and will show you how to install Ethereum, mine some Ether and create your first contract.There’s three key things I’d say to newbies about Ethereum out of the blocks: I think Ethereum and the rest of the stack is best being run from Linux (I use Ubuntu) because a lot of the examples I see out there are for this set up.This should make it easier to hunt for solutions and get advice and help.If you haven’t used Linux before, don’t worry, you’ll use the command line and only need to know a few commands.It’s free and pretty easy to setup an Oracle VM using Ubuntu on Windows.When you do it, make sure you allocate at least 150GB of virtual hard drive because the Ethereum node will take a lot of this.Also install the guest additions.
If you already have VM installed, you are probably like me and didn’t give it enough space so you’ll you need to resize the virtual drive.All of the examples in this series of posts build on top of each other and started with the base Ubuntu 64bit install with Guest Additions.There are various client nodes that can be used, I went for Geth as this seems to be one of the most supported and, along with Parity, is recommended by the Ethereum Foundation.Follow instructions here or just open your linux Terminal and run these commands: You can run the Geth client on various networks.A quick overview: Let’s set up Testnet to sync and in the meantime we can set up Dev network to work on our first contract.This will start Geth up in fast sync mode and it will start downloading the Blockchain.It has completed the sync when it has downloaded the latest header.You can check the latest header on the testnet here and then run this command in the geth console: Once it has finished downloading to the latest header (about 4 hours for me), we can start mining, but we will come back to that later.
There’s a good article here about the fast sync mode for Geth.So that you can crack on, let’s setup a Dev network.You’ll see there are no blocks syncing: That’s it, Dev network is set up :-).We now need to create an account and mine.We are going to use Geth’s Javascript Console using the functions defined here.Geth provides a wrapper for Ethereum’s web3 JavaScript Dapp API and the admin API.minethreads : how many CPU cores to use etherbase : which account to send the Ether too (0 being first in the list from personal.listAccounts) You can leave that running and you should start seeing Ether being mined.Leave that terminal running so that you keep mining Ether to use.Open a new terminal window.We are now going to connect to the client that is running through the miner.Check how much Ether you have.Unlock the account so that you can use it to make your first contract.At anytime you can stop the miner and then reconnect to Geth using the console flag.This starts both the node and the client.
Ok, now you’re rich, let’s make a contract.We will use the Greeter from Ethereum.There has been a lot of changes and improvements since their tutorial was created so a number of the steps do not work, hopefully this will get you going fairly painlessly.No doubt that some point in the future someone will say the same about this one!We will not use the command line compiler as it did not work at the time of writing this for the Greeter contract.litecoin week chartI think more effort is going into maintaining the Ethereum browser compiler and it’s also got more features — so using that is a win win.bitcoin summit 2014 san franciscoCopy this into the Ethereum browser compiler as shown here on the left.wiki bitcoin explorerCopy the text from the right titled ‘Web3 deploy’ to a text file (making sure you have word wrap turned off).fundacion bitcoin chile
You need to specify the text to use in the _greeting variable and Geth didn’t like the “untitled:” additions the editor added.Therefore in the text file, change the following lines: Copy and paste the text file to Geth and run it.Do the same for both the mortal and greeter code.You should see something like this (it can take up to a minute for the ‘mined’ response).You can now test if your first contract works: Anyone else on your Dev network can interact with your contract using this API: Where ABI is the ‘Interface’ field from the browser compiler and Address is the address of the contract you have just created (greeter.address).bitcoin price plnTry opening a new terminal and doing the following, changing the address in the at(…) to the address of your contract: That’s it.bitcoin historical volatility
You’re done with your first contract.Before you go, if testnet has finished its sync, why don’t you now go ahead and repeat all of this on that network?You can mine for Ether like we have done above or you can get it from a faucet provided by the lovely folks at ropsten.be.Don’t forget to set yourself up with a new account on your testnet (personal.newAccount()).You can check the transaction, its block details and when it has been mined on the etherscan website.Enter the account number in the search box and you should see something like this: Where to go for help related to part 1 General: https://gitter.im/ethereum/home Geth: https://gitter.im/ethereum/go-ethereum Solidity: https://gitter.im/ethereum/solidity /r/ethereum/ /ethereum/ Thanks to André Hammen and Griff Green for reviewing.Next in the series is Creating your first ‘domain’ name on Ethereum using ENS (Blockchain stack #2) There’s a team of us that have come together at Ziggify to work on a Blockchain play.