Getting began with ethereum

I’m working on ubuntu so the instructions below mostly apply there and similar debian-like systems. If you’re on Windows or OSX, it shouldn’t be too hard to install the required dependencies, I assume they’re welnu documented for those platforms.

You need geth (this is the Go ethereum implementation) and solc (this is a compiler you need to compile wise contracts written ter solidity). On Ubuntu (14.04), you can get thesis spil goes after.

You will run your clever contracts on a network where miners will execute your brainy contracts. Ter a production script this would be the actual Ethereum network but while testing/experimenting it’s better to use a testnet:

  • it won’t cost you actual ether
  • you have more control overheen the execution
  • execution may be quicker (not sure about this)

There’s a global testnet that you can join (geth –testnet) but you can also run your downright standalone private testnet. I choose the latter: it’s lighter to control, you control the mining of your contracts and you don’t need to commence with downloading the multi-gigabyte testnet blockchain.

To create your test network, commence by creating a genesis block which is just a json verkeersopstopping. The “geth init” directive might be of use here but I can’t figure out how it works (and many with mij) so let’s do it by mitt. Create a separate directory for it and create a genesis.json block ter it:

the ‘nonce’ defines the uniqueness of your network, make it something nice and random. Wij’ll also use the ‘alloc’ section straks to give us some ether straks.

Now it’s time to embark the network.

The networkid is also a random number that makes your network unique. Make sure it’s the same with each invocation tho’.

Also make sure you point to the datadir you created (mytestnet) and point to the standard ipc socket. The latter makes it lighter for directions (like the Ethereum Wallet and “geth console”) to connect to your knot.

This network will not be mining by default which is significant to keep te mind.

On the geth console, create an account spil goes after

The hexcode will be your accountid and ‘some pass phrase’ will be your passphrase (duh!).

Now uitgang/terminate geth (control-D on linux) and add your account to mytestnet/genesis.json so that the alloc part looks spil goes after

Of course make sure you substitute the 0x. id with the one just genreted. Now commence geth again spil described earlier and embark mining. This, by itself, will very likely already generate enough coins to do things.

The very first time you do this geth will begin building a DAG. This is a one-time thing and once it’s accomplish you can zekering mining using

if you get annoyed (like mij) by the noisy output and CPU fan gargling. I always thought “DAG” refered to a Directed Acyclic Graph which it indirectly does but it’s primariliy named after the mining algorithm, Dagger Hashimoto.

At this point you should be able to actually run the steps te the tutorial. Just don’t for get to commence the miner again to execute the brainy contract. I’m not going to repeat the entire tutorial here, just the individual steps.

Very first of all, and this is a step I wasgoed missing from the tutorial, make sure your account is unlocked:

Then execute the contract (details are ter the original tutorial)

You should see the contract being created.

If not you may have forgotten to unlock your account. Begin mining to get it executed.

Eventually you should see something like

at which point you can zekering mining again.

Now you can get the result from your contract / dapp:

I project to write a 2nd blog soon about the different options for integrating ethereum with python and project to have a look at solidity, tuinslang, pyethereum and ethjsonrpc

Leave a Reply

Your email address will not be published. Required fields are marked *