Skip to Content
Liquidity ProvidersLP Light-RPC node

LP Light RPC node

As of version 1.12.0, to call the LP RPC endpoints, you must run your own LP Light RPC node. Operating a Chainflip light-RPC node is straightforward and resource-efficient. The LP light-rpc node is just a normal Chainflip node running in a specialized --sync light-rpc mode. Your LP account key must be injected in the node’s keystore to be able to expose the LP RPC endpoints and submit extrinsics.

This light-rpc mode prunes older blocks and permits querying only recent blocks, significantly reducing disk space requirements compared to running a full node. The recommended minimum requirements for running a light-rpc node include:

  • 2 vCPU
  • 4 GB RAM
  • 20 GB SSD

Running the LP light-rpc node using Docker

Reference setup and compose profiles: chainflip-mainnet-apis 

Setup

  • Clone the chainflip-mainnet-apis repo
git clone https://github.com/chainflip-io/chainflip-mainnet-apis.git cd chainflip-mainnet-apis

LP account key

⛔️ Please make sure you backup your keys. If you lose your keys, you will lose access to your funds. ⛔️

  • If you have an existing LP account key, copy it to the ./chainflip/keys/lp/signing_key_file file. Please make sure that the key is in the correct location, otherwise it won’t be properly injected into the node’s keystore.

If you don’t have an LP account key, you can generate one using the following steps.

mkdir -p ./chainflip/keys/lp docker run --platform=linux/amd64 --entrypoint=/usr/local/bin/chainflip-cli chainfliplabs/chainflip-cli:berghain-1.12.0 generate-keys --json > chainflip/lp-keys.json cat chainflip/lp-keys.json | jq -r '.signing_key.secret_key' > chainflip/keys/lp/signing_key_file

Funding the Account

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 the public key of the Broker account:

cat chainflip/lp-keys.json | jq -r '.signing_account_id'
  • Head to the Auctions Web App 

  • Click “Register Node” and follow the instructions to fund the account

Running the node

  • Start an LP RPC node and wait for it to sync:
docker compose --profile lp up -d
  • View the logs to monitor sync progress
docker compose --profile lp logs -f

You should see something like this:

node-with-lp-1 | 2025-10-30 10:42:26 Chainflip Node node-with-lp-1 | 2025-10-30 10:42:26 ✌️ version 1.12.0-11b2cc9c943 node-with-lp-1 | 2025-10-30 10:42:26 ❤️ by Chainflip Team <https://github.com/chainflip-io>, 2021-2025 node-with-lp-1 | 2025-10-30 10:42:26 📋 Chain specification: Chainflip-Berghain node-with-lp-1 | 2025-10-30 10:42:26 🏷 Node name: decorous-paper-9644 node-with-lp-1 | 2025-10-30 10:42:26 👤 Role: FULL node-with-lp-1 | 2025-10-30 10:42:26 💾 Database: RocksDb at /etc/chainflip/chaindata/chains/Chainflip-Berghain/db/full_light node-with-lp-1 | 2025-10-30 10:42:26 ⚡ Light-RPC mode enabled node-with-lp-1 | 2025-10-30 10:42:26 Deleting old db files and recreating a new RocksDB database on startup. node-with-lp-1 | 2025-10-30 10:42:28 🔨 Initializing Genesis block/state (state: 0xceb9…3b8d, header-hash: 0x8b8c…6eb9) node-with-lp-1 | 2025-10-30 10:42:29 🏷 Local node identity is: 12D3KooWGP9hRqHK4mqKsGH55PyvDijQKtKDyvJSFMxmo3T7dj2T node-with-lp-1 | 2025-10-30 10:42:29 Running libp2p network backend node-with-lp-1 | 2025-10-30 10:42:29 🗝️ Lp key found in the keystore, enabling LP-related RPCs node-with-lp-1 | 2025-10-30 10:42:29 💻 Operating system: linux node-with-lp-1 | 2025-10-30 10:42:29 💻 CPU architecture: x86_64 node-with-lp-1 | 2025-10-30 10:42:29 💻 Target environment: gnu node-with-lp-1 | 2025-10-30 10:42:29 💻 Memory: 23996MB node-with-lp-1 | 2025-10-30 10:42:29 💻 Kernel: 6.10.14-linuxkit node-with-lp-1 | 2025-10-30 10:42:29 💻 Linux distribution: Ubuntu 22.04.5 LTS node-with-lp-1 | 2025-10-30 10:42:29 💻 Virtual machine: no node-with-lp-1 | 2025-10-30 10:42:29 📦 Highest known block at #0 node-with-lp-1 | 2025-10-30 10:42:29 〽️ Prometheus exporter started at 127.0.0.1:9615 node-with-lp-1 | 2025-10-30 10:42:29 Running JSON-RPC server: addr=0.0.0.0:9944, allowed origins=["*"]

