Multi-language SDK for interacting with a yu blockchain node.
| Language | Directory | Key Types |
|---|---|---|
| Go | go/ |
Sr25519, Ed25519, Secp256k1 |
| Python | python/ |
Ed25519 (built-in), Sr25519*, Secp256k1* |
| JavaScript | js/ |
Ed25519 (built-in), Sr25519* |
| Rust | rust/ |
Ed25519 (built-in) |
* requires optional dependency
All SDKs support:
- Writing — send a signed transaction:
POST /api/writing - Reading — query chain state:
POST /api/reading - Event subscription — receive receipts via WebSocket:
ws://.../subscribe/results
cd testchain
go mod tidy
go run main.goThis starts a single-node yu chain with poa and asset tripods on:
- HTTP:
localhost:7999 - WebSocket:
localhost:8999
Go
cd go && go mod tidy && go test ./tests/ -v -timeout 120sPython
cd python && pip install -r requirements.txt && pytest tests/ -vJavaScript
cd js && npm install && npm testRust
cd rust && cargo test -- --nocaptureyu-sdk/
├── testchain/ # Go program to start a poa+asset chain for testing
├── go/ # Go SDK
├── python/ # Python SDK
├── js/ # JavaScript SDK
└── rust/ # Rust SDK
Writing transactions are signed using yu's convention:
- JSON-serialize the
WrCallstruct msg = last_32_bytes(json_bytes)— equivalent toBytesToHashin yusignature = sign(private_key, msg)
Public key format: "0x" + hex(type_prefix_byte + pubkey_bytes)
- Sr25519: prefix
0x31(ASCII'1') - Ed25519: prefix
0x32(ASCII'2')