Skip to content

DappStarter/alert-julyee

Repository files navigation

My Dapp

This project is for the blockchain application My Dapp. It contains code for the Smart Contract, web-based dapp and NodeJS server.

Pre-requisites

In order to develop and build "My Dapp," the following pre-requisites must be installed:

Installation

Using a terminal (or command prompt), change to the folder containing the project files and type: npm install This will fetch all required dependencies. The process will take 1-3 minutes and while it is in progress you can move on to the next step.

Note: You may see some npm warnings about "web3-bzz" after dependencies are installed. These can be ignored as the associated code is never invoked.

Ganache Settings (for Ethereum only; skip for other blockchains)

Launch the Ganache GUI, then create a new workspace with any name of your choice. Once the workspace is active, click the gear icon and complete these configuration steps:

  • Workspace Tab: Truffle Projects: Select "Add Project" and select "truffle-config.js" from the same folder as this README.md file

  • Accounts & Keys Tab: Mnemonic (field with 12 or more words): Copy/paste the words below.

    gesture glimpse frame tribe stove deny rapid coach gown light army ghost

    These keywords are used to auto-generate accounts with private keys for development. If the keywords in "truffle-config.js" (which are the same as above) and Ganache don't match, you will not be able to deploy your Smart Contracts to Ganache.

  • Server Tab: Check that "Port Number" is "7545" and "Network ID = 5777"

Build, Deploy and Test

Using a terminal (or command prompt), change to the folder containing the project files and type: npm start This will run the "deploy" and "dapp" scripts which compile and deploy the Smart Contracts, then build and run the client-side dapp.

To view your dapp, open your browser to http://localhost:8000

If you encounter any problems at this step, visit https://support.trycrypto.com for help.

Other Scripts

If you prefer to run scripts individually, the order is:

npm install npm run deploy npm run dapp npm run server (must be run in a separate terminal window)

Smart Contract

npm run deploy to compile contracts/*.sol files, deploy them to the blockchain.

Dapp

Run the dapp in a separate terminal. You must have run npm run deploy for the dapp to see most recent smart contract changes.

npm run dapp runs the dapp on http://localhost:8000 using webpack dev server

Server

Run the server in a separate terminal. You must have run npm run deploy for the dapp to see most recent smart contract changes.

npm run server runs NodeJs server app on port 3000 with Express

Testing

test-config.js contains settings used by test scripts

Run tests using npm test [test file] (example: npm test ./test/dapp-tests.js)

Production Builds

DappStarter currently does not provide blockchain migration scripts to be used in production. However, here are the scripts for generating production builds:

npm run dapp:prod generates dapp bundle for production using webpack

npm run server:prod generates NodeJs server bundle for production using webpack

About

Kickstart your blockchain development with DappStarter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published