Update README

This commit is contained in:
sairajzero 2022-12-25 22:50:31 +05:30
parent 0d45711e63
commit bf692f05a7
3 changed files with 38 additions and 30 deletions

View File

@ -2,9 +2,10 @@
# SuperNode Storage
## Installation
### Pre-requisite
- [X] Nodejs `version >= 12.9`
- [X] MySQL Server
- [X] Nodejs `version >= 12.9` (`--lts` recommended)
- [X] MySQL Server `version > 8.0`
### Download
Download the repository using git:
@ -18,45 +19,44 @@ Install using npm:
cd SuperNodeStorage
npm install
```
Finish the configuration when prompted
### Configuration
#### General Configuration
In `args/` directory, Copy `config-sample.json` to `config.json`.
If not finished during installation, or to re-configure use:
```
cp args/config-sample.json args/config.json
npm run configure
```
Edit the values in `args/config.json` as required.
```
{
"privateKey": "<private-key>",
"port": "<port>",
"sql_user": "<MySQL-username>",
"sql_pwd": "<MySQL-password>",
"sql_db": "<database-name>",
"sql_host": "<sql-host>"
}
```
- **private-key**: Private key of the node
- **port**: Port of the server to run on
- **MySQL-username**: Username for MySQL
- **MySQL-password**: Password for MySQL
- **database-name**: Database in which the data should be stored (default: ***supernode***)
- **sql-host**: Host of the MySQL server (default: ***localhost***).
- **MySQL host**: Host of the MySQL server (default: ***localhost***)
- **Database name**: Database in which the data should be stored (`<database-name>`) (default: ***supernode***)
- **MySQL username**: Username for MySQL (`<sql-username>`)
- **MySQL password**: Password for MySQL (`<sql-password>`)
***Recommended*** *(optional)* Create and use a MySQL user instead of root. Remember to give access to the database to the user.
#### Parameter Generation *(Optional)*
Open `args/gen-param.html` in a browser and download `param.json` to `SuperNodeStorage/args` directory.
#### 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 (`<password>`)
*Note: `param.json` is used for controlled random values used by SecureRandom in Cryptography. If this step is skipped, `param-default.json` will be used as default parameter*
**Note**: Private key of the node is encrypted using the `<password>`. Thus use a ***strong*** password.
### More
For help or list of all commands, use
```
npm run help
```
## Starting the Server
After successful installation and configuration using the above steps, SuperNodeStorage can be started using:
```
npm start
npm start -- -PASSWORD=<password>
```
##
For more detailed Installation, check the wiki [here](https://github.com/ranchimall/SuperNodeStorage/wiki).
For more information and detailed installation, check the wiki [here](https://github.com/ranchimall/SuperNodeStorage/wiki).

View File

@ -43,13 +43,13 @@ function configureSQL() {
flaggedYesOrNo('Do you want to re-configure mySQL connection').then(value => {
if (value) {
console.log('Enter mySQL connection values: ')
getInput.Text('Host', config['sql_host']).then(host => {
getInput.Text('MySQL host', config['sql_host']).then(host => {
config['sql_host'] = host;
getInput.Text('Database name', config['sql_db']).then(dbname => {
config['sql_db'] = dbname;
getInput.Text('MySQL username', config['sql_user']).then(sql_user => {
config['sql_user'] = sql_user;
getInput.Text('Mysql password', config['sql_pwd']).then(sql_pwd => {
getInput.Text('MySQL password', config['sql_pwd']).then(sql_pwd => {
config['sql_pwd'] = sql_pwd;
resolve(true);
})

View File

@ -1,13 +1,19 @@
let message = `
SuperNode Storage
-----------------
=================
Setup
-----
npm install - Install the app and node modules.
npm run help - List all commands.
npm run setup - Finish the setup (configure and reset password).
npm run configure - Configure the app.
npm run reset-password - Reset the password (for private-key).
(Optional) Open args/gen-param.html and Download param.json to args/ directory
Start Node
----------
npm start - Start the application (main).
NOTE: argument 'PASSWORD' required for 'npm start'
@ -16,7 +22,9 @@ npm start -- -PASSWORD=<password>
(Optional) 'console.debug' is now turned off by default. pass argument '--debug' to turn it on
npm start -- -PASSWORD=<password> --debug
(Optional) Open args/gen-param.html and Download param.json to args/ directory
Debugging
---------
npm run checksum-db - List the stored node tables and checksum
`;
console.log(message);