toip.tools

function · Node only

startWitness

Starts a witness as a Node HTTP service, keeping its logs in a JSON file. For development and demos.

@toip-tools/eventlog/nodeView source
TypeScriptImport
import { startWitness } from "@toip-tools/eventlog/node";

Declaration

TypeScriptSignature
startWitness(opts: {
    seed: Uint8Array;
    dataPath: string;
    port?: number;
    host?: string;
    clock?: Clock;
}): Promise<{
    witness: Witness;
    url: string;
    aid: string;
    did: string;
    close: () => Promise<void>;
}>;

Parameters

optsrequired
{ seed: Uint8Array; dataPath: string; port?: number; host?: string; clock?: Clock; }
Fields of opts
seedrequired
Uint8Array<ArrayBufferLike>
dataPathrequired
string
portoptional
number | undefined
hostoptional
string | undefined
clockoptional
Clock | undefined

Returns

Promise<{ witness: Witness; url: string; aid: string; did: string; close: () => Promise<void>; }>