Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Wallet API Request format #506

Closed
jcalfee opened this issue Sep 26, 2017 · 5 comments
Closed

Wallet API Request format #506

jcalfee opened this issue Sep 26, 2017 · 5 comments

Comments

@jcalfee
Copy link
Contributor

jcalfee commented Sep 26, 2017

This is the wallet api create method:

std::string create(const std::string& name);

This is formatted like the Chain and Account History API but for this method, create:

echo '{name: "slim"}' | curl http://127.0.0.1:8888/v1/wallet/create -d @-

614897ms thread-0 wallet_api_plugin.cpp:77 operator() ] Exception encountered while processing wallet.create: {"code":4,"name":"parse_error_exception","message":"Parse Error","stack":[{"context":{"level":"error","file":"json.cpp","line":431,"method":"variant_from_stream","hostname":"","thread_name":"thread-0","timestamp":"2017-09-26T18:10:14"},"format":"Unexpected char '${c}' in "${s}"","data":{"c":115,"s":"slim"}},{"context":{"level":"warn","file":"json.cpp","line":476,"method":"from_string","hostname":"","thread_name":"thread-0","timestamp":"2017-09-26T18:10:14"},"format":"","data":{"str":"slim"}}]}

Am I doing this right? I think the Wallet API is different, I don't see any FC_REFLECT definitions for it so I suspect sending json is not going to work.

Furion and I would like to publish the API. Is it ready, should I do something different?

thank you..

@heifner
Copy link
Contributor

heifner commented Sep 26, 2017

My understanding was the cli wallet was only for esoc and only for localhost. We opened up localhost so that it could run out of Docker. Do we really wish to publish the API?

@jcalfee
Copy link
Contributor Author

jcalfee commented Sep 26, 2017

It appears to be designed so it can run in eosd as a plugin (locked down to localhost request only) or from a smaller process eos-walletd.. That would allow installable UI apps to work by starting a eos-walletd process. The wallet plugin in eosd is very convent for development so only one process can serve up all types of request.

Honestly though, I did loose some sleep over it thinking about someone trying to store everyone's private key on the server. I think it is better to have this API though, private key operations are anything but easy.

Another topic (kind of): I would like to know if eos-walletd could be compiled to wasm.. Not sure about the file io.. I'm wondering if it could be useful in an electron desktop app. In any case, the API is very important.

@jcalfee
Copy link
Contributor Author

jcalfee commented Sep 26, 2017

However, I don't know of anyone trying to use this API yet.. If you decide to make it more public just let us know and we will put it in the libraries. I'll let you know if I hear about a project to use it.

@Netherdrake
Copy link

Netherdrake commented Sep 26, 2017

Thank you for letting it bind to 0.0.0.0 so it can run Dockerised.

I think the access to the wallet API is very useful for people who want to automate things in any programming language, without having to rely on eosc.

To address the security concerns in the Python wrapper, I'm separating the wallet related API's into their own class, which triggers a warning if people try to do it trough non-localhost node.

@jcalfee jcalfee changed the title Wallet API Requst format Wallet API Request format Oct 9, 2017
@jgiszczak
Copy link
Contributor

nodeos is no longer built with the wallet plugin.

The API responds to a request of the form:

REQUEST:
---------------------
POST /v1/wallet/create HTTP/1.0
Host: 127.0.0.1:8900
content-length: 12
Accept: */*
Connection: close

"walletname"
---------------------

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants