Developers
Blueprint SDK Contexts
Tangle Services Context

Service Context

The ServiceContext trait provides a standardized interface for accessing service operator information and metadata from within your Blueprint through the Services pallet.

Overview

The ServiceContext trait provides access to service-related functionality that enables:

  • Operator Information - Query details about active service operators
  • Stake Data - Access operator stake and restake asset information
  • Service Metadata - Get metadata about the Blueprint instance
  • Multi-Party Coordination - Build complex services leveraging operator data

Using the Context

1. Define Your Context

First, define your context struct that implements the ServiceContext trait:

2. Access Service Information

You can then use this context to access service operator data and metadata: