Commit Graph

218 Commits

Author SHA1 Message Date
sairajzero
a06c5b4c7b Backup Sync improvements
- Removed: Immutable table-type (Previously immutable tables are now considered as mutable tables in backup feature)
- Backup sync-data from master are temporally cached and then processed after receiving all sync-data
- Backup sync-data from cache are now processed in ordered manner (to prevent foreign key constrain error, repeated data, re-adding a deleted data)
- Updated SQL Schema
2022-02-08 06:26:03 +05:30
Sai Raj
3fb401a226
Merge pull request #5 from ranchimall/main
Readme
2022-02-07 03:43:20 +05:30
Sai Raj
8a967eb9fa
Merge branch 'sairajzero:main' into main 2022-02-07 03:35:51 +05:30
sairajzero
ab3df761b0 Bug fixes
- Fixed: SQL schema asset foreign key incorrectly referenced
- Fixed: initial rate of asset not loading correctly from DB
- Fixed: get-rate API returning [object Object] instead of rates
- Fixed: Bug where transaction-loop happens with 0 quantity
- Improved: spendAsset to use assets NULL/Non-NULL base correctly
- Fixed: minor typos, syntax errors and SQL query errors

User-pages:
- Added: UI fields for assets in Buy/Sell orders
- Updated: UI display of correct asset in listing orders and transactions
- Updated: localStorage keys are prefixed 'exchange-'
- Fixed: Rates and Balance amount not displayed correctly

Others:
- Added: temporary code for tracing output lines in set_globals.js (commented out by default)
2022-02-07 03:12:20 +05:30
sairajzero
048ab0667b Multi asset: initial price and other improvements
- Read blockchain for asset's initial price
- Transfer all tokens to new sink on master transfer

Other Improvements:
- Slave: close existing backup sync when master WS closes
- Updated SQL schema, updated SQL syntax as required
2022-02-05 20:23:36 +05:30
sairajzero
df69ee0f7b Multi-asset: User API 2022-02-04 02:54:05 +05:30
sairajzero
92caef2c37 Multi-asset: coupling process 2022-02-04 02:28:02 +05:30
sairajzero
dbad25044a Multi-asset price.js 2022-02-03 05:46:26 +05:30
sairajzero
67c31d79a9 Multiple asset support
2 types of property:
1. Cash - main/central currency used for trading
2. Asset - (FLO/tokens) Can be brought or sold in the exchange market .

