-
Notifications
You must be signed in to change notification settings - Fork 363
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sdk/node: expose Connection constructor, version 1.0.2
Closes #437
- Loading branch information
Showing
7 changed files
with
26 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,5 +28,5 @@ The Chain Node.js SDK is available [via npm](https://www.npmjs.com/package/chain | |
For most applications, you can simply add Chain to your `package.json` with the following command: | ||
|
||
``` | ||
npm install --save [email protected].1 | ||
npm install --save [email protected].2 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ For most applications, you can simply add Chain to your `package.json` with | |
the following command: | ||
|
||
``` | ||
npm install --save [email protected].1 | ||
npm install --save [email protected].2 | ||
``` | ||
|
||
### In your code | ||
|
@@ -49,6 +49,16 @@ let callback = (err, data) => { | |
client.transactions.query({}, callback) | ||
``` | ||
|
||
## Using external signers | ||
|
||
To connect to an HSM other than the built-in Mock HSM, you must create a new | ||
`Connection` object: | ||
|
||
``` | ||
const myHsmConnection = new chain.Connection('https://myhost.dev/mockhsm', 'tokenname:tokenvalue') | ||
signer.addKey(myKey, myHsmConnection) | ||
``` | ||
|
||
## Testing | ||
|
||
To run integration tests, run an instance of Chain Core on localhost:1999. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
const Client = require('./client') | ||
const HsmSigner = require('./hsmSigner') | ||
const Connection = require('./connection') | ||
|
||
module.exports = { | ||
Client, | ||
HsmSigner | ||
HsmSigner, | ||
Connection, | ||
} |