bcoin-org / bcoin-org/bcoin-org.github.io

RPC commands require token to be set in client options

Open Beginner friendly
#163 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
19
Forks
38
PR merge metrics
No merged PRs in 30d

Description

For RPC calls when `wallet-auth: true`, the admin token needs to be set as an option when instantiating the client:

```
const {WalletClient, Network} = require('bcoin');
const network = Network.get('regtest');

const walletOptions = {
network: network.type,
port: network.walletPort,
apiKey: 'api-key'
token:
}

const walletClient = new WalletClient(walletOptions);

(async () => {
const result = await walletClient.execute('getwalletinfo');
console.log(result);
})();
```

The `token` property is stored in the `bcurl/client`, without setting this property there is no other way to add a token to an RPC call -- note that with the REST-API HTTP calls the docs already specify to add `?token=...` or `--token=...`

https://bcoin.io/api-docs/?shell--curl#wallet-authentication

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the linked API documentation's wallet-authentication section and inspect how the existing REST API token guidance is presented. Document that RPC WalletClient calls require the token option, using the reported example as a guide; done when the RPC authentication instructions clearly show how to supply the token.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
66/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.