diff --git a/README.md b/README.md new file mode 100644 index 0000000..95fad22 --- /dev/null +++ b/README.md @@ -0,0 +1,81 @@ +# Trade-Market + Trade market for trading assets (FLO) using BTC + +## Installation + +### Pre-requisite +- [X] Nodejs `version >= 12.9` (`--lts` recommended) +- [X] MySQL Server `version > 8.0` + +### Download +Download the repository using git: +``` +git clone https://github.com/ranchimall/flo-btc-market.git +``` + +### Install +Install using npm: +``` +cd flo-btc-market +npm install +``` +Finish the configuration when prompted + +### Configuration + +#### General Configuration +If not finished during installation, or to re-configure use: +``` +npm run configure +``` +- **port**: Port of the server to run on +- **session secret**: A random session secret. (Enter `YES` to automatically randomize it) + +- **MySQL host**: Host of the MySQL server (default: ***localhost***) +- **Database name**: Database in which the data should be stored (``) (default: ***flobtc***) +- **MySQL username**: Username for MySQL (``) +- **MySQL password**: Password for MySQL (``) + +***Recommended*** *(optional)* Create and use a MySQL user instead of root. Remember to give access to the database to the user. + +#### Set/Reset Node key password +If not set during installation, or to reset password, use: +``` +npm run reset-password +``` +- **private key**: Private key of the node +- **password**: Password to set for the node (``) + +**Note**: Private key of the node is encrypted using the ``. Thus use a ***strong*** password. + +### Create Database Schema (MySQL) +Create database schema in MySQL +``` +CREATE DATABASE ; +USE ; +SOURCE args/schema.sql; +``` +***Recommended*** *(optional)* Create a MySQL user and grant permissions +``` +CREATE USER ''@'localhost' IDENTIFIED WITH mysql_native_password BY ''; +GRANT ALL PRIVILEGES ON .* TO ''@'localhost'; +FLUSH PRIVILEGES; +``` + +### More +For help or list of all commands, use +``` +npm run help +``` + +## Starting the Server +After successful installation and configuration using the above steps, Server-Node can be started using: +``` +npm start -- -PASSWORD= +``` + +*(Optional)* +`console.debug` is now turned off by default. pass argument `--debug` to turn it on +``` +npm start -- -PASSWORD= --debug +```