Skip to content

Commit 6ac243a

Browse files
committed
add img files;
add default frpc.ini file for config; add to README;
1 parent 6751e16 commit 6ac243a

File tree

9 files changed

+116
-12
lines changed

9 files changed

+116
-12
lines changed

.DS_Store

0 Bytes
Binary file not shown.

README.md

+97-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,109 @@
1+
# Appraisr
2+
3+
Every time
4+
5+
Appraisr is a decentralized ratings system similar to Yelp or Google Reviews.
6+
7+
## System Requirements
8+
9+
- [Metamask](https://metamask.io/) wallet with [Chrome](https://www.google.com/chrome/) / [Brave](https://brave.com/) browser
10+
11+
- [Node](https://nodejs.org/en/download/) v16.14.0
12+
13+
- Download MacOS-compatible [FRP](https://github.com/fatedier/frp/releases) - required to connect from [Moralis to local Ganache instance](https://docs.moralis.io/guides/deploy-and-track-erc20-events#connecting-moralis-to-your-local-ganache-instance).
14+
15+
Follow Moralis how-to [guide](https://docs.moralis.io/guides/deploy-and-track-erc20-events#connecting-moralis-to-your-local-ganache-instance). Use Hardhat setting with Linux command.
16+
17+
Sample [`frpc.ini`](./config/frpc.ini) file can be found at `./config/`
18+
19+
![FRPC](./README/FRPC.png)
20+
21+
\*This demo has been tested on MacOS Monterey v12.0.1, with React app deployed on local Brave browser (v1.37.113) via Node v16.14.0. FRP version [frp_0.42.0_darwin_amd64](https://github.com/fatedier/frp/releases).
22+
23+
## Quick Start
24+
25+
On Terminal 1 clone this repository and install its dependencies:
26+
27+
```sh
28+
$ git clone https://github.com/yan-man/appraisr.git
29+
$ cd appraisr
30+
$ npm install
31+
```
32+
33+
On the same terminal (Terminal 1), start Hardhat's network node:
34+
35+
```sh
36+
$ npx hardhat node
37+
```
38+
39+
On a new terminal (Terminal 2), connect Moralis to Ganache Proxy Server via FRP, according to Moralis guide:
40+
41+
```sh
42+
$ ./frpc -c frpc.ini
43+
```
44+
45+
Successful response:
46+
47+
![FRPC start](./README/frpc-start.png)
48+
49+
On a new terminal (Terminal 3), go to the repository's root folder and run the script to
50+
deploy the collection of smart contracts and configure initial settings.
51+
52+
Initial Config Settings:
53+
54+
See helper file [library.json](./frontend/src/helpers/library.json)
55+
56+
- 2 initial sample Organizations will be created
57+
- 2 sample reviews given for each Organization by a total of 4 separate sample test accounts
58+
- 1 Verifier token given to each of the 20
59+
60+
```sh
61+
$ npx hardhat run scripts/deploy.js --network localhost
62+
```
63+
64+
Successful response:
65+
66+
![deploy-scripts](./README/deploy-scripts.png)
67+
168
1. start npx node
269
2. run deployment scripts
370
3. start frpc
471
4. add moralis details to index
572
5. npm run start
673

7-
next steps/ further:
74+
## User Guide
75+
76+
### Moralis
77+
78+
## Smart Contracts
79+
80+
## Mechanics
81+
82+
### Chainlink VRF
83+
84+
## Testing
85+
86+
## Design Patterns
87+
88+
## Troubleshooting
89+
90+
## Further
891

992
- split Appraiser contract into separate smaller contracts for bytesize
1093
- rewrite tests, add more integration testing
1194
- more front end functionality:
1295
- flesh out JSON metadata pin to IPFS for minted review NFTs
1396
- show Verifier tokens owned by user
97+
98+
## What's Included?
99+
100+
- [Frontend/Dapp](./frontend): A [Create React App](https://github.com/facebook/create-react-app) dApp which interacts with the `*.sol` smart contract.
101+
- [Hardhat](https://hardhat.org/): An Ethereum development task runner and testing network.
102+
- [Mocha](https://mochajs.org/): A JavaScript test runner.
103+
- [Chai](https://www.chaijs.com/): A JavaScript assertion library.
104+
- [ethers.js](https://docs.ethers.io/v5/): A JavaScript library for interacting with Ethereum.
105+
- [Waffle](https://github.com/EthWorks/Waffle/): To have Ethereum-specific Chai assertions/matchers.
106+
107+
## License
108+
109+
All non-boilerplate code is unlicensed. Yan Man 2022.

README/FRPC.png

75.7 KB
Loading

README/deploy-scripts.png

194 KB
Loading

README/frpc-start.png

66.7 KB
Loading

README/hardhat-node.png

102 KB
Loading

config/frpc.ini

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[common]
2+
server_addr = k9yyldx5xvzu.usemoralis.com
3+
server_port = 7000
4+
token = o6wnhm4DbU
5+
[hardhat]
6+
type = http
7+
local_port = 8545
8+
custom_domains = k9yyldx5xvzu.usemoralis.com
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"Appraiser": "0x99bbA657f2BbC93c02D617f8bA121cB8Fc104Acf",
3-
"Reviewer": "0x4826533B4897376654Bb4d4AD88B7faFD0C98528",
4-
"VRFv2Consumer": "0x8f86403A4DE0BB5791fa46B8e795C547942fE4Cf"
2+
"Appraiser": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",
3+
"Reviewer": "0x5FbDB2315678afecb367f032d93F642f64180aa3",
4+
"VRFv2Consumer": "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9"
55
}

frontend/src/helpers/library.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"Upvotes": 0,
1414
"Downvotes": 0,
1515
"reviewId": 1,
16-
"Timestamp": 1653633732,
16+
"Timestamp": 1653638896,
1717
"IsVerified": true
1818
},
1919
{
@@ -23,13 +23,13 @@
2323
"Upvotes": 0,
2424
"Downvotes": 0,
2525
"reviewId": 2,
26-
"Timestamp": 1653633733,
26+
"Timestamp": 1653638898,
2727
"IsVerified": true
2828
}
2929
],
3030
"orgId": 0,
31-
"AppraiserOrganization": "0x0AdECc0079Cab72DDe413b2634a811C15D2D3c21",
32-
"Verifier": "0x3E69aeCb6a5abAc2D87d6707649E2fB0173ee2Da",
31+
"AppraiserOrganization": "0x9f1ac54BEF0DD2f6f3462EA0fa94fC62300d3a8e",
32+
"Verifier": "0xCafac3dD18aC6c6e92c921884f9E4176737C052c",
3333
"AvgRating": 54.5
3434
},
3535
{
@@ -47,7 +47,7 @@
4747
"Upvotes": 0,
4848
"Downvotes": 0,
4949
"reviewId": 1,
50-
"Timestamp": 1653633734,
50+
"Timestamp": 1653638895,
5151
"IsVerified": true
5252
},
5353
{
@@ -57,12 +57,12 @@
5757
"Upvotes": 0,
5858
"Downvotes": 0,
5959
"reviewId": 2,
60-
"Timestamp": 1653633735,
60+
"Timestamp": 1653638897,
6161
"IsVerified": true
6262
}
6363
],
6464
"orgId": 1,
65-
"AppraiserOrganization": "0x74bE95FF2Bb67B49ca168ec5f682a03f0c8f3269",
66-
"Verifier": "0x0a52519F97941C942752eE44156A6EdeCA156Cdd"
65+
"AppraiserOrganization": "0x93b6BDa6a0813D808d75aA42e900664Ceb868bcF",
66+
"Verifier": "0xbf9fBFf01664500A33080Da5d437028b07DFcC55"
6767
}
6868
]

0 commit comments

Comments
 (0)