Author Topic: Request - Wallet API Access Using curl  (Read 2473 times)

0 Members and 1 Guest are viewing this topic.

Offline Fox

RESOLVED:
Code: [Select]
curl --data '{"jsonrpc": "2.0", "method": "call", "params": [0,"suggest_brain_key",[]], "id": 2}' http://127.0.0.1:8092/rpc

Not much different there. Just note the port it now connects to 8092 (cli_wallet) vs. 8090 (witness_node) prior. A simple, obvious error on my part.

Thanks both @abit and @xeroc for the pointers.
Witness: fox

Offline abit

  • Committee member
  • Hero Member
  • *
  • Posts: 4664
    • View Profile
    • Abit's Hive Blog
  • BitShares: abit
  • GitHub: abitmore
My goal is to suggest_brain_key using curl. Help was an example that I expected would function similar. Thus far I've been issuing curl requests to the witness node socket. I've not thought to query the CLI wallet socket. Does each app have a distinct set of functions to return queries for? I have made the assumption that Help, Info, About and suggest_brain_key were supplied by the witness node.
CLI API set is CLI commands: info, about..
Witness_node API is another set.
BitShares committee member: abit
BitShares witness: in.abit

Offline Fox

My goal is to suggest_brain_key using curl. Help was an example that I expected would function similar. Thus far I've been issuing curl requests to the witness node socket. I've not thought to query the CLI wallet socket. Does each app have a distinct set of functions to return queries for? I have made the assumption that Help, Info, About and suggest_brain_key were supplied by the witness node.
Witness: fox

Offline abit

  • Committee member
  • Hero Member
  • *
  • Posts: 4664
    • View Profile
    • Abit's Hive Blog
  • BitShares: abit
  • GitHub: abitmore
Are you talking about cli_wallet API, or witness_node API?
BitShares committee member: abit
BitShares witness: in.abit

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
Code: [Select]
curl --data '{"jsonrpc":"2.0","method":"call", "params":[0, "help", []],"id":0}' http://localhost:8092/rpc
works for me (different port)

The issue is that it returns a raw string that is pretty ugly.
What for do you need 'help' from the RPC?

Offline Fox

May I request some assistance with the syntax to access the wallet-api using curl (not wscat)? I have reviewed the the following documentation:
http://docs.bitshares.eu/api/websocket.html#call-format
http://docs.bitshares.eu/api/wallet-api.html#wallet-calls

I am successful requesting get_dynamic_global_properties:
Code: [Select]
curl --data '{"jsonrpc": "2.0", "method": "call", "params": [0,"get_dynamic_global_properties",[]], "id": 2}' http://127.0.0.1:8090/rpc
But fail requesting for help:
Code: [Select]
curl --data '{"jsonrpc": "2.0", "method": "call", "params": [0,"help",[]], "id": 2}' http://127.0.0.1:8090/rpc
Thanks in advance for the assistance,
Fox
Witness: fox