Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bridge pool cli #729

Merged
merged 16 commits into from
Nov 8, 2022
Merged

Conversation

batconjurer
Copy link
Member

This PR partially closes #425. It depends on #715. It sets up CLI commands for the following:

  • Adding a new transfer to the bridge pool
  • Querying the current contents of the pool
  • Getting a merkle proof of a selected set of transfers

It also generates a new binary, namadar which can handle these tasks. Eventually, this binary should become a more robust relayer. It refactors the queries in the shell a bit for better UX.

This is not covered by tests yet as this PR is large enough. The wasm code needs to be updated and then we can test. That will be the next PR.

@batconjurer batconjurer requested review from sug0 and james-chf November 3, 2022 09:58
@batconjurer batconjurer mentioned this pull request Nov 4, 2022
Copy link
Collaborator

@sug0 sug0 left a comment

Choose a reason for hiding this comment

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

there's no relaying happening yet, right? couldn't these sub-commands still be a part of namadac?

also, we should hold off on merging until #723 is in eth-bridge-integration

apps/src/lib/client/eth_bridge_pool.rs Outdated Show resolved Hide resolved
@batconjurer
Copy link
Member Author

there's no relaying happening yet, right? couldn't these sub-commands still be a part of namadac?

also, we should hold off on merging until #723 is in eth-bridge-integration

Yeah, it could be part of the client, but I'm imagining in the future when we want to craft ethereum txs and calculate gas prices vs fees and all that shit, this will all be in this other binary. It was also a nicer ux.

@batconjurer
Copy link
Member Author

Although submitting to the pool does probably make more sense as a client command.

@sug0 sug0 self-requested a review November 7, 2022 12:37
@sug0
Copy link
Collaborator

sug0 commented Nov 7, 2022

need rebasing against 0.9.0 I guess

@james-chf
Copy link
Contributor

I'll wait til after rebase on 0.9.0 to review, since the client side RPC logic changed in that release

@james-chf
Copy link
Contributor

I haven't looked why but running the namadar binary shows some wallet subcommands?

 > target/debug/namadar
Namada v0.9.0-1671-gb6112b4
Anoma Ethereum bridge pool command line interface.

USAGE:
    namadar [OPTIONS] <SUBCOMMAND>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
        --base-dir <base-dir>    The base directory is where the nodes, client and wallet
                                 configuration and state is stored. This value can also be set via
                                 `ANOMA_BASE_DIR` environment variable, but the argument takes
                                 precedence, if specified. Defaults to `.anoma`.
        --chain-id <chain-id>    The chain ID.
        --mode <mode>            The mode in which to run Anoma. Options are
                                         * Validator (default)
                                         * Full
                                         * Seed
        --wasm-dir <wasm-dir>    Directory with built WASM validity predicates, transactions. This
                                 value can also be set via `ANOMA_WASM_DIR` environment variable,
                                 but the argument takes precedence, if specified.

SUBCOMMANDS:
    construct-proof    Construct a merkle proof that the given transfer is in the pool.
    query              Get the contents of the Ethereum bridge pool.
    address            Address management, including methods to generate and look-up addresses.
    help               Prints this message or the help of the given subcommand(s)
    key                Keypair management, including methods to generate and look-up keys.

shared/src/ledger/queries/shell.rs Outdated Show resolved Hide resolved
apps/src/lib/cli.rs Outdated Show resolved Hide resolved
@batconjurer
Copy link
Member Author

.

I added methods to look up addresses from the wallet, but it looks like I messed up how it looks in the ui.

@batconjurer
Copy link
Member Author

I haven't looked why but running the namadar binary shows some wallet subcommands?

 > target/debug/namadar
Namada v0.9.0-1671-gb6112b4
Anoma Ethereum bridge pool command line interface.

USAGE:
    namadar [OPTIONS] <SUBCOMMAND>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
        --base-dir <base-dir>    The base directory is where the nodes, client and wallet
                                 configuration and state is stored. This value can also be set via
                                 `ANOMA_BASE_DIR` environment variable, but the argument takes
                                 precedence, if specified. Defaults to `.anoma`.
        --chain-id <chain-id>    The chain ID.
        --mode <mode>            The mode in which to run Anoma. Options are
                                         * Validator (default)
                                         * Full
                                         * Seed
        --wasm-dir <wasm-dir>    Directory with built WASM validity predicates, transactions. This
                                 value can also be set via `ANOMA_WASM_DIR` environment variable,
                                 but the argument takes precedence, if specified.

SUBCOMMANDS:
    construct-proof    Construct a merkle proof that the given transfer is in the pool.
    query              Get the contents of the Ethereum bridge pool.
    address            Address management, including methods to generate and look-up addresses.
    help               Prints this message or the help of the given subcommand(s)
    key                Keypair management, including methods to generate and look-up keys.

Bad copy pasta. Fixed

@batconjurer batconjurer requested a review from james-chf November 8, 2022 13:28
Copy link
Contributor

@james-chf james-chf left a comment

Choose a reason for hiding this comment

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

lgtm!

@batconjurer batconjurer merged commit d844aad into eth-bridge-integration Nov 8, 2022
@batconjurer batconjurer deleted the bat/ethbridge/bridge-pool-cli branch November 8, 2022 14:08
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.

3 participants