ConfidentialLedgerClient.GetConstitutionAsync(RequestContext) Method

Definition

[Protocol Method] Gets the constitution used for governance.

  • This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
public virtual System.Threading.Tasks.Task<Azure.Response> GetConstitutionAsync (Azure.RequestContext context = default);
abstract member GetConstitutionAsync : Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetConstitutionAsync : Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetConstitutionAsync (Optional context As RequestContext = Nothing) As Task(Of Response)

Parameters

context
RequestContext

The request context, which can override default behaviors of the client pipeline on a per-call basis.

Returns

The response returned from the service.

Exceptions

Service returned a non-success status code.

Examples

This sample shows how to call GetConstitutionAsync and parse the result.

TokenCredential credential = new DefaultAzureCredential();
ConfidentialLedgerClient client = new ConfidentialLedgerClient(new Uri("http://localhost:3000"), credential);

Response response = await client.GetConstitutionAsync();

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("digest").ToString());
Console.WriteLine(result.GetProperty("script").ToString());

This sample shows how to call GetConstitutionAsync with all request content and parse the result.

TokenCredential credential = new DefaultAzureCredential();
ConfidentialLedgerClient client = new ConfidentialLedgerClient(new Uri("http://localhost:3000"), credential);

Response response = await client.GetConstitutionAsync();

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("digest").ToString());
Console.WriteLine(result.GetProperty("script").ToString());

Remarks

The constitution is a script that assesses and applies proposals from consortium members.

Below is the JSON schema for the response payload.

Response Body:

Schema for Constitution:

{
  digest: string, # Required. SHA256 digest of the constitution script.
  script: string, # Required. Contents of the constitution.
}

Applies to