End-to-end developer toolkit for submitting compute jobs to the Republic blockchain using JSON RPC.
- JSON RPC Client: No need to run
republicdbinary - Key Management: Create, import, export keys programmatically
- Transaction Signing: Sign and broadcast transactions via RPC
- Job Submission: Submit compute jobs to validators
- Status Monitoring: Query and watch job status
- CLI Tool: Complete command-line interface
- LLM Inference Example: Ready-to-use GPT-2 inference container
cd republic-devtools
pip install -e .This will install the republic-dev CLI tool and the Python client library.
- Python >= 3.8
- Docker (for building inference containers)
- Running Republic blockchain node
# From the repository root
bash local_node.shWait for the chain to start (check with curl http://localhost:26657/status).
cd republic-devtools/examples
python complete_example.pyThis will:
- Check prerequisites
- Verify blockchain connectivity
- Build the Docker container for LLM inference
- Set up a test key
- Show you how to submit jobs
republic-dev node-statusrepublic-dev keys create my-keyrepublic-dev keys listrepublic-dev submit \
--from my-key \
--validator republicvaloper1... \
--image republic-llm-inference:latestrepublic-dev status <job-id>
# Or watch for changes
republic-dev status <job-id> --watchfrom republic_devtools.client import RepublicClient
# Initialize client
client = RepublicClient(
rpc_endpoint="http://localhost:26657",
chain_id="9001"
)
# Create a key
address = client.create_key("my-key")
print(f"Address: {address}")
# Submit a job
resp = client.submit_job(
from_key="my-key",
target_validator="republicvaloper1...",
execution_image="republic-llm-inference:latest",
verification_image="example-verification:latest"
)
print(f"TX Hash: {resp['txhash']}")
# Wait for job ID
job_id = client.wait_for_job(resp['txhash'])
print(f"Job ID: {job_id}")
# Check status
status = client.get_job_status(job_id)
print(status)--rpc: RPC endpoint (default:http://localhost:26657)--chain-id: Chain ID (default:9001)
Create a new key
List all stored keys
Show details for a specific key
Import an existing private key
Export private key (use with caution)
Submit a compute job
--from: Key name to sign with (required)--validator: Target validator address (required)--image: Docker image for execution (required)--verification: Docker image for verification--upload-endpoint: Upload endpoint--fetch-endpoint: Fetch endpoint--fee: Job fee amount--gas: Gas limit--fees: Transaction fees--wait/--no-wait: Wait for job ID
Get job status
--watch, -w: Watch for status changes--interval: Polling interval for watch mode
Check blockchain node status
Submit an LLM inference job (convenience command)
--key: Key name (required)--validator: Validator address (required)--model: Hugging Face model ID--prompt: Input prompt--image: Docker image