How to Set Up and Use ADAMANT 2FA Demo Application

Mar 27, 2024 | Blockchain

Welcome to the world of enhanced security! In this article, we’ll guide you through the setup and utilization of the ADAMANT 2FA Demo Application. This innovative service is designed to deliver one-time passwords (OTPs) to your ADAMANT Messenger account, serving as a cheaper, more secure, and reliable alternative to traditional SMS.

What is ADAMANT 2FA?

ADAMANT 2FA is a service aimed at providing additional security for your ADAMANT Messenger account by delivering OTPs. Its advantages over SMS include cost-effectiveness and heightened reliability.

  • More secure compared to SMS
  • Cheaper operational costs
  • Reliable delivery of one-time passwords

For further insights, check out the ADAMANT 2FA advantages.

Prerequisites

Setup Guide

Here’s how to set up your ADAMANT 2FA application:

  • Clone the repository and install dependencies:
  • git clone https://github.com/Adamant-im/adamant-2fa.git
    cd adamant-2fa
    npm install
    cd client
    yarn install
    cd ..
  • Create a database user and database:
  • sudo -u postgres psql
    postgres=# CREATE USER adamant-2fa WITH PASSWORD 'password';
    postgres=# CREATE DATABASE adamant-2fa WITH OWNER adamant-2fa;
  • Set up md5 authentication method by updating the pg_hba.conf file:
  • postgres=# SHOW hba_file;
  • Update the hba_file and restart PostgreSQL:
  • sudo nano /usr/local/var/postgresql/pg_hba.conf
    # Add the following line:
    local   adamant-2fa  adamant-2fa        md5
    sudo service postgresql restart

Configuration Steps

Next, create tables for Loopback models:

cd server
node create-lb-tables.js
cd ..

Set up your ADAMANT passphrase to send 2FA codes:

cp config.default.json config.json
nano config.json

Enter your ADM passphrase into the passPhrase field in the config.json file. Ensure that this account has sufficient ADM to send messages with 2FA codes. If you’re unsure how to create an ADM account, follow this guide on creating ADM account and getting free tokens.

Launching the Application

You can run the application in different modes:

  • Serve in Development Mode:
  • node .
    cd client
    yarn serve
  • Build and Serve:
  • cd client
    yarn build
    yarn serve-build
  • Launch using a Process Manager (e.g., pm2):
  • pm2 start ./server/server.js --name 2fa-demo-server
    pm2 start ./client/server.js --name 2fa-demo-client

Connecting ADAMANT 2FA to Your Service

If you have a service (such as an email provider, exchange, or any financial interface) and wish to enhance user security via 2FA, simply clone this project and make necessary modifications to the client and server components. For detailed instructions, refer to this article on how to connect ADAMANT 2FA to your business.

Troubleshooting

Should you encounter issues while setting up or using ADAMANT 2FA, consider the following troubleshooting tips:

  • If the app does not send 2FA codes, the debug console may show success: false and errorMessage: Wrong passPhrase parameter. Make sure you have created config.json in the root directory (where package.json is located) and correctly set the passPhrase and network parameters.
  • Ensure the ADAMANT console tool does not have conflicting configurations; it should be set to mainnet with the correct passphrase.
  • Familiarize yourself with logging functionalities to track down conditions within your application more effectively.

For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

Final Thoughts

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox