CARV
CARVPlayPortalProtocol
  • Overview
    • Introducing CARV
  • SVM - AI AGENTIC CHAIN
    • Introduction
      • Architecture
      • AI Agent in TEE environment
      • CARV Verifier Nodes
    • Quick Start
      • Bridge Token
      • Explorer
      • Command line tool
      • Reading from CARV SVM Network
      • Writing to the Network
      • Network Info
  • D.A.T.A. - AI FRAMEWORK
    • Introduction
      • DeepSeek Integration
      • D.A.T.A's Core Features
      • How It Empowers AI Agents
      • Driving the Future of AI and Blockchain
      • Leveraging CARV SVM Chain for Privacy and Trustless Data Sharing
    • Quick Start Guide
    • Architecture
    • ERC-7231 (CARV ID)
    • Examples
      • On-Chain Insights
    • Getting Started
      • D.A.T.A Framework Plugin for Eliza
    • Use Cases and Implementation
      • Getting On-Chain Data for AI Agents
      • What's Coming with the D.A.T.A Framework
    • API Documentation
      • News
      • On-chain Data SQL Query
        • Ethereum Schema
        • Bitcoin Schema
        • Base Schema
        • Solana Schema
      • On-chain Data SQL Query by LLM
      • Token Info and Price
      • User Balance by Twitter ID
      • User Balance by Discord ID
  • CARV Ecosystem
    • CARV Play
      • Portal Access
      • Integration Guide
        • .Play Name Service Integration
        • API-Verified Quest (RESTFUL)
        • API-Verified Quest (GraphQL)
        • CARV ID OAuth 2.0
        • CARV ID Telegram SDK
      • Smart Contracts & Security
    • MOFF Bot & Customer Data Platform
    • CARV Account
      • ERC 7231
    • Verifier Nodes
      • How to Purchase Nodes
      • Buyback Program
      • Why Verifier Nodes
      • How do Verifier Nodes Work
        • CARV/veCARV Token
        • CARV Vault
        • CARV NFT License
        • CARV Protocol Service
        • Trusted Execution Environment (TEE)
        • Verifier Node
        • Attestation
        • Delegation
        • Rewards
        • SGX Attestation Verification
      • Verifier Node Sale Dynamics
      • Smart Contract Addresses
      • License Key (NFT)
      • Delegation
      • Node Rewards
      • Join Mainnet Verifier Nodes
        • Prerequisites
        • Delegation Tutorial
        • Operating a Verifier Node
          • Running in VPS
          • Running in CLI
            • Using Source Code
            • Using Docker
            • Gasless Server API
          • Running in Desktop App
      • Explorer
      • FAQ
        • Node Sale
        • Node Operation
  • CARV LABS
    • Introduction
    • Working with CARV Labs
  • Tokenomics
    • Utility
      • veCARV(s)
    • Distribution & Vesting
  • DECENTRALIZED GOVERNANCE
    • ⚔️Universal Guardian Program
    • 📔DAO Governance
    • 🌏Community Programs & Activities
  • Resources
    • 🗜️Writings
    • 🗞️CARV in the News
    • 🫶Social & Community Links
    • 🅰️Brand Guideline
    • 💰Job Openings
Powered by GitBook
On this page
  • Blocks
  • Transactions
  • Contracts
  • Logs
  • Token_transfers
  • Traces
  1. D.A.T.A. - AI FRAMEWORK
  2. API Documentation
  3. On-chain Data SQL Query

Ethereum Schema

Blocks

CREATE EXTERNAL TABLE `eth.blocks`(
  `timestamp` timestamp, 
  `number` bigint, 
  `hash` string, 
  `parent_hash` string, 
  `nonce` string, 
  `sha3_uncles` string, 
  `logs_bloom` string, 
  `transactions_root` string, 
  `state_root` string, 
  `receipts_root` string, 
  `miner` string, 
  `difficulty` double, 
  `total_difficulty` double, 
  `size` bigint, 
  `extra_data` string, 
  `gas_limit` bigint, 
  `gas_used` bigint, 
  `transaction_count` bigint, 
  `base_fee_per_gas` bigint)
