• Stars
    star
    335
  • Rank 125,362 (Top 3 %)
  • Language
    JavaScript
  • Created almost 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

ADAMANT's Blockchain 2FA demo

ADAMANT 2FA Demo Application

What is ADAMANT 2FA

ADAMANT 2FA is a service to deliver one-time passwords (OTP) to ADAMANT Messenger account.

It's cheaper, more secure and reliable than SMS. ADAMANT 2FA advantages.

Live demo is available at 2fa-demo.adamant.im. For details read Presenting ADAMANT 2FA.

Prerequisites

Setup

Clone repository and install dependencies:

git clone https://github.com/Adamant-im/adamant-2fa.git
cd adamant-2fa && npm i
cd client && yarn install
cd ../

Create db-user and 2fa 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 auth method. Get hba_file path:

postgres=# SHOW hba_file;
          hba_file
-------------------------------------
/usr/local/var/postgres/pg_hba.conf
(1 row)

Update hba_file and restart postgresql:

sudo nano /usr/local/var/postgres/pg_hba.conf
  local   adamant-2fa  adamant-2fa        md5
sudo service postgresql restart

Create tables for Loopback models:

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

Set up ADAMANT passPhrase to send 2fa codes from:

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

The 2FA app uses config.json file. Enter your ADM passphrase into passPhrase field. Make sure this account has ADM to send messages with 2fa codes. How to create ADM account and get free tokens.

Note: 2FA demo uses adamant-console to send 2fa codes. If you have this tool installed separately, make sure it's default config doesn't exist, or set to mainnet and correct passPhrase.

Note: If the app doesn't send 2FA codes, debug console shows {"success":false,"errorMessage":"Wrong 'passPhrase' parameter"}. Make sure you've created config.json in the root directory (where package.json located), and you've set passPhrase and network parameters.

Start

Serve (Dev mode)

node .
cd client && yarn serve

Build

cd client && yarn build
yarn serve-build

Launch as process manager process

We recommend to use a process manager to start the program, f. e. pm2:

pm2 start ./server/server.js --name 2fa-demo-server
pm2 start ./client/server.js --name 2fa-demo-client

How to connect ADAMANT 2FA to your service

If you own a service (as email, exchange, financial interface, etc.) and want to add 2FA security for users, connect ADAMANT 2FA. To use ADAMANT 2FA, clone this project and modify client and server parts. Read more: How to connect ADAMANT 2FA to your business.

More Repositories

1

adamant

ADAMANT Blockchain Node
JavaScript
728
star
2

ETH-transactions-storage

Indexer for Ethereum to get transaction list by ETH address
Python
610
star
3

adamant-im

ADAMANT Decentralized Messenger. Progressive Web Application (PWA)
Vue
582
star
4

adamant-tradebot

Free self-hosted market-making software for cryptocurrency projects and exchanges. Makes trade volume, maintains spread and liquidity/depth, set price range, and builds live-like dynamic order book.
JavaScript
541
star
5

adamant-coinoptimus

Free self-hosted cryptocurrency trade bot for non-professional traders
JavaScript
378
star
6

pool

ADAMANT Forging pool with Web interface
JavaScript
352
star
7

adamant-api-jsclient

ADAMANT Javascript API library
TypeScript
350
star
8

adamant-exchangebot

Crypto exchange bot for ADAMANT
JavaScript
347
star
9

adamant-console

Command-line utilities to work with ADAMANT blockchain
JavaScript
342
star
10

adamant-explorer

ADAMANT Blockchain Explorer
JavaScript
338
star
11

adamant-iOS

iOS native client for ADAMANT Decentralized Messenger
Swift
337
star
12

adamant-notificationService

ADAMANT push Notification Service for iOS Messenger app
C#
324
star
13

AIPs

ADAMANT Improvement Proposal repository
HTML
288
star
14

adamant-wallets

Unified coin/token specification for wallets in ADAMANT apps
Vue
282
star
15

adamant-schema

Swagger schema for ADAMANT node
TypeScript
263
star
16

adamant-currencyinfo-services

Self-hosted crypto and fiat currency rates service provider. MOEX, Currency-Api, ExchangeRate.host, Coinmarketcap, CryptoCompare and Coingecko.
JavaScript
249
star
17

currencyinfo

Self-hosted crypto and fiat currency rates service provider. Combines MOEX, Currency-Api, ExchangeRate.host, Coinmarketcap, CryptoCompare, and Coingecko.
TypeScript
146
star
18

adamant-android

Android native client for ADAMANT Messenger
Java
28
star
19

adamant-fcm-notification-service

FCM push notification service for ADAMANT
Java
3
star
20

adamant-bountybot

Carry out bounty campaigns & crypto airdrops, with automatic task verifications and payouts. Bounty bots work in ADAMANT Messenger chats directly.
JavaScript
3
star
21

adamant-pool

ADAMANT Forging pool with Web interface
JavaScript
2
star
22

adamant-bet

Anonymous and Blockchain-proved betting on crypto rates
JavaScript
2
star
23

adamant-tradebot-dex

Free market-making software on decentralized exchanges (DEX) for cryptocurrency projects. Makes trade volume, manages liquidity, watches a token price. [In development]
1
star
24

adamant-watchbot

Watches ADAMANT blockchain transactions, notifies about specific ones, recoups fees
JavaScript
1
star
25

adamant-docker

ADAMANT node for Docker
Shell
1
star
26

adamant-trader

Advanced open-source cryptocurrency tradebot
1
star
27

ipfs-node

IPFS decentralized file storage and transfers
1
star