> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://docs.ampdb.io/api/mcp` to find what you need.

# Tempo

The Tempo provider connects Amp to Tempo, an EVM-compatible chain with its own transaction type and block fields. It
reads a Tempo node's JSON-RPC endpoint, over HTTP, WebSocket, or IPC. [Raw datasets](/datasets/raw-datasets) of kind
`tempo` extract through it into three tables, blocks, transactions, and logs: [Tempo Tables](/datasets/tables/tempo)
lists their columns.

## Prerequisites

* A running Amp: [Solo Mode](/running-amp/solo-mode) is the quickest.
* [`ampctl`](/clis/ampctl).
* A Tempo JSON-RPC endpoint that supports `eth_getBlockByNumber` and `eth_getBlockReceipts`, or
  `eth_getTransactionReceipt` instead of the latter (see [`fetch_receipts_per_tx`](/providers/tempo#receipts)). To extract history, it
  must still have the blocks and receipts you want.

Export the endpoint's URL, and its token if it needs one:

```bash
export TEMPO_RPC_URL=…
export TEMPO_RPC_TOKEN=…
```

`ampd` substitutes the variables when it extracts, not `ampctl` when you register, so set them in the environment
`ampd` runs in. When one is missing, `ampd` logs `environment variable substitution failed for provider, skipping`,
and the job fails with `No provider found for kind 'tempo' and network 'tempo-mainnet'`. See
[Environment variables](/providers#environment-variables).

## Configure the provider

A minimal configuration names the kind, the network, and the endpoint:

```toml [tempo_mainnet.toml]
kind = "tempo"
network = "tempo-mainnet"
url = "${TEMPO_RPC_URL}"
```

* `kind` is always `tempo`.
* `network` must match the `network` of the datasets that extract through it.
* `url` is the endpoint: `http://` or `https://`, `ws://` or `wss://` for WebSocket, or `ipc://` followed by the path
  of a node's IPC socket, like `ipc:///home/user/.tempo/tempo.ipc`.

A fuller one adds a token and limits. Export each variable it refers to, or leave out the fields you don't use: Amp
skips a provider with a variable that isn't set.

```toml [tempo_mainnet.toml]
kind = "tempo"
network = "tempo-mainnet"
url = "${TEMPO_RPC_URL}"
auth_token = "${TEMPO_RPC_TOKEN}"
rate_limit_per_minute = 600
concurrent_request_limit = 512
fetch_receipts_per_tx = false
timeout_secs = 30
```

* `auth_token` is sent as `Authorization: Bearer <token>`. Add `auth_header` to send it in another header instead, like
  `auth_header = "x-api-key"`, or `auth_header = "Authorization"` for endpoints that expect the bare token there.
* `rate_limit_per_minute` caps the requests Amp sends the endpoint. Set it to your endpoint's limit.
* `concurrent_request_limit` caps the requests in flight at once, `1024` by default.
* `fetch_receipts_per_tx` sets how Amp fetches receipts (see [Receipts](/providers/tempo#receipts)).
* `timeout_secs` is how long Amp waits for a request, `30` seconds by default.

The [configuration reference](/providers/configuration-reference#tempo) documents every field, with its type and
default.

## Create a dataset

:::steps
### Register the provider

Provider names take lowercase letters, digits, and underscores, and start with a letter or underscore.
[Providers](/providers) explains how registration works.

```bash
ampctl provider register tempo_mainnet ./tempo_mainnet.toml
```

### Generate the manifest

```bash
ampctl manifest generate --kind tempo --network tempo-mainnet -o tempo_mainnet.json
```

Add `--start-block` to skip the chain's early history (see [Start block](/datasets/raw-datasets#start-block)).

### Register the dataset

```bash
ampctl dataset register acme/tempo_mainnet ./tempo_mainnet.json --tag 1.0.0
```

### Deploy it

```bash
ampctl dataset deploy acme/tempo_mainnet@1.0.0
```
:::

[Raw Datasets](/datasets/raw-datasets) covers the manifest, finalized blocks, and how extraction works.

## How it differs from EVM RPC

Tempo's endpoint speaks Ethereum's JSON-RPC, and this provider works like [EVM RPC](/providers/evm-rpc): the same
fields, the same requests, the same handling of reorgs. What differs is what it reads. Tempo has its own transaction
type, with batched calls, fee tokens, sponsored fees, and other kinds of signatures, which EVM RPC datasets have no
columns for. Use `tempo` for Tempo chains.

Its tables follow EVM RPC's, with these differences:

* [`blocks`](/datasets/tables/tempo#blocks) adds `general_gas_limit` and `shared_gas_limit`, and
  `timestamp_millis_part`, the milliseconds that `timestamp`, in whole seconds, leaves out. It has no
  `block_access_list_hash` or `slot_number`.
* [`transactions`](/datasets/tables/tempo#transactions) adds `signature`, which holds secp256k1, P-256, and WebAuthn
  signatures; `calls`, a batched transaction's calls, whose `value` and `input` are then empty; `fee_token` and
  `fee_payer`, for fees paid in a token or by another account; and `nonce_key`, `fee_payer_signature`,
  `key_authorization`, `aa_authorization_list`, `valid_before`, and `valid_after`. It has no blob columns or
  `authorization_list`.
* [`logs`](/datasets/tables/tempo#logs) has the same columns, so the [EVM functions](/querying/functions/evm) decode
  them the same way.

## Receipts

Amp needs each transaction's receipt for its status, gas used, and logs. By default, it asks for a block's receipts in
one call, `eth_getBlockReceipts`. Not every endpoint supports it: set `fetch_receipts_per_tx = true` to ask for each
transaction's receipt with `eth_getTransactionReceipt` instead, which takes more requests.

## Limitations

* IPC only reaches a node on the machine `ampd` runs on.
* `rate_limit_per_minute` and `concurrent_request_limit` apply to each provider on its own, not to all of them together.

## Errors

### `no receipts returned for block 1234`

The endpoint answered `eth_getBlockReceipts` with nothing, usually because it doesn't support it. Set
`fetch_receipts_per_tx = true`.

### `block 1234 not found`

The endpoint doesn't have the block, often because a load balancer sent the request to a node that hasn't caught up.
Amp retries it. If it persists, check that the endpoint has the history you're extracting.
