Resources / cardano-sl / send-requests-to-wallet-api.md

You are browsing a mirror of a file hosted on GitHub. View original

How to send requests to Wallet API

Preparing

Clone cardano-sl repository:

$ git clone [email protected]:input-output-hk/cardano-sl.git
$ cd cardano-sl

Build it:

$ ./scripts/build/cardano-sl.sh

Run tmux:

$ tmux

Then launch nodes:

$ ./scripts/launch/demo-with-wallet-api.sh

By default 3 nodes will be started.

Send requests via curl

You can send requests via curl as well. Default port for the wallet API is 8090.

Please note that since cardano-sl-0.6 we are using TLS. This is an example of request (via SSL connection without certificate):

$ curl -k https://localhost:8090/api/settings/sync/progress

Possible response:

{"Right":{"_spLocalCD":{"getChainDifficulty":19273},"_spNetworkCD":{"getChainDifficulty":19273},"_spPeers":0}}

This is an example with the certificate:

curl --cacert /home/user/projects/cardano-sl/scripts/tls-files/ca.crt http://localhost:8090/api/settings/sync/progress

Please see online documentation for wallet API for complete information.

Send requests via Postman

You can send requests using Postman program as well.