hiero-ledger / hiero-ledger/hiero-sdk-python
feat(tck): implement createNode JSON-RPC method
- Dominant language
- Python
- Stars
- 63
- Forks
- 298
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 38
Description
**Problem**
The TCK server does not implement `createNode`, so the TCK driver's `NodeCreateTransaction` suite cannot run against the Python SDK. The SDK transaction already exists: `src/hiero_sdk_python/nodes/node_create_transaction.py` (`NodeCreateTransaction`).
This is the first node-service TCK method, so it also creates the node-service TCK modules that `updateNode` / `deleteNode` will build on. **Do this one before `updateNode` / `deleteNode`.**
**Before you start — required reading**
TCK handlers are contract work: the TCK driver validates exact parameter names, optionality, defaults, and error semantics against the published spec. Please do not code from this issue title alone (or paste it into an AI tool and ship the first thing that runs) — read these first:
1. **The spec page linked below**, in full — especially the parameter table, the expected response shape, and the error/edge-case tests. If your handler's behavior differs from the spec table, the TCK suite will fail even if the happy path works.
2. [`tck/README.md`](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/tck/README.md) — how the JSON-RPC server, param dataclasses, handler registry, and responses fit together, and how to run the TCK driver locally against your handler. Run the actual TCK suite before opening a PR; unit tests alone are not enough.
3. **An existing handler as your pattern** — pick the closest one in `tck/handlers/` with its matching `tck/param/` dataclass and follow its structure, naming, and error handling exactly. Do not invent a new style, and do not re-implement SDK logic in the handler — handlers only wire validated params onto the existing SDK transaction/query.
4. **The SDK class you are wrapping** (path in the Problem section) — read its setters and defaults so you know what the SDK already handles for you.
5. [`CONTRIBUTING.md`](https://github.com/hiero-ledger/hiero-sdk-python/blob/main/CONTRIBUTING.md) — test and PR conventions.
**Solution**
- [ ] Create `tck/param/node.py` with a `CreateNodeParams` dataclass covering the spec's parameter table (account ID, description, gossip/service endpoints, gossip CA certificate, gRPC certificate hash, gRPC web proxy endpoint, admin key, decline reward, `commonTransactionParams`). The spec's shared `ServiceEndpoint` structure (https://github.com/hiero-ledger/hiero-sdk-tck/blob/main/docs/test-specifications/node-service/ServiceEndpoint.md) needs its own dataclass — read it before designing the params.
- [ ] Create `tck/handlers/node.py` with a `createNode` handler registered via `@rpc_method("createNode")`, and make sure the module is imported so registration runs (see how existing handler modules are wired into `tck/handlers/__init__.py`).
- [ ] Return `nodeId` and `status` per the spec.
- [ ] Add unit tests under `tests/tck/`, then run the TCK driver's NodeCreateTransaction suite locally.
Note: node transactions run against the local network's freeze/council accounts — read the spec's setup notes for how the driver expects this to be keyed and paid.
**Acceptance criteria**
- [ ] `createNode` registered and dispatchable; `nodeId` + `status` returned
- [ ] `ServiceEndpoint` inputs (IP + port and domain-name forms) parsed per the shared structure spec
- [ ] Spec error cases behave as specified (invalid endpoints, missing admin key, invalid certificates, …)
- [ ] Unit tests added and the TCK `NodeCreateTransaction` suite passes
Spec: https://github.com/hiero-ledger/hiero-sdk-tck/blob/main/docs/test-specifications/node-service/NodeCreateTransaction.md
JS reference: https://github.com/hiero-ledger/hiero-sdk-js/blob/main/tck/methods/node.ts (`createNode`)
Contributor guide
Research direction
Read the NodeCreateTransaction spec and tck/README.md first, then compare an existing tck/handlers/ handler with its tck/param/ dataclass and inspect src/hiero_sdk_python/nodes/node_create_transaction.py. Add tck/param/node.py, tck/handlers/node.py, registration wiring, and tests under tests/tck/. Done means createNode returns the specified nodeId and status, handles endpoint and error cases, and passes the NodeCreateTransaction TCK suite.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, blockchain, testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100