Skip to content

Commit

Permalink
add --streamr-rest-url option
Browse files Browse the repository at this point in the history
  • Loading branch information
hpihkala committed Aug 30, 2019
1 parent adab124 commit 4d4ba07
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@ Give this option to print all the data to the console.

`--streamr-url [url]`

The Streamr websocket API URL, for example `wss://www.streamr.com/api/v1/ws`. If not defined,
the default value in the Streamr client library is used.
The Streamr websocket API URL. By default, uses the default value in the Streamr JS SDK (`wss://www.streamr.com/api/v1/ws`).

`--streamr-rest-url [url]`

The Streamr REST API URL. By default, uses the default value in the Streamr JS SDK (`https://www.streamr.com/api/v1`).


`--public`

Expand Down Expand Up @@ -101,4 +105,4 @@ AGPLv3, see [LICENSE](LICENSE).

## TODO

- Utility for the other direction (Streamr to MQTT)
- Utility for the other direction (Streamr to MQTT)
11 changes: 9 additions & 2 deletions bin/mqtt-streamr.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ const options = require('yargs')
})
.option('streamr-url', {
default: undefined,
describe: 'The Streamr websocket API URL, for example wss://www.streamr.com/api/v1/ws',
describe: 'The Streamr websocket API URL. By default, uses the default value in the Streamr JS SDK (wss://www.streamr.com/api/v1/ws)',
})
.option('streamr-rest-url', {
default: undefined,
describe: 'The Streamr REST API URL. By default, uses the default value in the Streamr JS SDK (https://www.streamr.com/api/v1)',
})
.option('public', {
type: 'boolean',
Expand Down Expand Up @@ -84,6 +88,9 @@ const clientConfig = {}
if (options['streamr-url']) {
clientConfig.url = options['streamr-url']
}
if (options['streamr-url']) {
clientConfig.restUrl = options['streamr-rest-url']
}

if (options['api-key']) {
clientConfig.auth = {
Expand Down Expand Up @@ -226,4 +233,4 @@ const connectMqttClient = () => {
})
}

connectMqttClient()
connectMqttClient()

0 comments on commit 4d4ba07

Please sign in to comment.