simpledht 0.1.3__py3-none-any.whl → 0.1.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
simpledht/__init__.py CHANGED
@@ -20,7 +20,7 @@ Example usage:
20
20
  node.bootstrap('other_node_ip:5000')
21
21
  """
22
22
 
23
- __version__ = "0.1.3"
23
+ __version__ = "0.1.4"
24
24
 
25
25
  from .dht_node import DHTNode
26
26
  from .cli import main as cli_main
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: simpledht
3
- Version: 0.1.3
3
+ Version: 0.1.4
4
4
  Summary: A simple distributed hash table implementation
5
5
  Home-page: https://github.com/dhruvldrp9/simpledht
6
6
  Author: Dhruvkumar Patel
@@ -53,7 +53,7 @@ pip install simpledht
53
53
 
54
54
  1. Clone the repository:
55
55
  ```bash
56
- git clone <repository-url>
56
+ git clone https://github.com/dhruvldrp9/SimpleDHT
57
57
  cd SimpleDHT
58
58
  ```
59
59
 
@@ -103,48 +103,50 @@ See the `examples/` directory for more detailed usage examples:
103
103
  #### Starting a Node
104
104
 
105
105
  To start a new DHT node:
106
+
106
107
  ```bash
107
- simpledht start --host 0.0.0.0 --port 5000
108
+ python -m simpledht.cli start --host 0.0.0.0 --port 5000
108
109
  ```
109
110
 
110
111
  To start a node and connect to existing nodes:
112
+
111
113
  ```bash
112
- simpledht start --host 0.0.0.0 --port 5001 --bootstrap "PUBLIC_IP:5000"
114
+ python -m simpledht.cli start --host 0.0.0.0 --port 5001 --bootstrap "PUBLIC_IP:5000"
113
115
  ```
114
116
 
115
117
  #### Storing Data
116
118
 
117
119
  To store a key-value pair:
120
+
118
121
  ```bash
119
- simpledht put --host PUBLIC_IP --port 5000 mykey "my value"
122
+ python -m simpledht.cli put --host PUBLIC_IP --port 5000 mykey "my value"
120
123
  ```
121
124
 
122
125
  #### Retrieving Data
123
126
 
124
- To retrieve a value:
125
127
  ```bash
126
- simpledht get --host PUBLIC_IP --port 5000 mykey
128
+ python -m simpledht.cli get --host PUBLIC_IP --port 5000 mykey
127
129
  ```
128
130
 
129
131
  ### Cross-Network Example
130
132
 
131
133
  1. Start Node 1 (First network):
132
134
  ```bash
133
- simpledht start --host 0.0.0.0 --port 5000
135
+ python -m simpledht.cli start --host 0.0.0.0 --port 5000
134
136
  ```
135
137
 
136
138
  2. Start Node 2 (Second network):
137
139
  ```bash
138
- simpledht start --host 0.0.0.0 --port 5000 --bootstrap "NODE1_PUBLIC_IP:5000"
140
+ python -m simpledht.cli start --host 0.0.0.0 --port 5000 --bootstrap "NODE1_PUBLIC_IP:5000"
139
141
  ```
140
142
 
141
143
  3. Store and retrieve data:
142
144
  ```bash
143
145
  # Store on Node 1
144
- simpledht put --host NODE1_PUBLIC_IP --port 5000 test_key "test_value"
146
+ python -m simpledht.cli put --host NODE1_PUBLIC_IP --port 5000 test_key "test_value"
145
147
 
146
148
  # Retrieve from Node 2
147
- simpledht get --host NODE2_PUBLIC_IP --port 5000 test_key
149
+ python -m simpledht.cli get --host NODE2_PUBLIC_IP --port 5000 test_key
148
150
  ```
149
151
 
150
152
  ## Network Configuration
@@ -168,12 +170,13 @@ If your node is behind a NAT router:
168
170
  2. Set up port forwarding for UDP port 5000
169
171
  3. Forward to your node's local IP address
170
172
 
171
- ## New Features in Version 0.1.2
173
+ ## New Features in Version 0.1.3
172
174
 
173
175
  - **Improved Bootstrap Mechanism**: Added retry logic for more reliable connections across networks
174
176
  - **Data Synchronization**: Nodes automatically sync data when joining the network
175
177
  - **Enhanced Error Handling**: Better handling of network timeouts and connection issues
176
178
  - **Full Data Replication**: All nodes maintain a complete copy of the data for redundancy
179
+ - **Alternative Command Method**: Added support for running via `python -m simpledht.cli`
177
180
 
178
181
  ## Troubleshooting
179
182
 
@@ -202,6 +205,7 @@ If your node is behind a NAT router:
202
205
  - `Address already in use`: Port conflict
203
206
  - `Failed to get public IP`: Network connectivity issue
204
207
  - `Connection attempt X/3 timed out, retrying...`: Network latency or connectivity issues
208
+ - `simpledht: command not found`: The command-line tool is not in your PATH. Use the Python module directly: `python -m simpledht.cli`
205
209
 
206
210
  ## Architecture
207
211
 
@@ -0,0 +1,10 @@
1
+ simpledht/__init__.py,sha256=wKPkOXmeKWw7EGzWO8OfiniWd9tdJ2ALL0Ee4pc-ZKw,546
2
+ simpledht/cli.py,sha256=9QgsyZv1-SKwblj2hYLsGKRjiCyBFjlGalafdqhoXrk,4877
3
+ simpledht/dht_node.py,sha256=58fd7Yq8gPLVbHaaJMW-9gnrC2YjPMF0EtD3I81EI6Q,14864
4
+ simpledht/test_dht.py,sha256=tsWGhtLkTArFJIdkaWManekhFx2KCUO0Gp93EGBUAlw,2346
5
+ simpledht-0.1.4.dist-info/licenses/LICENSE,sha256=MrSAzCY_7J3C4Hp8PaXaaFJP2ygfmuAWoLTVowEE3B0,1073
6
+ simpledht-0.1.4.dist-info/METADATA,sha256=yhcyaR_fM-5u2NoyzKgezVwb1AwSPuupgZrL-IpTB_M,6151
7
+ simpledht-0.1.4.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
8
+ simpledht-0.1.4.dist-info/entry_points.txt,sha256=Hm3BYz1MykAhg94m3JSYsMcdEQEia3bdRocokc-0wxs,49
9
+ simpledht-0.1.4.dist-info/top_level.txt,sha256=VjRxeoXfQJeoPoFhr5JGGMAI5NSLkYJl0WbySmpZ4bs,10
10
+ simpledht-0.1.4.dist-info/RECORD,,
@@ -1,10 +0,0 @@
1
- simpledht/__init__.py,sha256=j0WY2O6SGOuBS3CVdz_u-9R-fIoR6ArZ3XfP2qIrWMc,546
2
- simpledht/cli.py,sha256=9QgsyZv1-SKwblj2hYLsGKRjiCyBFjlGalafdqhoXrk,4877
3
- simpledht/dht_node.py,sha256=58fd7Yq8gPLVbHaaJMW-9gnrC2YjPMF0EtD3I81EI6Q,14864
4
- simpledht/test_dht.py,sha256=tsWGhtLkTArFJIdkaWManekhFx2KCUO0Gp93EGBUAlw,2346
5
- simpledht-0.1.3.dist-info/licenses/LICENSE,sha256=MrSAzCY_7J3C4Hp8PaXaaFJP2ygfmuAWoLTVowEE3B0,1073
6
- simpledht-0.1.3.dist-info/METADATA,sha256=cnSOqwQOc4hZAT7w2QGolEvcz0Op_3PLHELYhKYIIfI,5809
7
- simpledht-0.1.3.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
8
- simpledht-0.1.3.dist-info/entry_points.txt,sha256=Hm3BYz1MykAhg94m3JSYsMcdEQEia3bdRocokc-0wxs,49
9
- simpledht-0.1.3.dist-info/top_level.txt,sha256=VjRxeoXfQJeoPoFhr5JGGMAI5NSLkYJl0WbySmpZ4bs,10
10
- simpledht-0.1.3.dist-info/RECORD,,