feat(framework): support admin IPC and RPC - #82
Open
317787106 wants to merge 12 commits into
Open
Conversation
317787106
force-pushed
the
feature/admin_rpc
branch
from
July 31, 2026 09:13
e299fd9 to
147613e
Compare
317787106
force-pushed
the
feature/admin_rpc
branch
from
August 4, 2026 06:34
042981c to
a068c83
Compare
…return code when using --exec; use IPC frame; don't init args when using --attach; throw Tron_ERROR when output-directory is not exist
…rvice; add setErrorResolver for admin jsonrpc
…put-directory, else write in /tmp if path is too long; IPC client exist will not interpurt input
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Implements the Admin RPC transport and geth-style local IPC console requested by tronprotocol/java-tron#6497.
Admin RPC
org.tron.core.services.adminpackage with a shared admin API for HTTP and IPC transports.admin_exampleas a typed example method.HTTP transport
node.adminRpc.enable,node.adminRpc.listenAddress, andnode.adminRpc.portoptions.reference.conf.IPC transport and console
node.ipcEnableand createsjava-tron.<pid>.sockunder--output-directorywhen the complete encoded absolute path is at most 100 bytes./tmp/java-tron.<pid>.sockwhen the output-directory path is too long for a portable Unix-domain socket address.0600).nullafter commands whose return value is null.CLI
Interactive console:
Execute one command and return an appropriate process exit code:
--attachpath,--execwithout--attach, and unsupported node-startup options combined with attach mode.CommonParameter,LogService, database, witness, or node-service initialization, so the console process does not open or rotate the running node log files.Why are these changes required?
Administrative operations need a local, scriptable interface that does not require starting another node instance. The Unix-domain-socket console provides a secure-by-default local transport, while the optional loopback-bound HTTP Admin RPC supports controlled integration.
The framing, path-length fallback, idle timeout, accept backoff, deterministic disconnect handling, and consistent error envelopes make the console safe to operate across local development, containers, and deeply nested mounted output directories.
Testing
0600permissions, stale-path safety, request limits, concurrent clients, idle timeout, JSON-RPC errors, and teardown cleanup after stop failure.--exec, formatted output, clean exit, unexpected disconnects, and process exit codes.LogService.checkstyleMainandcheckstyleTest.--exec, and commands surrounded by leading/trailing whitespace.Follow-up