Giter Club home page Giter Club logo

cardanocli-rest's Introduction

Cardano CLI REST server

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.

REST server API Documentation

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

Server installation

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.

NodeJs installation

Install nodeJs by running the following cli command:

sudo apt update
sudo apt install nodejs

Check installation by running the following command: nodejs -v

npm installation

sudo apt install npm

PM2 installation

PM2 is a daemon process manager that will help you manage and keep your application online 24/7.

  1. Install PM2 with npm:

     sudo npm install pm2 -g
    
  2. 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.

Nginx installation

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.

CertBot installation

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.

Deployment Guide

  1. Clone git repository using the last released version.

  2. Install dependencies by running npm install in the shell.

  3. Copy config.yaml.dist to config.yaml and changes parameters values to fit your environment.

  4. Copy .env.dist file to .env and replace PORT parameter value.

  5. If using npm directly, start the application using npm run start.

  6. If using PM2, start the application using pm2 start ecosystem.config.js.

  7. Add necessary Nginx configuration in sites-available to create a reverse proxy to your NodeJs app listening PORT.

  8. Finally, add https support to your nginx conf. file by running sudo certbot --nginx.

cardanocli-rest's People

Contributors

alessandrokonrad avatar pascallapointe avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.