git clone https://github.com/chainflip-io/chainflip-perseverance.git
cd chainflip-perseverance
mkdir -p ./chainflip/keys/lp
mkdir -p ./chainflip/keys/broker
docker run --platform=linux/amd64 --entrypoint=/usr/local/bin/chainflip-cli chainfliplabs/chainflip-cli:perseverance generate-keys --json > chainflip/lp-keys.json
docker run --platform=linux/amd64 --entrypoint=/usr/local/bin/chainflip-cli chainfliplabs/chainflip-cli:perseverance generate-keys --json > chainflip/broker-keys.json
cat chainflip/broker-keys.json | jq -r '.signing_key.secret_key' > chainflip/keys/broker/signing_key_file
cat chainflip/lp-keys.json | jq -r '.signing_key.secret_key' > chainflip/keys/lp/signing_key_file
Note: The minimum funding amount for registering as a Broker or LP role is technically 1 FLIP. However, we recommend funding your accounts with at least 5 FLIP to account for transaction fees.
-
Get some
tFLIP
a. Add the
tFLIP
token to your wallet using the following address:0xdC27c60956cB065D19F08bb69a707E37b36d8086
b. Get in touch with us on Discord and we'll send you some
tFLIP
-
Get the public key of the Broker or LP account:
# Broker
cat chainflip/broker-keys.json | jq -r '.signing_account_id'
# LP
cat chainflip/lp-keys.json | jq -r '.signing_account_id'
- Then head to the Auctions Web App
- Connect your wallet
- Click "Add Node"
- Follow the instructions to fund the account
💡 Note: By default, the Node, LP and Broker APIs accept connection from any host. This is intentional to make testing easier. However, if you wish to make this more secure, feel free to update the ports in the
docker-compose.yml
file to only accept connections fromlocalhost
.
This can be achieved by adding
127.0.0.1:
before the port number. For example:
lp:
image: chainfliplabs/chainflip-lp-api:perseverance
pull_policy: always
stop_grace_period: 5s
stop_signal: SIGINT
platform: linux/amd64
restart: unless-stopped
ports:
- "127.0.0.1:10589:80"
volumes:
- ./chainflip/keys/lp:/etc/chainflip/keys
entrypoint:
- /usr/local/bin/chainflip-lp-api
command:
- --state_chain.ws_endpoint=ws://node:9944
depends_on:
- node
Start by starting the node and wait for it to sync:
docker compose up node -d
docker compose logs -f
💡 Note: You know that your node is synced once you start seeing logs similar to the following:
chainflip-perseverance-node-1 | 2023-10-13 16:02:00 ✨ Imported #614404 (0x990b…be63)
Once the node is synced you can start the APIs:
docker compose up -d
docker compose logs -f
If you want to only start the Broker API, you can run:
docker compose up -d broker
docker compose logs -f broker
If you want to only start the LP API, you can run:
docker compose up -d lp
docker compose logs -f lp
You can connect to your local RPC using PolkadotJS to see chain events.
Note: The following commands take a little while to respond because it submits and waits for finality.
Register a broker account:
curl -H "Content-Type: application/json" \
-d '{"id":1, "jsonrpc":"2.0", "method": "broker_registerAccount"}' \
http://localhost:10997
Request a swap deposit address:
curl -H "Content-Type: application/json" \
-d '{"id":1, "jsonrpc":"2.0", "method": "broker_requestSwapDepositAddress", "params": ["ETH", "FLIP","0xabababababababababababababababababababab", 0]}' \
http://localhost:10997
Register an LP account:
curl -H "Content-Type: application/json" \
-d '{"id":1, "jsonrpc":"2.0", "method": "lp_register_account", "params": [0]}' \
http://localhost:10589
Register a liquidity refund address:
Before you can deposit liquidity, you need to register a liquidity refund address. This is the address that will receive your liquidity back when you withdraw it.
curl -H "Content-Type: application/json" \
-d '{"id":1, "jsonrpc":"2.0", "method": "lp_register_liquidity_refund_address", "params": {"chain": "Ethereum", "address": "0xabababababababababababababababababababab"}}' \
http://localhost:10589
Request a liquidity deposit address:
curl -H "Content-Type: application/json" \
-d '{"id":1, "jsonrpc":"2.0", "method": "lp_liquidity_deposit", "params": ["ETH"]}' \
http://localhost:10589
For more details please refer to the Integrations documentation.