Commit Graph

343 Commits

Author SHA1 Message Date
sairajzero
8eb6d130d1 Removed create-schema command
- Removing create-schema command as its not creating triggers.
2023-01-02 01:09:59 +05:30
sairajzero
1ad701a70b Adding checksum-db script
- Usage: npm run checksum-db
- Prints the total records and checksum for each table stored.
2023-01-02 00:09:08 +05:30
sairajzero
9686f29f8e Reshare ids when node list updated
- Reconstruct shares for all active ids when node list is updated via blockchain
2023-01-01 21:43:08 +05:30
sairajzero
7a99a44265 Fixed bug: node closes when flosight unavailable 2022-12-31 02:17:56 +05:30
sairaj mote
934f103045 UI improvements 2022-12-30 19:59:18 +05:30
sairaj mote
9ae7793533 minor change 2022-12-30 19:08:33 +05:30
sairaj mote
28ac9062d4 reverted to error.message 2022-12-30 14:11:20 +05:30
sairaj mote
4882d3d3e7 Added error code message 2022-12-29 23:36:32 +05:30
sairaj mote
db44151223 Updated components 2022-12-29 18:27:55 +05:30
sairaj mote
12dc45fad1 code refactoring and UI changes
-- removed mapping tx time from transaction history
2022-12-29 18:10:59 +05:30
Sai Raj
257995f409
Merge pull request #7 from ranchimall/dev
New features
2022-12-28 03:45:12 +05:30
sairajzero
3c0bb7bdd4 Update keys.js 2022-12-28 03:41:05 +05:30
sairajzero
1faaa60843 reducing CHECKSUM_INTERVAL to 10 2022-12-23 03:08:43 +05:30
sairajzero
a05ae79e94 Node URL change
- update the node URL by sending message in blockchain (from exchangeID)
JSON property
Nodes.update: {nodeID: nodeURL}
2022-12-22 02:37:10 +05:30
sairajzero
28eec97b59 Update help.js 2022-12-22 02:31:40 +05:30
sairajzero
02bb160b5f Update btcOperator.js 2022-11-20 19:48:30 +05:30
sairajzero
64527259d9 Bug fix: convert values
Fixed: Max value not resolved properly when availability is less than configured max value
2022-11-17 23:39:54 +05:30
sairajzero
65c0d3c91f Blockchain-bonds and Bobs-fund balance check API
- Added API to check the balance and closing-amount needed for blockchain-bonds and bobs fund (checkBlockchainBond, checkBobsFund) in floExchangeAPI.
- API resolves values in
  .pending: bond/fund closed by user, but not yet finished processing
  .ready: bond/fund ready to close by users
  .upcoming: bond/fund that will be out of lockin period (by given prior_time parameter)

- Fixed: Bonds and Funds closing data not written to DB due to async
- Fixed: floExchangeAPI not reading trusted-id list from blockchain
- Added floExchangeAPI.config: getters for trustedList, assetList and tagList
2022-11-17 17:53:37 +05:30
sairajzero
28e4815636 Bug fix
- Bug fix: btcOperator getTx not throwing valid error when invalid txid
- Fixed: toStandardDecimal not rounding upto 8 decimal places on rare cases
2022-11-17 17:41:30 +05:30
sairajzero
b0ec2d6a85 Keys: invoke shuffle at interval 2022-11-17 03:38:46 +05:30
sairajzero
70c943c997 Backup module: bug fixes
- Fixed: keys.addShare unhandled on reject
- Fixed: sinks in Cooldown period not added in sink_chest (for market to verify tx that already occurred) on master process start.
- Fixed: sink list from slaves not handled properly for reconstruct (if needed)
- Fixed: minor syntax bugs
2022-11-16 22:40:13 +05:30
sairajzero
e4603078d2 Keys: Fixes and Improvements
- Added file lock using proper-lockfile module to prevent data corruption when multiple shares are queued to write at the same time
- Fixed: sinkShares Table num value throwing error when random number is negative. (Updated 'num' column to Unsigned)
- Changed INT_MIN, INT_MAX to UNSIGNED_INT_MIN, UNSIGNED_INT_MAX
- Added: support for multi-instance in keys module
- Fixed: index_dir and prime_file throwing error on startup
- Added: on init, create index directory if not exist
- Fixed: sink_chest. pick and active_pick returning undefined sometimes
- Fixed: various syntax bugs
2022-11-16 22:08:00 +05:30
sairajzero
506087e856 Bug fixes
- Fixed: get-sink, generate-sink, reshare-sink, discard-sink API not working
- Fixed:  API not working
- Fixed: SQL syntax in to_refund_sql in verifyConvert for timeout requests
- Fixed: key management init not invoked
- Fixed: Minor bug in getConvertValues. Also, have null value if not available.
- Added console.debug to rejected promise (SQL write) on readDataFromBlockchain in Blockchain bonds and Bob's fund
2022-11-16 21:57:29 +05:30
sairajzero
c911ca671e Update setup files 2022-11-16 21:43:41 +05:30
sairajzero
c5b43291ab API(admin): generate, reshare and discard sinks
- generateSink: generates a sinkID for given group
- reshareSink: regenerate the shares for given id and distribute
- discardSink: discards the given sink id

