<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ryan</title>
    <description>The latest articles on DEV Community by Ryan (@talemache).</description>
    <link>https://dev.to/talemache</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F554376%2F00bf1a7f-5216-481a-a03d-6c60e83873ee.jpeg</url>
      <title>DEV Community: Ryan</title>
      <link>https://dev.to/talemache</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/talemache"/>
    <language>en</language>
    <item>
      <title>Creating A Full Stack Social Media Platform (part 1)</title>
      <dc:creator>Ryan</dc:creator>
      <pubDate>Fri, 14 May 2021 02:35:56 +0000</pubDate>
      <link>https://dev.to/talemache/creating-a-full-stack-social-media-platform-4eei</link>
      <guid>https://dev.to/talemache/creating-a-full-stack-social-media-platform-4eei</guid>
      <description>&lt;h3&gt;
  
  
  Intro
&lt;/h3&gt;

&lt;p&gt;After creating a &lt;a href="https://dev.to/talemache/creating-a-blockchain-using-ethereum-part-1-4cn9"&gt;blockchain from scratch&lt;/a&gt;, I thought that I'd kick it up a notch and &lt;strong&gt;make my very own social media network&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;This was going to require a lot more time and effort and a &lt;strong&gt;ton&lt;/strong&gt; more coding. So with coffee in hand, some rusty python skills, and years of social media use under my belt, I was ready to begin.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QmRjNHmZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3wb8l9fa5zyrsr0jgpr9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QmRjNHmZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3wb8l9fa5zyrsr0jgpr9.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Soo many tutorials later, I had a good idea of what I needed to do and it seemed surprisingly simple. I found this video by &lt;a href="https://www.youtube.com/channel/UC8butISFwT-Wl7EV0hUK0BQ"&gt;freeCodeCamp.org&lt;/a&gt; particularly useful. &lt;/p&gt;

&lt;h3&gt;
  
  
  Required Installations
&lt;/h3&gt;

&lt;p&gt;First, I checked the version of python on my computer &lt;br&gt;
&lt;code&gt;python3 --version&lt;/code&gt; then installed a few packages using pip:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I had to install a virtual environment to keep track of packages&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SoNnY-V2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e7cra678twd99r2tor4o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SoNnY-V2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e7cra678twd99r2tor4o.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;then started it up. &lt;code&gt;virtual --python=python3.94 myenv&lt;/code&gt; &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QRDGwBOS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3zy8zxox8ilemzpyo5dv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QRDGwBOS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3zy8zxox8ilemzpyo5dv.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Saved the packages to the virtual environment &lt;br&gt;
&lt;code&gt;source myenv/bin/activate&lt;/code&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gOPfbQEn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0fyvszk061pu7goxsicb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gOPfbQEn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0fyvszk061pu7goxsicb.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;once inside &lt;strong&gt;myenv&lt;/strong&gt;, I installed flask. &lt;br&gt;
&lt;code&gt;pip install flask&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--c99NZpyr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p9pzbteae8vic5k1lrf3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--c99NZpyr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p9pzbteae8vic5k1lrf3.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Pretty straightforward. Now it was time to write some code, but it will have to wait until the next installment &lt;a href="https://www.instagram.com/explore/tags/irl/"&gt;#irl&lt;/a&gt;. Happy Coding!&lt;/p&gt;

</description>
      <category>python</category>
      <category>flask</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Creating a blockchain using Ethereum (part 2)</title>
      <dc:creator>Ryan</dc:creator>
      <pubDate>Wed, 12 May 2021 18:02:48 +0000</pubDate>
      <link>https://dev.to/talemache/creating-a-blockchain-using-ethereum-part-2-2i3a</link>
      <guid>https://dev.to/talemache/creating-a-blockchain-using-ethereum-part-2-2i3a</guid>
      <description>&lt;h3&gt;
  
  
  Recap
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;I really like crypto, so I created a private Ethereum blockchain and made a miner account.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Check it out &lt;em&gt;&lt;a href="https://dev.to/talemache/creating-a-blockchain-using-ethereum-part-1-4cn9"&gt;here&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Mining The First Block
&lt;/h3&gt;

&lt;p&gt;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:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;geth --rpc --rpcport "8085" --datadir /path/to/data/dir init /path/to/data/genesis.json&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbl2bmgfa5alvq4lif3ly.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbl2bmgfa5alvq4lif3ly.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then I simply started the private network and proceeded to mine!&lt;/p&gt;

&lt;p&gt;&lt;code&gt;geth --rpc --rpcport "8085" --datadir /path/to/dir --networkid 1234 --nodiscover console&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7ebhy6pxse7b8sifdxsp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7ebhy6pxse7b8sifdxsp.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next I got my account ID using &lt;code&gt;eth.accounts&lt;/code&gt; in the console, took a sip of coffee and waited while my ether stacked up. &lt;/p&gt;

