Commit Graph

69 Commits

Author SHA1 Message Date
sairajzero
3cb6c3f60c Organizing scripts: floCrypto v2.2.0 2022-02-27 20:33:51 +05:30
sairajzero
8094660f53 Organizing scripts: lib v1.2.0 2022-02-27 20:31:15 +05:30
sairajzero
6caa0658f6 floCloudAPI v2.1.0a (bugFix)
Fixed bug: UpdateObjectData not working correctly
2021-11-05 18:18:09 +05:30
sairajzero
57ef8d14df floBlockchainAPI_v2.1.1a
- formatting the code
2021-09-17 02:46:48 +05:30
sairajzero
5c21a01b68 floBlockchainAPI v2.1.1
- improved sendTx to check if the utxo is already used but unconfirmed (ie, still in mempool) and ignore those utxos.
This allows users to send multiple tx from the same floID without the need to wait for confirmation of prev tx as long as enough utxos are available.

- Optional parameter: strict_utxo (boolean): Default=true (safe mode).
If false, allows unconfirmed UTXOs to be included in the txn.
This will allow users to chain send tx as long as enough balance FLO is available.
WARNING: if one tx in the chain is dropped, all next tx dependent on that tx will be dropped too.

- writeData (as it invokes sendTx) also have the above improvements
2021-09-17 02:25:16 +05:30
sairajzero
f8954a2532 floBlockchainAPI v2.1.0
- readData: option txid changed to tx. now resolves data with txid, time, blockheight along with flo data as an object [if option tx is true].
Note: backward not compactible when txid was passed as option
2021-08-12 21:47:02 +05:30
sairajzero
b575432ace floCloudAPI_v2.1.0
- Updating to node version of SuperNodeStorage
2021-07-24 04:09:44 +05:30
sairajzero
df8df5edbc floBlockchainAPI_2.0.1e
- Adding floBlockchainAPI.util.current(): returns the current working flosight link (to be used after at least 1 API request'
2021-06-07 14:27:52 +05:30
sairajzero
25df4bbbc0 bugfix (floBlockchainAPI_v2.0.1d)
floBlockchainAPI_v2.0.1d
- fetch_retry removes incorrect uri when parallel requests are called.
2021-06-06 17:10:55 +05:30
sairajzero
99ac3accb9 bugfix: (floBlockchainAPI v2.0.1c)
-Fixed: no Flosight working error shown even when there  are flosight(s) working
2021-06-05 12:27:32 +05:30
sairajzero
962f68c230 floBlockchainAPI v2.0.1b
Additional filter options to readData function
- receivedOnly: filters only received data
- txid: (boolean) resolve txid or not
- sender: flo-id(s) of sender
- receiver: flo-id(s) of receiver
2021-04-22 02:09:48 +05:30
sairajzero
05f110661e floCrypto_v2.0.1, floBlockchainAPI_v2.0.1a
floCrypto_v2.0.1 (ASCII fns)
- validateASCII
- convertToASCII
- revertUnicode

floBlockchainAPI_v2.0.1a
bugfix
2021-04-18 02:36:51 +05:30
sairajzero
836f359cf2 floDapps_v2.0.1c
- Added verifyPin: function to verify the pin of login credentials without logging in (ie, not storing the keys in memory)
- 'pin' argument can be ignored to check if private key is secured or not.
2021-02-12 03:06:42 +05:30
sairajzero
dd59c25d73 floCloudAPI_v2.0.2e
- Fixed bug: multiple cloud connection caused issue with inactive array.
Hence replaced Array with Set
2021-01-20 22:54:38 +05:30
sairajzero
b5532444fb floCloudAPI_v2.0.2d | floDapps_v2.0.1b
floCloudAPI_v2.0.2d
- Fixed bug: syntax error in requestObjectData
 - Added closeRequest: closes the active live requests

floDapps_v2.0.1b
- minor improvements and alignment.
- Fixed: deleteAppData deletes the lastTx data of the adminID.
2021-01-02 19:11:15 +05:30
sairajzero
1a57f74704 Alignment
- Moving onLoadStartUp script tag to head
2020-12-31 23:20:51 +05:30
sairajzero
fc747dae83 floBlockchainAPI v2.0.1 | floCloudAPI v2.0.2c
- Added: getTx(txid) to floBlockchainAPI. resolves the tx data of the given txid.

-
2020-12-19 22:26:00 +05:30
sairajzero
30c13ae12f compactIDB v2.0.1
- Fixed bug: database upgrade not working correctly when upgrading existing db.
- Added upgradeDB as a standalone function. (also called by initDB if upgrade is required)
- Added getDBversion: resolves the version of the db
- Improved openDB: rejects if the db is not found
2020-12-15 05:02:50 +05:30
sairajzero
b0e15d1a7f Minor bug fixes 2020-12-09 03:49:32 +05:30
sairajzero
99ce43c089 floCloudAPI_v2.0.2a | floDapps_v2.0.1
floCloudAPI v2.0.2a
- deleteApplicationData accepts options instead of application (to match other functions).
- Added editApplicationData
- sendGeneralData not longer stores data in IDB.
- fixed bug: Infinite callback loop in requestGeneralData and requestObjectData

floDapps v2.0.1
- added mid startup support
- added deleteUserData and deleteAppData
- replaced reactor startup logger with setCustomStartupLogger
2020-11-30 03:29:06 +05:30
sairajzero
f5f29cb620 bug fix
- Changed SNStorageID
- fixed bug: supernodes not read from blockchain
- generalData incorrectly stored
2020-10-15 01:33:19 +05:30
sairajzero
a8218630ea Contacts feature
- spliting IDB into 3 parts:
1. floDapps - common DB for all apps across all users
2. userDB - common DB for all apps for specific user floID
3. appDB - app DB across all users

- contacts, pubKeys can be stored by users in userDB
- users can send direct message across all apps using floDapps.sendMessage
- syncData can be used to sync user data between devices
2020-10-12 02:38:28 +05:30
sairajzero
cc2d4f8248 Mark feature 2020-09-27 03:21:43 +05:30
sairajzero
65f16fa14b Bug fixes
minor bug fixes
2020-09-20 13:11:07 +05:30
sairajzero
4e9af8060a stdop Improvement
STD_OP

floGlobals
- combined vectorClock (for objectData) and generalVC (for generalData) into lastVC.

init
- Bug fixed: floData of 16 character dropped by floSight.

floCrypto
- Improved getFloIDfromPubkeyHex to getFloID: return floID from either pubKey or privKey.
- verifyPrivKey, validateAddr return false if arguments are empty.

floSupernode
- Removed floSupernode module.
- Kbucket submodule moved to floCloudAPI

Kbucket (subModule)
- Improved KBucket module
- Kbucket cyclic array (SNCO) is formed (w.r.t. distance) when kBucket is launched
- nextNode, prevNode are determined by SNCO

compactIDB
- Improved searchData (accepts option parameter instead of patternEval)
	.options (lowerKey, upperKey, atKey, patternEval, lastOnly)

floCloudAPI
- Improved data signature during sending.
	.current format ( ["receiverID", "time", "application", "type", "message", "comment"])
- Adding live request:
	.requesting data now accepts option callback
	.when callback option is passed, the request becomes live request
	.ie, cloud automatically forwards new data received by the requested floID
	.callback function is called with new data is received
	.callback supported functions: requestApplicationData, requestGeneralData, requestObjectData
- Adding feature to delete from cloud.
	.data received can now be deleted from cloud
	.signature is required for verification (thus requires privKey logged in)
	.can only delete own data (received only)

floDapps
- merged manageSubAdmins and setApplicationSettings into manageAppConfig(adminPrivKey, addList, rmList, settings)
- Improved getNextGeneralData
	.getNextGeneralData can now sub-categorize comment (even when generalData is request for all comment)
	.getNextGeneralData now keeps a track pointer of previously called. [vectorClock (ie, second parameter) must be null, default is null]
2020-09-19 03:39:19 +05:30
sairajzero
9b7dd8214d bug fix
- Fixed: Invalid private key on signing in error not working correctly and cause other bugs
2020-08-25 18:03:12 +05:30
sairajzero
fe1ce64562 minor change
-  floBlockchainAPI's readData: changing default limit option value from 1000 to no limit
2020-08-07 04:34:03 +05:30
sairajzero
58bee2e9db minor bug fix
- floBlockchainAPI.readData's option pattern ll now test for JSON key matching the pattern
- startUp fn readAppConfigFromAPI checks if the content is a object or not to prevent errors
2020-08-07 04:19:38 +05:30
sairajzero
f6a07b20ba Minor Improvements
- generalData now also stores sign and pubKey.
- renamed startup fn readSubAdminListFromAPI to readAppConfigFromAPI.
- readAppConfigFromAPI also loads settings from the IDB to floGlobals.
2020-08-01 18:38:10 +05:30
sairajzero
62c190567e Adding settings and encrypted generalData feature
- floDapps now reads 'settings' from blockchain
- improved manageSubAdmins: doesnot send tx if addList and rmList are empty (i.e, no changes)
- setApplicationSettings: used to set settings for the application.
Note: existing settings are overwritten (ie, not appended) if same key is used.
- sendGeneralData now supports a new option (encrypt): Encrypts the message before sending.
Note: option value can be boolean true or pubKey of a floID. Passing true will encrypt the data using the default encryptionKey (default 'encryptionKey' must be set in settings).
- getNextGeneralData now supports a new option (decrypt): Decrypts the message if possible.
Note: option value can be true, privateKey or array of privateKeys.
If boolean true is passed, decrypts using myPrivKey (loggedIn privateKey).
If privateKey (string) is passed, decrypts using the given privateKey.
If array of privateKeys are passed, decrypts the message using the suitable key from the given array. (for example, say messages A, B, C are encrypted for keys X, Y, Z respectively, passing [X, Z] will decrypt messages A and C.
2020-07-31 22:24:27 +05:30
sairajzero
5e1e8a624f bug fix: new line in floData cause error
since newline char is not supported in floData, new line (\n) is replaced with space.
2020-05-22 18:50:29 +05:30
sairajzero
a66c2d91c2 minor changes
-Renamed defaultDB propertyName in compactIDB
-Fixed error in writeDataMultiple comment
2020-05-14 03:52:39 +05:30
sairajzero
32da4e28af Improved initDB
initDB also deletes objectstores on upgrade needed (version change)
2020-05-07 15:46:58 +05:30
sairajzero
489996c1b8 Improve clearCredentials
Clearing the private key, public key and floID from memory on clearCredentials
2020-05-06 19:56:31 +05:30
sairajzero
d90e9f6ed4 Adding secure PrivateKey feature
floDapps.securePrivKey(pwd): replaces the stored private key with encrypted variant.
Changed made in startup function getCredentials to support securePrivateKey.

Improved and promisified clearCredentials.
2020-05-06 00:31:44 +05:30
sairajzero
0308af983f Adding clearData to CompactIDB
compactIDB.clearData clears all data in the given objectstore.
2020-05-02 18:48:02 +05:30
sairajzero
38f43d805d InitDB: add missing objectStores
InitDB now automatically adds the missing objectstore instead of rejecting
2020-05-02 18:10:47 +05:30
sairajzero
1954fc0782 Improved sendTxMultiple and writeDataMultiple
sendTxMultiple:
There are 2 modes (given send amount, preserve ratio)
- Given Send Amount: Uses the given send amount from each sender IDs. Pass the senderPrivKeys as object with amount to invoke this mode
eg. { privateKey1: sendAmt1, privateKey2: sendAmt2...}
- preserveRatio: The ratio of the balance of the senders are maintained. Pass the senderPrivKeys as array of private keys.
eg. [privatekey1, privatekey2....]
*Note: receivers must always be object of floIDs with receive amount.
eg. {receiverID1: receiveAmt1, receiver2: receiveAmt2...}

writeDataMultiple:
There are 2 modes (preserveRatio, equalContribution)
- preserveRatio: preserves the ratio of the balance of senders
- equalContribution: all senders contribute equal amount to the transaction
Note:
*senderPrivKey and receivers are arrays
eq. [privateKey1, privateKey2, ..] and [receiverID1, receiverID2...]
*sends default amount (floGlobals.sendAmt) to each receiver)
*last (4th) parameter is optional:
(default) true: invokes preserveRatio mode
false: invokes equalContibution mode
2020-04-26 01:04:12 +05:30
sairajzero
a569adcb74 Adding mergeUTXOs, sendTxMulti and writeDataMulti
mergeUTXOs: /merge all UTXOs of a given floID into a single UTXO

sendTxMulti: Send Tx from (and/or) to multiple floID

writeDataMulti: Write data into blockchain from (and/or) to multiple floID
2020-04-25 17:54:13 +05:30
sairajzero
0a6fb69349 Beautify the scripts 2020-04-23 21:16:54 +05:30
sairajzero
3d0c8883b7 Improved floCloudAPI
floCloudAPI now stores the lastCommit value of the objects via requestObjectData, resetObjectData, updateObjectData

resetObjectData and updateObjectData now takes the new and old value from floGlobals.appObjects and lastCommit respectively

Parameter changes:
resetObjectData: function(objectName, options = {})
updateObjectData: function(objectName, options = {})
2020-03-10 22:00:56 +05:30
sairajzero
8652959e54 floCrypto: errorHanding
errorHanding added to floCrypto.getPubKeyHex and floCrypto.getFloIDfromPubkeyHex
2020-03-04 03:45:50 +05:30
sairajzero
47ca6a802e moving onloadStartup to a seperate script tag 2020-02-16 02:38:51 +05:30
sairajzero
d6c4b4882e changing TEST_MODE adminID 2020-02-16 02:36:35 +05:30
sairajzero
86ea714139 adding manage subAdmin to floDapps
floDapps.manageSubAdmins() allows the user to add and/or remove subadmin list via blockchain
*Requires Admin Privatekey of the app
2020-02-16 02:34:58 +05:30
sairajzero
c3a51f44a7 bug fix 2020-02-06 14:56:12 +05:30
sairajzero
7a6a2dc9ea Custom privKeyInput is made promisified
privKeyInput now uses given key when resolved and generates random key when rejected
2020-02-06 13:38:09 +05:30
sairajzero
cdeab33c20 Login as guest feature
Entering a empty string for private Key now automatically generated a random key and logins as guest
2020-02-03 18:43:29 +05:30
sairajzero
2bf166ffd1 bug fix: floSupernode module 2020-01-31 20:22:35 +05:30
sairajzero
a44fe4be72 adding custom input for privkey 2020-01-31 14:42:42 +05:30