Sample Ardor APIs for Node JS
This release is compatible with the Ardor 2.3.2 APIs.
A new configuration parameter disableSslCertificateVerification was added to config.json.
Use it to enable https communication with a node when using a self signed certificate.
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.
Setup using NPM
npm i ardor
echo n | copy /-y node_modules\ardor\sample\*.* *.* - copy the Ardor samples without overwriting existing files
Setup using Ardor installation
Install the Ardor software (no need to download the blockchain)
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
Configure the remote node, Ardor account and default chain by editing the
Invoke any of the available samples using node, for example
Packaging and Distribution
If installed from Ardor installation, the Ardor package no longer depends on a local Ardor node.
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.
We recommend that you avoid using these APIs in your scripts when connecting to an untrusted remote node.