Make sure:

  • To see that light-rpc mode is enabled in the logs. Log line similar to: ⚡ Light-RPC mode enabled

  • LP key is properly injected and LP RPC endpoints are enabled. Log line similar to: 🗝️ Lp key found in the keystore, enabling LP-related RPCs

  • Wait until the node is synced before start making RPC calls. This should take around 2 minutes.

💡 Note: Your node is considered synced when you see logs similar to:

node-with-lp-1 | 2025-10-30 10:53:49 🏆 Imported #10260208 (0xe26d…ad53 → 0xc279…f190) node-with-lp-1 | 2025-10-30 10:53:54 💤 Idle (8 peers), best: #10260208 (0xc279…f190), finalized #10260206 (0x0507…e82d), ⬇ 229.9kiB/s ⬆ 184.4kiB/s node-with-lp-1 | 2025-10-30 10:53:55 🏆 Imported #10260209 (0xc279…f190 → 0x7cb8…21f4)
  • You can check the node’s health and verify it is synced by using this RPC call:
curl -H "Content-Type: application/json" \ -d '{"id":1, "jsonrpc":"2.0", "method": "system_health"}' \ http://localhost:9944

You should a response showing that isSyncing is false, similar to:

{"jsonrpc":"2.0","result":{"peers":8,"isSyncing":false,"shouldHavePeers":true},"id":1}
  • To stop the node:
docker compose --profile lp down

Interacting with the APIs

Now you can interact with the APIs using any HTTP or WS client. Here we use the curl and wscat commands.

Register the LP account via RPC

curl -H "Content-Type: application/json" \ -d '{"id":1, "jsonrpc":"2.0", "method": "lp_register_account", "params": [0]}' \ http://localhost:9944
  • For example, to request a liquidity deposit address for ETH :
curl -H "Content-Type: application/json" \ -d '{"id":1, "jsonrpc":"2.0", "method": "lp_request_liquidity_deposit_address_v2", "params": ["ETH"]}' \ http://localhost:9944
  • Subscribe to order fills. Note that subscriptions are only supported over WebSockets.
wscat -c ws://localhost:9944 -x '{ "id": 1, "jsonrpc": "2.0", "method": "lp_subscribe_order_fills"}'

Migrating from LP-API Binary

If you’re upgrading from a previous version that used separate LP API binary service, the new LP light-rpc mode provides a simplified architecture where all APIs are exposed directly onto the rpc node. There are no additional steps that are required from your side because all the same endpoints are exposed on the rpc node. All you have to do is:

  • Make sure that your LP key is in the right location so that it can be properly injected into the node’s keystore. Follow the steps in LP account key
  • Redirect all your bots or external services from the old binary port to the new light-rpc node port.

To give you a better idea of the new architecture, here is a visual comparison of the old and new architecture:

  • Before version 1.12.0, you needed to run 2 services: the LP API binary and an RPC node. The signing key is injected into the LP API binary’s keystore.
LP API binary and RPC node
  • As of version 1.12.0, the LP and general RPCs are consolidated as part of the node itself. the signing key is injected into the node’s keystore on startup.
LP Light-RPC node

Running the LP light-rpc node using chainflip-node binary

This section is for users who do not want to use Docker compose, and want to directly use chainflip-node binary compiled from source code or obtained using apt.

The main goal of LP light-rpc mode is to enable LPs to track only latest chain blocks data and in particular be able to make rpc calls that require signed extrinsics such as set_limit_order, lp_update_limit_order etc …

  • The first step is to inject the LP Signing Key inside the chainflip node. This can be achieved using this command
/usr/local/bin/chainflip-node key insert \ --chain=/etc/chainflip/berghain.chainspec.json \ --base-path=/etc/chainflip/chaindata \ --suri=0x$$(cat /etc/chainflip-keys/lp/signing_key_file) \ --key-type=lqpr \ --scheme=sr25519

NB: please change /etc/chainflip-keys/lp/signing_key_file with location of your LP signing key file

  • Then run the node in light-rpc mode, by simply calling the chainflip-node binary with some special command line arguments that makes the node prune blocks minimising disk space. This will require about 20GB of disk space.
/usr/local/bin/chainflip-node \ --base-path=/etc/chainflip/chaindata \ --chain=/etc/chainflip/berghain.chainspec.json \ --max-runtime-instances=32 \ --rpc-cors=all \ --rpc-methods=safe \ --rpc-external \ --sync=light-rpc \ --blocks-pruning=128 \ --state-pruning=128 \ --disable-log-color \ --log info,grandpa=error,runtime::grandpa=off,aura=error,babe=error,txpool::api=error

If you inspect the above command we achieve disk space-saving by a combination of methods:

  • Enabling Chainflip special light-rpc sync mode using: --sync=light-rpc
  • Setting the number of blocks data to prune to 128 using: --blocks-pruning=128
  • Setting the number of blocks state data to prune to 128 using: --state-pruning=128
Last updated on