Welcome to the KongSwap project. This document will guide you through setting up and running the project locally.
- 🦍 KongSwap
To get started, explore the project directory structure to familiarize yourself with the components and scripts available.
Ensure you have the following installed on your development environment:
- Operating System: Linux/MacOS (e.g., Ubuntu 24.04.01)
- Rust/Cargo: Version 1.80.1
- Node.js/pnpm: Node v22.9.0, pnpm 10.8.3
- Dfinity CDK (dfx): Version 0.24.0
- jq: Command-line JSON processor
Follow these steps to set up and run the project:
Start the Internet Computer replica in the background. Use the --clean option to start from scratch, but note that this will erase all existing data.
# Start the replica
dfx start --clean --backgroundNote: You may need to stop any running replicas first using
dfx stopordfx killall.
This step only needs to be done once.
Create user identities for the project.
# Navigate to the scripts directory
cd scripts/local
# Run the identity creation script
./create_identity.shTip: Use
dfx identity listto view the list of created users.
Compile and deploy your canisters locally. This process may take some time.
# Deploy canisters
./deploy_kong.shIf successful, you will see URLs for accessing the frontend and backend canisters.
The system is initially empty. You need to add tokens and liquidity pools. Modify the deploy_tokens_pools.sh script to adjust settings like amounts and prices.
# Deploy tokens and pools
./deploy_tokens_pools.shOnce everything is deployed and running, access the frontend at:
http://oaq4p-2iaaa-aaaar-qahqa-cai.localhost:4943/
After completing these steps, KongSwap should be fully operational. For further customization or troubleshooting, refer to the scripts and documentation within the project directory.
If you encounter issues or need to reset the project, follow these steps:
- Stop the replica:
dfx stop dfx killall
- Remove the
.dfxandnode_modulesfolders:rm -rf .dfx rm -rf node_modules
- Clean the Cargo cache:
cargo clean
- Start the replica again:
dfx start --clean --background
- Deploy the canisters again:
./deploy_kong.sh
Run cargo uninstall cargo-audit and try again.