Cryptomask Docs
  • CRYPTOMASK SERVER
    • Installing Database
    • Installing Cryptomask Server
  • Cryptomask Wallet
    • Quickstart
    • Changing App Name
    • Changing App ID
    • Changing App Icon
    • Customize and Extend
    • Building and Releasing
Powered by GitBook
On this page
  • Prerequisites
  • Quickstart
  • Installing Node JS
  • Installing Cryptomask Server dependencies
  • Running in Production server
  1. CRYPTOMASK SERVER

Installing 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

For the production release you need to changed NODE_ENV=production

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

curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -

Install Node.js

sudo apt install -y nodejs

Verify installation

node -v

Install Node JS Using Homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Install Node.js

brew install node@18

Verify the Installation

node -v

Install Node JS using the Official Installer

Download the Node.js Installer:

  • Go to the Node.js official website.

  • Click on the "Previous Releases" link to find version 18.8.0.

  • Download the appropriate installer for your system (e.g., 64-bit MSI).

Run the Installer:

  • Double-click the downloaded .msi file.

  • Follow the installation wizard:

    • Accept the license agreement.

    • Choose the installation directory.

    • Enable the option to add Node.js to the PATH.

Installing Cryptomask Server dependencies

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

npm install

Migrate database

npx primsa migrate dev

To start development server, run

npm run dev

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

npm install pm2 -g

And run below command to spin up the production server

pm2 start app.config.json
PreviousInstalling DatabaseNextQuickstart

Last updated 1 month ago

Get Your API Key | Moralis API DocumentationMoralis API Documentation
Logo