This project is part of the [Alchemy University Ethereum Developer Bootcamp]
This project is an example of using a client and server to facilitate transfers between different addresses. Since there is just a single server on the back-end handling transfers, this is clearly very centralized. We won't worry about distributed consensus for this project.
You can transfer funds from an account using his associated private key to another account suing his public key. To ensure that the person trying to move the fund is the owner, a message is signed using the private key. Then the signed message is sent to the server that will check if the signed message is associated to the sender account. If the sender possess the funds and the signed message is correct, the funds will be sent. To ensure that a signed message can't be used again to process the same transaction again and again, a nonce representing the number of transaction done is included in the signed message.
The client folder contains a react app using vite. To get started, follow these steps:
- Open up a terminal in the
/client
folder - Run
npm install
to install all the depedencies - Run
npm run dev
to start the application - Now you should be able to visit the app at http://127.0.0.1:5173/
The server folder contains a node.js server using express. To run the server, follow these steps:
- Open a terminal within the
/server
folder - Run
npm install
to install all the depedencies - Run
node index
to start the server
The application should connect to the default server port (3042) automatically!
Hint - Use nodemon instead of node
to automatically restart the server on any changes.