Skip to content

arcane-finance-defi/mixer-operator

Repository files navigation

Miden mixer operator

The mixer operator is a Rust-based off-chain service that generates consume-note transactions using the provided cross-chain notes and preconfigured public faucet accounts.

API

The service provides singe endpoint POST /mix that generates tx from the note and account and returns tx id

Configuration

./Rocket.toml contains the configs for the service

Config keys

  • rpc_url URL of miden node GRPC api
  • rpc_timeout_ms miden rpc request timeout in milliseconds
  • public_account_ids comma separated list of public faucet accounts on miden chain to work with

Prerequisites

  • rust v1.88.0

How to run

Start the service with the cmd

cargo run --release

How to deploy

  1. Build the service with target x86_64-unknown-linux-gnu
  2. Connect to the server via SSH ssh [email protected]
  3. Stop the previous version killall mixer-operator
  4. Copy the binaries to the server scp ./target/x86_64-unknown-linux-gnu/release/mixer-operator [email protected]:/root/mixer/mixer-operator
  5. Start the service cd ./mixer && nohup ./mixer-operator &

How to test

Test prerequisites

  • Latest version of miden-bridge CLI (Install with cargo install --git https://github.com/arcane-finance-defi/miden-bridge-cli miden-client-cli command)
  • Foundry toolchain
  1. Cleanup previous cli configs rm -r miden-client.toml store.sqlite3 templates keystore
  2. Fill .env file. cp .env.example .env and fill the TEST_PRIVATE_KEY env var with EVM private key of the source test account, TEST_RECEIVER_ADDRESS with public EVM address of target account, TEST_USDC_AMOUNT to specify custom amount of USDC tokens to be mixed. DO NOT USE THE ACCOUNT THAT HOLDS ANY REAL ASSETS. THE PRIVATE KEY WILL BE INCLUDED INTO THE TEST LOGS
  3. Run test with cargo test --package mixer-operator --test mixing_flow test_usdc_mixing_flow -- --exact (may take some time)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors 4

  •  
  •  
  •  
  •  

Languages