Pinax

    Datasets

    Blockchain tables over S3, queried with your own project credentials.

    Delta Lake · Parquet · AWS Signature Version 4
    Resources & endpoints

    SQL & Connect

    Read Datasets from your preferred SDK or tool with your Pinax Project ID and API key. Run these examples locally or on your server.

    Connection details

    Endpoint
    https://datasets.s3.pinax.network
    Region
    us-east-1
    Bucket
    eth
    Addressing
    Path style

    Loading your project…

    Examples use placeholders. Find your Project ID and API key on the API keys page.

    Access key ID = Project ID
    <your Pinax Project ID>
    Secret access key = API key
    <your Pinax API key>

    Putting the API key in the Access key ID field reverses the mapping and returns 403 unauthenticated.

    DuckDB example

    DuckDB 1.5 or newer
    1-- DuckDB 1.5 or newer. Your Pinax Project ID is the S3 access key,
    2-- your Pinax API key the secret.
    3INSTALL delta; LOAD delta;
    4CREATE SECRET pinax (
    5 TYPE s3,
    6 KEY_ID '<your Pinax Project ID>',
    7 SECRET '<your Pinax API key>',
    8 REGION 'us-east-1',
    9 ENDPOINT 'datasets.s3.pinax.network',
    10 URL_STYLE 'path'
    11);
    12
    13-- To keep the key out of SQL and history, export AWS_ACCESS_KEY_ID (Project ID)
    14-- and AWS_SECRET_ACCESS_KEY (API key) before starting DuckDB, then:
    15-- INSTALL aws; LOAD aws;
    16-- CREATE SECRET pinax (TYPE s3, PROVIDER credential_chain, CHAIN 'env',
    17-- REGION 'us-east-1', ENDPOINT 'datasets.s3.pinax.network', URL_STYLE 'path');
    18
    19-- Read through the Delta log, filtered by date.
    20SELECT block_num, block_id, timestamp, num_transactions
    21FROM delta_scan('s3://eth/blocks')
    22WHERE date = DATE '2020-01-01'
    23ORDER BY block_num
    24LIMIT 10;

    Python and Node.js read credentials from environment variables. Run the commented export line in your shell before starting the example. Keep credentials out of shared files and shell history.