0.5.0
This file specifies the Express routes for the API that supports the Directory UI.
This file contains the configurations for running the Express server that
will serve API requests for the API specified in ./routes/api.js
.
To run: $ node server.js
To run using forever: $ forever start server.js
This file contains functions to query the registrations
table in the
alpha_kuwa_directory
database to support the API in ./routes/api.js
.
This program scans the directory in the Kuwa Storage Manager registrations repository containing the Kuwa client directories with the client address as the name of the directory. The directory hierarchy is as follows:
rootDir/ 0x6dc989e6d3582f5c3da1fd510a5b0ad950d67f3a/
Each Kuwa client directory will contain an 'info.json', which will contain the client address, the client's contract address, and the contract JSON ABI. It will also contain the video recording of the client speaking the challenge phrase.
The program will read the information necessary to load the Kuwa client's smart contract in order to call the getRegistrationStatus() function to obtain the status of the client.
It will then store this information into the 'registration' table of the MySQL DB so that one can quickly retrieve Kuwa client addresses with a certain status.
This file represents the React UI App for displaying the directory of Kuwa IDs. in tabular form.
The Kuwa client ID (Ethereum address), the client's contract address, the creation time, and the last status update time are displayed.
Users can select to only display Kuwa IDs with a certain status using the select box.
Get all Kuwa IDs.
Get Kuwa IDs based on status.
req.params.status
should be one of the following:
"Valid", "Invalid", "Credentials-Provided",
"Challenge-Expired", "Video-Uploaded", "QR-Code-Scanned"
Get the selected columns from "config.json" converted to proper display format for the UI. We can perhaps have the column mappings as another table in the registration DB?
This class contains functions to scan the Kuwa client directories uploaded to the raw registrations repository by the Kuwa Storage Manager whenever a new user registers to become a Kuwa client.
(string)
The absolute path to the root directory containing all the
Kuwa client directories.
(EthClient)
An object containing functions and variables to interact with the
Ethereum blockchain.
Returns information about a Kuwa client based on the files in its directory.
(string)
The absolute path to a Kuwa client directory
(Array)
An array of filenames (should be static) inside the client directory
ClientInfo
:
Information about a Kuwa client
Processes a Kuwa client directory by retrieving the necessary information to store into the database.
(string)
The absolute path of a Kuwa client directory
ClientInfo
:
Information about a Kuwa client
Get all Kuwa clients regardless of their status.
Promise
:
A Promise object containing the rows of the query
Get Kuwa clients with a certain status ("Valid", "Invalid", "Credentials-Provided", "Challenge-Expired", "Video-Uploaded", "QR-Code-Scanned").
Join with another SQL table? We can put status mappings in the "config.json" but that doesn't look right and is a bit hacky. See https://stackoverflow.com/questions/16753122/sql-how-to-replace-values-of-select-return
(string)
The status of the Kuwa client
Promise
:
A Promise object containing the rows of the query
Type: Object
(string)
: The current status of the Kuwa client
(string)
: Absolute path to the video file of the user speaking the challenge phrase
(string)
: The Ethereum address of the Kuwa client ("0x123abc...")
(string)
: The application binary interface (in JSON) of the Kuwa client's deployed contract
Creates a new MySQL database client.
(any)
(any)
(any)
(any)
Creates a new connection to the MySQL database.
(string)
The hostname of the database to connect to
(string)
The user to authenticate as
(string)
The password of the user
(string)
The name of the database for the connection
Object
:
The connection object
Insert or update a single row in the table corresponding to a Kuwa client.
(string)
Name of the table
(ClientInfo)
Information about a Kuwa client
Create a database client using a configuration object from a configuration file.
(Object)
configuration object
Name | Description |
---|---|
The.host any
|
|
The.user any
|
|
The.password any
|
|
The.database any
|
DBClient
:
The DBClient object created from a configuration object
using destructuring assignment
Create a new client for interacting with the Ethereum blockchain.
(string)
The address transactions should be sent from (the origin EOA or wallet address)
(string)
The Ethereum keystore directory containing the JSON file that contains the
public/private key pair for the wallet
(string)
The password for recovering the private key from the JSON file
(string)
The URL to access the Ethereum network over HTTP
Loads an Ethereum wallet.
Loads an already deployed contract in the Ethereum blockchain.
Create an Ethereum client using a configuration object from a configuration file.
(Object)
configuration object
Name | Description |
---|---|
The.my_address any
|
|
The.key_store_dir any
|
|
The.password any
|
|
The.eth_network_url any
|
EthClient
:
An EthClient object created from a configuration object
using destructuring assignment
string
:
The current datetime (UTC) in 'yyyy-MM-dd HH:mm:ss' format.
Driver function to run the scan process.