https://github.com/chainstacklabs/query-evm-nodes-python
Query historical data on full and archive nodes to understand the difference
https://github.com/chainstacklabs/query-evm-nodes-python
blockchain ethereum python
Last synced: 3 months ago
JSON representation
Query historical data on full and archive nodes to understand the difference
- Host: GitHub
- URL: https://github.com/chainstacklabs/query-evm-nodes-python
- Owner: chainstacklabs
- License: mit
- Created: 2023-02-27T08:47:51.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-04-05T05:43:32.000Z (almost 3 years ago)
- Last Synced: 2024-12-29T16:33:11.274Z (over 1 year ago)
- Topics: blockchain, ethereum, python
- Language: Python
- Homepage: https://chainstack.com/querying-full-and-archive-evm-nodes-with-python/
- Size: 19.5 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

Chainstack is the leading suite of services connecting developers with Web3 infrastructure
Supported protocols •
Chainstack blog •
Chainstack docs •
Blockchain API reference •
Start for free
# Querying full and archive EVM nodes with Python
This project allows the retrieval of historical data from the blockchain programmatically, switching between a full and archive node provider when necessary.
See the full tutorial on the Chainstack blog:
* [Querying full and archive Ethereum nodes with Python](https://chainstack.com/querying-full-and-archive-evm-nodes-with-python/)
## Project details
This repository holds the Python version of a tool to query common state functions. Some essential functions include getting an address balance and storage at a given position, a contract bytecode, or even the whole transactions included on a given block.
This tool queries the blockchain using the web3 and inquirer libraries for Python.
## Quick start
### Clone this repository
```sh
git clone https://github.com/chainstacklabs/chainstack-full-vs-archive-query-py.git
```
### Install dependencies
```sh
pip install -r requirements.txt
```
### Edit the env.sample file
Add your RPC node URLs and rename the file to `.env`.
```env
CHAINSTACK_FULL_NODE="CHAINSTACK_FULL_NODE_URL"
CHAINSTACK_ARCHIVE_NODE="CHAINSTACK_ARCHIVE_NODE_URL"
```
### Run the program
```sh
python main.py
```
## Prerequisites
* Python: ^3.7— [install Node](https://www.python.org/downloads/)
* A full and archive node RPC endpoints.
Deploy a full and archive node with Chainstack:
1. [Sign up with Chainstack](https://console.chainstack.com/user/account/create).
1. [Deploy a node](https://docs.chainstack.com/platform/join-a-public-network).
1. [View node access and credentials](https://docs.chainstack.com/platform/view-node-access-and-credentials).
## Install
Clone this repository:
```sh
git clone https://github.com/chainstacklabs/chainstack-full-vs-archive-query-py.git
```
Install the dependencies in the project's directory:
```sh
cd query-full-and-archive-nodes-python
```
```sh
pip install -r requirements.txt
```