Skip to main content

Invite To Context

Invite to context with Admin Dashboard​

  • Currently not available

Invite to context with the CLI using meroctl​

Inviting to the context consists of 3 steps:

  1. Identity Exchange: The peer wishing to join (invitee) shares their identity with the existing member (invitor).
  2. Create Invitation: The invitor generates an invitation payload for the context.
  3. Accept Invitation: The invitee signs the invitation payload to confirm their identity and join the context.

In the example below, Node 2 is the coordinator node (invitee), and Node 1 is the user node (invitor).

Step-by-Step Process​

  1. Invitee Generates and Shares Identity To join the context, the invitee must first create and share their identity with the invitor. This can be done using the following command:
Node 2
context identity new

This generates a private and public key pair, where the public key is the inviteeContextIdentity. Share this public key with the invitor.

Example
context identity new
β”‚ Private Key: G5pK45VAegesDwvHqyQsZ6NNQyRPjZ7YQLJSz1XBfpdc
β”‚ Public Key: 21A1pcDPMJTH6bQb1xRw1i1JqDRmvysxYp7eEQMnz3sp
  1. Invitor Creates an Invitation Once the invitee’s public key is shared, the invitor generates an invitation to the context using the following command:
Node 1
context invite {contextId} {invitorContextIdentity} {inviteeContextIdentity}
Example
context invite GjJEnAwfLVPveyUWaGqJspzUXndyJkNWgD7M5uDNQZqv 62HEbeSo6NKLufZZALVvEUthQGcf6G3A4g1ug2KKjELg 21A1pcDPMJTH6bQb1xRw1i1JqDRmvysxYp7eEQMnz3sp
β”‚ Invited 21A1pcDPMJTH6bQb1xRw1i1JqDRmvysxYp7eEQMnz3sp to context GjJEnAwfLVPveyUWaGqJspzUXndyJkNWgD7M5uDNQZqv
β”‚ Invitation Payload: 3FdouEaEdTWtP6YBH3tjXgBJixiVF921t9DxTPbie5GVkhxjMQH7ipkB9h3RAA6EjGYEF5eugjuC154WRUx71eDRoZkdJ94ucZdyWXEA461BQyaQjS3GzQtimcqMWG9UbP7eGoci3jKnJycuoadLhVd

To check the invitor's identity, use this command:

Node 1
context identity ls {contextId}
Example
context identity ls GjJEnAwfLVPveyUWaGqJspzUXndyJkNWgD7M5uDNQZqv
β”‚ Identity | Owned β”‚
21A1pcDPMJTH6bQb1xRw1i1JqDRmvysxYp7eEQMnz3sp | *

Listed identity is invitorContextIdentity used above.

  1. Invitee Accepts the Invitation After receiving the invitation payload from the invitor, the invitee can accept the invitation by signing it with their private key:
Node 2
context join {inviteePrivateKey} {invitationPayload}
Example
context join G5pK45VAegesDwvHqyQsZ6NNQyRPjZ7YQLJSz1XBfpdc 3FdouEaEdTWtP6YBH3tjXgBJixiVF921t9DxTPbie5GVkhxjMQH7ipkB9h3RAA6EjGYEF5eugjuC154WRUx71eDRoZkdJ94ucZdyWXEA461BQyaQjS3GzQtimcqMWG9UbP7eGoci3jKnJycuoadLhVd
β”‚ Joined context GjJEnAwfLVPveyUWaGqJspzUXndyJkNWgD7M5uDNQZqv as 21A1pcDPMJTH6bQb1xRw1i1JqDRmvysxYp7eEQMnz3sp, waiting for catchup to complete...
  1. Verifying Context Membership To confirm successful joining of the context, the invitee can list their contexts with the following command:
Node 2
context ls
Example
context ls
β”‚ Context ID | Application ID | Last Transaction β”‚
GjJEnAwfLVPveyUWaGqJspzUXndyJkNWgD7M5uDNQZqv | 3dTQEovDrrTVqFoTXRDef5M2VQM51osB66XRdTnT7uRb | DoQ99Yty1ygPcc4ek4zsMUNpyAEtaA4MnRC8beGaFtd
Was this page helpful?
Need some help? Check Support page