Files
aitbc/apps/blockchain-node/fix_tx_metadata2.py
aitbc1 bbe67239a1
Some checks failed
AITBC CI/CD Pipeline / lint-and-test (3.11) (push) Has been cancelled
AITBC CI/CD Pipeline / lint-and-test (3.12) (push) Has been cancelled
AITBC CI/CD Pipeline / lint-and-test (3.13) (push) Has been cancelled
AITBC CI/CD Pipeline / test-cli (push) Has been cancelled
AITBC CI/CD Pipeline / test-services (push) Has been cancelled
AITBC CI/CD Pipeline / test-production-services (push) Has been cancelled
AITBC CI/CD Pipeline / security-scan (push) Has been cancelled
AITBC CI/CD Pipeline / build (push) Has been cancelled
AITBC CI/CD Pipeline / deploy-staging (push) Has been cancelled
AITBC CI/CD Pipeline / deploy-production (push) Has been cancelled
AITBC CI/CD Pipeline / performance-test (push) Has been cancelled
AITBC CI/CD Pipeline / docs (push) Has been cancelled
AITBC CI/CD Pipeline / release (push) Has been cancelled
AITBC CI/CD Pipeline / notify (push) Has been cancelled
Security Scanning / Bandit Security Scan (apps/coordinator-api/src) (push) Has been cancelled
Security Scanning / Bandit Security Scan (cli/aitbc_cli) (push) Has been cancelled
Security Scanning / Bandit Security Scan (packages/py/aitbc-core/src) (push) Has been cancelled
Security Scanning / Bandit Security Scan (packages/py/aitbc-crypto/src) (push) Has been cancelled
Security Scanning / Bandit Security Scan (packages/py/aitbc-sdk/src) (push) Has been cancelled
Security Scanning / Bandit Security Scan (tests) (push) Has been cancelled
Security Scanning / CodeQL Security Analysis (javascript) (push) Has been cancelled
Security Scanning / CodeQL Security Analysis (python) (push) Has been cancelled
Security Scanning / Dependency Security Scan (push) Has been cancelled
Security Scanning / Container Security Scan (push) Has been cancelled
Security Scanning / OSSF Scorecard (push) Has been cancelled
Security Scanning / Security Summary Report (push) Has been cancelled
AITBC CLI Level 1 Commands Test / test-cli-level1 (3.11) (push) Has been cancelled
AITBC CLI Level 1 Commands Test / test-cli-level1 (3.12) (push) Has been cancelled
AITBC CLI Level 1 Commands Test / test-cli-level1 (3.13) (push) Has been cancelled
AITBC CLI Level 1 Commands Test / test-summary (push) Has been cancelled
refactor: improve gossip broker cleanup and enhance CLI wallet transaction handling
- Refactor _InProcessBroadcast.subscribe to use asynccontextmanager for cleaner resource cleanup
- Remove manual release callback in _InProcessSubscriber
- Update file-based wallet send to submit transactions via blockchain RPC
- Fetch balance and nonce from chain before sending transactions
- Add tx_hash and status tracking to local transaction history
- Enhance run_subprocess to support additional kwargs and return Comp
2026-03-23 14:06:17 +01:00

51 lines
1.6 KiB
Python

import sqlite3
def fix_db():
print("Fixing transaction table on aitbc node...")
conn = sqlite3.connect('/opt/aitbc/data/ait-mainnet/chain.db')
cursor = conn.cursor()
try:
cursor.execute('ALTER TABLE "transaction" ADD COLUMN nonce INTEGER DEFAULT 0;')
print("Added nonce column")
except sqlite3.OperationalError as e:
print(f"Error adding nonce: {e}")
try:
cursor.execute('ALTER TABLE "transaction" ADD COLUMN value INTEGER DEFAULT 0;')
print("Added value column")
except sqlite3.OperationalError as e:
print(f"Error adding value: {e}")
try:
cursor.execute('ALTER TABLE "transaction" ADD COLUMN fee INTEGER DEFAULT 0;')
print("Added fee column")
except sqlite3.OperationalError as e:
print(f"Error adding fee: {e}")
try:
cursor.execute('ALTER TABLE "transaction" ADD COLUMN status TEXT DEFAULT "pending";')
print("Added status column")
except sqlite3.OperationalError as e:
print(f"Error adding status: {e}")
try:
cursor.execute('ALTER TABLE "transaction" ADD COLUMN tx_metadata TEXT;')
print("Added tx_metadata column")
except sqlite3.OperationalError as e:
print(f"Error adding tx_metadata: {e}")
try:
cursor.execute('ALTER TABLE "transaction" ADD COLUMN timestamp TEXT;')
print("Added timestamp column")
except sqlite3.OperationalError as e:
print(f"Error adding timestamp: {e}")
conn.commit()
conn.close()
print("Done fixing transaction table.")
if __name__ == '__main__':
fix_db()