Welcome to the my_wallet
project! This project is a secure token wallet developed for the Internet Computer Protocol (ICP) blockchain. It supports basic functionalities such as sending and receiving IRCRC2 tokens and displays token balances.
- Project Overview
- Features
- Setup Instructions
- Running the Project Locally
- Frontend Development
- Testing
- Contributing
- Documentation
- License
The my_wallet
project includes:
- Smart Contracts: Developed in Rust for managing token transactions.
- Frontend: A web interface for interacting with the wallet.
The project uses the ICP blockchain and adheres to the IRCRC2 token standard.
- Create Tokens: Initialize tokens with an owner and balance.
- Transfer Tokens: Send tokens to other addresses.
- Fetch Balance: Display the current balance of a wallet.
- Install dfx and ensure Rust is installed.
- Ensure Node.js and npm are installed for the frontend.
-
Clone the Repository
git clone https://github.com/jhunuak47/My_wallet.git cd my_wallet
-
Build and Deploy Backend
Navigate to the backend directory and build the smart contract:
cd my_wallet_backend cargo build
Deploy the contract to the local ICP testnet:
dfx start --background dfx deploy
-
Setup Frontend
Navigate to the frontend directory, install dependencies, and start the application:
cd my_wallet_frontend npm install npm start
The frontend application will be available at
http://localhost:8080
, and it proxies API requests to the backend running at port 4943.
If you are hosting the frontend code elsewhere, ensure you adjust environment variables as follows:
- Set
DFX_NETWORK
toic
if you are using Webpack. - Replace
process.env.DFX_NETWORK
in autogenerated declarations if needed. - Configure
dfx.json
to replaceprocess.env.DFX_NETWORK
with a string in the autogenerated declarations. - Write your own
createActor
constructor if necessary.
To test your project locally, use the following commands:
# Start the replica, running in the background
dfx start --background
# Deploy canisters to the replica and generate candid interface
dfx deploy
Once deployed, your application will be accessible at http://localhost:4943?canisterId={your_canister_id}
.
Write unit tests for your smart contract in my_wallet_backend/tests
. You can run tests with:
cargo test
Contributions are welcome! If you want to contribute to the my_wallet
project, please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/YourFeature
). - Commit your changes (
git commit -am 'Add new feature'
). - Push to the branch (
git push origin feature/YourFeature
). - Create a new Pull Request.
For more information, check out these resources:
- Quick Start
- SDK Developer Tools
- Rust Canister Development Guide
- ic-cdk
- ic-cdk-macros
- Candid Introduction
This project is licensed under the MIT License. See the LICENSE file for details.
Feel free to adjust any details as needed!