avatarLajos Deme

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

3297

Abstract

tive.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*KYtT0luD5zVaA7E9)"></div> </div> </div> </a> </div><div id="fc19" class="link-block"> <a href="https://writingcooperative.com/how-to-write-leads-that-engage-an-audience-72e0c6c527ad"> <div> <div> <h2>How to Write Leads that Engage an Audience</h2> <div><h3>Powerful leads is expository writing</h3></div> <div><p>writingcooperative.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*GjrCRifCDdvhUyWl)"></div> </div> </div> </a> </div><p id="c97e">Writing never comes to an end. It is a living piece of art that emerges over time, and if a writer returns to it at a later time, words morph and mature with simple pen movements. However, eventually, there is a deadline, the writer needs to make some money, or simply become bored with the topic. Until then, the possibilities for improvement are limitless.</p><p id="eb43">Revisions are my favorite part of the process. They are my opportunities to play with the language. Like a child molds Play-doh into new forms, I manipulate words and phrases to produce rhythms, double meanings, emotions, and inspire thoughts. Three of my favorite revision strategies are discussed below.</p><div id="987d" class="link-block"> <a href="https://writingcooperative.com/show-dont-tell-is-great-advice-but-how-f632a23f912d"> <div> <div> <h2>Show Don’t Tell is Great Advice: But How?</h2> <div><h3>4 Strategies to Strengthen Description in Your Writing</h3></div> <div><p>writingcooperative.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*uwTjzUvyxjmQPIWF)"></div> </div> </div> </a> </div><div id="a80c" class="link-block"> <a href="https://writingcooperative.com/3-revision-strategies-to-create-sentence-variety-72c273c1efd6"> <div> <div> <h2>Sentence Variety Cheat Sheet</h2> <div><h3>Adding Spice to the narrative tempts the readers and brings them back for seconds</h3></div> <div><p>writingcooperative.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*MHdLO4qM-I7wBlZB)"></div> </div> </div> </a> </div><div id="1e28" class="link-block"> <a href="https://readmedium.com/transitions-convey-readers-smoothly-through-the-story-52b091f7765c"> <div> <div> <h2>Transitions Convey Readers Smoothly Through the Story</h2> <div><h3>Words work hard so writers can work smart</h3></div> <div><p>medium.com</p></div> </div> <div> <div style="back

Options

ground-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*2XagpkMoZ-iUI368)"></div> </div> </div> </a> </div><p id="50be">If you try any of these strategies, I would love to know how they worked for you. I have experienced the positive results first hand and watched other writers grow in skills and excitement.</p><p id="e144">If you find value in what you read, my name is Brenda Mahler and more articles are available if you follow me on Medium. Enjoy!</p><div id="144f" class="link-block"> <a href="https://readmedium.com/desire-to-improve-your-writing-skills-part-1-8848560da3de"> <div> <div> <h2>Desire to Improve Your Writing Skills? Part 1: Prewriting and Writer’s Block</h2> <div><h3>Don’t become mired in the minutia when answers are available</h3></div> <div><p>medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*adJHjx3Kur-RNHUX)"></div> </div> </div> </a> </div><div id="5642" class="link-block"> <a href="https://readmedium.com/desire-more-strategies-to-improve-your-writing-skills-part-2-4c4298119d04"> <div> <div> <h2>Desire More Strategies to Improve Your Writing Skills? Part 2: Audience, Voice and Development</h2> <div><h3>Learn how to push the clouds away and gain inspiration</h3></div> <div><p>medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*uKSp68IgHwGnWacv)"></div> </div> </div> </a> </div><div id="ebce" class="link-block"> <a href="https://readmedium.com/desire-strategies-to-improve-your-writing-part-4-editing-de2a4a2e1682"> <div> <div> <h2>Desire Strategies to Improve Your Writing? Part 4: Editing</h2> <div><h3>It’s a beautiful day but it’s time to rake the leaves</h3></div> <div><p>medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*97n4krDCswYVNAjb)"></div> </div> </div> </a> </div><h2 id="aa13">The Most Interesting Publication on Medium</h2><div id="26c4" class="link-block"> <a href="https://readmedium.com/starting-a-community-for-writers-looking-for-more-exposure-interested-f7ecaddc5ef2"> <div> <div> <h2>FELLOWSHIP WRITERS: A Community For Writers Seeking Support. Interested?</h2> <div><h3>A community of writers, a positive environment, a safe place to become a better reader/writer. Not Religiously…</h3></div> <div><p>medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*40pzqfwpF76RIJIzOvDC0A.png)"></div> </div> </div> </a> </div></article></body>

How to Setup Your Local Solidity Development Environment

Get started with smart contract development

Photo by Sieuwert Otterloo on Unsplash

Welcome to the first article in my series on smart contract development with Solidity. All articles will be published in this publication so make sure to follow us if you are interested. The publication will start from elementary concepts and progress all the way to more advanced topics, covering the ins and outs of Solidity and Ethereum.

Ethereum

Let’s begin with the very basics and briefly mention what Ethereum is. Ethereum is a decentralized open-source blockchain with smart contract functionality developed in the Go programming language. Ethereum was first conceived in 2013 by Vitalik Buterin. Since then, it grew to be one of the largest cryptocurrencies in existence used by millions of people.

Smart contract

Smart contracts are computer programs or protocols that are stored on a blockchain and run when predefined conditions are met. They are useful for automatically executing parts of an agreement, and storing legally relevant information about this agreement.

In the world of Ethereum, a smart contract is an Ethereum account. They have balances, can send and receive money and do the actions a regular account can. They are controlled by the code written inside the smart contract. Users can interact with the contract by submitting transactions that call functions in the contract.

Solidity

Solidity is the programming language used to develop these smart contracts on Ethereum. It is an open-source, object-oriented, statically-typed programming language that many say is somewhat similar to JavaScript.

In this series, we will deal with the intricacies of this language. The first step in this process is to set up our local development environment, so let’s get started!

Getting started

There is a great browser-based IDE for Solidity called Remix, which is great if you just want to get your feet wet, but if you’re serious about Solidity sooner or later you should set up your local development environment. This is why I won’t talk about Remix here, and cut straight to the chase.

Since we will write Solidity code, you might want to install some great extensions to help you with that in your text editor. Personally, I use VSCode, so here is one extension that I recommend, but feel free to shop around for others:

Step 0 is having node and npm installed on your workstation.

Step 1 is installing a development environment. The two most often used are Truffle combined with Ganache and Hardhat. Both are pretty good, and I’m going to go over getting started with both.

Truffle

Truffle is a great development environment, testing framework, and asset pipeline. Its trusted companion is Ganache, a tool for firing up a personal, local Ethereum blockchain on your machine that you can use to test your smart contracts or do any other work like executing some commands.

Start by installing Truffle via npm:

npm install -g truffle

Verify that everything went well by running truffle version on the command line.

Then install Ganache, or just ganache-cli, which only contains the CLI.

Run:

npm install -g ganache

or:

npm install -g ganache-cli

Verify that it’s working by running ganache or ganache-cli. It should output something like this:

Your very own Ethereum blockchain with a couple of accounts, private keys, and all that sweet stuff.

Now it’s time to create our first project. Let’s create a folder and cd into it, then run truffle init. This creates an empty Truffle project with no example contracts included. This is how the default project structure looks like:

  • contracts/ folder will contain all our smart contract logic.
  • migrations/ is where you will create files that will handle the deployment of your smart contracts.
  • test/ contains our tests.
  • truffle-config.js file contains our Truffle configuration. It’s similar to a package.json file.

When you’re done with writing the code, the next step before deployment is to compile it. Run truffle compile in your project root.

Before deployment, we also need to do a migration, which alters the state of our contracts (deeper explanation coming in future lessons). cd into the migrations folder and create a file named 2_deploy_contracts.js. This file should contain the following (let’s assume we have a contract named Lottery.sol, swap this name to your actual contract):

var Lottery = artifacts.require("Lottery");

module.exports = function(deployer) {
  deployer.deploy(Lottery);
};

Now start ganache and run truffle migrate. Your smart contract is now deployed to your local Ethereum blockchain so you can start playing around with it.

If you want to run your tests just run truffle test.

Hardhat

Hardhat is the other quite famous development environment for Solidity. It is used to compile, deploy, test, and debug Ethereum software. Instead of Ganache, we have the Hardhat Network, which comes built-in, and Hardhat Runner, the CLI.

You have to install Hardhat locally in each project. Create a new folder, do npm init inside it, then install Hardhat by running:

npm install --save-dev hardhat

To create your project run npx hardhat. You should see the following:

You have the option to create a basic or advanced sample project or just an empty project with a config file. When you create a sample project, the CLI will ask you to install a couple of plugins. Plugins are integral parts of the whole Hardhat ecosystem and their task is to extend the functionality of Hardhat with new capabilities. They make smart contract development a lot easier and definitely a lot more fun. A nice plugin that I use every time for example is hardhat-gas-reporter, that estimates your contracts’ gas usage per unit test.

The directory structure looks similar to the Truffle version:

  • contracts/ folder is the place for our smart contracts.
  • scripts/ contains our deploy.js file, which looks a bit different than the Truffle version but serves the same purpose
  • test/ for our tests
  • The hardhat.config.js file

Once you’ve written your contracts, the flow to deployment is once again similar to Truffle. Just run npx hardhat compile to compile the contracts. To execute your tests run npx hardhat test. To deploy you have to run your script with npx hardhat run scripts/sample-script.js.

Conclusion

This was a light introduction to Ethereum, smart contracts, and Solidity. We’ve seen how to set up a local environment for smart contract development using the two most popular tools, Truffle and Hardhat.

Thank you for staying with us till the end. If you enjoyed reading this piece please keep in touch and follow Solidify to keep up with our lessons on Solidity. The upcoming articles will start to dwell on the intricacies of the language, progressing from beginner to advanced level.

Ethereum
Solidity
Programming
Software Development
Blockchain Development
Recommended from ReadMedium