Vana SDK - v0.1.0
    Preparing search index...

    Manages interactions with Vana personal servers and identity infrastructure.

    This controller handles communication with personal servers for data processing and identity servers for public key derivation. It provides methods for posting computation requests to personal servers, polling for results, and retrieving cryptographic keys for secure data sharing. All server interactions use the Replicate API infrastructure with proper authentication and error handling.

    Personal servers enable privacy-preserving computation on user data, while identity servers provide deterministic key derivation for secure communication without requiring servers to be online during key retrieval.

    // Post a request to a personal server
    const response = await vana.server.postRequest({
    permissionId: 123,
    });

    // Get a server's identity including public key for encryption
    const identity = await vana.server.getIdentity(
    "0x742d35Cc6558Fd4D9e9E0E888F0462ef6919Bd36"
    );

    // Poll for computation results
    const result = await vana.server.pollStatus(response.urls.get);

    [URL_PLACEHOLDER] | Vana Personal Servers for conceptual overview

    Index

    Methods

    • Creates an operation via the personal server API.

      Parameters

      • params: CreateOperationParams

        The request parameters object

        Parameters for the vana.server.createOperation method.

        • permissionId: number

          The permission ID

      Returns Promise<{}>

      A Promise that resolves to an operation response with status and control URLs

      This method submits a computation request to the personal server API. The response includes the operation ID.

      When server request fails or parameters are invalid

      When personal server API communication fails

      const response = await vana.server.createOperation({
      permissionId: 123,
      });

      console.log(`Operation created: ${response.id}`);
    • Polls the status of a computation request for updates and results.

      Parameters

      • operationId: string

        The operation ID returned from the initial request submission

      Returns Promise<{}>

      A Promise that resolves to the current operation response with status and results

      This method checks the current status of a computation request by querying the personal server API using the provided operation ID. It returns the current status, any available output, and error information. The method can be called periodically until the operation completes or fails.

      Common status values include: starting, processing, succeeded, failed, canceled.

      When the polling request fails or returns invalid data

      // Poll until completion
      let result = await vana.server.getOperation(response.id);

      while (result.status === "processing") {
      await new Promise(resolve => setTimeout(resolve, 1000));
      result = await vana.server.getOperation(response.id);
      }

      if (result.status === "succeeded") {
      console.log("Computation completed:", result.output);
      }