Skip to content

doitian/ckb-otx-swap

Repository files navigation

This is a demo to swap CKB and SUDT automatically using Open Transaction (OTX).

Getting Started

  1. Download open-transaction-pool and build the executable.

    git clone https://github.com/doitian/open-transaction-pool.git ../open-transaction-pool/
    pushd ../open-transaction-pool/
    cargo build --release
    popd
  2. Use the config file open-transaction-pool.toml in this repository to start open-transaction-pool.

    ../open-transaction-pool/target/release/open-transaction-pool -c open-transaction-pool.toml
  3. Generate development key pairs for the web server.

    npm run init
    
  4. Run the development server.

    npm run dev
    # or
    yarn dev
    # or
    pnpm dev

Open http://localhost:3000 with your browser to see the demo.

Steps to Send a Swap Proposal

  • First go to the assets page http://localhost:3000/assets
  • Claim CKB via Faucet
  • Issue SUDT when there are some CKBs in the account.
  • Use the buttons in the assets list to initiate the swap proposal.

Attentions

  • As of now, the open transaction pool lacks a P2P extension for broadcasting open transactions. Thus, it is essential to share a single pool instance among multiple users.
  • The demo requires exact match on the amount of CKB and SUDT.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published