Commit Graph

42 Commits

Author SHA1 Message Date
Kleissner
f305e5b158 Lite Packet algorithm for data transfer. It bypasses the CPU expensive Peernet Protocol packet encoding (which uses public key signing). 2022-01-17 03:48:40 +01:00
Kleissner
6a5312d834 New config field LogTarget. Simplified function backend.LogError. 2022-01-12 22:18:34 +01:00
Kleissner
f2c344dc96 Major refactoring of the code base into Backend structure. Increase version number to Alpha 6 to prepare for the upcoming release. 2021-12-29 05:29:34 +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
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
c63f5543f6 Implement protocol.CommandGetBlock. Close #33 2021-12-04 03:17:28 +01:00
Kleissner
f7e8f1821b New flag Firewall in the Features field to inform uncontacted peers that a Traverse message might be required to establish a connection. Close #61
This flag can be activated via the config setting LocalFirewall.
The Features field exists in Announcement/Response messages and was now added to peer records.
2021-11-20 04:28:03 +01:00
Kleissner
75e3d9a42e Initial UDT implementation for file transfer.
New function RequestFileTransferUDT to download files from other peers.
2021-10-24 04:26:30 +02:00
Kleissner
c9d9be2972 Refactor message encoding into protocol package. User Agent must be now provided in the Init function. 2021-10-18 04:37:02 +02:00
Kleissner
f1e8e0cab8 Finally moving Sequence code into protocol package 2021-10-18 02:41:55 +02:00
Kleissner
5d93a74981 Collecting network vars and functions in networks structure 2021-10-18 02:12:36 +02:00
Kleissner
e2542b3a4d Create struct ipList from ip listening list 2021-10-18 01:10:40 +02:00
Kleissner
1b9151d6fd Refactor sequence code into SequenceManager 2021-10-17 21:34:30 +02:00
Kleissner
767181620e Prepare refactoring of sequence code 2021-10-17 20:02:35 +02:00
Kleissner
1b93eac17a Moving FeatureSupport() and UserBlockchain.Header() calls out of Message Encoding.
This paves the way for refactoring the message code into the protocol package.
2021-10-17 17:40:22 +02:00
Kleissner
93f10fd3b5 Untangle connection from MessageRaw, paving the way for refactoring the message code into the protocol package. 2021-10-17 16:39:41 +02:00
Kleissner
0c7b1e0e03 Start refactoring protocol code into sub package. Move Packet Encoding and list of Commands. Change SetSelfReportedPorts parameters.
More related commits to follow!
2021-10-17 16:28:19 +02:00
Kleissner
2937154c8d Add filters for low-level packet and high-level message interception for debugging purposes. Close #4 2021-07-31 17:29:14 +02:00
Kleissner
96ee35ebf9 Finalize filter for log messages. Close #26 2021-06-29 00:48:22 +02:00
Kleissner
94c8e16724 Record BlockchainHeight and BlockchainVersion for each peer. New function IsPortForward. 2021-06-09 22:35:55 +02:00
Kleissner
d148fddd1e Simplify and streamline send code. Close #21 2021-05-19 03:40:26 +02:00
Kleissner
8e2043728c Properly count IPv4 and IPv6 networks listening (exclude link-local ones). Close #22 2021-05-18 23:22:11 +02:00
Kleissner
9eb1127b40 Alpha 2 release. Includes Traverse message according to latest Whitepaper 0.8.
Send and traverse code needs some cleanup.
2021-05-11 10:33:06 +02:00
Kleissner
db1c2e358c Store Features field in peer structure 2021-05-11 09:40:49 +02:00
Kleissner
3a502a1ecc Minor UPnP improvement: Run discovery of each network in parallel. 2021-05-07 01:05:02 +02:00
Kleissner
5f8f299799 Working UPnP code. Close #16 2021-05-06 14:57:40 +02:00
Kleissner
f1da49d68e Add PortForward setting to override external listening port. Improve default config inline documentation.
Prepare EnableUPnP setting.
2021-05-04 12:43:31 +02:00
Kleissner
0fe2ce60ec Add reported internal and external port to Connection. New function peer.IsBehindNAT.
PeerlistAdd is now called on every incoming message. User Agent fixes.
2021-05-04 01:13:11 +02:00
Kleissner
f3c9d5e17f Add new fields Port Internal and Port External to the Announcement/Response message according to the latest Whitepaper 0.7.3.
These fields will be used for NAT detection and UPnP support.
2021-05-03 14:05:07 +02:00
Kleissner
0dd9ef028b Fix race condition in sequence validation and invalidation. Once they are now checked, they can be immediately invalidated. 2021-04-20 17:20:55 +02:00
Kleissner
1eb4f4083b Implement SEQUENCE_LAST flag 2021-04-19 15:05:17 +02:00
Kleissner
b2db81143e Proper message sequence implementation for Response and Pong messages. Record round-trip time at connection level! Reply timeout. Close #13 #5
Fixes.
2021-04-19 05:18:07 +02:00
Kleissner
00db57aed8 Provide the new sequence number in responses. New message Local Discovery to be sent instead of Announcement via IPv4 Broadcast and IPv6 Multicast.
Detecting IPv6 link-local addresses as local ones. Fixes.
2021-04-18 21:50:30 +02:00
Kleissner
323f379ee7 Message encoding of announcement and response messages.
More changes coming.
Rename of organization to Peernet s.r.o.
InformationRequest proper termination signal.
2021-03-14 04:30:57 +01:00
Kleissner
76e4114be9 Network start listening on new interfaces #2
Removal from listening IP map
2021-03-02 04:48:08 +01:00
Kleissner
56a24b8b64 Termination of networks upon removal of their network adapter. 2021-03-02 04:14:22 +01:00
Kleissner
213c724016 Detect network changes, initial code. Actions to be developed. #2 2021-03-02 00:28:03 +01:00
Kleissner
ce831b31b6 Connection status field 2021-03-01 01:37:39 +01:00
Kleissner
9086e201c3 Minor change: New networkWire.unicast field which might be handy in the future. 2021-03-01 01:01:44 +01:00
Kleissner
b53ab7c7b3 Reworked connection code. Pings are now regularly sent out to every connection to check if it remains valid.
Invalid connections are moved to a second list, and eventually dropped if they don't become active.
2021-02-28 20:59:39 +01:00
Kleissner
ea05439262 No code changes; export some functions/struct. 2021-02-26 14:45:16 +01:00
Kleissner
fec65603f5 Initial commit. 2021-02-26 05:57:42 +01:00