Faucet, Oracle & Vault / Relayer
This project is currently under active development.
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
andrpcpassword
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}
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.
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
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
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.