grin-wallet/doc/samples/v3_api_node
dependabot[bot] bc9d7ebe49
Bump lodash from 4.17.15 to 4.17.19 in /doc/samples/v3_api_node (#483)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-07-20 09:39:42 -04:00
..
src Add sample script to init and call the secure owner API from node.js (#335) 2020-02-18 12:28:23 +00:00
package-lock.json Bump lodash from 4.17.15 to 4.17.19 in /doc/samples/v3_api_node (#483) 2020-07-20 09:39:42 -04:00
package.json Add sample script to init and call the secure owner API from node.js (#335) 2020-02-18 12:28:23 +00:00
readme.md Add sample script to init and call the secure owner API from node.js (#335) 2020-02-18 12:28:23 +00:00

Connecting to the wallet's V3 Owner API from Node

This is a small sample with code that demonstrates how to initialize the Wallet V3's Secure API and call API functions through it.

To run this sample:

First run the Owner API:

grin-wallet owner_api

This sample doesn't use the authentication specified in the wallet's .api_secret, so before running the owner_api please ensure api authentication is commented out in grin-wallet.toml. Including the authentication token as part of the request is a function of your json-rpc client library of choice, so it's not included in the sample to make setup a bit simpler.

ensure the client url in src\index.js is set correctly:

const client = jayson.client.http('http://localhost:3420/v3/owner');

Then (assuming node.js and npm are installed on the system):

npm install
node src/index.json

Feel free to play around with the sample, modifying it to call whatever functions you'd like to see in operation!