DEV Community

Cover image for Creating a blockchain using Ethereum (part 2)
Ryan
Ryan

Posted on • Edited on

Creating a blockchain using Ethereum (part 2)

Recap

  • I really like crypto, so I created a private Ethereum blockchain and made a miner account.

Check it out here

Mining The First Block

I needed to run a few more code snippets before I could start mining. I reinitialized the genesis file to enable a remote (rpc) server:

geth --rpc --rpcport "8085" --datadir /path/to/data/dir init /path/to/data/genesis.json

Alt Text

Then I simply started the private network and proceeded to mine!

geth --rpc --rpcport "8085" --datadir /path/to/dir --networkid 1234 --nodiscover console

Alt Text

Next I got my account ID using eth.accounts in the console, took a sip of coffee and waited while my ether stacked up.

..............................................................

After less than 5 minutes, I was shocked at how much I had made:

eth.getBalance("account ID")

Alt Text

Which in today's market would come out to roughly 3.82511175e+23 USD

Alt Text

Granted, the difficulty was set to easy and this isn't on the main Ethereum network so it's not real ether, but it got me thinking. What if I used my M1 on the actual network?

Luckily for me there've been plenty of people who have already tried this which saved me the extra effort. Here's an example from BarTech TV

In the video they ended up with a hash rate of around 2.2 MH/s.

How does that stack up against better hardware? An article from 2020:

The latest Nvidia RTX 3090 has a hash rate of 120[MH/s], whereas an ASIC hardware Innosilicon A10 Pro has a hash rate of 500 [MH/s].

With the current GPU trends and mining difficulty, it may take up to half a year or more to mine 1 Ethereum.

So what would a hash of 2.2 MH/s be in USD? I went to a profitability calculator to find out:

Alt Text

Nearly 5 USD Check it out for yourself

Conclusion

This was a fun project that was pretty quick and very simple. Now, it's clear that I won't be an ether millionaire anytime soon, but maybe someone else reading this has the resources and will be inspired to start mining and make a profit. Happy mining!

Top comments (0)