Skip to content

cmd/rofl: Add refresh-trust-root subcommand#699

Open
anzoman wants to merge 3 commits into
masterfrom
anzoman/feature/rofl-refresh-trust-root
Open

cmd/rofl: Add refresh-trust-root subcommand#699
anzoman wants to merge 3 commits into
masterfrom
anzoman/feature/rofl-refresh-trust-root

Conversation

@anzoman
Copy link
Copy Markdown
Contributor

@anzoman anzoman commented May 28, 2026

Adds oasis rofl refresh-trust-root to fetch the latest consensus trust root and update the rofl.yaml manifest automatically.

Closes #567.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 28, 2026

Deploy Preview for oasisprotocol-cli canceled.

Name Link
🔨 Latest commit c4835a8
🔍 Latest deploy log https://app.netlify.com/projects/oasisprotocol-cli/deploys/6a198900afd557000809b30b

@anzoman anzoman force-pushed the anzoman/feature/rofl-refresh-trust-root branch 3 times, most recently from 7857ac5 to 9c3d990 Compare May 29, 2026 09:58
@anzoman anzoman marked this pull request as ready for review May 29, 2026 10:04
@anzoman anzoman requested review from kostko and matevz May 29, 2026 10:05
Comment thread cmd/rofl/refresh_trust_root.go Outdated
@matevz
Copy link
Copy Markdown
Member

matevz commented May 29, 2026

While you're at it, can you also fix the oasis rofl trust-root output?

$ oasis rofl trust-root
TrustRoot {
    height: 32299682,
    hash: "a1f25ff6febef34216b08d31122bafc1fd24b0d2445a0f6b8da9b5f62624e89a".into(),
    runtime_id: "000000000000000000000000000000000000000000000000a6d1e3ebf60dff6c".into(),
    chain_context: "0b91b8e4e44b2003a7c5e23ddadb5e14ef5345c0ebcb3ddcae07fa2f244cab76".to_string(),
}

Should be normal json.

@anzoman anzoman force-pushed the anzoman/feature/rofl-refresh-trust-root branch from 9c3d990 to 6cc7e7a Compare May 29, 2026 12:27
anzoman added 3 commits May 29, 2026 14:37
Add a `set-trust-root` subcommand that writes the consensus trust root
(block height and hash) into the deployment section of the rofl.yaml
manifest. The block height and hash may be passed as positional
arguments; when omitted, the latest finalized block is used, and when
only the height is given, the corresponding hash is fetched from the
network.

The naming and positional-argument style mirror `oasis network
set-chain-context`.
The `trust-root` command previously printed a Rust struct literal. Emit
standard indented JSON instead so the output is easier to consume
programmatically.
Document the new `set-trust-root` subcommand and its positional
arguments, and update the `trust-root` section to reflect the JSON
output.
@anzoman anzoman force-pushed the anzoman/feature/rofl-refresh-trust-root branch from 6cc7e7a to c4835a8 Compare May 29, 2026 12:39
@anzoman anzoman requested a review from matevz May 29, 2026 12:40
)

var setTrustRootCmd = &cobra.Command{
Use: "set-trust-root [height] [hash]",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
Use: "set-trust-root [height] [hash]",
Use: "set-trust-root [<height>] [<hash>]",


var setTrustRootCmd = &cobra.Command{
Use: "set-trust-root [height] [hash]",
Short: "Set the trust root in the rofl.yaml manifest",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
Short: "Set the trust root in the rofl.yaml manifest",
Short: "Set the trust root in the ROFL app manifest",

var setTrustRootCmd = &cobra.Command{
Use: "set-trust-root [height] [hash]",
Short: "Set the trust root in the rofl.yaml manifest",
Long: "Set the consensus block height and hash of the trust root in the rofl.yaml manifest.\n\n" +
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
Long: "Set the consensus block height and hash of the trust root in the rofl.yaml manifest.\n\n" +
Long: "Set the consensus block height and hash of the trust root in the ROFL app manifest.\n\n" +

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.

Add subcommand to refresh ROFL app trust root

3 participants