Setting up the environment

Filip Koprivec
3 min readJan 16, 2023

--

This is the first one in a list of Solidity tutorials specifically focused on Flare development. Do check others in the series (linked at the bottom).

Environment

Most of the tutorials can also be done via browser using the remix IDE.

Install a sufficiently recent version of nodejs >= 16.0.0 and npm. Hardhat's introduction has a nice guide.

Clone the repository to your local machine and run npm install. This should set up the environment and install all the needed packages. Copy .env.sample file to .env file as you will need it in the future.

Looking around

The repository contains most of the boilerplate to get started.

  • package.json: contains the dependencies and configuration for the project.
  • hardhat.config.ts: contains the hardhat configuration for the project. It is used to set up the hardhat environment, load hardhat plugins etc. Most importantly, the Songbird network is added to the hardhat configuration, so you can interact with it from the command line.
  • test/: will contain the tests for the contracts.
  • contracts/: here be d̶r̶a̶g̶o̶n̶s contracts.
  • scripts/: will contain deployment scripts.
  • .env.sample: sample environment file.

Set up Metamask

  1. Install the Metamask extension and create your account. Follow the instructions and write down the recovery phrase.
    Remember to keep your account’s private key and recovery phrase secure and not share it with anyone. Nobody non-malicious will ever ask you for your security phrase or private key
  2. We also need to add the Songbird network to Metamask. Open Metamask click on networks and click on Add Network. Input data from the Flare webpage and click Save.
Available networks
Songbird configuration

In a similar fashion, you should also add the Coston and Coston2 networks (flare testnet) to Metamask. All the information is available flare network config page.

Pro tip
Flare explorer has an add network button, which adds network for you (It's a bit rusty now, but it can do most of the work). Just scroll to the bottom and click the button.

Click on the Foxy image near Add Flare

You can also use the Flare governance portal to one-click add networks.

Yay, you made it this far! You have successfully created and prepared an empty project and set up

Stay tuned for the next post where we create our first smart contract and write some tests for it.

--

--

No responses yet