Note: All these APIs are admin-only
2022-11-15 15:51:10 +05:30
sairajzero
c8b70e3fec APIs for getSink and getConvertValues
- floExchangeAPI.getSink: resolves an active sink id (for a service, default: exchange)
- services can be listed in floExchangeAPI.serviceList

- floExchangeAPI.getConvertValues: resolves the available convert values
2022-11-15 03:29:23 +05:30
sairajzero
b029c0ec30 Convert Values
- Convert can now be done in certain values if configured
2022-11-15 03:22:41 +05:30
sairajzero
6c0237b0b5 Upgrade Keys module
Keys module
- Private keys of node and sinks (shares) are managed by keys module
- sink_chest is moved here
- Seperate sinkIDs for each service

Sink Private key security improvements
- Shares are stored as index in SQL
- Indexes are mapped with sinkIDs in file system
- File is shuffled on interval
- Every file data is stored in encrypted format

Other changes
- changes required for the above
- RefundTransact is now dedicated to Convert service only (as every service has diff sinkID)
- moved periodicProcess to background.js
2022-11-15 03:20:33 +05:30
sairajzero
178fcf4ce2 Update database module
- Updated database module so that other modules can use it directly by require()
- use path module where-ever needed
- Fixed: public directory not viewed in browser when opening the link
2022-11-12 04:30:25 +05:30
sairajzero
e4adaf7ed7 Minor changes and Bug fixes
- deduce BTC fee from users
- If timeout rejected tx are confirmed, refund the asset
- Blockchain bond and Bob's fund withdraw now sends equivalent BTC to users (via BTC blockchain)
- Fixed minor bugs
- Changed toFixed (fn to limit the decimal) to toStandardDecimal (set_global.js)
2022-11-05 03:56:40 +05:30
sairajzero
821de1a6d7 inscribing marketID in floExchangeAPI.js
- Inscribed marketID and market name inside floExchange.js
- Added getter for floExchangeAPI
  .adminID
  .application
  .nodeList
2022-10-29 03:46:55 +05:30
sairajzero
a7747a2ecf Bug fix
- Fixed: Bob's fund data not read from blockchain
- Fixed: incorrect senders list passed to readData from blockchain
- Fixed: when data is not saved in DB correctly, do not update LastTx, hence in next refresh, it might get resolved
- Fixed: bugs in Blockchain bonds closing and bob's fund closing
- Merged parse.main and parse.end in Bob's fund module
2022-10-26 04:55:50 +05:30
sairajzero
48609bd1b7 Changing env-var to arguments
- Changes console.log and console.debug to relevant types
- PASSWORD and I environment variables are now passed as arguments to npm commands
- Added optional argument `--debug`. when passed, console.debug is also logged, else console.debug are turned off
2022-10-25 03:18:36 +05:30
sairajzero
4b26ad60bd Bug fix
- Adding rate column to DirectConvert table to store the rate of conversion
- Fixed: withdrawConvertFundCurrency not working correctly
- Fixed: closeBlockchainBond and closeBobsFundInvestment syntax bugs
- Adding request_timeout after with convert request will expire if tx from user is still unconfirmed
- Fixed: conversion result value has more than 8 decimal places
- Fixed minor syntax bugs
2022-10-25 02:12:58 +05:30
sairajzero
0389e833a5 Bug fix
- Updated btcOperator
- Changed all BIT to TINYINT in SQL schema
- Fixed: "Public key missing" error in deposit/withdraw convert fund
- Updated btcOperator
- Fixed: btcOperator not imported in index.html and main.js
2022-10-24 15:56:30 +05:30
sairajzero
64a81fc762 Bug fixes
- Fixed SQL query in checkPoolBalance

