Skip to content

petrovMA/moonbeam_smartcontract_tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Moonbeam simple smart-contract tutorial:

1. Install and configure docker in one command:

curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh

Docker official instructions

2. Install and configure docker in one command:

docker pull purestake/moonbeam:tutorial-v7

Last version of moonbeam node docker image you can find here

3. Run moonbeam local node:

docker run --rm --name moonbeam_development --network host \
purestake/moonbeam:tutorial-v7 \
--dev

4. Open new terminal window

5. install node js:

curl -fsSL https://deb.nodesource.com/setup_17.x | sudo -E bash -
sudo apt-get install -y nodejs

More about node js

6. Create hardhat directory and go to hardhat directory:

mkdir hardhat-tutorial && cd hardhat-tutorial

7. Create npm project and add hardhat library:

npm init --yes
npm install --save-dev hard hardhat

8. Configure and compile hardhat project:

npx hardhat
npx hardhat compile

9. Add dev network and key to config file:

nano hardhat.config.js

9.1. add private key

const { privateKey } = require('./secrets.json');

9.2. add network

networks: {
  dev: {
    url: "http://127.0.0.1:9933",
    chainId: 1281,
    accounts: [privateKey]
  }
}

9.3. add private key to file "secrets.json"

You can find privateKey for devNet in Pre-funded Development Accounts

10. Run deploy script:

npx hardhat run scripts/deploy.js --network dev

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors