```
chore: enhance .gitignore and remove obsolete documentation files - Reorganize .gitignore with categorized sections for better maintainability - Add comprehensive ignore patterns for Python, Node.js, databases, logs, and build artifacts - Add project-specific ignore rules for coordinator, explorer, and deployment files - Remove outdated documentation: BITCOIN-WALLET-SETUP.md, LOCAL_ASSETS_SUMMARY.md, README-CONTAINER-DEPLOYMENT.md, README-DOMAIN-DEPLOYMENT.md ```
This commit is contained in:
38
home/client/client_wallet.json
Normal file
38
home/client/client_wallet.json
Normal file
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"address": "aitbc18f75b7eb7e2ecc7567b6",
|
||||
"balance": 9365.0,
|
||||
"transactions": [
|
||||
{
|
||||
"type": "earn",
|
||||
"amount": 10000.0,
|
||||
"job_id": "genesis_distribution",
|
||||
"description": "Initial funding from genesis block",
|
||||
"timestamp": "2026-01-23T14:55:27.329418"
|
||||
},
|
||||
{
|
||||
"type": "spend",
|
||||
"amount": -100.0,
|
||||
"description": "Payment for GPU training",
|
||||
"timestamp": "2026-01-23T14:55:49.690981"
|
||||
},
|
||||
{
|
||||
"type": "spend",
|
||||
"amount": -500.0,
|
||||
"description": "GPU inference batch",
|
||||
"timestamp": "2026-01-23T14:55:56.229075"
|
||||
},
|
||||
{
|
||||
"type": "spend",
|
||||
"amount": -10.0,
|
||||
"description": "Payment for job 78f7546575e24d3dbf64b96e78d8e54b",
|
||||
"timestamp": "2026-01-23T15:09:30.029201"
|
||||
},
|
||||
{
|
||||
"type": "spend",
|
||||
"amount": -25.0,
|
||||
"description": "Payment for job e3b3fd7ddd684270932cfd8107771e81",
|
||||
"timestamp": "2026-01-23T15:09:41.183693"
|
||||
}
|
||||
],
|
||||
"created_at": "2026-01-23T14:55:27.329386"
|
||||
}
|
||||
74
home/client/wallet.py
Executable file
74
home/client/wallet.py
Executable file
@@ -0,0 +1,74 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Client wallet for managing AITBC tokens
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
from datetime import datetime
|
||||
|
||||
# Add parent directory to path to import wallet module
|
||||
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
import importlib.util
|
||||
spec = importlib.util.spec_from_file_location("wallet", os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "wallet.py"))
|
||||
wallet = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(wallet)
|
||||
AITBCWallet = wallet.AITBCWallet
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description="Client Wallet - Manage AITBC for paying for GPU services")
|
||||
parser.add_argument("--wallet", default="client_wallet.json", help="Wallet file name")
|
||||
|
||||
subparsers = parser.add_subparsers(dest="command", help="Commands")
|
||||
|
||||
# Balance command
|
||||
balance_parser = subparsers.add_parser("balance", help="Show balance")
|
||||
|
||||
# Address command
|
||||
address_parser = subparsers.add_parser("address", help="Show wallet address")
|
||||
|
||||
# History command
|
||||
history_parser = subparsers.add_parser("history", help="Show transaction history")
|
||||
|
||||
# Send command (pay for services)
|
||||
send_parser = subparsers.add_parser("send", help="Send AITBC to GPU provider")
|
||||
send_parser.add_argument("amount", type=float, help="Amount to send")
|
||||
send_parser.add_argument("to", help="Recipient address")
|
||||
send_parser.add_argument("description", help="Payment description")
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
if not args.command:
|
||||
parser.print_help()
|
||||
return
|
||||
|
||||
# Use client-specific wallet directory
|
||||
wallet_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
wallet_path = os.path.join(wallet_dir, args.wallet)
|
||||
|
||||
wallet = AITBCWallet(wallet_path)
|
||||
|
||||
if args.command == "balance":
|
||||
print("💼 CLIENT WALLET")
|
||||
print("=" * 40)
|
||||
wallet.show_balance()
|
||||
print("\n💡 Use 'send' to pay for GPU services")
|
||||
|
||||
elif args.command == "address":
|
||||
print(f"💼 Client Address: {wallet.data['address']}")
|
||||
print(" Share this address to receive AITBC")
|
||||
|
||||
elif args.command == "history":
|
||||
print("💼 CLIENT TRANSACTION HISTORY")
|
||||
print("=" * 40)
|
||||
wallet.show_history()
|
||||
|
||||
elif args.command == "send":
|
||||
print(f"💸 Sending {args.amount} AITBC to {args.to}")
|
||||
print(f" For: {args.description}")
|
||||
wallet.spend(args.amount, args.description)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user