Off-chain APIs

The off-chain API of the Nerif Network is implemented as a GraphQL server within each Nerif Network Node. This API allows network users to directly interact with the network by sending HTTP requests to the GraphQL endpoints exposed by the node.

Ownership Verification

To ensure security and access control, the Nerif Network implements an ownership verification mechanism. This mechanism verifies that requests to modify workflows or perform other actions are coming from trusted entities. Requests must be signed by the sender's private key and include the necessary data for verification.

Implementation:

  1. The sender requests signing artifacts.

  2. The node returns the signing artifacts, which include the current nonce of the sender's address (whitelisted address with at least one active workflow).

  3. The sender signs the provided signing artifacts along with the request payload and attaches the signature to the request.

  4. Nerif Network verifies the signature against the current nonce and payload. If the verification is successful, the network processes the request.

Create Workflow

To create a workflow, you need to provide a valid workflow configuration that includes a list of steps, the owner address, and a signature of the provided signing artefacts. The receiving node verifies and validates the request before broadcasting it to the network. If the workflow is invalid, an error is returned, and it is not broadcasted to the network.

Before creating a workflow within the Nerif Network, it is necessary for the user to register the workflow through the Registry contract function “registerWorkflow”. This registration process ensures that the workflow is properly recorded and recognized within the network. Once the workflow is registered, it can be created and utilized within the Nerif Network.

Get Existing Workflow

This endpoint retrieves an existing workflow based on its ID. The workflow can be either publicly available or private. For private workflows, the default ownership verification mechanism is used.

Manually Execute Workflow

This endpoint allows the workflow owner to trigger the execution of an existing active workflow. Only the workflow owner can initiate this action using the default ownership verification mechanism.

Please note that manual workflow execution is only available for workflows that have the manual execution trigger.

Last updated