Giter Club home page Giter Club logo

crypto-star-dapp's Introduction

CryptoStar Dapp - Project submission for Udacity blockchain developer course

General Information

ERC-721 Token Name: Udacity Dollar
ERC-721 Token Symbol: UDD
Version of Truffle used: 5.0.2
Version of OpenZeppelin used: 2.3
Token Address on the Rinkeby Network: 0x792925Ef40e504B460dE21d68106Ce6CE5b848AB

Dependencies

For this project, you will need to have:

  1. Node and NPM installed - NPM is distributed with Node.js
# Check Node version
node -v
# Check NPM version
npm -v
  1. Truffle v5.X.X - A development framework for Ethereum.
# Unsinstall any previous version
npm uninstall -g truffle
# Install
npm install -g truffle
# Specify a particular version
npm install -g [email protected]
# Verify the version
truffle version
  1. Metamask: 5.3.1 - If you need to update Metamask just delete your Metamask extension and install it again.

  2. Ganache - Make sure that your Ganache and Truffle configuration file have the same port.

  3. Other mandatory packages:

cd app
# install packages
npm install --save  [email protected]
npm install --save  [email protected]
npm install webpack-dev-server -g
npm install web3

Run the application

  1. Clean the frontend
cd app
# Remove the node_modules  
# remove packages
rm -rf node_modules
# clean cache
npm cache clean
rm package-lock.json
# initialize npm (you can accept defaults)
npm init
# install all modules listed as dependencies in package.json
npm install
  1. Start Truffle by running
# For starting the development console
truffle develop
# truffle console

# For compiling the contract, inside the development console, run:
compile

# For migrating the contract to the locally running Ethereum network, inside the development console
migrate --reset

# For running unit tests the contract, inside the development console, run:
test
  1. Frontend - Once you are ready to start your frontend, run the following from the app folder:
cd app
npm run dev

Important

When you will add a new Rinkeyby Test Network in your Metamask client, you will have to provide:

Network Name New RPC URL Chain ID
Private Network 1 http://127.0.0.1:9545/ 1337

The chain ID above can be fetched by:

cd app
node index.js

Troubleshoot

Error 1

'webpack-dev-server' is not recognized as an internal or external command

Solution:

  • Delete the node_modules folder, the one within the /app folder
  • Execute npm install command from the /app folder

After a long install, everything will work just fine!

Error 2

ParserError: Source file requires different compiler version. 
Error: Truffle is currently using solc 0.5.16, but one or more of your contracts specify "pragma solidity >=0.X.X <0.X.X".

Solution: In such a case, ensure the following in truffle-config.js:

// Configure your compilers  
compilers: {    
  solc: {      
    version: "0.5.16", // <- Use this        
    // docker: true,
    // ...

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.