Welcome to the KongSwap project. This document will guide you through setting up and running the project locally.
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:
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 --background
Note: You may need to stop any running replicas first using
dfx stop
ordfx 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.sh
Tip: Use
dfx identity list
to view the list of created users.
Compile and deploy your canisters locally. This process may take some time.
# Deploy canisters
./deploy_kong.sh
If 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.sh
Once 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:
dfx stop
dfx killall
.dfx
and node_modules
folders:
rm -rf .dfx
rm -rf node_modules
cargo clean
dfx start --clean --background
./deploy_kong.sh
Run cargo uninstall cargo-audit
and try again.