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/node` · [View source](https://github.com/yourbuddyconner/toip-tools/blob/main/packages/eventlog/src/node/index.ts#L12)

Import:

```ts
import { startWitness } from "@toip-tools/eventlog/node";
```

## Declaration

Signature:

```ts
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

**`opts` (required)**

`{ seed: Uint8Array; dataPath: string; port?: number; host?: string; clock?: Clock; }`

**Fields of `opts`**

- **`seed` (required)**: `Uint8Array<ArrayBufferLike>`
- **`dataPath` (required)**: `string`
- **`port` (optional)**: `number | undefined`
- **`host` (optional)**: `string | undefined`
- **`clock` (optional)**: `Clock | undefined`

### Returns

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

[Usage guide](https://toip.tools/toolkit/eventlog/#usage) · [Error handling](https://toip.tools/toolkit/eventlog/#errors) · [All exports](https://toip.tools/toolkit/eventlog/api/node/)

---

This is the Markdown version of https://toip.tools/toolkit/eventlog/api/node/startWitness/. An index of the documentation for AI assistants is at https://toip.tools/llms.txt.
