Sample Ardor APIs for Node JS
This release is compatible with the Ardor 2.3.4 APIs. What's new?
General Information
The Node JS module performs local signing and encryption using the same code used by the official Ardor wallet.
- Your passphrase, seed or private key are never submitted to the remote node when submitting a transaction.
- Transaction bytes returned by the remote node are parsed and validated against the submitted data.
- Transaction signing, encryption, and decryption are invoked locally using Javascript code.
`npm i ardor` Setup using NPM
`echo n | copy /-y node_modules\ardor\sample\*.* *.*` - copy the Ardor samples without overwriting existing files
Install the Ardor software (no need to download the blockchain) Setup using Ardor installation
Install Node JS and NPM from https://nodejs.org
Open a command prompt
Navigate to the Ardor installation folder
`cd html/www/js` - make sure the folder has write permissions
`npm install`
`cd sample`
Configure the remote node, Ardor account and default chain by editing the `config.json` file Run Examples
Invoke any of the available samples using node, for example `node send.money.js`
If installed from Ardor installation, the Ardor package no longer depends on a local Ardor node. Packaging and Distribution
You can use the content of the `html/www/js` folder as a standalone module.
Your passphrase or private key are submitted to a remote node only when invoking specific APIs which require them to operate like the startForging API. Warning
We recommend that you avoid using these APIs in your scripts when connecting to an untrusted remote node.