Commit Graph

299 Commits

Author SHA1 Message Date
Kleissner
281622aa49 NodelistLookup function 2021-12-14 02:05:08 +01:00
Kleissner
ced9574e5e webapi: Live download implementation. 2021-12-14 01:27:04 +01:00
Kleissner
b3f1293f3c UDT: closing messageOut results into too fast closing. Don't close it for now as an ugly bush fix. 2021-12-14 01:20:16 +01:00
Kleissner
10e5213944 UDT: Fix the close problem: Have a regular Close() function that may be called after reading/writing is done, and a Terminate() function that can be called anytime. 2021-12-13 22:52:42 +01:00
Kleissner
f18e651f40 webapi: /file/view add parameter 'nocache' to force download from remote peer. This is useful for testing purposes. 2021-12-13 16:52:13 +01:00
Kleissner
cab881ebdb webapi: Add option for some URLs to accept the API key in the parameter, instead of the "x-api-key" HTTP header. By default add /file/read and /file/view.
This allows embedding the URLs into existing code that may not be able to set the special HTTP header.
2021-12-13 16:49:56 +01:00
Kleissner
7adadf9ad5 UDT: Fix critical bugs that appear during high packet loss. Recv: Implement resending ACKs (until ACK2'ed). Send: Implement unsolicited data resending of unacked data packets. Double sending time each try to prevent ddos. 2021-12-13 16:21:53 +01:00
Kleissner
5d0989bfeb Introduce nodeList for quicker lookup based on node ID. It is mirrored from peerList.
This improves the speed of lookup in FindNode if the node is already connected.
2021-12-13 13:33:09 +01:00
Kleissner
ca58296e65 UDT: Fix race condition 'send on closed channel' by introducing a separate termination signal. 2021-12-13 13:30:23 +01:00
Kleissner
388343dc3e Version Alpha 5. 2021-12-13 04:16:02 +01:00
Kleissner
ecef7b5fb8 Webapi: Live implementation of search and explore. Removed dummy code. 2021-12-13 04:07:38 +01:00
Kleissner
8c8a901a31 Search: Deduplication of file IDs if found via multiple search terms. 2021-12-13 04:02:17 +01:00
Kleissner
359387af0d Search index: Change unindexing algorithm on entire blockchain level instead of version+block number. Fixing bug in unindexing. 2021-12-13 02:15:55 +01:00
Kleissner
f9c661b003 Search index: Add blockchain version to the records. 2021-12-13 00:05:54 +01:00
Kleissner
d494d46410 🔍 search algorithm! 🎉🎊🥳 2021-12-12 19:12:01 +01:00
Kleissner
0cd4519688 Send Announcement instead of ping in case blockchain info was not refreshed within a certain threshold. This helps to keep the global blockchain cache active, with no additional overhead. Close #78 2021-12-12 01:06:55 +01:00
Kleissner
ea31af1f6e Fix bug in packetGarbage 2021-12-11 22:25:54 +01:00
Kleissner
9f2783349e Fix race condition in UDT, check if socket is nil before closing it 2021-12-11 21:43:06 +01:00
Kleissner
c12b68c35c Update blockchain height to 64-bits according to the Whitepaper 0.9.2. Close #74 2021-12-11 20:43:38 +01:00
Kleissner
5db25f2704 Minor fix for mobile: Explicitly cast length to uint64 so it works on stupid systems (32-bit) as well 2021-12-11 18:46:43 +01:00
Kleissner
c8e0d1cfbe Blockchain: New TargetBlockSize which is honored for files and profile fields. Close #80, close #75 2021-12-11 18:07:48 +01:00
Kleissner
15e46133c7 Global Blockchain Cache implementation. Automatically download other blockchains based on the limits in the config.
Started with a unified backend struct. Long term all lose vars should be put there, which in term will support multiple concurrent Peernet instances (users) within the same process.
2021-12-11 14:55:02 +01:00
Kleissner
1ece19709e Store: New Count() function to return count of all records stored. 2021-12-11 13:00:49 +01:00
Kleissner
d2bde58d4b Get Block message: BlockTransferReadBlock validate limit. Fix in startBlockTransfer. New high-level function BlockDownload to download requested blocks. 2021-12-11 12:59:50 +01:00
Kleissner
b65f53611a Rename file to clarify 2021-12-11 04:03:35 +01:00
Kleissner
2900f06281 Add blockchain multi store implementation. Close #73 2021-12-11 03:58:23 +01:00
b83a48bf44 added .idea/ to gitignore 2021-12-09 14:10:58 +04:00
Kleissner
c2af2fe5e7 Housekeeping, renaming few things for clarification. 2021-12-08 20:55:17 +01:00
Kleissner
4aa15d6a78 Minor fix in test code 2021-12-08 04:19:04 +01:00
Kleissner
a26900755b UDT: Resend NAKs every SynTime until missing packets are received. Fix #70
Fix additional divide by 0 bug
2021-12-08 04:09:48 +01:00
Kleissner
85dcb9d256 UDT: Multiplexer pass down external termination signal. This makes sure any socket reader will return with EOF and does not hang.
Change transferSequenceTimeout to 1 minute which is more appropriate.
2021-12-08 01:36:50 +01:00
Kleissner
34e48c09df UDT bug: Fix #68 fillDataToMTU, appended slice was not returned. 2021-12-04 03:52:34 +01:00
Kleissner
c63f5543f6 Implement protocol.CommandGetBlock. Close #33 2021-12-04 03:17:28 +01:00
Kleissner
65f1d4eab7 Blockchain: Add functions GetBlockRaw and DecodeBlockRaw 2021-12-04 03:09:27 +01:00
Kleissner
66e890ff08 Protocol: Add encoding of Get Block message. 2021-12-04 03:03:11 +01:00
Kleissner
50ec1c804e Proper abstraction of virtualPacketConn. It now supports other transport protocol encodings. 2021-12-04 02:56:14 +01:00
Kleissner
68d8c11872 Refactor file transfer header encoding into protocol sub-module. 2021-11-30 03:53:19 +01:00
Kleissner
e648f80e31 webapi: /file/read and /file/view serve file from warehouse if available. 2021-11-29 17:51:22 +01:00
Kleissner
1be95b46fd webapi: Add documentation about file type and format. 2021-11-29 03:13:15 +01:00
Kleissner
e10ece7358 Blockchain: blockchain.IterateDeleteRecord decode all records at once, fixing multiple issues with file tags that could result in corrupted or orphaned records. Fix #66, fix #37, fix #38 2021-11-29 02:06:51 +01:00
Kleissner
d7f66474ef Blockchain: Fix bug in encodeBlockRecordFiles. Virtual tags were mistakenly counted, resulting in corruption. 2021-11-29 01:52:25 +01:00
Kleissner
ffc558b7f2 Change file permission of config file to 666 😈 when creating it. This is consistent with the log file. 2021-11-28 22:05:27 +01:00
Kleissner
793e586234 webapi: Set merkle fields of file records when adding files to the blockchain. 2021-11-28 22:03:08 +01:00
Kleissner
e5c2d8d91d Protocol change: Implement merkle tree for files and store root hash and fragment size in the blockchain. 2021-11-28 21:59:52 +01:00
Kleissner
05a31cf3af Warehouse: Automatically create .merkle companion files to store the entire merkle tree. Close #48
Pregenerating this means that fragments can be serve immediately with 0 hash calculation needed.
2021-11-28 21:52:30 +01:00
Kleissner
5ad8586cd4 Merkle: Define MinimumFragmentSize. Split code into ReadMerkleTreeHeader function. #48 2021-11-28 20:47:01 +01:00
Kleissner
d5b95542e6 Rename fragment to merkle #48 2021-11-27 14:57:19 +01:00
Kleissner
954afb2c12 Merkle tree: export/import functions. #48 2021-11-27 05:30:20 +01:00
Kleissner
c7665d7385 Merkle Tree create verification hashes and implementation of validation function. #48 2021-11-27 02:30:31 +01:00
Kleissner
19971c629d Merkle tree creation. #48 2021-11-27 00:53:39 +01:00