This directory contains examples of creating channels and hooks using both the TypeScript SDK and Solidity scripts.
- Get pnpm installed.
- Create a copy of
.envfile by copying the content from.env.example, follow the instruction to set it up. - Install dependencies by running:
pnpm install. - Optional: You may want to test against a local anvil node.
- To setup and run anvil locally, see Anvil document.
- Follow the
README.mdfile in protocol folder to deploy the contracts to anvil node
The TypeScript examples use the @ecp.eth/sdk package to interact with the protocol.
Create a channel:
npm run create-channelThe Solidity examples use Foundry to interact with the protocol directly.
- Ensure Foundry is installed:
curl -L https://foundry.paradigm.xyz | bash
foundryupCreate a channel:
forge script solidity/CreateChannel.s.sol --rpc-url $RPC_URL --broadcastReplace $RPC_URL with the url of RPC node for the target chain.
- DO NOT use your real wallet or private key for testing
- Make sure you have enough ETH to pay for the channel creation fee
- The private key should be kept secure and never committed to version control
- The examples use the mainnet network by default