http_transport

Builds a TRANSPORT for an HTTP or HTTPS JSON-RPC endpoint. It records the endpoint, declared chain id, and request policy without contacting the provider.

Scalar function Client

Example

Runs locally

-- Anvil uses chain id 31337 by default.
SELECT http_transport('http://127.0.0.1:8545', 31337) AS transport;

API reference

http_transport(VARCHAR, UBIGINT) #

Records chain_id as trusted metadata. The function does not call eth_chainId or verify the value against the endpoint.

Inputs

Name Type Use
url VARCHAR

HTTP or HTTPS JSON-RPC endpoint. Without a scheme, localhost and 127.0.0.1 use http://; other hosts use https://.

required positional
chain_id UBIGINT

EVM chain id recorded in the TRANSPORT. Determica trusts this value and does not query the endpoint while constructing the TRANSPORT.

required positional

Returns

Name Type
transport TRANSPORT

HTTP TRANSPORT. Returns a TRANSPORT value containing type, url, chain_id, and the merged config object.

http_transport(VARCHAR) #

Uses chain id 1. If url has no scheme, local endpoints use HTTP and other hosts use HTTPS.

Inputs

Name Type Use
url VARCHAR

HTTP or HTTPS JSON-RPC endpoint. Without a scheme, localhost and 127.0.0.1 use http://; other hosts use https://.

required positional

Returns

Name Type
transport TRANSPORT

HTTP TRANSPORT. Returns a TRANSPORT value containing type, url, chain_id, and the merged config object.

Overload examples

Runs locally

SELECT http_transport('eth.drpc.org') AS transport;
http_transport(VARCHAR, UBIGINT, JSON) #

Overrides selected HTTP policy fields. Fields omitted from config keep their defaults.

Inputs

Name Type Use
url VARCHAR

HTTP or HTTPS JSON-RPC endpoint. Without a scheme, localhost and 127.0.0.1 use http://; other hosts use https://.

required positional
chain_id UBIGINT

EVM chain id recorded in the TRANSPORT. Determica trusts this value and does not query the endpoint while constructing the TRANSPORT.

required positional
config JSON

JSON object whose fields override the default request, retry, pagination, batching, and rate-limit policy.

required positional

Returns

Name Type
transport TRANSPORT

HTTP TRANSPORT. Returns a TRANSPORT value containing type, url, chain_id, and the merged config object.

Overload examples

Runs locally

-- Limit retries and parallel requests for a rate-limited provider.
SELECT http_transport(
  'https://eth.llamarpc.com',
  1,
  json('{
    "timeout_ms": 15000,
    "retry_count": 2,
    "max_block_range": 1000,
    "requests_per_second": 10,
    "max_concurrent": 4
  }')
) AS transport;

Guidance

Request and retry policy

The config object overrides individual defaults. http_transport merges the object locally; the CLIENT validates supported field types and ranges when it consumes the TRANSPORT.

  • timeout_ms sets the timeout for each HTTP attempt and defaults to 30000.
  • retry_count is the number of retries after the first attempt and defaults to 9.
  • Native clients wait retry_delay_ms before the first retry, then double the delay up to retry_max_delay_ms. The defaults are 125 and 32000. Browser clients retry without a blocking delay.
  • deadline_ms is checked between attempts and defaults to 0, which disables the retry deadline.
  • verify_ssl defaults to true for native clients. Browsers apply their own certificate policy.

RPC work limits

  • max_block_range is the largest eth_getLogs block range one request spans and defaults to 2000. get_logs starts at 2000 blocks or less and doubles after sparse chunks up to it; set it to the provider's limit.
  • max_rpc_batch_size defaults to 100 and caps batches created by timestamp lookup and shared chain-state hydration. read_contract and create_access_list use their own rpc_batch_size options.
  • requests_per_second and max_concurrent default to 20 and 10. Rate limits are shared by normalized URL; the first request for a URL sets both values for the runtime.

transport vs http_transport

  • Use http_transport when you need HTTP-specific options like timeout, retry count, rate limits, concurrency, SSL verification, or log pagination limits.
  • Use transport for minimal generic transport construction.

Examples

Runs locally

SELECT http_transport('http://127.0.0.1:8545', 31337) AS transport;