serverInstalling Cryptomask Server

Prerequisites

To run Cryptomask server you need the below prerequisites.

  • Windows/Mac OS/Ubuntu Server with 4GB RAM

  • Node JS Version 18.18.0

  • PostgreSQL Version 15.4 (stable)

Quickstart

Running the server is straightforward. To get started, configure the service application by updating the necessary values in the .env file.

.env
NODE_ENV=development
BACKEND_PORT=3001	
SECRET=SUPER_SECRET_TOKEN_NEVER_DISCLOSE	
DATABASE_URL="postgresql://<REPLACE_USERNAME>:<REPLACE_WITH_YOUR_POSTGRES_PASSWORD>@localhost:5432/cryptomask"
MORALIS_API_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJub25jZSI6IjNjNTBjYjQxLTExNTktNDgzNS1iZTU1LWMwMmUyNTNmOTAxMyIsIm9yZ0lkIjoiMzU0MTI2IiwidXNlcklkIjoiMzYzOTcwIiwidHlwZUlkIjoiN2EzYTE2YzItYTBjNS00Nzg5LWI1OGQtMjkyZmM4MjM5MGU0IiwidHlwZSI6IlBST0pFQ1QiLCJpYXQiOjE2OTI2ODI1MjUsImV4cCI6NDg0ODQ0MjUyNX0.i-2kfCVT0Jfw0USaSTTVM6eQg2pbrZMNO1YwplIObsY
circle-info

For the production release you need to changed NODE_ENV=production

circle-info

postgres is the default username

  • The SECRET is a password you choose, and it’s crucial to keep it highly confidential. This value is used to sign JWT tokens, ensuring the security of your application.

  • To obtain you your MORALIS_API_KEY from below link

Installing Node JS

Download and run the NodeSource setup script for Node.js 18

Install Node.js

Verify installation

Installing Cryptomask Server dependencies

Open terminal in the root of the server script and run the below command to install project dependencies.

Migrate database

To start development server, run

Running in Production server

To run this backend service in a production environment you need to install PM2 and run the script as service. Follow below instruction for achieve this.

Installing PM2 as global node module

And run below command to spin up the production server

Last updated