&lt;p&gt;..............................................................&lt;/p&gt;

&lt;p&gt;After less than 5 minutes, I was shocked at how much I had made:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;eth.getBalance("account ID")&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvv3wcr9o5gkiown8fni5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvv3wcr9o5gkiown8fni5.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Which in today's market would come out to roughly 3.82511175e+23 USD&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3pkpk9uq65i80u8hrux6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3pkpk9uq65i80u8hrux6.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;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 &lt;em&gt;actual&lt;/em&gt; network? &lt;/p&gt;

&lt;p&gt;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 &lt;a href="https://www.youtube.com/watch?v=TLImyWDXS6I" rel="noopener noreferrer"&gt;BarTech TV&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;In the video they ended up with a hash rate of around 2.2 MH/s. &lt;/p&gt;

&lt;p&gt;How does that stack up against better hardware? An &lt;a href="https://zipmex.com/learn/how-long-to-mine-ethereum/" rel="noopener noreferrer"&gt;article&lt;/a&gt; from 2020:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;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]. &lt;/p&gt;

&lt;p&gt;With the current GPU trends and mining difficulty, it may take up to &lt;strong&gt;half a year or more&lt;/strong&gt; to mine 1 Ethereum.&lt;/p&gt;
&lt;/blockquote&gt;

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

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzc6w32hfrw0i4i37635h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzc6w32hfrw0i4i37635h.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Nearly 5 USD&lt;/strong&gt; &lt;em&gt;&lt;a href="https://www.cryptocompare.com/mining/calculator/eth?HashingPower=2.2&amp;amp;HashingUnit=MH%2Fs&amp;amp;PowerConsumption=140&amp;amp;CostPerkWh=0.12&amp;amp;MiningPoolFee=1" rel="noopener noreferrer"&gt;Check it out for yourself&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;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! &lt;/p&gt;

</description>
      <category>go</category>
      <category>blockchain</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Creating a blockchain using Ethereum (part 1)</title>
      <dc:creator>Ryan</dc:creator>
      <pubDate>Tue, 11 May 2021 18:44:58 +0000</pubDate>
      <link>https://dev.to/talemache/creating-a-blockchain-using-ethereum-part-1-4cn9</link>
      <guid>https://dev.to/talemache/creating-a-blockchain-using-ethereum-part-1-4cn9</guid>
      <description>&lt;h3&gt;
  
  
  Intro
&lt;/h3&gt;

&lt;p&gt;Over the past few months I've really, &lt;em&gt;really&lt;/em&gt; gotten into crypto so today I decided to create my own blockchain from scratch(ish). After very little research I decided Ethereum would be the best choice and I found this article on &lt;a href="https://medium.facilelogin.com/build-your-own-blockchain-b8eaeea2f891"&gt;Medium&lt;/a&gt; and got cracking.&lt;/p&gt;

&lt;h3&gt;
  
  
  Installing geth
&lt;/h3&gt;

&lt;p&gt;In the article they used Go Ethereum (geth), which is just the Golang implementation of the Ethereum protocol. The official site suggests that one of the quickest ways to get up and running is using Docker. Unfortunately I'm on a Mac M1 chip (arm64 CPU), so I thought it would be easier to use the Rosetta 2 emulator and Homebrew:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hosI17kI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ea4emy94knhy8w4hai8j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hosI17kI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ea4emy94knhy8w4hai8j.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This set it up in the /usr/local directory. From here I could install:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;arch -x86_64 brew install ethereum&lt;/code&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--a-4IqLC3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bmho0poaqqbm8s7p8dkm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--a-4IqLC3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bmho0poaqqbm8s7p8dkm.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating a Miner Account
&lt;/h3&gt;

&lt;p&gt;Next, I set up a miner account to generate public and private keys:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;geth account new --datadir &amp;lt;path-to-data-directory&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Finally I set up and initialized the genesis block which required creating a simple json file:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---B4vyNwf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d15qvy7fbseavdymxt68.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---B4vyNwf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d15qvy7fbseavdymxt68.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;geth -datadir &amp;lt;path-to-data-directory&amp;gt; init &amp;lt;path-to-genesis-block&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5-R3SyFb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dut9z1fwiz0n0za4jiwl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5-R3SyFb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dut9z1fwiz0n0za4jiwl.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And that was it! I was ready to start mining. Pretty easy, maybe 30 minutes and very little coding. Hopefully this trend continues in the next steps.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://dev.to/talemache/creating-a-blockchain-using-ethereum-part-2-2i3a"&gt;Goto Part 2&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>go</category>
      <category>blockchain</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
