Skip to content

Latest commit

 

History

History
172 lines (118 loc) · 6 KB

File metadata and controls

172 lines (118 loc) · 6 KB

License

Hedera Transaction Tool

The Hedera Transaction Tool application is a demo application that allows a user to generate keys, create, sign, and submit transactions to a Hedera network. This software is designed for use solely by the Hedera Council and staff. The software is being released as open source as example code only, and is not intended or suitable for use in its current form by anyone other than members of the Hedera Council and Hedera personnel. If you are not a Hedera Council member or staff member, use of this application or of the code in its current form is not recommended and is at your own risk.

Prerequisites

  • Node.js

    • Required version: >= 24.20.0 <25

    • Verify installation:

      node -v
  • pnpm

    • Required version: >= 9.13.1

    • Installation of pnpm(if not already installed):

      npm install -g pnpm@latest
    • Verify installation:

      pnpm --version
  • Python setuptools

    • Required version: >= 75.6.0

    • Installation of python-setuptools with brew:

      brew install python-setuptools
    • Verify installation:

      python -m setuptools --version

1. Clone the project

git clone https://github.com/hashgraph/hedera-transaction-tool.git
cd hedera-transaction-tool

2. Install dependencies

The repository is a single pnpm workspace; install once from the root for all modules (back-end, front-end, automation):

pnpm install

Front-end-specific scripts can then be run via the workspace filter (from any directory):

pnpm -F hedera-transaction-tool <script>          # e.g. pnpm -F hedera-transaction-tool dev

Or by cd front-end and running the script as before — both work.

Do not rename this workspace package. The name field in front-end/package.json is hedera-transaction-tool because Electron reads it as app.getName(), which determines:

  • the userData directory (~/Library/Application Support/hedera-transaction-tool/ on macOS, ~/.config/hedera-transaction-tool/ on Linux, %APPDATA%\hedera-transaction-tool\ on Windows) — where the local SQLite database, logs, and Prisma data live;
  • the macOS Keychain entry name (hedera-transaction-tool Safe Storage) — which holds the symmetric key Electron's safeStorage uses to encrypt private keys, mnemonics, and other sensitive blobs.

Renaming the package would silently relocate every existing user's database to a fresh empty path and decouple their encrypted blobs from the keychain entry that can decrypt them. Effectively a mass invisible data loss on every install.

3. Generate Prisma client library

pnpm -F hedera-transaction-tool generate:database

4. Start developing

pnpm -F hedera-transaction-tool dev

5. Build for distribution

pnpm build:mac

6. Run the unit tests

pnpm test:main # run tests for the main process
pnpm test:renderer # run tests for the renderer process
pnpm test:shared # run tests for the shared utils

Run the tests with coverage

pnpm test:main:coverage # run tests for the main process
pnpm test:renderer:coverage # run tests for the renderer process
pnpm test:shared:coverage # run tests for the shared utils

7. Troubleshooting

  • Prisma issues

    • If you encounter problems with @prisma/client:

      npx prisma generate
    • Alternatively, reinstall node_modules and run:

      npx prisma generate
  • ENOENT errors

    • If errors persist after reinstalling node_modules and running prisma_generate, it may be caused by a missing Electron distribution.

    • To fix this, manually rebuild Electron from the front-end directory:

      pnpm rebuild electron

Frontend Logging

Both main and renderer processes write structured logs to a single local file via electron-log.

Log file location

Logs are written to app.getPath('userData')/logs/app.log. Log rotation keeps one active 5 MB log file plus 5 archives (~30 MB maximum).

Log format

Each line is a JSON object:

{"timestamp":"2026-03-13T10:00:00.000Z","level":"info","component":"renderer.websocket","message":"Socket connected","metadata":{"url":"wss://..."}}

Fields: timestamp (ISO 8601), level (error | warn | info | debug), component, message, and optional metadata.

Component naming

Components follow the convention <process>.<module>.<submodule>:

  • main.* — main process loggers (e.g., main.console, main.database, main.localUser.accounts)
  • renderer.* — renderer process loggers (e.g., renderer.console, renderer.store.user, renderer.page.createTransactionGroup)

Create a logger with createLogger('renderer.myComponent') in the renderer or createLogger('main.myModule') in the main process.

Log level configuration

The default log level is info. Override it by setting the HTT_LOG_LEVEL environment variable before launching the app:

HTT_LOG_LEVEL=debug pnpm dev

Available levels: error, warn, info, debug.

Sensitive data filtering

Logs are automatically sanitized before being written to disk:

  • Key-based redaction: Values under keys containing password, accesstoken, refreshtoken, jwt, authorization, cookie, secret, privatekey, mnemonic, recoveryphrase, seed, signaturebytes, signatureraw, signedtransaction, signaturemap, transactionbytes, requestbody, responsebody, pem, encrypted, or secrethash are replaced with [redacted].
  • Pattern scrubbing: JWT tokens (eyJ...), Bearer tokens, and PEM blocks are stripped from message text.
  • Payload omission: Long hex or base64 strings (>128 chars) are summarized as payload omitted instead of being logged verbatim.