Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
ae9eae9
fix: create missing ip_rate_limit table in init_db
createkr Feb 17, 2026
9689db5
feat: add public RustChain network status dashboard
nicepopo86-lang Feb 17, 2026
9eff30f
ci: make PR test pipeline blocking and deterministic
createkr Feb 17, 2026
bb55fe8
docs: add Simplified Chinese translation
addidea Feb 17, 2026
369fb50
feat: decentralized GPU render protocol with escrow
createkr Feb 17, 2026
0890bed
feat: wRTC Telegram price ticker bot
createkr Feb 17, 2026
97db4b5
feat: Docker deployment with nginx and SSL
addidea Feb 17, 2026
80914e6
feat: Grafana monitoring with Prometheus dashboards
addidea Feb 17, 2026
de55f96
docs: comprehensive API reference
createkr Feb 17, 2026
6b27dec
feat: implement multi-node database sync protocol #36 (#219)
createkr Feb 17, 2026
39665a1
Add US regulatory position document — RTC is not a security
Scottcjn Feb 17, 2026
5a89527
feat(telegram-bot): add RustChain community bot commands (#265)
createkr Feb 18, 2026
b88179d
fix(windows-miner): headless fallback when tkinter missing
Scottcjn Feb 18, 2026
ac39d4d
fix(windows setup): detect/install tkinter (Tcl/Tk) + headless hint
Scottcjn Feb 18, 2026
78db134
security: trust X-Forwarded-For only from trusted proxies
Scottcjn Feb 18, 2026
2ddc12f
Merge pull request #270 from Scottcjn/security/trusted-proxy
sophiaeagent-beep Feb 18, 2026
b38e9d9
Merge pull request #269 from Scottcjn/fix/windows-miner-headless
sophiaeagent-beep Feb 18, 2026
e2901a6
docs: complete SEO overhaul and technical documentation expansion (#2…
firaslamouchi21 Feb 18, 2026
0a00d2d
feat(museum): integrate Hall of Hunters panel into PoA living museum
Scottcjn Feb 18, 2026
b05f98c
feat(museum): add hunters API proxy and 3D hall HUD
Scottcjn Feb 18, 2026
388655d
docs: add SECURITY.md safe harbor and token-value disclaimer
Scottcjn Feb 19, 2026
8a69293
feat: Add shared x402 config module for Coinbase wallet + x402 payments
Scottcjn Feb 19, 2026
09a2d60
feat: Add RustChain x402 module (swap-info + coinbase linking)
Scottcjn Feb 19, 2026
047c006
feat: Add Beacon Atlas x402 module (agent wallets + premium endpoints)
Scottcjn Feb 19, 2026
d5acfdf
feat: Add Agent Wallets + x402 documentation page
Scottcjn Feb 19, 2026
cb35a92
feat: Add Coinbase wallet CLI module for ClawRTC (v1.5.0)
Scottcjn Feb 19, 2026
1d27e70
feat: Add Agent Wallets + x402 section to README
Scottcjn Feb 19, 2026
fb030bd
fix: Restore README + add Agent Wallets / x402 section
Scottcjn Feb 19, 2026
ba1e8e0
docs: add one-page mechanism spec and falsification matrix
Scottcjn Feb 19, 2026
0fcef17
fix(rate-limit): prevent X-Forwarded-For spoof bypass
liu971227-sys Feb 20, 2026
d3e4262
fix(attest): block missing-fingerprint bypass
liu971227-sys Feb 20, 2026
06a057b
fix(wallet): reject sub-micro transfer amounts
liu971227-sys Feb 20, 2026
fdebe37
feat(monitoring): add cross-node consistency probe
liu971227-sys Feb 20, 2026
dbd2874
hardening(anchor): remove default Ergo API key and wallet password
liu971227-sys Feb 20, 2026
12adee9
security(fingerprint): add AWS, GCP, Azure, and cloud provider VM det…
Scottcjn Feb 22, 2026
3bb2911
fix: add inline attestation nonce replay protection
Feb 22, 2026
81e3982
Merge pull request #327 from autonomy414941/fix/attest-nonce-replay-i…
sophiaeagent-beep Feb 22, 2026
7601eda
fix: reject non-finite withdrawal amounts (#330)
autonomy414941 Feb 22, 2026
4be4c0a
docs: add documentation quality checklist and troubleshooting guidanc…
nicepopo86-lang Feb 22, 2026
402b214
docs: fix manual install commands and repository structure paths
autonomy414941 Feb 22, 2026
46cb78d
feat: add /api/badge/<miner_id> endpoint + GitHub Action for mining s…
AdnanMehr8 Feb 22, 2026
938f05e
feat: add GitHub gamification — welcome bot, auto-labeler, stale bot,…
Scottcjn Feb 22, 2026
fa6a648
feat: add dynamic badges and contributor engagement section to README
Scottcjn Feb 22, 2026
f654c21
feat: add --version flag to all miners
Pitrat-wav Feb 23, 2026
696429c
docs: add requirements.txt
Pitrat-wav Feb 23, 2026
8becd34
feat: add colored output to all miners
Pitrat-wav Feb 23, 2026
b656fd3
feat: add JSON output mode to universal miner
Pitrat-wav Feb 23, 2026
7e8a271
docs: add installation troubleshooting section
nicepopo86-lang Feb 23, 2026
5b9de27
feat: add reusable mining status badge action
nicepopo86-lang Feb 23, 2026
0caf5c5
feat: add BoTTube API integration example
nicepopo86-lang Feb 23, 2026
6da30da
fix: correct f-string quoting in hardware_fingerprint output
Feb 23, 2026
fb2f3ea
Merge pull request #363 from autonomy414941/fix/hardware-fingerprint-…
Scottcjn Feb 23, 2026
248948b
fix: fail closed on mock signature mode outside test runtime
Feb 23, 2026
c6dcea2
fix: prevent unauthenticated sensitive API disclosure
Feb 23, 2026
29d5a32
Merge pull request #366 from autonomy414941/fix/mock-signature-fail-c…
Scottcjn Feb 23, 2026
6e1b71a
Merge pull request #368 from autonomy414941/fix/api-sensitive-disclos…
Scottcjn Feb 23, 2026
ac9679b
security: validate limit query params to avoid endpoint 500s (#372)
autonomy414941 Feb 24, 2026
ff840dc
security: enforce entropy-quality thresholds in hardware collision ch…
createkr Feb 25, 2026
363a7da
feat: add RustChain Telegram Bot (Bounty #249)
zzjpython Feb 25, 2026
a3eddab
fix: extract badge Python to separate file, reduce cron to daily
Scottcjn Feb 26, 2026
aab1582
fix: extract badge Python to separate file, reduce cron to daily
Scottcjn Feb 26, 2026
5585b68
fix: extract badge Python to separate file, reduce cron to daily
Scottcjn Feb 26, 2026
13a8390
fix: auto-label PRs with BCOS tiers, default to L1 instead of hard-fail
Scottcjn Feb 26, 2026
f7efe09
fix: auto-label PRs with BCOS tiers, default to L1 instead of hard-fail
Scottcjn Feb 26, 2026
5e6cae7
feat(sdk): rustchain Python SDK v0.2.0 — Bounty #2297
sungdark Mar 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
524 changes: 156 additions & 368 deletions README.md

Large diffs are not rendered by default.

65 changes: 51 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,54 @@
[tool.pytest.ini_options]
testpaths = ["tests"]
pythonpath = ["node", "."]
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "rustchain"
version = "0.2.0"
description = "Python SDK for RustChain blockchain network — Proof of Antiquity consensus"
readme = "README.md"
license = {text = "MIT"}
authors = [
{name = "OpenClaw Agent", email = "agent@openclaw.dev"}
]
keywords = ["rustchain", "blockchain", "proof-of-antiquity", "crypto", "rtc", "mining"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Internet :: WWW/HTTP :: HTTP Clients",
"Topic :: Software Development :: Libraries :: Python Modules",
]
requires-python = ">=3.9"
dependencies = [
"aiohttp>=3.9.0",
"httpx>=0.27.0",
]

[project.optional-dependencies]
dev = [
"pytest>=8.0.0",
"pytest-asyncio>=0.23.0",
"mypy>=1.8.0",
]

[tool.ruff]
line-length = 120
select = ["E", "F", "W", "B", "I"]
ignore = []
exclude = ["deprecated", "node_backups"]
[project.scripts]
rustchain = "rustchain.cli:main"

[tool.ruff.lint]
ignore = ["E501"] # Ignore long lines for legacy code
[project.urls]
Homepage = "https://rustchain.org"
Repository = "https://github.com/Scottcjn/Rustchain"
Documentation = "https://github.com/Scottcjn/Rustchain/blob/main/API_WALKTHROUGH.md"

[tool.mypy]
python_version = "3.11"
ignore_missing_imports = true
exclude = ["deprecated", "node_backups"]
[tool.setuptools.packages.find]
where = ["src"]

[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests"]
67 changes: 67 additions & 0 deletions src/rustchain/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
"""
rustchain — Python SDK for RustChain Proof-of-Antiquity blockchain.

Install:
pip install rustchain

Quickstart:
from rustchain import RustChainClient

client = RustChainClient()
health = client.health()
epoch = client.epoch()
miners = client.miners()
balance = client.balance("my-wallet")
txs = client.explorer.transactions(limit=50)
blocks = client.explorer.blocks(limit=20)

Async usage:
from rustchain import AsyncRustChainClient
import asyncio

async def main():
client = AsyncRustChainClient()
health = await client.health()

asyncio.run(main())

CLI:
rustchain health
rustchain balance my-wallet
rustchain epoch
rustchain miners
rustchain wallet generate
"""

__version__ = "0.2.0"

from .client import RustChainClient, AsyncRustChainClient
from .explorer import Explorer
from .crypto import SigningKey
from .exceptions import (
RustChainError,
APIError,
ConnectionError,
TimeoutError,
ValidationError,
WalletError,
SigningError,
AttestationError,
)

__all__ = [
# Client
"RustChainClient",
"AsyncRustChainClient",
"Explorer",
"SigningKey",
# Exceptions
"RustChainError",
"APIError",
"ConnectionError",
"TimeoutError",
"ValidationError",
"WalletError",
"SigningError",
"AttestationError",
]
104 changes: 104 additions & 0 deletions src/rustchain/cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
"""
RustChain CLI
Command-line interface for RustChain network.

Usage:
rustchain balance <wallet_id>
rustchain health
rustchain epoch
rustchain miners
rustchain transfer <from> <to> <amount> [--fee N] [--seed <seed>]
rustchain wallet generate
rustchain wallet sign <from> <to> <amount>
"""

import argparse
import sys
from . import RustChainClient, AsyncRustChainClient
from .crypto import SigningKey


def main() -> None:
parser = argparse.ArgumentParser(prog="rustchain", description="RustChain CLI")
sub = parser.add_subparsers(dest="cmd", required=True)

# rustchain health
sub.add_parser("health", help="Check node health")

# rustchain epoch
sub.add_parser("epoch", help="Get current epoch info")

# rustchain miners
sub.add_parser("miners", help="List active miners")

# rustchain balance <wallet_id>
bal = sub.add_parser("balance", help="Check wallet balance")
bal.add_argument("wallet_id", help="Wallet or miner ID")

# rustchain transfer <from> <to> <amount> [--fee] [--sig]
xfer = sub.add_parser("transfer", help="Submit a signed transfer")
xfer.add_argument("from_wallet")
xfer.add_argument("to_wallet")
xfer.add_argument("amount", type=int, help="Amount in smallest units (1 RTC = 1_000_000)")
xfer.add_argument("--fee", type=int, default=0)
xfer.add_argument("--sig", required=True, help="Hex Ed25519 signature")

# rustchain wallet generate
wgen = sub.add_parser("wallet", help="Wallet subcommands")
wsub = wgen.add_subparsers(dest="wallet_cmd")

gen = wsub.add_parser("generate", help="Generate a new Ed25519 wallet")
gen.add_argument("--seed", help="Optional seed phrase or hex seed")

sign = wsub.add_parser("sign", help="Sign a transfer payload")
sign.add_argument("from_wallet")
sign.add_argument("to_wallet")
sign.add_argument("amount", type=int)
sign.add_argument("--fee", type=int, default=0)
sign.add_argument("--seed", help="Seed to derive key from")

args = parser.parse_args()
client = RustChainClient()

try:
if args.cmd == "health":
print(client.health())
elif args.cmd == "epoch":
print(client.epoch())
elif args.cmd == "miners":
for m in client.miners():
print(m)
elif args.cmd == "balance":
print(client.balance(args.wallet_id))
elif args.cmd == "transfer":
print(client.transfer(
args.from_wallet, args.to_wallet, args.amount,
signature=args.sig, fee=args.fee,
))
elif args.wallet_cmd == "generate":
if args.seed:
key = SigningKey.from_seed(args.seed.encode())
else:
key = SigningKey.generate()
sig = key.sign(b"rustchain-wallet-generated").hex()
print(f"Private key (hex): {sig[:64]}...")
print("(Store this securely — it cannot be recovered)")
elif args.wallet_cmd == "sign":
if args.seed:
key = SigningKey.from_seed(args.seed.encode())
else:
key = SigningKey.generate()
sig_hex, payload = key.sign_transfer(
args.from_wallet, args.to_wallet, args.amount, args.fee,
)
print(f"Signature: {sig_hex}")
print(f"Payload: {payload}")
else:
parser.print_help()
except Exception as e:
print(f"Error: {e}", file=sys.stderr)
sys.exit(1)


if __name__ == "__main__":
main()
Loading