Aster TypeScript 0.3.893
    Preparing search index...

    Class AsterServer

    High-level Aster RPC server.

    Creates an IrohNode, serves RPC over QUIC, handles consumer admission, and prints a startup banner.

    // Run `npx aster-gen` first — start() auto-imports aster-rpc.generated.js
    const server = new AsterServer({
    services: [new MissionControl()],
    });
    await server.start();
    console.log(server.address);
    await server.serve();
    Index

    Accessors

    • get gate(): GatePolicy

      The server's Gate-0 policy (Rust GatePolicy), built from the trust settings: allowAllConsumers → 'open_dev', otherwise 'protected' (only the admission ALPNs are open until a peer is admitted). Successful consumer / delegated admission admits the peer into gate.store; gate.admit() / gate.revoke() manage peers directly.

      Returns GatePolicy

    • get health(): HealthServer | null

      The /healthz /readyz /metrics listener (Rust), when the config enables it (healthPort, healthEnabled; ASTER_HEALTH_*). Use it to add readiness checks: server.health?.check('db').set(true).

      Returns HealthServer | null

    • get address(): string

      The aster1... connection address for clients.

      Returns string

    • get endpointId(): string

      Hex endpoint ID of this server's node.

      Returns string

    • get running(): boolean

      Whether the server is running.

      Returns boolean

    • get services(): ServiceSummary[]

      List of services hosted by this server.

      Returns ServiceSummary[]

    Constructors

    Methods

    • Start the node and prepare for serving. Idempotent.

      On first call, auto-imports aster-rpc.generated.js from the working directory (unless generated was passed explicitly), registers the generated metadata, then registers all services.

      Returns Promise<void>

    • Start accepting connections. Blocks until close() is called.

      Returns Promise<void>

    • Stop accepting connections and close the node.

      Returns Promise<void>

    • Create a local in-process transport for testing.

      Returns LocalTransport

    Properties

    registry: ServiceRegistry
    config: AsterConfig
    logger: AsterLogger