distributed-state-network 0.5.2__tar.gz → 0.5.3__tar.gz
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.
- {distributed_state_network-0.5.2 → distributed_state_network-0.5.3}/PKG-INFO +1 -1
- {distributed_state_network-0.5.2 → distributed_state_network-0.5.3}/pyproject.toml +1 -1
- {distributed_state_network-0.5.2 → distributed_state_network-0.5.3}/src/distributed_state_network/dsnode.py +5 -6
- {distributed_state_network-0.5.2 → distributed_state_network-0.5.3}/src/distributed_state_network/handler.py +1 -1
- {distributed_state_network-0.5.2 → distributed_state_network-0.5.3}/src/distributed_state_network/objects/config.py +3 -1
- {distributed_state_network-0.5.2 → distributed_state_network-0.5.3}/tests/connections.py +1 -0
- {distributed_state_network-0.5.2 → distributed_state_network-0.5.3}/.github/workflows/publish.yml +0 -0
- {distributed_state_network-0.5.2 → distributed_state_network-0.5.3}/.gitignore +0 -0
- {distributed_state_network-0.5.2 → distributed_state_network-0.5.3}/LICENSE +0 -0
- {distributed_state_network-0.5.2 → distributed_state_network-0.5.3}/README.md +0 -0
- {distributed_state_network-0.5.2 → distributed_state_network-0.5.3}/coverage.sh +0 -0
- {distributed_state_network-0.5.2 → distributed_state_network-0.5.3}/documentation/ds-node-config.md +0 -0
- {distributed_state_network-0.5.2 → distributed_state_network-0.5.3}/documentation/ds-node-server.md +0 -0
- {distributed_state_network-0.5.2 → distributed_state_network-0.5.3}/documentation/ds-node.md +0 -0
- {distributed_state_network-0.5.2 → distributed_state_network-0.5.3}/documentation/protocol.md +0 -0
- {distributed_state_network-0.5.2 → distributed_state_network-0.5.3}/documentation/usage.md +0 -0
- {distributed_state_network-0.5.2 → distributed_state_network-0.5.3}/src/distributed_state_network/__init__.py +0 -0
- {distributed_state_network-0.5.2 → distributed_state_network-0.5.3}/src/distributed_state_network/create_key.py +0 -0
- {distributed_state_network-0.5.2 → distributed_state_network-0.5.3}/src/distributed_state_network/objects/endpoint.py +0 -0
- {distributed_state_network-0.5.2 → distributed_state_network-0.5.3}/src/distributed_state_network/objects/hello_packet.py +0 -0
- {distributed_state_network-0.5.2 → distributed_state_network-0.5.3}/src/distributed_state_network/objects/msg_types.py +0 -0
- {distributed_state_network-0.5.2 → distributed_state_network-0.5.3}/src/distributed_state_network/objects/peers_packet.py +0 -0
- {distributed_state_network-0.5.2 → distributed_state_network-0.5.3}/src/distributed_state_network/objects/signed_packet.py +0 -0
- {distributed_state_network-0.5.2 → distributed_state_network-0.5.3}/src/distributed_state_network/objects/state_packet.py +0 -0
- {distributed_state_network-0.5.2 → distributed_state_network-0.5.3}/src/distributed_state_network/util/__init__.py +0 -0
- {distributed_state_network-0.5.2 → distributed_state_network-0.5.3}/src/distributed_state_network/util/aes.py +0 -0
- {distributed_state_network-0.5.2 → distributed_state_network-0.5.3}/src/distributed_state_network/util/byte_helper.py +0 -0
- {distributed_state_network-0.5.2 → distributed_state_network-0.5.3}/src/distributed_state_network/util/ecdsa.py +0 -0
- {distributed_state_network-0.5.2 → distributed_state_network-0.5.3}/src/distributed_state_network/util/https.py +0 -0
- {distributed_state_network-0.5.2 → distributed_state_network-0.5.3}/src/distributed_state_network/util/key_manager.py +0 -0
- {distributed_state_network-0.5.2 → distributed_state_network-0.5.3}/technical.md +0 -0
- {distributed_state_network-0.5.2 → distributed_state_network-0.5.3}/tests/test.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: distributed-state-network
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.3
|
|
4
4
|
Summary: A tool to distribute the state of a network device to other devices on the network
|
|
5
5
|
Project-URL: Homepage, https://github.com/erinclemmer/distributed_state_network
|
|
6
6
|
Project-URL: Issues, https://github.com/erinclemmer/distributed_state_network/issues
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "distributed-state-network"
|
|
7
|
-
version = "0.5.
|
|
7
|
+
version = "0.5.3"
|
|
8
8
|
authors = [{name="Erin Clemmer", email="erin.c.clemmer@gmail.com"}]
|
|
9
9
|
description = "A tool to distribute the state of a network device to other devices on the network"
|
|
10
10
|
keywords = ["distributed", "networking"]
|
|
@@ -56,10 +56,8 @@ class DSNode:
|
|
|
56
56
|
self.config.node_id: StatePacket.create(self.config.node_id, time.time(), self.cred_manager.my_private(), { })
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
# Determine initial IP - use 127.0.0.1 for localhost, will be updated when connecting to remote nodes
|
|
60
|
-
initial_ip = "127.0.0.1"
|
|
61
59
|
self.address_book = {
|
|
62
|
-
self.config.node_id: Endpoint(
|
|
60
|
+
self.config.node_id: Endpoint(self.config.network_ip, config.port)
|
|
63
61
|
}
|
|
64
62
|
|
|
65
63
|
self.logger = logging.getLogger("DSN: " + config.node_id)
|
|
@@ -96,6 +94,7 @@ class DSNode:
|
|
|
96
94
|
return
|
|
97
95
|
self.send_ping(node_id)
|
|
98
96
|
except Exception:
|
|
97
|
+
self.logger.error(f"PING Failure for {node_id}")
|
|
99
98
|
if node_id in self.node_states: # double check if something has changed since the ping request started
|
|
100
99
|
remove(node_id)
|
|
101
100
|
if self.disconnect_cb is not None:
|
|
@@ -189,7 +188,7 @@ class DSNode:
|
|
|
189
188
|
|
|
190
189
|
if key not in self.node_states:
|
|
191
190
|
self.send_hello(self.address_book[key])
|
|
192
|
-
|
|
191
|
+
|
|
193
192
|
node_state = self.send_update(key)
|
|
194
193
|
self.handle_update(node_state)
|
|
195
194
|
|
|
@@ -203,6 +202,8 @@ class DSNode:
|
|
|
203
202
|
|
|
204
203
|
peers = { }
|
|
205
204
|
for key in self.address_book.keys():
|
|
205
|
+
if key == self.config.node_id:
|
|
206
|
+
continue
|
|
206
207
|
peers[key] = self.address_book[key]
|
|
207
208
|
|
|
208
209
|
pkt = PeersPacket(self.config.node_id, None, peers)
|
|
@@ -213,7 +214,6 @@ class DSNode:
|
|
|
213
214
|
self.logger.info(f"HELLO => {con.to_string()}")
|
|
214
215
|
|
|
215
216
|
pkt = self.my_hello_packet()
|
|
216
|
-
pkt.detected_address = con.address
|
|
217
217
|
payload = pkt.to_bytes()
|
|
218
218
|
content = self.send_http_request(con, MSG_HELLO, payload)
|
|
219
219
|
|
|
@@ -306,7 +306,6 @@ class DSNode:
|
|
|
306
306
|
|
|
307
307
|
if pkt.node_id not in self.node_states:
|
|
308
308
|
self.node_states[pkt.node_id] = pkt
|
|
309
|
-
return
|
|
310
309
|
|
|
311
310
|
if get_dict_hash(self.node_states[pkt.node_id].state_data) != get_dict_hash(pkt.state_data):
|
|
312
311
|
self.node_states[pkt.node_id] = pkt
|
|
@@ -8,7 +8,7 @@ from distributed_state_network.objects.config import DSNodeConfig
|
|
|
8
8
|
from distributed_state_network.util.aes import generate_aes_key
|
|
9
9
|
from distributed_state_network.util import stop_thread
|
|
10
10
|
|
|
11
|
-
VERSION = "0.5.
|
|
11
|
+
VERSION = "0.5.3"
|
|
12
12
|
logging.basicConfig(level=logging.INFO)
|
|
13
13
|
|
|
14
14
|
# Silence Flask and Werkzeug logging
|
|
@@ -8,6 +8,7 @@ class DSNodeConfig:
|
|
|
8
8
|
node_id: str
|
|
9
9
|
credential_dir: str
|
|
10
10
|
port: int
|
|
11
|
+
network_ip: str
|
|
11
12
|
aes_key: str | None
|
|
12
13
|
bootstrap_nodes: List[Endpoint]
|
|
13
14
|
|
|
@@ -16,7 +17,8 @@ class DSNodeConfig:
|
|
|
16
17
|
return DSNodeConfig(
|
|
17
18
|
data["node_id"],
|
|
18
19
|
data["credential_dir"] if "credential_dir" in data else "credentials",
|
|
19
|
-
data["port"],
|
|
20
|
+
data["port"],
|
|
21
|
+
data["network_ip"] if "network_ip" in data else "127.0.0.1",
|
|
20
22
|
data["aes_key"] if "aes_key" in data else None,
|
|
21
23
|
[Endpoint.from_json(e) for e in data["bootstrap_nodes"]]
|
|
22
24
|
)
|
{distributed_state_network-0.5.2 → distributed_state_network-0.5.3}/.github/workflows/publish.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{distributed_state_network-0.5.2 → distributed_state_network-0.5.3}/documentation/ds-node-config.md
RENAMED
|
File without changes
|
{distributed_state_network-0.5.2 → distributed_state_network-0.5.3}/documentation/ds-node-server.md
RENAMED
|
File without changes
|
{distributed_state_network-0.5.2 → distributed_state_network-0.5.3}/documentation/ds-node.md
RENAMED
|
File without changes
|
{distributed_state_network-0.5.2 → distributed_state_network-0.5.3}/documentation/protocol.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|