scripts/ reorganization: - Sort 14 loose root scripts into subfolders: blockchain/ (genesis, proposer, mock chain, testnet BTC) dev/ (CLI wrapper, dev services, OpenAPI gen, systemd setup, domain proxy) ops/ (coordinator proxy, remote tunnel) gpu/ (miner workflow) - Merge scripts/testing/ into scripts/test/ (eliminate duplicate folder) - Create scripts/examples/ for usage demos and simulations Root-level cleanup: - Move home/ (12 simulation scripts) → scripts/examples/ - Move dev-utils/ (2 files) → scripts/dev/ - Move protocols/receipts/sample → tests/fixtures/ - Delete stale src/ (duplicate of apps/blockchain-node/src/) - Remove empty home/, dev-utils/, protocols/ directories Documentation updates: - Update docs/6_architecture/8_codebase-structure.md tree and table - Update root README.md tree to reflect new structure
43 lines
1.1 KiB
Python
Executable File
43 lines
1.1 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
"""
|
|
Quick job submission and payment
|
|
Usage: python3 quick_job.py "your prompt"
|
|
"""
|
|
|
|
import subprocess
|
|
import sys
|
|
import time
|
|
|
|
if len(sys.argv) < 2:
|
|
print("Usage: python3 quick_job.py \"your prompt\"")
|
|
sys.exit(1)
|
|
|
|
prompt = sys.argv[1]
|
|
|
|
print(f"🚀 Submitting job: '{prompt}'")
|
|
|
|
# Submit job
|
|
result = subprocess.run(
|
|
f'cd ../cli && python3 client.py submit inference --prompt "{prompt}"',
|
|
shell=True,
|
|
capture_output=True,
|
|
text=True
|
|
)
|
|
|
|
# Extract job ID
|
|
job_id = None
|
|
for line in result.stdout.split('\n'):
|
|
if "Job ID:" in line:
|
|
job_id = line.split()[-1]
|
|
break
|
|
|
|
if job_id:
|
|
print(f"✅ Job submitted: {job_id}")
|
|
print("\n💡 Next steps:")
|
|
print(f" 1. Start miner: python3 cli/miner.py mine")
|
|
print(f" 2. Check status: python3 cli/client.py status {job_id}")
|
|
print(f" 3. After completion, pay with:")
|
|
print(f" cd home/client && python3 wallet.py send 25.0 $(cd home/miner && python3 wallet.py address | grep Address | cut -d' ' -f4) 'Payment for {job_id}'")
|
|
else:
|
|
print("❌ Failed to submit job")
|