Background
KeystoreFactory is a standalone command-line utility for generating wallet keystores and importing private keys, invoked via the --keystore-factory CLI flag from FullNode.jar.
The plugins module already contains several similar standalone tools:
ArchiveManifest - Archive manifest tool (main entry point)
Toolkit - General purpose utilities, including DbConvert, DbLite, DbCopy, DbMove, DbRoot, etc.
Problem Statement
KeystoreFactory is functionally a standalone utility tool, not core framework logic. Its current placement in the framework module:
- Blurs module boundaries:
framework should contain core node logic, while plugins houses standalone tools
- Increases framework coupling:
KeystoreFactory has no dependencies on framework-specific code beyond common modules
- Inconsistent organization: Similar standalone tools already exist in
plugins
Rationale
Why should this feature exist?
Moving KeystoreFactory to plugins would:
- Improve code organization by grouping all standalone tools together
- Reduce framework module size
- Make the plugin module's purpose clearer as the home for auxiliary tools
- Follow the existing pattern of similar utilities
What are the use cases?
- Developers building custom tools: Clearer module structure makes it easier to understand where new tools should be placed
- Build optimization: Plugin tools can be built and distributed independently
- Code maintenance: Easier to locate and maintain standalone utilities
Who would benefit from this feature?
- Core developers maintaining the java-tron codebase
- Users who need keystore generation tools (clearer separation of concerns)
Proposed Solution
Move KeystoreFactory to plugins module as a subcommand of Toolkit
Following the existing pattern where db is a subcommand of Toolkit, KeystoreFactory should be added as another subcommand.
Source: framework/src/main/java/org/tron/program/KeystoreFactory.java
Destination: plugins/src/main/java/common/org/tron/plugins/KeystoreFactory.java
Specification
Changes Required:
- Move the class: Relocate
KeystoreFactory.java to plugins/src/main/java/common/
- Update package: Change package from
org.tron.program to org.tron.plugins
- Refactor to picocli: Add picocli annotations to support being a
Toolkit subcommand (like DbLite)
- Register with Toolkit: Add
KeystoreFactory as a subcommand in Toolkit.java
- Remove CLI flag: Remove
--keystore-factory from CLIParameter.java and FullNode.java
- Update documentation: Update user docs to reflect new invocation method
API Changes
Breaking Change: The --keystore-factory CLI flag will be removed from FullNode.jar.
New invocation method:
# Old method (no longer works after this change)
java -jar FullNode.jar --keystore-factory
# New method (as a Toolkit subcommand)
java -jar Toolkit.jar keystore-factory
Scope of Impact
Backward Compatibility
- CLI interface changes - users need to update their invocation method
- No impact on keystore file format or functionality
Implementation
Do you have ideas regarding the implementation?
Yes, the implementation follows the existing DbLite subcommand pattern.
Are you willing to implement this feature?
Background
KeystoreFactoryis a standalone command-line utility for generating wallet keystores and importing private keys, invoked via the--keystore-factoryCLI flag fromFullNode.jar.The
pluginsmodule already contains several similar standalone tools:ArchiveManifest- Archive manifest tool (main entry point)Toolkit- General purpose utilities, includingDbConvert,DbLite,DbCopy,DbMove,DbRoot, etc.Problem Statement
KeystoreFactoryis functionally a standalone utility tool, not core framework logic. Its current placement in theframeworkmodule:frameworkshould contain core node logic, whilepluginshouses standalone toolsKeystoreFactoryhas no dependencies on framework-specific code beyond common modulespluginsRationale
Why should this feature exist?
Moving
KeystoreFactorytopluginswould:What are the use cases?
Who would benefit from this feature?
Proposed Solution
Move
KeystoreFactorytopluginsmodule as a subcommand ofToolkitFollowing the existing pattern where
dbis a subcommand ofToolkit,KeystoreFactoryshould be added as another subcommand.Source:
framework/src/main/java/org/tron/program/KeystoreFactory.javaDestination:
plugins/src/main/java/common/org/tron/plugins/KeystoreFactory.javaSpecification
Changes Required:
KeystoreFactory.javatoplugins/src/main/java/common/org.tron.programtoorg.tron.pluginsToolkitsubcommand (likeDbLite)KeystoreFactoryas a subcommand inToolkit.java--keystore-factoryfromCLIParameter.javaandFullNode.javaAPI Changes
Breaking Change: The
--keystore-factoryCLI flag will be removed fromFullNode.jar.New invocation method:
Scope of Impact
Backward Compatibility
Implementation
Do you have ideas regarding the implementation?
Yes, the implementation follows the existing
DbLitesubcommand pattern.Are you willing to implement this feature?