Skip to content

[Intermediate]: Implement deleteFile TCK endpoint #1215

@rwalworth

Description

@rwalworth

🔧 Intermediate

This issue is suited for contributors who are comfortable with C++ and Git and are ready to work across multiple files, follow established patterns, and test against an external system.

Intermediate Issues typically involve reading existing code, understanding how components interact, and replicating patterns in a new context. They may also require setting up additional tooling or infrastructure beyond the SDK itself.

Important

🔧 About Intermediate Issues

Intermediate Issues are a good fit for contributors who are comfortable with
the basic project workflow and want to take on more involved tasks.

These issues often involve:

  • Working across multiple files and components
  • Following established patterns to implement new functionality
  • Setting up and testing against external tools or environments

You'll usually see Intermediate Issues focused on things like:

  • Adding new endpoints, services, or transaction types
  • Wiring up existing SDK classes to new subsystems (e.g. TCK server)
  • Changes that require local environment setup beyond just building the SDK

Other types of contributions — such as small doc fixes, larger features,
or deeper architectural work — are just as valuable and may use different labels.


👾 Description of the Issue

The TCK (Test Compatibility Kit) server in this repository exposes JSON-RPC endpoints that the hiero-sdk-tck test suite calls to verify SDK behavior across all Hiero SDKs.

The FileService currently implements two endpoints:

  • createFile — creates a file on the Hiero network
  • updateFile — updates an existing file

The TCK test suite also expects a deleteFile endpoint, but it is not yet implemented in this C++ SDK. The test file test-file-delete-transaction.ts in the TCK repo calls the deleteFile JSON-RPC method with the following parameters:

Parameter Type Required Description
fileId string optional The ID of the file to delete
commonTransactionParams object optional Common transaction parameters (signers, memo, fee, etc.)

The SDK already has a fully implemented FileDeleteTransaction class in:

src/sdk/main/include/FileDeleteTransaction.h

This issue is about wiring up the existing FileDeleteTransaction class to the TCK server, following the same pattern used by deleteToken in the TokenService.


💡 Proposed Solution

Add a deleteFile JSON-RPC endpoint to the TCK server by:

  1. Creating a new DeleteFileParams struct (parameter deserialization)
  2. Declaring and implementing a deleteFile function in FileService
  3. Registering the new method in TckServer

The implementation should:

  • Follow the exact same pattern as deleteToken in the TokenService
  • Use the existing FileDeleteTransaction SDK class
  • Accept fileId and commonTransactionParams as optional parameters
  • Return a JSON object with a status string from the transaction receipt

👩‍💻 Implementation Guidance

The deleteToken endpoint in TokenService is the closest reference — deleteFile is structurally identical, just for files instead of tokens. Study how deleteToken is wired up end-to-end and replicate that pattern.

At a high level, you'll need to:

  1. Create a DeleteFileParams struct for JSON deserialization
  2. Declare and implement a deleteFile function in FileService
  3. Register the new deleteFile method in TckServer

Reference files:

File What to look at
src/tck/include/token/params/DeleteTokenParams.h Params struct pattern (closest match)
src/tck/include/token/TokenService.h Service header pattern
src/tck/src/token/TokenService.cc deleteToken implementation (closest match)
src/tck/src/TckServer.cc How endpoints are registered (includes, method registration, template instantiation)
src/sdk/main/include/FileDeleteTransaction.h The SDK class being wired up

✅ Acceptance Criteria

To help get this change merged smoothly:

  • Scope: Changes are limited to adding the deleteFile TCK endpoint
  • Pattern: Implementation follows the same structure as existing endpoints (e.g. deleteToken)
  • Params: DeleteFileParams correctly deserializes fileId and commonTransactionParams from JSON
  • Registration: The deleteFile method is registered in TckServer and responds to JSON-RPC calls
  • Behavior: No other SDK behavior or API changes
  • Build: Project compiles successfully
  • Tests: Existing CI checks pass
  • Review: All code review feedback addressed

📋 Step-by-Step Contribution Guide

To help keep contributions consistent and easy to review, we recommend following these steps:

  • Comment /assign to request the issue
  • Wait for assignment
  • Fork the repository and create a branch
  • Set up the project using the instructions in README.md
  • Make the requested changes
  • Sign each commit using -s -S
  • Push your branch and open a pull request

Read Workflow Guide for step-by-step workflow guidance.
Read README.md for setup instructions.

❗ Pull requests cannot be merged without S and s signed commits.
See the Signing Guide.


🤔 Additional Information

If you have questions while working on this issue, feel free to ask!

You can reach the community and maintainers here:
Hiero-SDK-C++ Discord

Whether you need help finding the right file, understanding existing code,
or confirming your approach — we're happy to help.

Metadata

Metadata

Assignees

Labels

priority: mediumNormal priority; to be addressed in the standard development cycleskill: intermediateRequires familiarity with the codebase structure and SDK concepts

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions