<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Priom Chowdhury</title><link>/</link><description>Recent content on Priom Chowdhury</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><copyright>All Rights Reserved by Priom</copyright><lastBuildDate>Tue, 08 Jan 2019 00:00:00 +0000</lastBuildDate><atom:link href="/index.xml" rel="self" type="application/rss+xml"/><item><title>Deployment Automation for Goerli testnet in 10 minutes</title><link>/blog/deployment-automation-for-goerli-testnet-in-10-minutes/</link><pubDate>Tue, 08 Jan 2019 00:00:00 +0000</pubDate><guid>/blog/deployment-automation-for-goerli-testnet-in-10-minutes/</guid><description>Hello world, happy new year to everyone. Hope you are having a great start to 2019.
Today, I’m going to share a short tutorial to quickly deploy the new Goerli Proof-of-Authority cross-client test network which was originally developed at [ETHBerlin](https://ethberlin.com) in September 2018 and then we, Afri (@5chdn) and ChainSafe (@chainsafeth), have been actively developing Goerli. As of now, Goerli is supported in Geth, Parity, Pantheon, Nethermind and EthereumJS. If you would like to follow the current development of Goerli, fork the Goerli testnet repo.</description><content>&lt;p>Hello world, happy new year to everyone. Hope you are having a great start to 2019.&lt;/p>
&lt;h3 id="today-im-going-to-share-a-short-tutorial-to-quickly-deploy-the-new-goerlihttpsgoerlicom-proof-of-authority-cross-client-test-network-which-was-originally-developed-at-ethberlinhttpsethberlincom-in-september-2018-and-then-we-afrihttpstwittercom5chdn-5chdn-and-chainsafehttpstwittercomchainsafeth-chainsafeth-have-been-actively-developing-goerli-as-of-now-goerli-is-supported-in-gethhttpsgithubcomethereumgo-ethereum-parityhttpsgithubcomparitytechparity-ethereum-pantheonhttpsgithubcompegasysengpantheon-nethermindhttpsgithubcomnethermindethnethermind-and-ethereumjshttpsgithubcomethereumjsethereumjs-client">Today, I’m going to share a short tutorial to quickly deploy the new &lt;strong>&lt;a href="https://goerli.com">Goerli&lt;/a>&lt;/strong> Proof-of-Authority cross-client test network which was originally developed at [&lt;strong>ETHBerlin]&lt;/strong>(&lt;a href="https://ethberlin.com">https://ethberlin.com&lt;/a>) in September 2018 and then we, &lt;a href="https://twitter.com/5chdn">Afri&lt;/a> (@5chdn) and &lt;a href="https://twitter.com/chainsafeth">ChainSafe&lt;/a> (@chainsafeth), have been actively developing &lt;strong>Goerli&lt;/strong>. As of now, Goerli &lt;strong>is&lt;/strong> supported in &lt;a href="https://github.com/ethereum/g**o-ethereum">Geth&lt;/a>, &lt;a href="https://github.com/paritytech/parity-ethereum">Parity&lt;/a>, &lt;a href="https://github.com/PegaSysEng/pantheon">Pantheon&lt;/a>, &lt;a href="https://github.com/NethermindEth/nethermind">Nethermind&lt;/a> and &lt;a href="https://github.com/ethereumjs/ethereumjs-client">&lt;strong>EthereumJS&lt;/strong>&lt;/a>.&lt;/h3>
&lt;h4 id="if-you-would-like-to-follow-the-current-development-of-goerli-fork-the-goerli-testnet-repohttpsgithubcomgoerlitestnet">If you would like to follow the current development of &lt;strong>Goerli&lt;/strong>, fork the &lt;strong>Goerli&lt;/strong> testnet &lt;a href="https://github.com/goerli/testnet">repo&lt;/a>.&lt;/h4>
&lt;p>&lt;img src="https://cdn-images-1.medium.com/max/4000/1*2IvbXbp80TjyqbGKJMIuoQ.jpeg" alt="ETHBerlin — Goerli Demo">&lt;/p>
&lt;p>Let’s get started. These steps will work on any &lt;strong>UNIX system (Mac &amp;amp; Linux).&lt;/strong> First, go ahead and create a &lt;strong>GCP (Google Cloud Platform)&lt;/strong> account &lt;a href="https://cloud.google.com/">here&lt;/a> and then create a project. By default, Google gives $300 worth of free credits for a year.&lt;/p>
&lt;p>Then, we need &lt;a href="https://www.terraform.io/">Terraform&lt;/a>, it is an open source tool to easily create reusable and modular infrastructure deployment automation code.&lt;/p>
&lt;p>To install it on &lt;strong>Mac,&lt;/strong> you can use &lt;a href="https://brew.sh/">brew&lt;/a>, if you don’t have &lt;strong>brew&lt;/strong>, you can install it using this script. Once, you are done, then go ahead and install using the next command.&lt;/p>
&lt;pre tabindex="0">&lt;code>/usr/bin/ruby -e &amp;#34;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)&amp;#34;
brew install terraform
&lt;/code>&lt;/pre>&lt;p>If you are on any &lt;strong>Linux,&lt;/strong> follow the quick walkthrough &lt;a href="https://learn.hashicorp.com/terraform/getting-started/install.html">&lt;em>here&lt;/em>&lt;/a> to install Terraform. &lt;strong>Terraform&lt;/strong> has some excellent documentation on how to get up and running quickly.&lt;/p>
&lt;p>Next step, you have to create a &lt;em>service account key&lt;/em> in GCP.&lt;/p>
&lt;p>&lt;img src="https://cdn-images-1.medium.com/max/806/1*QW8rRWOD6N_05jZ576x4rA.png" alt="GCP IAM">&lt;/p>
&lt;p>On the creation screen, give it a name and description. For the role access, make sure you give it &lt;strong>&lt;em>Compute Engine Admin&lt;/em>&lt;/strong> role. Next, create your key and download the &lt;strong>&lt;em>JSON&lt;/em>&lt;/strong> key. Make sure to &lt;strong>&lt;em>securely&lt;/em>&lt;/strong> store this file, this file is &lt;strong>&lt;em>very very private and sensitive&lt;/em>&lt;/strong>! And &lt;strong>&lt;em>DO NOT EVER PUSH THIS FILE TO YOUR PUBLIC REPO!&lt;/em>&lt;/strong>&lt;/p>
&lt;p>&lt;img src="https://cdn-images-1.medium.com/max/2560/1*fIB74o-aFsMmilzh9d3P7w.png" alt="GCP service account key creation">&lt;/p>
&lt;p>Now that we have our necessary steps done, we will start writing our Terraform deployment script.&lt;/p>
&lt;p>In your project directory, copy the &lt;strong>&lt;em>JSON&lt;/em>&lt;/strong> file which you just downloaded and then create a file called &lt;strong>&lt;em>goerli.tf&lt;/em>&lt;/strong> (you can name it whatever you want).&lt;/p>
&lt;!-- raw HTML omitted -->
&lt;p>This is what your Terraform file will look like. In the first block, we define the provider which is &lt;em>google&lt;/em> for us, inside that we define the location for the &lt;em>credentials.json&lt;/em> and your &lt;em>project ID&lt;/em> which you will find in your project settings.&lt;/p>
&lt;p>Next, we define our &lt;em>virtual instance’s name, region, cpu, ram, hard disk, operating system, firewalls, and other necessary configs.&lt;/em>&lt;/p>
&lt;p>At the very bottom, we define our &lt;em>startup script&lt;/em> where the list of commands will run after the virtual instance is created to do the basic housekeeping stuff like updating the &lt;strong>OS&lt;/strong>, installing &lt;a href="https://nodejs.org">&lt;strong>Node.js&lt;/strong>&lt;/a> and &lt;a href="https://geth.ethereum.org/">Geth&lt;/a> (the client which will be running Goerli at).&lt;/p>
&lt;p>Now, in your terminal, run the command:&lt;/p>
&lt;pre tabindex="0">&lt;code>terraform apply
&lt;/code>&lt;/pre>&lt;p>And, you should see your instance is being created in the GCP compute engine console.&lt;/p>
&lt;h4 id="congratulations-you-have-successfully-deployed-your-virtual-machine-on-the-cloud---">Congratulations, you have successfully deployed your virtual machine on the cloud! 👏 👏 👏&lt;/h4>
&lt;p>Next, we will SSH into our newly created VM. GCP provides few ways to connect to your remote machine rather than traditional methods; creating and managing your SSH keys like other cloud providers so, we will use the &lt;strong>gcloud&lt;/strong> utils. You need to have &lt;strong>gcloud&lt;/strong> installed on your computer so, go ahead and follow the instructions &lt;a href="https://cloud.google.com/sdk/install">&lt;em>here&lt;/em>&lt;/a>.&lt;/p>
&lt;p>&lt;img src="https://cdn-images-1.medium.com/max/3052/1*3Hat1Xt8itUFxqFHI9qDVQ.png" alt="gcloud command in GCP console">&lt;/p>
&lt;p>Once, you SSH’d into your VM, go ahead and clone the &lt;strong>Goerli&lt;/strong> testnet repo from &lt;a href="https://github.com/goerli/testnet">Github&lt;/a> into your home directory and then we will run a few commands.&lt;/p>
&lt;pre tabindex="0">&lt;code>geth init ./testnet/geth/goerli.genesis
&lt;/code>&lt;/pre>&lt;p>This is to initialize &lt;strong>Goerli&lt;/strong>’s &lt;strong>Genesis&lt;/strong> block.&lt;/p>
&lt;p>We are almost done, next, we will copy the &lt;em>boot nodes (the IP addresses of the peer nodes)&lt;/em> to the &lt;em>&lt;strong>geth&lt;/strong> data directory&lt;/em>.&lt;/p>
&lt;pre tabindex="0">&lt;code>cp testnet/geth/static-nodes.json .ethereum
&lt;/code>&lt;/pre>&lt;p>Now, we will boot up our &lt;strong>Goerli&lt;/strong> node&lt;/p>
&lt;pre tabindex="0">&lt;code>nohup geth --networkid 6284 &amp;amp;
&lt;/code>&lt;/pre>&lt;p>This will continue to run in the background. &lt;em>6284&lt;/em> is the network ID of &lt;strong>Goerli&lt;/strong> so when running Geth we need to specify as the — &lt;em>goerli&lt;/em> hasn’t been merged to &lt;strong>Geth&lt;/strong> master yet. Here is the &lt;a href="https://github.com/ethereum/go-ethereum/pull/18121">&lt;em>link&lt;/em>&lt;/a> to the PR.&lt;/p>
&lt;p>You will see a file called &lt;em>nohup.out,&lt;/em> where it stores the log. Now, if you do:&lt;/p>
&lt;pre tabindex="0">&lt;code>tail -f nohup.out
&lt;/code>&lt;/pre>&lt;p>You should see the terminal output of &lt;strong>Geth&lt;/strong> running the &lt;strong>Goerli&lt;/strong> network.&lt;/p>
&lt;h4 id="congrats-we-are-done-here-you-are-successfully-one-of-the-peers-in-the-goerli-network-">Congrats, we are done here, you are successfully one of the peers in the &lt;strong>Goerli&lt;/strong> network! 🎉🎉🎉&lt;/h4>
&lt;p>You can use the same Terraform file by just tweaking a little bit to automate your deployment to any cloud provider like AWS, Azure, AliCloud, DigitalOcean, or even Heroku. You can also customize the current configuration to play with it.&lt;/p>
&lt;p>&lt;strong>Here is a list of a few useful resources:&lt;/strong>&lt;/p>
&lt;blockquote>
&lt;p>&lt;a href="https://github.com/ethereum/go-ethereum/wiki/geth">&lt;strong>ethereum/go-ethereum&lt;/strong>&lt;/a>&lt;/p>
&lt;p>&lt;!-- raw HTML omitted -->Official Go implementation of the Ethereum protocol - ethereum/go-ethereum&lt;!-- raw HTML omitted -->&lt;/p>
&lt;/blockquote>
&lt;blockquote>
&lt;p>&lt;a href="https://www.terraform.io/docs/providers/google/index.html">&lt;strong>Provider: Google Cloud Platform - Terraform by HashiCorp&lt;/strong>&lt;/a>&lt;/p>
&lt;p>&lt;!-- raw HTML omitted -->The Google provider is used to configure your Google Cloud Platform infrastructure&lt;!-- raw HTML omitted -->&lt;/p>
&lt;/blockquote>
&lt;blockquote>
&lt;p>&lt;a href="https://cloud.google.com/compute/docs/concepts">&lt;strong>Concepts | Compute Engine | Google Cloud&lt;/strong>&lt;/a>&lt;/p>
&lt;p>&lt;!-- raw HTML omitted -->Google Cloud delivers secure, open, intelligent, and transformative tools to help enterprises modernize for today&amp;rsquo;s digital world.&lt;!-- raw HTML omitted -->&lt;/p>
&lt;/blockquote>
&lt;hr>
&lt;h3 id="if-you-like-this-article-please-give-some--if-you-have-any-questions-and-feedbacks-please-leave-comments-below-you-can-also-reach-me-in-twitterhttpstwittercompri0m-at-pri0mhttpstwittercompri0m-and-follow-me-on-githubhttpsgithubcompriom">If you like this article, please give some 👏🏻. If you have any questions and feedbacks, please leave comments below. You can also reach me in &lt;a href="https://twitter.com/pri0m">Twitter&lt;/a> at @&lt;a href="https://twitter.com/pri0m">pri0m&lt;/a> and follow me on &lt;a href="https://github.com/priom">Github&lt;/a>.&lt;/h3>
&lt;h3 id="follow-chainsafe-systemshttpsmediumcomu8bf3eecb7075-to-learn-more-about-ethereum-and-upcoming-development-updates-reach-out-to-us-in-twitterhttpstwittercomchainsafeth-at-chainsafethhttpstwittercomchainsafeth">Follow &lt;a href="https://medium.com/u/8bf3eecb7075">ChainSafe Systems&lt;/a>, to learn more about Ethereum and upcoming development updates. Reach out to us in &lt;a href="https://twitter.com/chainsafeth">Twitter&lt;/a> at &lt;a href="https://twitter.com/chainsafeth">@chainsafeth&lt;/a>.&lt;/h3></content></item></channel></rss>