A cross-chain asset swap platform built on the Internet Computer Protocol (ICP) that enables seamless asset transfers between different blockchain networks.
Blockchain Junction is a decentralized application (dApp) that facilitates cross-chain asset swaps through a sophisticated backend canister written in Rust and a modern React frontend. The platform supports multiple blockchain networks including Internet Computer, Bitcoin, and Ethereum, providing users with a unified interface for managing cross-chain assets.
- Cross-Chain Asset Swaps: Seamlessly swap assets between different blockchain networks
- Multi-Chain Support: Currently supports ICP, Bitcoin, and Ethereum networks
- Secure Authentication: Internet Identity integration for secure user authentication
- Real-time Balance Management: Track asset balances across multiple chains
- Modern UI/UX: Beautiful, responsive interface with glass morphism design
- Decentralized Architecture: Fully decentralized backend running on ICP canisters
This project consists of two main components:
- Backend Canister (
src/blockchain_junction_backend/): Rust-based smart contract handling cross-chain logic - Frontend Application (
src/blockchain_junction_frontend/): React-based web interface
- UI/UX Overhaul: Complete redesign with modern glass morphism effects and animations
- JSX Syntax Fixes: Resolved all React compilation errors and mismatched tags
- Enhanced Styling: Added comprehensive CSS utilities and responsive design
- Component Architecture: Modular component structure with reusable glass cards
- Animation System: Integrated Framer Motion for smooth animations and transitions
Before you begin, ensure you have the following installed:
- Node.js (v16 or higher)
- npm or yarn
- DFX (DFINITY Canister SDK) - Installation Guide
- Git
First, install dependencies in both the project root and frontend directory:
# Install dependencies in project root
npm install
# Navigate to frontend directory and install dependencies
cd src/blockchain_junction_frontend/
npm install
# Return to project root
cd ../..Purpose: This installs all necessary packages for both the backend canister development and the React frontend application.
dfx start --backgroundPurpose: Starts the local Internet Computer replica in the background, allowing you to continue using the terminal while the network runs.
dfx start --cleanPurpose: Starts the local network with a clean state, removing all previous canister data and deployments. Use this when you want to reset everything.
dfx identity listPurpose: Lists all available DFX identities on your system. Identities are used to manage different developer accounts and permissions.
dfx identity new <identity-name>Purpose: Creates a new identity for development. Replace <identity-name> with your desired name (e.g., my-dev-identity).
dfx identity whoamiPurpose: Shows which identity is currently active. This identity will be used for deployments and canister calls.
dfx identity use <your-identity-name>
# or use default
dfx identity use defaultPurpose: Switches to a specific identity. Use "default" for the default identity or specify your custom identity name.
dfx deployPurpose: Compiles and deploys both the backend canister (Rust) and frontend canister to your local Internet Computer network. This makes your application accessible locally.
After successful deployment, you'll see output similar to:
URLs:
Frontend canister via browser
blockchain_junction_frontend: http://127.0.0.1:4943/?canisterId=<canister-id>
Backend canister via Candid interface
blockchain_junction_backend: http://127.0.0.1:4943/_/candid?id=<canister-id>
Warning: Mainnet deployment costs cycles (ICP tokens). Ensure you have sufficient cycles before proceeding.
# Check available identities
dfx identity list
# Create production identity (recommended)
dfx identity new production
# Check current identity
dfx identity whoami
# Switch to production identity
dfx identity use production# Redeem faucet coupon (if you have one)
dfx cycles redeem-faucet-coupon <coupon-code> --icPurpose: Redeems a cycles faucet coupon to get free cycles for deployment. Replace <coupon-code> with your actual coupon code.
dfx cycles balance --icPurpose: Displays your current cycles balance on the mainnet. You need cycles to deploy and run canisters on the Internet Computer.
dfx deploy --icPurpose: Deploys your application to the Internet Computer mainnet. This makes your application publicly accessible on the decentralized web.
cd src/blockchain_junction_frontend/
npm run devPurpose: Starts the Vite development server for hot-reloading during frontend development.
cd src/blockchain_junction_frontend/
npm run buildPurpose: Creates an optimized production build of the frontend application.
| Command | Purpose |
|---|---|
dfx start --background |
Start local IC network in background |
dfx start --clean |
Start with clean state |
dfx stop |
Stop local IC network |
dfx deploy |
Deploy to local network |
dfx deploy --ic |
Deploy to mainnet |
dfx canister status --all |
Check status of all canisters |
dfx cycles balance |
Check cycles balance (local) |
dfx cycles balance --ic |
Check cycles balance (mainnet) |
-
"dfx command not found"
- Install DFX:
sh -ci "$(curl -fsSL https://internetcomputer.org/install.sh)"
- Install DFX:
-
"Port already in use"
- Stop existing DFX:
dfx stop - Then restart:
dfx start --background
- Stop existing DFX:
-
"Insufficient cycles"
- Get cycles from faucet or purchase ICP tokens
- Convert ICP to cycles:
dfx cycles convert <amount>
-
Frontend not loading
- Ensure both backend and frontend are deployed
- Check canister URLs in deployment output
- Verify local network is running
After successful deployment:
- Test the cross-chain swap functionality
- Explore the Candid interface for backend testing
- Customize the frontend for your specific needs
- Add additional blockchain integrations
- Implement comprehensive testing
For more detailed information, refer to the Internet Computer Documentation.
To get started, you might want to explore the project directory structure and the default configuration file. Working with this project in your development environment will not affect any production deployment or identity tokens.
To learn more before you start working with blockchain_junction, see the following documentation available online:
- Quick Start
- SDK Developer Tools
- Rust Canister Development Guide
- ic-cdk
- ic-cdk-macros
- Candid Introduction
If you want to start working on your project right away, you might want to try the following commands:
cd blockchain_junction/
dfx help
dfx canister --help