eyecreate_public_client

Create sync Web3 instance with public (read-only) Seismic access

Create a synchronous Web3 instance with public (read-only) Seismic access.

Overview

create_public_client() creates a client for read-only operations on the Seismic network. No private key is required. The w3.seismic namespace provides only public read operations: get_tee_public_key(), get_deposit_root(), get_deposit_count(), and contract() (with .tread only).

This is useful for applications that only need to query chain state without submitting transactions, such as block explorers, analytics dashboards, or read-only dApps.

Signature

def create_public_client(rpc_url: str) -> Web3

Parameters

Parameter
Type
Required
Description

rpc_url

str

Yes

HTTP(S) URL of the Seismic node (e.g., "https://gcp-1.seismictest.net/rpc"). WebSocket URLs are not supported — see note below

Returns

Type
Description

Web3

A Web3 instance with w3.seismic namespace attached (SeismicPublicNamespace)

Examples

Basic Usage

Using Chain Configuration

Read-Only Contract Access

Standard Web3 Operations

Block Explorer Pattern

How It Works

The function performs two steps:

  1. Create Web3 instance

  2. Attach public Seismic namespace

No TEE public key fetching or encryption setup is performed since the client cannot perform shielded operations.

Client Capabilities

Standard Web3 Methods (e.g. w3.eth, w3.net)

  • get_block(), get_transaction(), get_balance()

  • get_code(), call(), estimate_gas()

  • All other standard read-only web3.py functionality

Public Seismic Methods (w3.seismic)

NOT Available

Public vs Wallet Client

Feature
Public Client
Wallet Client

Private key

Not required

Required

Shielded writes

No

Yes

Signed reads

No

Yes

Transparent reads

Yes

Yes

Deposits

No

Yes

TEE queries

Yes

Yes

Standard Web3

All read operations

All operations

Notes

  • HTTP only — Sync clients use Web3 with HTTPProvider, which does not support WebSocket connections. This is a limitation of the underlying web3.py library (WebSocketProvider is async-only). If you need WebSocket support (persistent connections, subscriptions), use create_async_public_client() with ws=True

  • No private key required or accepted

  • No encryption setup performed

  • No RPC calls during client creation (lightweight)

  • Cannot perform any write operations or shielded reads

  • Contract wrappers only expose .tread (transparent read)

  • For write operations, use create_wallet_client()

  • For async operations, use create_async_public_client()

Use Cases

  • Block explorers and chain analytics

  • Read-only dApps that display public data

  • Monitoring and alerting systems

  • Price oracles and data aggregators

  • Public dashboards and visualizations

  • Testing and validation tools

See Also

Last updated