The Cardano CLI REST server as been developed to work in tandem with the cardanocli-js library. The server provides integration with a remote cardano-cli & cardano-node installation.
The cardanocli-js library can be initiated to use a http provider or a local cardano-cli
binary executable.
By leveraging this capability, you can now use the same underlying library to build portable software that can connect
and submit transaction on the network. Sound's great right?!
!!! CAUTION : API Security Authentication is not yet available and will be part of future improvement.
You can find more information on the REST API by following the link bellow:
https://app.swaggerhub.com/apis-docs/pascallapointe/cardanocli-rest/1.0.0
First, NodeJs, npm, PM2, Nginx and CertBot must be installed on ubuntu server. If everything is installed, jump to the deployment guide bellow.
PM2, Nginx and Certbot are optional on a private network, but strongly recommended a public server.
Install nodeJs by running the following cli command:
sudo apt update
sudo apt install nodejs
Check installation by running the following command:
nodejs -v
sudo apt install npm
PM2 is a daemon process manager that will help you manage and keep your application online 24/7.
-
Install PM2 with
npm
:sudo npm install pm2 -g
-
Start PM2 using the config file
ecosystem.config.js
at the project root:pm2 start ecosystem.config.js
See PM2 documentation on the official website.
Here DigitalOcean documentation on how to install Nginx on Ubuntu server 20.04.
NodeJs should never be accessible directly from the public internet. Use Nginx as it is better suited for this.
Got to the official website for installation instructions.
CertBot allow you to use https with Nginx. NEVER use the REST server without https on a public server.
-
Clone git repository using the last released version.
-
Install dependencies by running
npm install
in the shell. -
Copy
config.yaml.dist
toconfig.yaml
and changes parameters values to fit your environment. -
Copy
.env.dist
file to.env
and replacePORT
parameter value. -
If using npm directly, start the application using
npm run start
. -
If using PM2, start the application using
pm2 start ecosystem.config.js
. -
Add necessary Nginx configuration in
sites-available
to create a reverse proxy to yourNodeJs app listening PORT
. -
Finally, add https support to your nginx conf. file by running
sudo certbot --nginx
.