# RPC and APIs

Mazze exposes a JSON-RPC interface over HTTP, WebSocket, and TCP. Handlers are implemented in the `client` crate and call into consensus and storage.

## Namespaces

* `mazze_*` - core chain queries, blocks, receipts, balances, logs, and DAG tips.
* `debug_*` - execution tracing and diagnostics.
* `trace_*` - transaction and block traces.
* `txpool_*` - pending pool status and contents.

## Query path

Most RPCs resolve through:

* `ConsensusGraph` for chain/epoch context.
* `BlockDataManager` for headers, receipts, and rewards.
* State DB for balances, storage, and contract code.

## Configuration

RPC ports and limits are configured in `client/src/configuration.rs`, including HTTP/WS/TCP ports, thread counts, and max payload sizes.

## Key source files

* `crates/client/src/rpc/impls/mazze/mazze_handler.rs`
* `crates/client/src/rpc/impls/mazze/common.rs`
* `crates/client/src/rpc/traits/mazze_space/mazze.rs`
* `crates/client/src/configuration.rs`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mazze.io/architecture/rpc-and-apis.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
