QVAC Logo

startQVACProvider( )

Starts a provider service that offers QVAC capabilities to remote peers.

function startQVACProvider(params): Promise<object>;

The provider's keypair can be controlled via the seed option or the QVAC_HYPERSWARM_SEED environment variable.

Parameters

NameTypeRequired?Description
params.topicstringTopic hex string for peer discovery
params.firewallFirewallConfigOptional firewall configuration

FirewallConfig

FieldTypeRequired?DefaultDescription
mode"allow" | "deny""allow"Firewall mode
publicKeysstring[][]Public keys to allow or deny

Returns

Promise<object> — The provide response containing success, publicKey, and optional error.

Throws

ErrorWhen
INVALID_RESPONSE_TYPEResponse type does not match expected "provide"
PROVIDER_START_FAILEDThe server reports provider start failure

Example

const response = await startQVACProvider({
  topic: "a1b2c3d4...",
  firewall: {
    mode: "allow",
    publicKeys: ["peer-public-key-hex"],
  },
});
console.log("Provider public key:", response.publicKey);

On this page