Skip to content

feat: RustChain Java SDK + CLI Miner — Bounty #675 - #1982

Merged
Scottcjn merged 1 commit into
Scottcjn:mainfrom
LaphoqueRC:feat/java-tools-675
Mar 29, 2026
Merged

Scottcjn merged 1 commit into
Scottcjn:mainfrom
LaphoqueRC:feat/java-tools-675

Conversation

@LaphoqueRC

Copy link
Copy Markdown
Contributor

Java Tools & Features — Bounty #675 (100 RTC)

Deliverables

  • RustChainClient.java (~210 lines) — HTTP client with retries, exponential backoff
  • Fingerprint.java (~190 lines) — Hardware fingerprinting in Java
  • Miner.java (~200 lines) — CLI mining loop with ANSI output
  • RustChainClientTest.java (~100 lines) — JUnit 5 offline tests
  • pom.xml — Maven build, Java 11+, zero external runtime deps
  • README.md — Build, run, API reference

Features

  • Zero external dependencies (java.net.http only)
  • Shade plugin for fat JAR
  • Graceful SIGINT shutdown
  • Clock-drift fingerprinting via nanoTime

Closes #675

RTC Wallet: RTC2fe3c33c77666ff76a1cd0999fd4466ee81250ff

- tools/java/rustchain-sdk/pom.xml
  Maven build, Java 11+, zero external runtime deps (java.net.http only),
  JUnit 5 for tests, shade plugin for executable fat JAR.

- RustChainClient.java (~210 lines)
  HTTP client wrapping /health, /epoch, /api/miners, /api/stats,
  /attest/submit.  Configurable base URL, timeout, retries with
  exponential back-off.  Built-in minimal JSON serialiser; no external libs.

- Fingerprint.java (~190 lines)
  Hardware fingerprint collector: CPU arch, logical cores, JVM heap,
  OS name/version, JVM version, clock-drift measurement via nanoTime
  loops, SHA-256 identity hash.  Produces toDeviceMap() and
  toFingerprintMap() ready for attestation payloads.

- Miner.java (~200 lines)
  CLI mining loop: fingerprint → submitAttestation → sleep.
  Args: --node-url, --miner-id, --interval.
  ANSI-coloured console output; graceful SIGINT shutdown hook;
  per-session cycle/success/failure summary.

- RustChainClientTest.java (~100 lines)
  Offline unit tests: constructor config, URL normalisation, JSON
  serialisation (null/bool/int/string/map/list/escaping),
  ApiResponse.isSuccess(), extractField().

- tools/java/README.md
  Build instructions, CLI usage, full API reference with code examples.
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Mar 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Welcome to RustChain! Thanks for your first pull request.

Before we review, please make sure:

  • Your PR has a BCOS-L1 or BCOS-L2 label
  • New code files include an SPDX license header
  • You've tested your changes against the live node

Bounty tiers: Micro (1-10 RTC) | Standard (20-50) | Major (75-100) | Critical (100-150)

A maintainer will review your PR soon. Thanks for contributing!

@github-actions github-actions Bot added the size/XL PR: 500+ lines label Mar 29, 2026
@Scottcjn
Scottcjn merged commit 5c20361 into Scottcjn:main Mar 29, 2026
7 of 9 checks passed
@Scottcjn

Scottcjn commented Apr 2, 2026

Copy link
Copy Markdown
Owner

Payment confirmed — LaphoqueRC was paid via on-chain RTC transfer as part of a batch settlement. Total paid to date: 2,155 RTC across all contributions. Thank you for the work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/XL PR: 500+ lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants