You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is a good fit for contributors who are already familiar with the Hiero C++ SDK and feel comfortable navigating the codebase.
Intermediate Issues often involve:
Exploring existing implementations
Understanding how different components work together
Making thoughtful changes that follow established patterns
The goal is to support deeper problem-solving while keeping the task clear, focused, and enjoyable to work on.
Important
🧭 About Intermediate Issues
Intermediate Issues are a great next step for contributors who enjoy
digging into the codebase and reasoning about how things work.
These issues often:
Involve multiple related files or components
Encourage investigation and understanding of existing behavior
Leave room for thoughtful implementation choices
Stay focused on a clearly defined goal
Other kinds of contributions — from beginner-friendly tasks to large
system-level changes — are just as valuable and use different labels.
🐞 Problem Description
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 transaction endpoints (createFile, deleteFile, updateFile) but is missing the getFileContentsquery endpoint. The TCK test file test-file-contents-query.ts calls this method and cannot run against this C++ SDK until it is implemented.
The full TCK specification for this endpoint — including all input/output parameters, test cases, and expected behavior — is published here:
The SDK already has a fully implemented FileContentsQuery class in src/sdk/main/include/FileContentsQuery.h. This issue is about wiring up that existing class to the TCK server.
What makes this interesting: This endpoint introduces query payment parameters (queryPayment and maxQueryPayment) which are not present in any of the existing FileService endpoints. These map to Query::setQueryPayment(const Hbar&) and Query::setMaxQueryPayment(const Hbar&) on the base Query class. The response also requires converting a std::vector<std::byte> to a string, which is a different serialization pattern from existing endpoints.
💡 Expected Outcome
The TCK server should respond to a new getFileContents JSON-RPC method. The full input/output parameter specification is defined in the TCK docs. In summary:
Inputs:
Parameter
Type
Required
Description
fileId
string
required
The ID of the file to query
queryPayment
string
optional
Explicit payment amount in tinybars
maxQueryPayment
string
optional
Maximum payment amount in tinybars
Output:{ "contents": "..." } — the file contents as a string
The implementation should:
Follow the query pattern established by getAccountInfo / getAccountBalance in AccountService.cc
Use FileContentsQuery from the SDK
Support optional queryPayment and maxQueryPayment via the Query base class methods
Convert the FileContents (std::vector<std::byte>) result to a string for the JSON response
Not modify any existing endpoints or SDK behavior
🧠 Implementation Notes
Architecture
Each TCK endpoint has four parts:
Params struct — a header in src/tck/include/file/params/ that defines the JSON-RPC parameters and their deserialization
Service header — a function declaration in src/tck/include/file/FileService.h
Service implementation — the function body in src/tck/src/file/FileService.cc
Server registration — wiring in src/tck/src/TckServer.cc (include, addMethod call, template instantiation)
Reference implementations
What you're building
Closest existing reference
GetFileContentsParams struct
src/tck/include/account/params/GetAccountInfoParams.h — similar query params pattern, but add mQueryPayment and mMaxQueryPayment fields
getFileContents function
getAccountBalance in src/tck/src/account/AccountService.cc — simpler query pattern
Byte-to-string conversion:FileContentsQuery::execute() returns FileContents, which is a type alias for std::vector<std::byte> (defined in FileContentsQuery.h line 21). To convert this to a string for the JSON response, use Hiero::internal::Utilities::byteVectorToString() from <impl/Utilities.h> (this header is already included in FileService.cc).
Query payment parameters: The queryPayment and maxQueryPayment values arrive as strings representing tinybars. Parse them and pass to the query using Hbar::fromTinybars(). Look at how CommonTransactionParams handles mMaxTransactionFee for a similar pattern.
No commonTransactionParams: This is a query, not a transaction. The params struct should not include CommonTransactionParams.
🧩 Intermediate Friendly
This issue is a good fit for contributors who are already familiar with the Hiero C++ SDK and feel comfortable navigating the codebase.
Intermediate Issues often involve:
The goal is to support deeper problem-solving while keeping the task clear, focused, and enjoyable to work on.
Important
🧭 About Intermediate Issues
Intermediate Issues are a great next step for contributors who enjoy
digging into the codebase and reasoning about how things work.
These issues often:
Other kinds of contributions — from beginner-friendly tasks to large
system-level changes — are just as valuable and use different labels.
🐞 Problem Description
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
FileServicecurrently implements transaction endpoints (createFile,deleteFile,updateFile) but is missing thegetFileContentsquery endpoint. The TCK test filetest-file-contents-query.tscalls this method and cannot run against this C++ SDK until it is implemented.The full TCK specification for this endpoint — including all input/output parameters, test cases, and expected behavior — is published here:
The SDK already has a fully implemented
FileContentsQueryclass insrc/sdk/main/include/FileContentsQuery.h. This issue is about wiring up that existing class to the TCK server.What makes this interesting: This endpoint introduces query payment parameters (
queryPaymentandmaxQueryPayment) which are not present in any of the existing FileService endpoints. These map toQuery::setQueryPayment(const Hbar&)andQuery::setMaxQueryPayment(const Hbar&)on the baseQueryclass. The response also requires converting astd::vector<std::byte>to a string, which is a different serialization pattern from existing endpoints.💡 Expected Outcome
The TCK server should respond to a new
getFileContentsJSON-RPC method. The full input/output parameter specification is defined in the TCK docs. In summary:Inputs:
fileIdqueryPaymentmaxQueryPaymentOutput:
{ "contents": "..." }— the file contents as a stringThe implementation should:
getAccountInfo/getAccountBalanceinAccountService.ccFileContentsQueryfrom the SDKqueryPaymentandmaxQueryPaymentvia theQuerybase class methodsFileContents(std::vector<std::byte>) result to a string for the JSON response🧠 Implementation Notes
Architecture
Each TCK endpoint has four parts:
src/tck/include/file/params/that defines the JSON-RPC parameters and their deserializationsrc/tck/include/file/FileService.hsrc/tck/src/file/FileService.ccsrc/tck/src/TckServer.cc(include,addMethodcall, template instantiation)Reference implementations
GetFileContentsParamsstructsrc/tck/include/account/params/GetAccountInfoParams.h— similar query params pattern, but addmQueryPaymentandmMaxQueryPaymentfieldsgetFileContentsfunctiongetAccountBalanceinsrc/tck/src/account/AccountService.cc— simpler query patternsrc/sdk/main/include/Query.h—setQueryPayment(const Hbar&)(line 129) andsetMaxQueryPayment(const Hbar&)(line 139)Things to think about
Byte-to-string conversion:
FileContentsQuery::execute()returnsFileContents, which is a type alias forstd::vector<std::byte>(defined inFileContentsQuery.hline 21). To convert this to a string for the JSON response, useHiero::internal::Utilities::byteVectorToString()from<impl/Utilities.h>(this header is already included inFileService.cc).Query payment parameters: The
queryPaymentandmaxQueryPaymentvalues arrive as strings representing tinybars. Parse them and pass to the query usingHbar::fromTinybars(). Look at howCommonTransactionParamshandlesmMaxTransactionFeefor a similar pattern.No
commonTransactionParams: This is a query, not a transaction. The params struct should not includeCommonTransactionParams.Files to create and modify
src/tck/include/file/params/GetFileContentsParams.hmFileId,mQueryPayment,mMaxQueryPaymentsrc/tck/include/file/FileService.hsrc/tck/src/file/FileService.ccFileContentsQuery.h,Hbar.h) andgetFileContentsimplementationsrc/tck/src/TckServer.ccKey SDK headers to study
src/sdk/main/include/FileContentsQuery.hsetFileId, returnsFileContents(std::vector<std::byte>) viaexecute()src/sdk/main/include/Query.hsetQueryPayment(const Hbar&),setMaxQueryPayment(const Hbar&)src/sdk/main/include/Hbar.hHbar::fromTinybars(int64_t)— for parsing payment amountssrc/sdk/main/include/impl/Utilities.hbyteVectorToString(const std::vector<std::byte>&)— for converting file contents to string✅ Acceptance Criteria
To help get this change merged smoothly:
getFileContentsis registered inTckServerand responds to JSON-RPC callsfileId,queryPayment, andmaxQueryPaymentfrom JSONqueryPaymentandmaxQueryPaymentare correctly applied viaQuerybase class methods when provided{ "contents": "..." }with the file contents as a string, as specified in the TCK docsAccountServicequery endpoints📋 Contribution Guide
To help your contribution go as smoothly as possible, we recommend following these steps:
/assignto request the issueREADME.md-s -SRead Workflow Guide for step-by-step workflow guidance.
Read README.md for setup instructions.
❗ Pull requests cannot be merged without
Sandssigned commits.See the Signing Guide.
📚 Additional Context or Resources
If you have questions, the community is happy to help:
Hiero-SDK-C++ Discord