Skip to content

One Stake, Endless Opportunities. Build with Polkadot SDK (Substrate).

License

Notifications You must be signed in to change notification settings

bifrost-io/bifrost

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

82840d1 · Aug 30, 2021
Jun 29, 2021
Aug 13, 2021
Aug 7, 2021
Aug 17, 2021
Aug 27, 2021
Aug 27, 2021
Aug 30, 2021
Aug 13, 2021
Aug 27, 2021
Aug 27, 2021
Oct 8, 2019
Sep 6, 2019
Aug 13, 2021
Aug 27, 2021
Aug 27, 2021
Aug 6, 2021
Jun 4, 2021
Jul 29, 2019
Aug 17, 2021
Aug 27, 2021
Jul 22, 2021

Repository files navigation

Bifrost Banner

Bifrost Logo

Welcome,

Bifrost is a DeFi protocol to provide derivative for pledged assets.

👉 Discover the Bifrost project at bifrost.finance.
👉 Learn to use the Bifrost network with our technical docs.

🐣 Supported by

Web3 Foundation Grants Substrate Builders Program Web3 Bootcamp

master-build Codacy Badge Substrate Version Docker License Telegram Twitter Medium

Install Rust and required tools

curl https://sh.rustup.rs -sSf | sh
make init

Build binary

make build-all-release

Testing

make test-all

Generate runtime weights

if runtime logic change we may do the benchmarking to regenerate WeightInfo for dispatch calls

make run-benchmarking

Testing runtime migration

If modify the storage, should test the data migration before production upgrade.

make try-bifrost-runtime-upgrade

Run development chain

RUST_LOG=debug cargo run -p node-cli --locked --features "with-dev-runtime" -- --tmp --dev 

Run local testnet with polkadot-launch

Install polkadot-launch

yarn global add polkadot-launch
cd -

Build polkadot

git clone -n https://github.com/paritytech/polkadot.git /tmp/polkadot
cd /tmp/polkadot
git checkout release-v0.9.9
cargo build --release
cd -

Launch Polkadot and the parachain

cd -
polkadot-launch ./scripts/bifrost-launch.json

It will take about 1-2 minutes for the parachain to start producing blocks.

Run local testnet with parachain-launch

Install parachain-launch

yarn global add @open-web3/parachain-launch

Generate docker files

parachain-launch generate --config=scripts/bifrost-docker-launch.yml --yes

It will pull images and generate required docker files in a folder called output in your current working directory

Start relaychain and parachain

To start the nodes, navigate to the output folder that the generated docker scripts in and start containers:

cd ./output
docker-compose up -d --build

Run full node with docker

Create bifrost-fullnode directory, generate node-key and get bifrost.json

mkdir -p ~/bifrost-fullnode/network
subkey generate-node-key --file ~/bifrost-fullnode/network/node-key
wget -O ~/bifrost-fullnode/bifrost.json https://github.com/bifrost-finance/bifrost/releases/download/bifrost-v0.8.0/bifrost.json

Start the node with docker

Replace your-fullnode-name

docker pull bifrostnetwork/bifrost:v0.8.3
docker run -d \
-v ~/bifrost-fullnode:/bifrost \
-p 9944:9944 \
-p 9933:9933 \
-p 30333:30333 \
-p 9615:9615 \
bifrostnetwork/bifrost:v0.8.3 \
  --name your-fullnode-name \
  --base-path "/bifrost" \
  --node-key-file "/bifrost/network/node-key" \
  --chain "/bifrost/bifrost.json" \
  --parachain-id 2001 \
  --pruning=archive \
  --prometheus-external \
  --rpc-external \
  --ws-external \
  --rpc-cors all \
  --execution wasm