PARTITIONED BY ( 
  `date` string)
ROW FORMAT SERDE 
  'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe' 
STORED AS INPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat' 
OUTPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat'
LOCATION
  's3://aws-public-blockchain/v1.0/eth/blocks'
TBLPROPERTIES (
)

Transactions

CREATE EXTERNAL TABLE `eth.transactions`(
  `hash` string, 
  `nonce` bigint, 
  `transaction_index` bigint, 
  `from_address` string, 
  `to_address` string, 
  `value` double, 
  `gas` bigint, 
  `gas_price` bigint, 
  `input` string, 
  `receipt_cumulative_gas_used` bigint, 
  `receipt_gas_used` bigint, 
  `receipt_contract_address` string, 
  `receipt_root` string, 
  `receipt_status` bigint, 
  `block_timestamp` timestamp, 
  `block_number` bigint, 
  `block_hash` string, 
  `max_fee_per_gas` bigint, 
  `max_priority_fee_per_gas` bigint, 
  `transaction_type` bigint, 
  `receipt_effective_gas_price` bigint)
PARTITIONED BY ( 
  `date` string)
ROW FORMAT SERDE 
  'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe' 
STORED AS INPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat' 
OUTPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat'
LOCATION
  's3://aws-public-blockchain/v1.0/eth/transactions'
TBLPROPERTIES (
)

Contracts

CREATE EXTERNAL TABLE `eth.contracts`(
  `address` string, 
  `bytecode` string, 
  `block_timestamp` timestamp, 
  `block_number` bigint, 
  `block_hash` string)
PARTITIONED BY ( 
  `date` string)
ROW FORMAT SERDE 
  'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe' 
STORED AS INPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat' 
OUTPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat'
LOCATION
  's3://aws-public-blockchain/v1.0/eth/contracts'
TBLPROPERTIES (
)

Logs

CREATE EXTERNAL TABLE `eth.logs`(
  `log_index` bigint, 
  `transaction_hash` string, 
  `transaction_index` bigint, 
  `address` string, 
  `data` string, 
  `topics` array<string>, 
  `block_timestamp` timestamp, 
  `block_number` bigint, 
  `block_hash` string)
PARTITIONED BY ( 
  `date` string)
ROW FORMAT SERDE 
  'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe' 
STORED AS INPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat' 
OUTPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat'
LOCATION
  's3://aws-public-blockchain/v1.0/eth/logs'
TBLPROPERTIES (
)

Token_transfers

CREATE EXTERNAL TABLE `eth.token_transfers`(
  `token_address` string, 
  `from_address` string, 
  `to_address` string, 
  `value` double, 
  `transaction_hash` string, 
  `log_index` bigint, 
  `block_timestamp` timestamp, 
  `block_number` bigint, 
  `block_hash` string)
PARTITIONED BY ( 
  `date` string)
ROW FORMAT SERDE 
  'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe' 
STORED AS INPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat' 
OUTPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat'
LOCATION
  's3://aws-public-blockchain/v1.0/eth/token_transfers'
TBLPROPERTIES (
)

Traces

CREATE EXTERNAL TABLE `eth.traces`(
  `transaction_hash` string, 
  `transaction_index` bigint, 
  `from_address` string, 
  `to_address` string, 
  `value` double, 
  `input` string, 
  `output` string, 
  `trace_type` string, 
  `call_type` string, 
  `reward_type` string, 
  `gas` double, 
  `gas_used` double, 
  `subtraces` bigint, 
  `trace_address` string, 
  `error` string, 
  `status` bigint, 
  `block_timestamp` timestamp, 
  `block_number` bigint, 
  `block_hash` string, 
  `trace_id` string)
PARTITIONED BY ( 
  `date` string)
ROW FORMAT SERDE 
  'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe' 
STORED AS INPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat' 
OUTPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat'
LOCATION
  's3://aws-public-blockchain/v1.0/eth/traces'
TBLPROPERTIES (
)
PreviousOn-chain Data SQL QueryNextBitcoin Schema

Last updated 4 months ago