Subscribing to Settled Claims

This tutorial walks you through how to subscribe to claim settlement events on the VSL network using vsl-cli. This is helpful if you're building a service that needs to react to claims once they are verified and settled.

If you haven't submitted a claim yet, check out the Submitting and Verifying Claims tutorial first.

Step 1: Enter REPL Mode

Start the interactive CLI session:

vsl-cli repl --tmp-config

This opens a temporary configuration environment for running CLI commands interactively.

Step 2: Connect to the Network

You can use either a local node or connect to the public VSL Devnet.

Option A: Local Node

vsl> server:launch --db tmp --genesis-file "genesis.json"

Option B: Remote Devnet

vsl> network:add remote --url https://rpc.vsl.pi2.network
vsl> network:use remote

Check the connection:

vsl> health:check

Step 3: Subscribe to Settled Claims

Use the claim:settled command with the --follow flag to listen for new settled claims as they appear:

vsl> claim:settled --follow

This command keeps the session open and prints new claim settlement events in real time.

You’ll see outputs like:

{
  "id": "0x123...",
  "type": "identity",
  "client": "0xabc...",
  "verifier": "0xdef...",
  "timestamp": 1710000000
}

You can also include the --json flag to get machine-readable output for use in scripts or integrations:

vsl> claim:settled --follow --json

Step 4: Optional Filtering (Future Support)

Right now, subscriptions stream all settled claims. If you want to filter by verifier or claim type, you’ll need to do so in your own application logic or scripting layer.

Step 5: Stop the Stream

To exit the live subscription, press Ctrl + C in your terminal.

What’s Next?

You can now react to claim settlement events in real time. Consider using this in services like automated payouts, badge issuance, or analytics.

Explore more in these tutorials:

Need help? Join our Discord community and ask questions or share feedback.

Last updated

Was this helpful?