Giter Site home page Giter Site logo

signing isn't working yet about agoric-sdk HOT 5 CLOSED

agoric avatar agoric commented on August 30, 2024
signing isn't working yet

from agoric-sdk.

Comments (5)

warner avatar warner commented on August 30, 2024

Note: modifying the ag-solo code and then re-running ag-solo start, without resetting everything, runs into other problems, because our persistence is currently broken. So the ag-solo side throws exceptions about "historical inaccuracy in replay-fulfillToPresence". And when you delete t1 and rebuild the ag-solo node, that erases the keypair, so the chain has to be rebuilt as well.

from agoric-sdk.

michaelfig avatar michaelfig commented on August 30, 2024

I'm getting a missing ./state/vatState:

Michael-Macbook-680:cosmic-swingset michael$ ag-chain-cosmos init --chain-id agoric
-Starting Node
/Users/michael/agoric/cosmic-swingset/node_modules/@agoric/swingset-vat/src/kernel/vatManager.js:1
Error: Cannot find module './state/vatState'
Require stack:
- /Users/michael/agoric/cosmic-swingset/node_modules/@agoric/swingset-vat/src/kernel/vatManager.js
- /Users/michael/agoric/cosmic-swingset/node_modules/@agoric/swingset-vat/src/kernel/kernel.js
- /Users/michael/agoric/cosmic-swingset/node_modules/@agoric/swingset-vat/src/kernel/index.js
- /Users/michael/agoric/cosmic-swingset/node_modules/@agoric/swingset-vat/src/controller.js
- /Users/michael/agoric/cosmic-swingset/node_modules/@agoric/swingset-vat/src/index.js
- /Users/michael/agoric/cosmic-swingset/node_modules/@agoric/swingset-vat/src/main.js
- /Users/michael/agoric/cosmic-swingset/lib/launch-chain.js
- /Users/michael/agoric/cosmic-swingset/lib/ag-chain-cosmos
    at Object.<anonymous> (/Users/michael/agoric/cosmic-swingset/node_modules/@agoric/swingset-vat/src/kernel/vatManager.js:1)
Michael-Macbook-680:cosmic-swingset michael$ find . -name 'vatState*'
Michael-Macbook-680:cosmic-swingset michael$ 

from agoric-sdk.

michaelfig avatar michaelfig commented on August 30, 2024

That's my error: I had to reset the esm cache:

rm -rf node_modules/\@agoric/swingset-vat/node_modules/.cache

from agoric-sdk.

warner avatar warner commented on August 30, 2024

Ugh, so it turns out that REST interface doesn't actually sign anything. It just emits a transaction record that the client must encode and sign themselves. The tutorial says it explicitly, somehow I missed that earlier: https://cosmos.network/docs/tutorial/rest.html#tx-handlers :

Now define the buyName and setName transaction routes. Notice these aren't actually sending the transactions to buy and set names. That would require sending a password along with the request which would be a security issue. Instead these endpoints build and return each specific transaction which can then be signed in a secure manner and afterwards broadcast to the network using a standard endpoint like /txs.

It used to be possible to sign messages (there was even an endpoint for signing), but cosmos/cosmos-sdk#3641 removed that ability back in Februrary. The issue has some discussion about the lack of encoding/signing tools in javascript and python.

@michaelfig where did you see the example that suggested password would be accepted? I'm guessing there are some SDK docs that are out of date, and they might appreciate us filing a bug. I found one place (the bottom of that tutorial page, which mentions a function named clientrest.CompleteAndBroadcastTxREST that doesn't appear anywhere in the SDK), but if we could find the place that says password and get it removed, it might save time for the next folks who go down this path.

Rats, I was expecting we could use the REST interface to do the signing, since our javascript code doesn't know how to do the signing itself (in fact it doesn't even have easy access to the private key, which is buried in some database somewhere that the CLI tool knows about).

So we either have to go back to shelling out to the helper process, or we need that FFI binding to the same code that the CLI functions are using. I'll start with the subprocess, since we already have code for that, but I'd love it if we could invoke it more directly.

from agoric-sdk.

warner avatar warner commented on August 30, 2024

in the old repo. this was cosmic-swingset issue 3

from agoric-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.