Git Product home page Git Product logo

connect-front-end-to-smart-contract-onlocal-blockchain-'s Introduction

Tools :

  1. Metamask browser extension
  2. Hardhat

step to run:

1. install metamask browser extension

2. add local network

### 3. import account using private key

image image

private key generate after running hardhat node, there will be 20 accounts

4. open new teriminal

compile the contract first:

npx hardhat compile

running the node:

npx hardhat node

5. open another terminal

deploy the smart contract to node:

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

6. testing some function through terminal

getOwner & show textRaw

npx hardhat run scripts/get.js --network localhost

set textraw & increment number

npx hardhat run scripts/set.js --network localhost

7. run index.html using live server

image

8. connect to metamask first by hit connect wallet button

>before

>after

9. button function explain:

  • set text = to set rawText
  • increment = to increment the number
  • load = to reload the text or number after edit
  • connect wallet = to connect to wallet

note: when set new text or increment to load the result please wait untill confirmed transaction on metamask appear

metamask4

metamask transaction confirmation

connect-front-end-to-smart-contract-onlocal-blockchain-'s People

Contributors

indraryadi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.