Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chainstacklabs/evm-blockchain-bridge
A simplified blockchain bridge between two EVM compatible networks
https://github.com/chainstacklabs/evm-blockchain-bridge
blockchain bridge
Last synced: 7 days ago
JSON representation
A simplified blockchain bridge between two EVM compatible networks
- Host: GitHub
- URL: https://github.com/chainstacklabs/evm-blockchain-bridge
- Owner: chainstacklabs
- Created: 2022-03-07T16:15:36.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-08-16T20:36:41.000Z (about 1 year ago)
- Last Synced: 2023-09-12T13:19:26.396Z (about 1 year ago)
- Topics: blockchain, bridge
- Language: Vue
- Homepage: https://chainstack.com/how-to-create-blockchain-bridge/
- Size: 693 KB
- Stars: 28
- Watchers: 7
- Forks: 34
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Chainstack is the leading suite of services connecting developers with Web3 infrastructure
• Homepage •
Supported protocols •
Chainstack blog •
Chainstack docs •
Blockchain API reference •
• Start for free •# EVM Blockchain bridge simplified
**[You can read the full article for this project in the Chainstack blog](https://chainstack.com/how-to-create-blockchain-bridge/)**
This project contains multiple pieces to create a functional (although **not production ready**) ERC20 blockchain bridge between two EVM-compatible chains.
It uses a wallet as an escrow and leverages the events triggered by the ERC20 tokens to burn and mint tokens on each side of the bridge
## Requirements
- Node.js at least v18.15.0— [Install Node](https://nodejs.org/en)
- You'll need access to nodes in different chains to use this bridge. [Check out the Chainstack docs to learn how to deploy nodes](https://docs.chainstack.com/docs/platform-introduction).## Build & Compile
Create a Metamask wallet and get some tokens for your target networks. This code was tested with Sepolia and BNB testnet. You can get testnet tokens using the [Chainstack Faucet](https://faucet.chainstack.com/sepolia-faucet).
Clone the repository.
```sh
git clone https://github.com/chainstacklabs/evm-blockchain-bridge.git
```### Deploy smart contracts
```sh
cd solidity
```Clean install dependencies.
```sh
npm ci
```Rename `/solidity/.env.example` to `/solidity/.env` and fill in the details with your wallet address and the RPC endpoints from your Chainstack dashboard.
To deploy your contracts, run `npm run deploy:ori` and `npm run deploy:dest`.
You'll get the contract address in the console.
> You can test the contracts running `npm run test`.
### Front-end
Navigate to the `web` directory.
```sh
cd .. && cd web
```Clean install dependencies
```sh
npm ci
```Rename `/web/.env.example` to `/web/.env` and fill in the details with your wallet address, RPC endpoints, and token addresses from the deployed smart contracts.
To build the front end, run `npm run build` inside the `web` directory. You can run the front end locally with `npm run dev` or deploy the generated `dist` folder to any static site hosting.
### Back-end
The back-end service is required to run the bridge.
Navigate to the `backend` directory.
```sh
cd .. && cd backend
```Clean install dependencies
```sh
npm ci
```Rename `/backend/.env.example` to `/backend/.env` and fill in the details with your wallet address, RPC endpoints, and token addresses from the deployed smart contracts.
To start the back-end service, run `npm start`.
Once the back-end service runs, you can use the front end to send tokens through the bridge.