Giter Site home page Giter Site logo

nppooldev's Introduction

Setup

Pre-requisites

This app can be hosted locally using Node.js, Truffle and Ganache. The installation steps are as follows:

  1. Download and install Node.js https://nodejs.org/en/
  2. Install Truffle using npm (Node.js' built-in package manager) npm install -g truffle
  3. Download and install Ganache https://www.trufflesuite.com/ganache
  4. Add Metamask extension to your browser of choice (Chrome, Brave, Edge, Firefox)

Hosting a local server

  1. To host a local blockchain, Run Ganache -> Create a new workspace -> Server -> change port to 8545 -> Save workspace.
  2. Navigate to project folder in console and deploy the smart contracts with the commands: truffle migrate --reset
  3. To host the web app locally, navigate to [project folder]/client/, and run the following commands: npm run start
  4. The web app should now be available at http://localhost:8080/ on your browser.

Interacting with local server

To connect your simulated wallet on Ganache with the webapp, first run Ganache with the configured settings, then do the following:

  1. On Ganache, click on the key icon at the right end of the first address, and copy the private key.
  2. On Metamask, click on the colored circle at the top right corner -> Import Account -> Paste the private key
  3. With the new wallet added, change the network to Localhost 8545 (next to the colored circle).
  4. Host the web app locally (step 3 in the previous section) and navigate to the server on browser.
  5. Metamask will now prompt you to give access to the webapp, accept and your account will now be connected with the app.

nppooldev's People

Contributors

jinhongkuan avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Forkers

jacky-liu1

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.