-
Smart contracts contracts/ test/ hardhat.config.ts package.json package-lock.json tsconfig.json
-
WebApp web-app/
-
API cmd/ pkg/ go.mod go.sum
suggest to run local ipfs $ ipfs daemon
- Add image to IPFS
$ ipfs add file1.jpg
- Modify image url with prefix
https://ipfs.io/ipfs/
in metadata file:file1.json
- Add metadata to IPFS
$ ipfs add file1.json
- Modify tokenURIs.json
- Repeat step 1-5 for 5 times
if not using local ipfs, remember to remove IPFS_URL in docker-compose.yaml
- install dependencies `$ npm install``
- run local node
$ npx hardhat node
- deploy smart contract
$ npx hardhat run --network localhost scripts/deploy.ts
- you will get the smart contract address
- Modify CONTRACT_ADDRESS in
docker-compose.yaml
and value is from step 4
We only support local hardhat node. Other networks could be added in web-app/src/_app.tsx
And consider this document https://wagmi.sh/react/providers/configuring-chains
$ docker compose up
Open browser and browse http://localhost:3000
- prepare local postgres and create database
benz
- copy .env.sample to .env and modify those values
- run backend
$ godotenv -f .env -- go run ./cmd/api/main.go
- modify
web-app/.env.local
- install frontend dependencies
$ npm run install:dev
- run frontend
$ npm run dev
- only test on local hardhat
$ npm test
will run testcases for smart contract$ go test ./pkg/...
will run testcases for backend only check uniqueness- there are no tests for frontend
- I used walletconnect and wagmi direclty, not using web3.js and ether.js
- For 3i explantion I choose hash because receipt would be stored in smart contract. If we want to verify the value, using hash is easier. Encryption/Decryption may need to store some secrets or to exchange keys in the frontend.