PROJECT: Decentralized Star Notary Service Project - For this project, you will create a DApp by adding functionality with your smart contract and deploy it on the public testnet.
This Starter Code has already implemented the functionalities you implemented in the StarNotary (Version 2) exercise, and have comments in all the files you need to implement your tasks.
For this project, you will need to have:
- Node and NPM installed - NPM is distributed with Node.js
# Check Node version
node -v
# Check NPM version
npm -v
- 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 truffle@5.0.2
# Verify the version
truffle version
-
Metamask: 5.3.1 - If you need to update Metamask just delete your Metamask extension and install it again.
-
Ganache - Make sure that your Ganache and Truffle configuration file have the same port.
-
Other mandatory packages:
cd app
# install packages
npm install --save openzeppelin-solidity@2.3
npm install --save truffle-hdwallet-provider@1.0.17
npm install webpack-dev-server -g
npm install web3
- 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
- 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
- Frontend - Once you are ready to start your frontend, run the following from the app folder:
cd app
npm run dev
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
'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!
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,
// ...
-
Feel free to raise a Pull Request if you find a bug/scope of improvement in the current repository.
-
If you have suggestions or facing issues, you can log in issue.
Do not use the Old depreacted zipped starter code
Specify the Truffle version and OpenZeppelin version used in the project : Truffle v5.4.7 openzeppelin-solidity-2.3.0
Your ERC-721 Token Name : "weffii"
Your ERC-721 Token Symbol : "WEF"
Your “Token Address” on the Rinkeby Network : "0x1778618BBff29E9caF5C8e1cFA16A9EF545C7487"
Network name: 'rinkeby' Network id: 4 Block gas limit: 29999829 (0x1c9c2d5)
transaction hash: 0x9c4f1df3ec64256279ef599636f1a6900c94de64e41d3eb92226b96b74309eb8 Blocks: 2 Seconds: 17 contract address: 0x0445D7c18Cb21e792b3886125B247C93eC6D1e59 block number: 9187950 block timestamp: 1630061074 account: 0x069A95757Cf3080c8A5B9c325241C2D24E117c34 balance: 0.99773463 gas used: 226537 (0x374e9) gas price: 10 gwei value sent: 0 ETH total cost: 0.00226537 ETH
Saving migration to chain. Saving artifacts
Total cost: 0.00226537 ETH
transaction hash: 0x4ca9f2567c7f5e9b2e849c320ebb5c85e1820cc98d57b3b3313d7a5bdb6fddb3 Blocks: 1 Seconds: 13 contract address: 0x1778618BBff29E9caF5C8e1cFA16A9EF545C7487 block number: 9187952 block timestamp: 1630061104 account: 0x069A95757Cf3080c8A5B9c325241C2D24E117c34 balance: 0.96975795 gas used: 2751905 (0x29fda1) gas price: 10 gwei value sent: 0 ETH total cost: 0.02751905 ETH
Saving migration to chain. Saving artifacts
Total cost: 0.02751905 ETH
Total deployments: 2 Final cost: 0.02978442 ETH