Skip to content

Automate Keyring Unlock — No More Pass-Phrase Prompts#110

Merged
mateeullahmalik merged 5 commits intomasterfrom
supportPassphraseParam
Jul 31, 2025
Merged

Automate Keyring Unlock — No More Pass-Phrase Prompts#110
mateeullahmalik merged 5 commits intomasterfrom
supportPassphraseParam

Conversation

@mateeullahmalik
Copy link
Collaborator

@mateeullahmalik mateeullahmalik commented Jul 31, 2025

Pull Request: Automate Keyring Unlock — No More Pass-Phrase Prompts


✨ Summary

This PR makes supernode start-up fully non-interactive on Cosmos-SDK v0.50.13.
When a pass-phrase is supplied in config.yml (passphrase_plain | _env | _file) we:

  • feed it to the SDK on an endless loop, and

  • swap os.Stdin for a pipe so input.GetPassword treats the session as non-TTY.

Local developers who omit the pass-phrase still get the normal prompt.


🗂️ Files Changed

Path Description
pkg/keyring/keyring.go • new repeatReader helper• new buildReaderAndPossiblySwapStdin that pipes the pass-phrase and replaces os.Stdin• imports bufio & standard libs only (no extra deps)

@a-ok123 a-ok123 requested review from a-ok123 and Copilot July 31, 2025 20:05

This comment was marked as outdated.

j-rafique
j-rafique previously approved these changes Jul 31, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements automated keyring unlock functionality to eliminate interactive passphrase prompts during supernode startup. It adds support for three passphrase sources (plain text, environment variable, or file) in the configuration and modifies the keyring initialization to automatically feed the passphrase to the Cosmos SDK when provided.

  • Adds passphrase configuration options (passphrase_plain, passphrase_env, passphrase_file) to KeyringConfig
  • Implements automated stdin replacement with a pipe for non-interactive keyring operations
  • Updates keyring initialization to use the new configuration structure instead of separate parameters

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pkg/keyring/keyring.go Core keyring automation logic with stdin pipe replacement and passphrase handling
supernode/config/config.go Adds three new passphrase fields to KeyringConfig structure
supernode/config/save.go Updates CreateDefaultConfig to accept passphrase parameters
supernode/cmd/init.go Adds CLI flags and interactive prompts for passphrase configuration
supernode/cmd/helpers.go Updates keyring initialization to use new config structure
supernode/cmd/start.go Switches to config-based keyring initialization
supernode/cmd/supernode.go Removes unused accountAddress field
tests/system/e2e_cascade_test.go Updates test to use new keyring initialization API
README.md Documents new passphrase configuration options and CLI flags

@mateeullahmalik mateeullahmalik merged commit 837a84d into master Jul 31, 2025
7 checks passed
@mateeullahmalik mateeullahmalik deleted the supportPassphraseParam branch August 12, 2025 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants