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

Feat/sign with lab #1579

Closed
wants to merge 16 commits into from
Closed

Conversation

elizabethengelman
Copy link
Contributor

@elizabethengelman elizabethengelman commented Aug 29, 2024

This branch is based on #1406 #1590, I also opened a PR against that branch directly in the AhaLabs org so that it is easier to see the diff: AhaLabs#25.

Companion Lab PR: stellar/laboratory#987

Todo:

  • update default lab link to /transaction/cli-sign

What

Closes #1428

This PR adds the ability to sign a tx via lab, by opening lab in the browser with the xdr prefilled in the Lab UI.

To test, on this branch, run:

  • you can generate your tx xdr, but this example uses xdr created from deploying the test_hello_world contract.
    (stellar contract deploy --wasm target/wasm32-unknown-unknown/test-wasms/test_hello_world.wasm --build-only --network testnet --source testnet-alice)
  • run the following from the root dir of this project, on this branch:
echo AAAAAgAAAADcOHnq5sGLOngOCEMyLqqn5CvFV2HGbOSjJAIzhqBdkAAAAGQAEb7UAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAYAAAAAQAAAAAAAAAAAAAAANw4eermwYs6eA4IQzIuqqfkK8VXYcZs5KMkAjOGoF2Q04SY/PMseMCgfbEFkX5gTr9qD/d0mvD9H3acFOz/X5oAAAAALtGgcgsAibk5q8VOLY2R1G1NdGX7fLzlz7iBFBy64JIAAAAAAAAAAAAAAAA= \
| cargo run tx sign --network testnet \
--sign-with-lab \
--lab-url http://laboratory-pr987.previews.kube001.services.stellar-ops.com/transaction/sign

Why

This will allow for another way for users to sign their tx.

Known limitations

  • Based on discussions during our weekly check-in, this PR is the first step in implementing this feature. For now, when the user adds the --sign-with-lab flag, the CLI will send the transaction's xdr to lab via a query param, and then will print out the xdr to the stdout.

    In future iterations, we may want to send the signed tx xdr back to the command line, but for now the intention is to have the user either:
    a. send the transaction from lab
    b. manually copy the signed xdr from Lab, and paste it back in the command line to use with the cli

  • Instead of having the flag be --sign-with-lab, what if we change it to --sign-externally? This would open us up to allow a user to pass in any URL that accepts xdr and networkPasshrase as query params. 🤔

@Ifropc
Copy link
Contributor

Ifropc commented Sep 6, 2024

Added some comments in Aha labs PR, thanks @elizabethengelman !

@elizabethengelman
Copy link
Contributor Author

closing this in favor of #1604

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Enable the CLI to generate links or files compatible with the Stellar Lab
3 participants