- Fixed: collectAndCall not set in app
- Fixed assetList not set
- Fixed: confirmDepositToken not working
- Fixed: confirmRefund not working
- Fixed bug: verifyTx.BTC

- Fixed bugs in some multi-value insert queries in SQL
- Fixed various syntax bugs
- Changed success logs to console.info
2022-10-24 15:55:30 +05:30
sairajzero
9e31246b42 Fixed various bugs 2022-10-21 04:02:27 +05:30
sairajzero
76339f1621 Optimization and Bug fix
- Renamed all `status` columns to `r_status`
- r_status uses INT instead of VARCHAR
- status-codes are used instead of strings
- Codes for status and modes can be found at floExchangeAPI.processCode
- Merged DepositCoin, WithdrawCoin, DepositToken, WithdrawToken into VaultTransactions so that all deposit/withdraw transactions can be viewed in order
- Updated relevant SQL syntaxes for the above
- Converted all multi-valued placeholders in SQL queries to array based placeholders
- Fixed minor bugs
2022-10-20 04:23:35 +05:30
sairajzero
f4bedfbd48 SQL fixes for previous updates
- Added table: ConvertFund
- Added triggers for CloseBondTransact, CloseFundTransact, ConvertFund, RefundTransact
- Updated truncateAll.sql
2022-10-19 21:27:54 +05:30
sairajzero
0381c44733 Convert fund management
- Added Withdrawal of convert fund
- Convert fund is moved to a different table (ConvertFund)
- Added APIs for withdraw fund
- Changed add-convert-fund to deposit-convert-fund
- Fixed minor bugs
2022-10-19 21:26:11 +05:30
sairajzero
970b4547cb Update Std_op 2022-10-18 04:46:15 +05:30
sairajzero
fde297fb44 Convert feature add-ons
- Reject request when not enough fund is available to convert.
- MIN_FUND  is the minimum fund that should be reserved.
- Add funds for conversion via adminID

- Added: Refund feature
- Automate a refund on currency when convertToCoin request is made when fund is insufficient
- ConvertFrom now accepts an non-broadcasted tx_hex from user and broadcast it when convert fund is available. (if convert fund is insufficient, then tx is not broadcasted)
2022-10-18 04:45:55 +05:30
sairajzero
d8682a2561 minor fixes: bobs fund
- Fixed: tapoutWindow and tapoutInterval storing in DB when there is no tapout
- Fixed: lockin-period and tapout check in closeFund
2022-10-11 17:46:49 +05:30
sairajzero
29bedbdcc8 Bug fixes
- Fixed: refreshData for bobs-fund and blockchain-bonds not been invoked
- Fixed: DB assignment for conversion, bonds and bobs-fund
2022-10-11 17:12:30 +05:30
sairajzero
d3f08dd921 Background process for close-fund 2022-10-11 16:56:42 +05:30
sairajzero
8a82a0b675 Close Bobs-Fund feature
- Adding feature to close bobs' fund investment upon user requests
- Added: API for the same
2022-10-11 03:15:34 +05:30
sairajzero
80879a250b Bug fix
- Fixed: incorrect eCode file mapped
- moved productStr inside IIF
- Fixed: some minor syntax bugs
2022-10-11 03:05:04 +05:30
sairajzero
7c99f41e48 API for close-blockchain-bonds 2022-10-10 19:23:20 +05:30
sairajzero
90d2a4764e Close-Blockchain-bond support
- Adding feature to close blockchain bonds upon user requests (when lock-in period is over)
- Improved some syntax and structure of coding
2022-10-10 19:22:51 +05:30
sairajzero
fef11b4712 moving conversion.js into service folder 2022-10-09 23:08:48 +05:30