- Allow multiple tokens to act as asset in addition to FLO.
- Changes required for the above in deposits, withdraws, placing orders
- some code optimization in market.js
- Updated SQL schema
2022-02-02 04:17:47 +05:30
sairajzero
512dc3bcbc Automatically reload user page upon incorrect server
- Upon receiving responseError INCORRECT_SERVER_ERROR, reload the client page.
(Triggered mainly when master is changed).
- Fixed some minor syntax bugs
2022-01-26 21:46:19 +05:30
Sai Raj
9fa8c683bc
Merge branch 'sairajzero:main' into main 2022-01-26 16:09:11 +05:30
sairajzero
827bdcd793 Use sinkID for deposits
- Send Sink ID to users on get-account request
- In user page, store sink ID and use it for deposit FLO/Rupee
2022-01-26 16:08:30 +05:30
Sai Raj
c4a5455b41
Update README.md 2022-01-26 02:31:23 +05:30
Sai Raj
d7283fb13b
Merge branch 'sairajzero:main' into main 2022-01-26 02:23:25 +05:30
sairajzero
cdc55dbdc9 Update truncateAll.sql 2022-01-26 02:22:33 +05:30
sairajzero
bf302c3ebc bug fix: backup/sync
- Fixed minor bugs in backup/sync process
- Fixed: Master doesn't sync when it comes back online
- Decreased backup interval time to 1 min.
2022-01-26 02:20:34 +05:30
sairajzero
2c35c545e8 Bug fixes (client side)
Fixed Client page bugs:
- Fixed minor bugs in client side pages
- client page to use floGlobals.js
- moved KBucket.js to public (as its need by client page too).
Fixed Server Bugs:
- Added Access-Control-Allow-Origin to response headers
- Fixed: trustedIDs not loaded
- Fixed minor bugs (syntax errors)
2022-01-25 01:28:22 +05:30
sairajzero
8c1aad3d28 Bug fixes
- Added lastTx table to SQL schema
- setup file 'reset-password' now accepts any private key (node keys)
- Fixed minor SQL syntax
2022-01-23 04:51:15 +05:30
sairajzero
11b99c3e76 Process for exception cases
Case: No other node active when self node is init
- Start the exchange system.
Case: When node becomes master when prev node goes down
- Add self share to collectShare
- collect shares from other node to re-construct sink private key
- Fixed some minor bugs
2022-01-23 04:49:15 +05:30
sairajzero
52a1b3077d multi-node support
- Run multiple nodes in the same directory with diff config files
- pass the env variable 'I' (optional) to run a diff node instance with config file config<I>.json (also uses keys<I>.json)
- Updated setup files
- Fixed bugs in SQL schema
2022-01-23 03:24:27 +05:30
Sai Raj
e1830c3130
Merge branch 'sairajzero:main' into main 2022-01-20 05:39:41 +05:30
sairajzero
7dbe78c1cc User-end update
- updated custom session for distributed system
- Fetch node list and url from blockchain
2022-01-20 05:38:55 +05:30
sairajzero
9760710c18 Check session expiry on each request 2022-01-20 05:35:48 +05:30
sairajzero
348cc989c9 Custom session for distributed servers
- Adding custom session login for the distributed server system.
- Added Sessions table to backup
2022-01-18 05:11:34 +05:30
Sai Raj
cbff20f89e
Merge branch 'sairajzero:main' into main 2022-01-14 04:53:41 +05:30
sairajzero
abb82b0b34 Minor Fixes
- Adding tables to SQL schema
- Moved Kbucket usage from main.js to backup/head.js
- node Kbucket, ordered NodeList are calculated in backup/head.js
2022-01-14 04:52:41 +05:30
sairajzero
c32833e625 Adding application name in floGlobals 2022-01-14 04:15:21 +05:30
sairajzero
0ba0f10245 Renaming files 2022-01-14 04:11:25 +05:30
sairajzero
626c9ec214 Backup transfer/retrieval process 2022-01-14 04:08:44 +05:30
sairajzero
9fd1ae49c2 move tokenAPI to tokenAPI.js 2022-01-14 04:07:51 +05:30
sairajzero
db9ff02488 Update main.js
- fetch data (nodeList, TagList, trustedIDs) from blockchain
- Act as slave or master when needed
2021-12-30 06:53:04 +05:30
sairajzero
0b70f099b0 Update App Server
- Use App server port for Websocket Server.
- pause/resume serving and market when node acts as slave/master respectively.
2021-12-30 06:49:48 +05:30
sairajzero
c4732f5831 Restoration 2021-12-30 06:33:10 +05:30
sairajzero
4b9a5e656b Create KBucket.js 2021-12-30 06:30:06 +05:30
Sai Raj
59046ffd50
Update README.md 2021-12-08 14:17:32 +05:30
Sai Raj
34457b5118
Update README.md 2021-12-08 14:16:43 +05:30
sairajzero
f1e9658007 Audit Transaction
Store the following values upon successful transaction
- Timestamp
- Quanity, unit value, total cost
- Old/New Balance of Rupee and FLO for both seller and buyer
2021-12-06 22:13:37 +05:30
sairajzero
946087481a Move transaction process to coupling.js 2021-12-06 20:55:35 +05:30
sairajzero
1b6488bdd1 Adding foreign key attributes to SQL schema
- All floID based columns (floID, seller, buyer) are now foreign keys with reference to User.floID
- tag in Tags table is now referred to tag in TagList
- Indicate the error when adding user tags via API
2021-12-05 00:40:49 +05:30
sairajzero
9feef5bfe9 Minor fixes
- Fixed bug: sell order placement not working.
- log the current_rate
- indicate when max price-up/down has reached.
2021-12-05 00:37:45 +05:30
sairajzero
d3b27348ee Bug fix
- Fixed various bugs in the last update
- Added 'use strict'; to multiple files to prevent undeclared variables
2021-12-03 20:09:40 +05:30
sairajzero
4a898e6bff Initial price
- load init price from DB if possible, else fetch from API
- store the price history in DB every 1 hr
- get the 24hr-past-rate from DB
- update the last tx timestamp upon successful transaction
- added priceHistory table to SQL schema and backup
2021-12-03 01:45:59 +05:30
sairajzero
278fc8bcbd Price updation
- Update current_price when no seller or buyer available.
- Inc price only when sell-orders from rated sellers are available.
- User must buy a minimum FLO before placing a sell order unless they are a 'Miner'.
2021-12-02 05:26:01 +05:30
Sai Raj
4a92ee7acf
Merge pull request #4 from ranchimall/main 2021-11-25 05:14:04 +05:30
Sai Raj
eb4100e21b
Merge branch 'sairajzero:main' into main 2021-11-25 05:11:55 +05:30
sairajzero
a7c96e9ce2 Priority case: FLO brought from outside
FLO brought from outside the source will be processed after those brought from source-market.
2021-11-25 05:10:39 +05:30
sairajzero
5ac3316008 Allow trusted IDs to add/rm user tags via API 2021-11-18 15:58:40 +05:30
sairajzero
b5cde90e89 Bug fix 2021-11-05 21:43:26 +05:30
sairajzero
744979fb2a Adding tables for Tags (groups) 2021-11-05 21:43:15 +05:30
sairajzero
d435157bd2 Different group/tag priority for sell and buy 2021-11-02 03:39:07 +05:30