Skip to content

gregdhill/interbtc-clients

 
 

Repository files navigation

InterBTC Clients

Faucet, Oracle & Vault / Relayer

This project is currently under active development.

Prerequisites

Download and start Bitcoin Core:

bitcoind -regtest -server

Build and run the BTC Parachain:

git clone [email protected]:interlay/btc-parachain.git
cd btc-parachain
cargo run --release -- --dev

Generate an address and mine some blocks:

address=`bitcoin-cli -regtest getnewaddress`
bitcoin-cli -regtest generatetoaddress 101 $address

Note: This may require rpcuser and rpcpassword to be set.

Alternatively run bitcoin-cli from docker:

docker run --network host --entrypoint bitcoin-cli ruimarinho/bitcoin-core:0.20 -regtest -rpcuser=rpcuser -rpcpassword=rpcpassword ${COMMAND}

Development

Building requires a specific rust toolchain and nightly compiler version. The requirements are specified in the ./rust-toolchain.toml override file.

Running rustup show from the root directory of this repo should be enough to set up the toolchain and you can inspect the output to verify that it matches the version specified in the override file.

Getting Started

Oracle

The BTC Parachain requires a price oracle to calculate collateralization rates, for local development we can run this client to automatically update the exchange rate at a pre-determined time interval.

cargo run --bin oracle

Vault

The Vault client is used to intermediate assets between Bitcoin and the BTC Parachain. It is also capable of submitting Bitcoin block headers to the BTC Parachain.

source .env
cargo run --bin vault

Troubleshooting

Too many open files

On cargo test the embedded parachain node in the integration tests can consume a lot of resources. Currently the best workaround is to increase the resource limits of the current user.

Use ulimit -a to list the current resource limits. To increase the maximum number of files set ulimit -n 4096 or some other reasonable limit.

About

InterBTC Clients | Vault, Oracle, Faucet

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 99.4%
  • Other 0.6%