Table of Contents generated with DocToc
Final project for Consensys Bootcamp 2021
Lves lets you journal about life’s most important events and record the inner workings of your mind. Time and time again, journaling has been shown to improve your state of mind and clarify your thoughts. Now, you can write with the confidence that your life will be recorded on the blockchain, existing long after you are gone…your life doesn’t end with death. Together, we are recording the complex, varied lives of all humans who are alive today, and all humans yet to come.
artifacts
- Folder in which compiled smart contract artifacts are storedclient
- Front-end application scaffolded using vitedist
- production build of applicationsrc
- directory containing front-end application codeassets
- holds image filescomponents
- React componentscontext
- React Context definitions for application state managementcontracts
- Smart contract files generated during compilation (necessary to be withinsrc
file so it is copied from outside the folder)typechain-types
- Typescript contract definitions and code created by Typechainutils
- Utility functionsviews
- Application views or "pages"
contracts
- Smart contract files generated during compilationtest
- Smart contract unit tests
- Install Node.js (14.x+) Node install
- Have the Metamask browser extension installed. Chrome / Brave Extension Firefox Extension
- Add a
"Custom RPC"
in Metamask withNetwork Name - Localhost 8545
New RPC URL - http://127.0.0.1:8545
Chain ID - 1337
(Note: Make sure to use127.0.0.1
and notlocalhost
aslocalhost
seemingly does not resolve correctly onBrave
andChrome
browsers). See the image below on where to start adding a custom network.
- Install all project dependencies by running
npm run install-all-deps
- Add a
.env.local
file to the/client
directory and add the followingVITE_CHAIN_ID=1337
- Start the Hardhat development console
npm run start-local-node
. Thechain id
is configured to be1337
. When your local node is running you should see the text Started HTTP and WebSocket JSON-RPC server at http://127.0.0.1:8545/` showing that the port is running on8545
. - Compile and deploy contracts by opening a new tab in your terminal and from within the root directory running
npm run deploy:dev
- Grab your ETH Wallet Address from Metamask and add some test ETH to it with
npm run faucet ${YOUR_WALLET_ADDRESS}
. Example:npm run faucet 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266
- Start the client by opening a new tab in your terminal and from within the root directory running
npm start-client
- In your browser, navigate to
http://localhost:7777
where you should see the app running
- If you are testing locally and come across an error that says something similar to
Nonce too high. Expected nonce to be 0 but got 19. Note that transactions can't be queued when automining.
, follow the steps in this link to fix. https://dev.to/nmassi/comment/1dafo.
- update your
.env
file int he root of the project to include youROPSTEN_URL
andPRIVATE_KEY
(You can generate this from alchemy.io) - run
npm run deploy:ropsten
. - once this has compiled update the
VITE_CHAIN_ID
in.env.local
in theclient
folder to the chain id for Ropsten, which is 3.VITE_CHAIN_ID=3
- run
npm run build-client
(After this is run your frontend app can be deployed to the host of your choosing and will be expecting a contract on Ropsten)
Smart contract tests are in the test
folder in the top level of the project. To run them use the following command npm run test
.
https://lves-ropsten.vercel.app/
0xDDe49681e68B12Ec4FBB65e8663782DC18F0B405