Skip to content

Commit 4e64bb9

Browse files
authored
Merge pull request #40 from VaitaR/dev
Dev
2 parents c6bb7d4 + e2cf39b commit 4e64bb9

126 files changed

Lines changed: 24523 additions & 1917 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2,49 +2,5 @@
22
# Copy this file to .env and fill in your API keys
33
# You only need keys for the scanners you plan to use
44

5-
# Etherscan (etherscan.io)
6-
# Networks: goerli, main, sepolia, test
5+
# Etherscan (etherscan.io) API Key V2 support all chains under 1 key
76
ETHERSCAN_KEY=your_eth_api_key_here
8-
9-
# BscScan (bscscan.com)
10-
# Networks: main, test
11-
BSCSCAN_KEY=your_bsc_api_key_here
12-
13-
# PolygonScan (polygonscan.com)
14-
# Networks: main, mumbai, test
15-
POLYGONSCAN_KEY=your_polygon_api_key_here
16-
17-
# Optimism Etherscan (etherscan.io)
18-
# Networks: goerli, main, test
19-
OPTIMISM_ETHERSCAN_KEY=your_optimism_api_key_here
20-
21-
# Arbiscan (arbiscan.io)
22-
# Networks: goerli, main, nova, test
23-
ARBISCAN_KEY=your_arbitrum_api_key_here
24-
25-
# FtmScan (ftmscan.com)
26-
# Networks: main, test
27-
FTMSCAN_KEY=your_fantom_api_key_here
28-
29-
# GnosisScan (gnosisscan.io)
30-
# Networks: chiado, main
31-
GNOSISSCAN_KEY=your_gnosis_api_key_here
32-
33-
# BaseScan (basescan.org)
34-
# Networks: goerli, main, sepolia
35-
BASESCAN_KEY=your_base_api_key_here
36-
37-
# LineaScan (lineascan.build)
38-
# Networks: main, test
39-
LINEASCAN_KEY=your_linea_api_key_here
40-
41-
# BlastScan (blastscan.io)
42-
# Networks: main, sepolia
43-
BLASTSCAN_KEY=your_blast_api_key_here
44-
45-
# OKLink X Layer (oklink.com/api/v5/explorer/xlayer)
46-
# Networks: main
47-
OKLINK_KEY=your_xlayer_api_key_here
48-
49-
# Optional: Set log level for debugging
50-
# AIOCHAINSCAN_LOG_LEVEL=DEBUG

.github/workflows/test-install.yml

Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
name: Test Installation
2+
3+
on:
4+
push:
5+
branches: [main, develop, real-using-test]
6+
pull_request:
7+
branches: [main, develop]
8+
9+
jobs:
10+
test-wheel-install:
11+
name: Test Wheel Installation (Python ${{ matrix.python-version }})
12+
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
python-version: ['3.10', '3.11', '3.12', '3.13']
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Install Rust
23+
uses: dtolnay/rust-toolchain@stable
24+
25+
- name: Set up Python ${{ matrix.python-version }}
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: ${{ matrix.python-version }}
29+
30+
- name: Install build tools
31+
run: |
32+
python -m pip install --upgrade pip
33+
pip install 'maturin>=1.8,<2.0' build wheel setuptools
34+
35+
- name: Build wheel
36+
run: |
37+
maturin build --release --out dist/
38+
python -m build --sdist
39+
40+
- name: Test wheel installation in clean environment
41+
run: |
42+
# Create a fresh virtual environment
43+
python -m venv /tmp/test-env
44+
source /tmp/test-env/bin/activate
45+
46+
# Install the built wheel
47+
pip install dist/*.whl
48+
49+
# Verify package can be imported
50+
python -c "import aiochainscan; print('✓ Package imported successfully')"
51+
52+
# Verify version
53+
python -c "import aiochainscan; print(f'✓ Version: {aiochainscan.__version__}')"
54+
55+
# Verify main modules
56+
python -c "from aiochainscan import ChainscanClient, Method; print('✓ Main classes imported')"
57+
58+
# Verify facade imports
59+
python -c "from aiochainscan import get_balance, get_block, get_transaction; print('✓ Facades imported')"
60+
61+
# Verify CLI is available
62+
which aiochainscan || echo "⚠ CLI not found"
63+
aiochainscan --help || echo "⚠ CLI help failed"
64+
65+
deactivate
66+
67+
- name: Test source distribution installation
68+
run: |
69+
# Verify sdist was created correctly
70+
ls -la dist/*.tar.gz
71+
python -c "
72+
import tarfile, sys
73+
sdist = sorted(__import__('glob').glob('dist/*.tar.gz'))[0]
74+
with tarfile.open(sdist) as t:
75+
names = t.getnames()
76+
print(f'✓ Source distribution created: {sdist}')
77+
print(f' Contains {len(names)} files')
78+
has_pyproject = any('pyproject.toml' in n for n in names)
79+
has_cargo = any('Cargo.toml' in n for n in names)
80+
has_rust = any('.rs' in n for n in names)
81+
print(f' pyproject.toml present: {has_pyproject}')
82+
print(f' Cargo.toml present: {has_cargo}')
83+
print(f' Rust sources present: {has_rust}')
84+
if not (has_pyproject and has_cargo and has_rust):
85+
print('✗ Source distribution is incomplete!')
86+
sys.exit(1)
87+
print('✓ Source distribution structure is valid')
88+
"
89+
90+
- name: Test editable install
91+
run: |
92+
# Test development install
93+
python -m venv /tmp/test-editable
94+
source /tmp/test-editable/bin/activate
95+
96+
# Install maturin first (for Rust extension build)
97+
pip install 'maturin>=1.8,<2.0'
98+
99+
pip install -e .
100+
101+
# Verify editable install
102+
python -c "import aiochainscan; print('✓ Editable install works')"
103+
104+
deactivate
105+
106+
test-git-install:
107+
name: Test Git Installation (Python 3.11)
108+
runs-on: ubuntu-latest
109+
110+
steps:
111+
- name: Checkout code
112+
uses: actions/checkout@v4
113+
114+
- name: Install Rust
115+
uses: dtolnay/rust-toolchain@stable
116+
117+
- name: Set up Python
118+
uses: actions/setup-python@v5
119+
with:
120+
python-version: '3.11'
121+
122+
- name: Test direct git install
123+
run: |
124+
# Build wheel directly with maturin (avoids PEP 517 isolation ZIP64 issue)
125+
python -m pip install --upgrade pip 'maturin>=1.8,<2.0'
126+
maturin build --release --out /tmp/git-wheels/
127+
128+
# Simulate user installing the built wheel
129+
python -m venv /tmp/test-git
130+
source /tmp/test-git/bin/activate
131+
pip install /tmp/git-wheels/*.whl
132+
133+
# Verify installation
134+
python -c "import aiochainscan; print('✓ Git install successful')"
135+
python -c "from aiochainscan import *; print('✓ All imports successful')"
136+
137+
# List installed files to verify Python modules are present
138+
pip show -f aiochainscan | grep -E '(aiochainscan/.*\.py|Location:)' | head -20
139+
140+
deactivate
141+
142+
test-dependencies:
143+
name: Test Dependencies (Python 3.11)
144+
runs-on: ubuntu-latest
145+
146+
steps:
147+
- name: Checkout code
148+
uses: actions/checkout@v4
149+
150+
- name: Install Rust
151+
uses: dtolnay/rust-toolchain@stable
152+
153+
- name: Set up Python
154+
uses: actions/setup-python@v5
155+
with:
156+
python-version: '3.11'
157+
158+
- name: Build and install
159+
run: |
160+
python -m pip install --upgrade pip 'maturin>=1.8,<2.0'
161+
# Use maturin directly to avoid pip PEP 517 isolation which triggers ZIP64 issue
162+
maturin build --release --out dist/
163+
pip install dist/*.whl
164+
165+
- name: Check dependencies are installed
166+
run: |
167+
python -c "import httpx; print('✓ httpx')"
168+
python -c "import aiolimiter; print('✓ aiolimiter')"
169+
python -c "import tenacity; print('✓ tenacity')"
170+
python -c "import eth_abi; print('✓ eth_abi')"
171+
python -c "import structlog; print('✓ structlog')"
172+
python -c "import orjson; print('✓ orjson')"
173+
python -c "import pydantic; print('✓ pydantic')"
174+
175+
- name: Verify package structure
176+
run: |
177+
python -c "
178+
import aiochainscan
179+
import os
180+
pkg_path = os.path.dirname(aiochainscan.__file__)
181+
print(f'Package location: {pkg_path}')
182+
183+
# Check for key modules
184+
modules = ['client', 'config', 'network', 'core', 'services', 'adapters', 'ports', 'domain']
185+
for mod in modules:
186+
mod_path = os.path.join(pkg_path, mod + '.py')
187+
dir_path = os.path.join(pkg_path, mod)
188+
if os.path.exists(mod_path) or os.path.isdir(dir_path):
189+
print(f'✓ {mod} exists')
190+
else:
191+
print(f'✗ {mod} missing')
192+
"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ examples/*_results.json
184184
examples/*_summary.md
185185
examples/*_detailed.md
186186
!examples/README.md
187+
exports/
187188

188189
# Dump files and directories
189190
dumps/

0 commit comments

Comments
 (0)