Commit Graph

  • fc1f0407f3 -> Alpha 3. DHT: Store and Get functions use search client. Multiple improvements in search client. Alpha parameter is now provided by init caller. StoreDataDHT add closestCount parameter. Kleissner 2021-07-29 03:17:14 +02:00
  • e5d09e7086 New filter DHTSearchStatus for debug purposes. Various minor improvements and fixes. New high-level FindNode and AsyncSearch functions. Kleissner 2021-07-28 01:33:33 +02:00
  • 891e621e8a DHT: Add Search Client which runs the search in concurrent levels. This means faster results. Add function FilterSearchStatus to get notified on the status of searches for debugging. FindNode uses the new search client. Kleissner 2021-07-28 01:28:31 +02:00
  • 66ebf7c91e New DHT function IsNodeContact to check if node is in local routing table Kleissner 2021-07-07 02:50:12 +02:00
  • c1ccc3c344 Export PublicKey2NodeID Kleissner 2021-07-07 02:40:07 +02:00
  • 560f019786 Remove unnecessary module for dht subdirectory. This streamlines dependencies on the core module. Kleissner 2021-07-07 02:38:08 +02:00
  • 27fdafd231 Only set error filter function if not already set, which is important for callers to intercept the init messages. Kleissner 2021-07-06 13:37:27 +02:00
  • 96ee35ebf9 Finalize filter for log messages. Close #26 Kleissner 2021-06-29 00:48:22 +02:00
  • 084f3bc1ee Prepare log functions for filters. Init all filter functions by assigning empty stubs. #26 Kleissner 2021-06-28 02:37:31 +02:00
  • f5ce15d33a Initial filters for new peers and new connections. More filters to be added. #4 Kleissner 2021-06-09 22:45:43 +02:00
  • 94c8e16724 Record BlockchainHeight and BlockchainVersion for each peer. New function IsPortForward. Kleissner 2021-06-09 22:35:55 +02:00
  • 594c06e276 Implemented block encoding according to Whitepaper 0.8.2. Blocks aren't yet shared. Kleissner 2021-05-30 15:28:11 +02:00
  • 1a44b9c5e7 Include both IPv4/IPv6 addresses in peer records in Response message. This makes peer list sharing more efficient and speeds up discovery. Close #24 Kleissner 2021-05-21 02:33:32 +02:00
  • 82033e124a Finalize Traverse message implementation. Close #23 Remove createVirtualAnnouncement function, no longer needed. Kleissner 2021-05-19 14:56:39 +02:00
  • d148fddd1e Simplify and streamline send code. Close #21 Kleissner 2021-05-19 03:40:26 +02:00
  • 8e2043728c Properly count IPv4 and IPv6 networks listening (exclude link-local ones). Close #22 Kleissner 2021-05-18 23:22:11 +02:00
  • 9eb1127b40 Alpha 2 release. Includes Traverse message according to latest Whitepaper 0.8. Send and traverse code needs some cleanup. Kleissner 2021-05-11 10:33:06 +02:00
  • db1c2e358c Store Features field in peer structure Kleissner 2021-05-11 09:40:49 +02:00
  • 9f21f56896 UPnP improve filter of ineligible IPs Kleissner 2021-05-11 00:35:00 +02:00
  • db46b80e3f Move ping code to separate file (no changes) Kleissner 2021-05-09 15:37:32 +02:00
  • f084edc316 New function record.IsBadQuality to make sure bad peers returned in the Response message are not considered. Improved remote peer NAT detection. Placeholder for sending the Traverse message. Fix in handling incoming FIND_PEER request. Do not return self as closest node. Do not share peers for which the internal port is not known. Kleissner 2021-05-09 00:49:34 +02:00
  • f70875a345 Use PortReportedExternal when available. Kleissner 2021-05-08 17:25:20 +02:00
  • 530cd541c1 Add new fields Port Internal and Port External to the exchanged peer record according to the latest Whitepaper 0.7.3. This allows peers to detect each other's NAT and port forwarding status. Kleissner 2021-05-08 13:03:45 +02:00
  • 3a502a1ecc Minor UPnP improvement: Run discovery of each network in parallel. Kleissner 2021-05-07 01:05:02 +02:00
  • 5f8f299799 Working UPnP code. Close #16 Kleissner 2021-05-06 14:57:40 +02:00
  • eb0afce3f9 Fix race condition in cmdResponse. Kleissner 2021-05-06 14:54:28 +02:00
  • e929d6ba2f Make result channel buffered. Function QueueResult to queue the incoming message non-blocking. This fixes a bug (write on closed channel). Kleissner 2021-05-06 14:48:34 +02:00
  • 4df71d531f Add basic forked UPnP library. More changes upcoming. #16 Kleissner 2021-05-05 21:35:32 +02:00
  • f1da49d68e Add PortForward setting to override external listening port. Improve default config inline documentation. Prepare EnableUPnP setting. Kleissner 2021-05-04 12:43:31 +02:00
  • 0fe2ce60ec Add reported internal and external port to Connection. New function peer.IsBehindNAT. PeerlistAdd is now called on every incoming message. User Agent fixes. Kleissner 2021-05-04 01:13:11 +02:00
  • 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. Kleissner 2021-05-03 14:05:07 +02:00
  • 948fa2be91 Add placeholder for future code Kleissner 2021-05-03 11:00:17 +02:00
  • 1e7bb0c40c Fix #19 IPv4 address format in byte form Kleissner 2021-04-25 22:12:59 +02:00
  • 250f60a4b6 New flag: IsRootPeer. Rearranged initialization priority (initNetwork should always be last). Kleissner 2021-04-25 05:34:00 +02:00
  • 35f50230cd Add 2 root peers. New seed list auto update. Kleissner 2021-04-25 04:40:45 +02:00
  • f13695709f Kademlia: Initial bucket refresh implementation. This might be improved down the road. Kleissner 2021-04-25 04:22:10 +02:00
  • 611dfa3b1c RefreshBuckets: Use self ID on bucket 0. Kleissner 2021-04-25 03:44:52 +02:00
  • 1c03afd63b Fix: Check if channel is closed. Kleissner 2021-04-25 00:07:53 +02:00
  • 63e736486a Implement auto refresh of buckets. Close #11 Kleissner 2021-04-24 23:06:08 +02:00
  • 6693d442a6 Add function dht.RefreshBuckets. Use RW mutex for accessing hash table. Kleissner 2021-04-24 22:42:39 +02:00
  • 146bb6991e Proper ShouldEvict implementation Kleissner 2021-04-22 06:11:39 +02:00
  • 27152cb145 Provide old and new peer in ShouldEvict. New comparison function IsNodeCloser. Remove unused code (which was likely buggy anyway). Kleissner 2021-04-22 05:45:46 +02:00
  • 4b905f4eab Enable local peer discovery for public IPv4s for now. Kleissner 2021-04-21 03:42:46 +02:00
  • ec809029d8 Sequences add pointer to high-level data. Proper mapping of sequences to information requests. Kleissner 2021-04-21 03:27:03 +02:00
  • e432696ad1 dht.Get return sender's nodeID Kleissner 2021-04-21 03:06:30 +02:00
  • 8a33f19986 Remove unnecessary ListIR. Removes complexity. Kleissner 2021-04-21 02:49:31 +02:00
  • 0dd9ef028b Fix race condition in sequence validation and invalidation. Once they are now checked, they can be immediately invalidated. Kleissner 2021-04-20 17:20:55 +02:00
  • 8269219cf0 Fix sendAllNetworks: New sequence number per packet Kleissner 2021-04-20 07:18:46 +02:00
  • 62c4b370fc New announcementPacket structure to report back values up the chain Kleissner 2021-04-20 05:25:56 +02:00
  • 8bb1a3bdf7 GetRTT function Kleissner 2021-04-19 15:32:14 +02:00
  • 1eb4f4083b Implement SEQUENCE_LAST flag Kleissner 2021-04-19 15:05:17 +02:00
  • b2db81143e Proper message sequence implementation for Response and Pong messages. Record round-trip time at connection level! Reply timeout. Close #13 #5 Fixes. Kleissner 2021-04-19 05:18:07 +02:00
  • 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. Kleissner 2021-04-18 21:50:30 +02:00
  • 703e40c947 Add Sequence field #13 to packet header according to latest Whitepaper 0.7.1 The field is yet to be used. Kleissner 2021-04-18 05:22:19 +02:00
  • a82f575816 Embed IsLast indicator in bit 15 of count of peer records field Kleissner 2021-04-18 03:18:59 +02:00
  • ce2d3309af Update seed list. New function LoadConfigOut to parse main config into custom structure. Remove reuseport module file (not needed). Kleissner 2021-04-15 12:59:06 +02:00
  • 6a9d167177 Module update Kleissner 2021-04-10 16:06:55 +02:00
  • ff9804bf6d Start with the store code. Properly handle announcement requests. Add core data functions: Data2Hash, GetData, GetDataLocal, GetDataDHT, StoreDataLocal, StoreDataDHT Kleissner 2021-04-10 16:00:43 +02:00
  • 96213d4ed9 Minor fixes. dht.Store and Get work now! Kleissner 2021-04-10 15:43:56 +02:00
  • 27ec231e14 Moving store code to nested module Kleissner 2021-04-09 22:41:08 +02:00
  • e69589c5c8 Kademlia: Use information requests from updated DHT library. More testing & fixes upcoming. Kleissner 2021-04-09 16:36:35 +02:00
  • c44e57a0a0 Add information request list to DHT structure. It keeps track of requests and matches responses. Break up SendRequest into individual functions SendRequestStore and SendRequestFindNode, which improves readability. Alpha parameter must be now passed. MarkNodeAsSeen is exported. Breaking up dht.iterate and embedding into 3 functions Get, FindNode, and FindValue. Kleissner 2021-04-09 16:07:20 +02:00
  • 7927e18572 Add Connectivity documentation Kleissner 2021-04-05 18:43:59 +02:00
  • b2cbe2d066 Support for feature bits: IPv4_LISTEN and IPv6_LISTEN Share IPv4/IPv6 peer connections only if supported by the remote peer. Kleissner 2021-04-05 14:58:47 +02:00
  • d83123bf46 dht.GetClosestContacts introduce custom filter function Kleissner 2021-04-05 14:45:33 +02:00
  • f4473c6139 Add MIT license. Close #12 Note: This applies and affects only the core library. Kleissner 2021-04-05 11:01:58 +02:00
  • b8e408048c Add byte to Announcement/Response to inform about sender's feature support. According to Whitepaper 0.7. Kleissner 2021-03-17 11:40:20 +01:00
  • ddd3f65187 Fix in msgEncodeResponse when multiple peers are returned in a Response message Kleissner 2021-03-17 02:56:17 +01:00
  • 75c0d12850 Adding initial 2 root peers. The Peernet network is live! 16.03.2021 Kleissner 2021-03-16 23:04:28 +01:00
  • 8d2a94d078 Add go module for core package Kleissner 2021-03-16 22:31:22 +01:00
  • 8b329f7258 Enable go module for sub packages Kleissner 2021-03-16 22:19:15 +01:00
  • caf3a4f11c initSeedList skip if self Kleissner 2021-03-16 19:59:54 +01:00
  • 81fd372b0a contactArbitraryPeer only if not already in peer list. Remove nodes from Kademlia structure when appropriate. Kleissner 2021-03-16 15:55:13 +01:00
  • e8b53051f2 Convert tabs to white spaces Kleissner 2021-03-16 14:36:17 +01:00
  • 842d5c7c7b Add use paragraph to readme Kleissner 2021-03-16 14:35:16 +01:00
  • cfb0129152 Forking dependency reuseport. Close #8 Kleissner 2021-03-16 14:24:37 +01:00
  • 3080119fc1 Initial working Kademlia network - peer list exchange is working! Using the announcement and response messages to exchange peer lists. Fixes in encoding. Add arbitrary Info structure to DHT Lite/Node. Kleissner 2021-03-15 22:25:05 +01:00
  • 323f379ee7 Message encoding of announcement and response messages. More changes coming. Rename of organization to Peernet s.r.o. InformationRequest proper termination signal. Kleissner 2021-03-14 04:30:57 +01:00
  • f120971944 Initial code of DHT Lite. Requires more testing and iterations (pun intended). Kleissner 2021-03-08 03:15:52 +01:00
  • b5395d9186 DHT: Add in-memory store. Kleissner 2021-03-06 12:45:20 +01:00
  • 5ff6b5ccc1 DHT: Starting with the fork, initially only the hash table. The distributed part follows. Kleissner 2021-03-06 11:55:37 +01:00
  • 73e1643548 Network detection proper action on IP new and remove. Close #2 Kleissner 2021-03-02 13:40:29 +01:00
  • 76e4114be9 Network start listening on new interfaces #2 Removal from listening IP map Kleissner 2021-03-02 04:48:08 +01:00
  • 56a24b8b64 Termination of networks upon removal of their network adapter. Kleissner 2021-03-02 04:14:22 +01:00
  • 213c724016 Detect network changes, initial code. Actions to be developed. #2 Kleissner 2021-03-02 00:28:03 +01:00
  • c34adc472c Prevent link-local to non-link-local connections for multicast and broadcast. Kleissner 2021-03-01 04:13:18 +01:00
  • fec5644b9f Connections: Introduce Redundant type to lower ping overhead. Kleissner 2021-03-01 03:41:26 +01:00
  • ce831b31b6 Connection status field Kleissner 2021-03-01 01:37:39 +01:00
  • dcc7464f46 New function IsNetworkErrorFatal to invalidate connections on fatal network errors. Use connection.Expires field to trigger removal of inactive connections after a while. Kleissner 2021-03-01 01:05:37 +01:00
  • 9086e201c3 Minor change: New networkWire.unicast field which might be handy in the future. Kleissner 2021-03-01 01:01:44 +01:00
  • 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. Kleissner 2021-02-28 20:59:39 +01:00
  • aca6d65044 Introduce default configuration file which is embedded into the binary. Proper LoadConfig function with error status. Close #1 Separate InitLog function with error return. Kleissner 2021-02-28 14:46:16 +01:00
  • ea05439262 No code changes; export some functions/struct. Kleissner 2021-02-26 14:45:16 +01:00
  • fec65603f5 Initial commit. Kleissner 2021-02-26 05:57:42 +01:00