Setup Environment
Prerequisites
To start building your Dapp you will need to install some programs:
To check that Node is installed properly, open a console (admin PowerShell on Windows) and type node -v
. This should print a version number, like v10.15.0
.
To test npm, type npm -v
and you should see the version number, like 6.4.1
.
Install Node.js
You can skip this section if you already have a working Node.js >=16.0
installation. If not, here's how to install it on Ubuntu, MacOS and Windows.
Linux
For Ubuntu based distro, copy and paste these commands in a terminal:
Check out this link for each platform installers.
MacOS
Make sure you have git
installed.
Windows
If you are using Windows, we strongly recommend you use Windows Subsystem for Linux (also known as WSL 2). You can use Hardhat without it, but it will work better if you use it.
To install Node.js using WSL 2, please read this guide.
Creating a new Hardhat project
We'll install Hardhat using the Node.js package manager (npm
), which is both a package manager and an online repository for JavaScript code.
You can use other package managers with Node.js, but we suggest you use npm 7 or higher to follow this guide. You should already have it if you followed the previous section's steps.
Open a new terminal and run these commands to create a new folder:
Select Create an empty hardhat.config.js
with your keyboard and hit enter.
When Hardhat is run, it searches for the closest hardhat.config.js
file starting from the current working directory. This file normally lives in the root of your project and an empty hardhat.config.js
is enough for Hardhat to work. The entirety of your setup is contained in this file.
Create a VIC Wallet
You will need a wallet address and some tokens. We will show you how to do it on both Viction Testnet and Mainnet.
1. Create a VIC wallet and save your Mnemonic
You can create a new VIC wallet using Viction Wallet mobile app for iOS, or the web version (https://wallet.tomochain.com/#/login). Under Settings go to Advanced Settings, here you can Choose network and select Viction TestNet
or Viction
[mainnet].
Go to Settings menu, select Backup wallet and then Continue. Here you can see your wallet’s private key and the 12-word recovery phrase. Write down the 12-word recovery phrase.
You can also create a new Viction wallet with MetaMask, MyEtherWallet or TrustWallet. For instance, for mainnet you can go to MyEtherWallet and select VIC (viction.xyz) on the top right corner. Enter a password and then Create a new wallet. Write down your recovery phrase.
For this tutorial, my wallet address (testnet) is:
My recovery phrase (12-word mnemonic
) is:
Write them down. This will be needed later. Notice that your wallet address (public key) and your recovery phrase will be different than mine.
Important! Always keep your private key and recovery phrase secret!
2. Get some VIC funds
Tokens are required for different matters, like smart contract deployment or to use in Dapps.
Testnet: Receive 15 free testnet VIC tokens using Viction's Faucet.
Mainnet: You need real VIC tokens from exchanges.
Go to faucet and collect 30 VIC
. Now your wallet has enough balance to do everything in this tutorial so… let’s go ahead!
3. The Block Explorer
To check the balance of a wallet address, you can use VicScan.
Mainnet: https://vicscan.xyz/
Testnet: https://scan-ui-testnet.viction.xyz/
Last updated