distributed-state-network 0.5.0__tar.gz → 0.5.2__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.0 → distributed_state_network-0.5.2}/PKG-INFO +1 -1
- {distributed_state_network-0.5.0 → distributed_state_network-0.5.2}/documentation/ds-node-config.md +2 -0
- {distributed_state_network-0.5.0 → distributed_state_network-0.5.2}/pyproject.toml +1 -1
- {distributed_state_network-0.5.0 → distributed_state_network-0.5.2}/src/distributed_state_network/dsnode.py +4 -4
- {distributed_state_network-0.5.0 → distributed_state_network-0.5.2}/src/distributed_state_network/handler.py +1 -1
- {distributed_state_network-0.5.0 → distributed_state_network-0.5.2}/src/distributed_state_network/objects/config.py +2 -0
- {distributed_state_network-0.5.0 → distributed_state_network-0.5.2}/tests/connections.py +2 -1
- {distributed_state_network-0.5.0 → distributed_state_network-0.5.2}/.github/workflows/publish.yml +0 -0
- {distributed_state_network-0.5.0 → distributed_state_network-0.5.2}/.gitignore +0 -0
- {distributed_state_network-0.5.0 → distributed_state_network-0.5.2}/LICENSE +0 -0
- {distributed_state_network-0.5.0 → distributed_state_network-0.5.2}/README.md +0 -0
- {distributed_state_network-0.5.0 → distributed_state_network-0.5.2}/coverage.sh +0 -0
- {distributed_state_network-0.5.0 → distributed_state_network-0.5.2}/documentation/ds-node-server.md +0 -0
- {distributed_state_network-0.5.0 → distributed_state_network-0.5.2}/documentation/ds-node.md +0 -0
- {distributed_state_network-0.5.0 → distributed_state_network-0.5.2}/documentation/protocol.md +0 -0
- {distributed_state_network-0.5.0 → distributed_state_network-0.5.2}/documentation/usage.md +0 -0
- {distributed_state_network-0.5.0 → distributed_state_network-0.5.2}/src/distributed_state_network/__init__.py +0 -0
- {distributed_state_network-0.5.0 → distributed_state_network-0.5.2}/src/distributed_state_network/create_key.py +0 -0
- {distributed_state_network-0.5.0 → distributed_state_network-0.5.2}/src/distributed_state_network/objects/endpoint.py +0 -0
- {distributed_state_network-0.5.0 → distributed_state_network-0.5.2}/src/distributed_state_network/objects/hello_packet.py +0 -0
- {distributed_state_network-0.5.0 → distributed_state_network-0.5.2}/src/distributed_state_network/objects/msg_types.py +0 -0
- {distributed_state_network-0.5.0 → distributed_state_network-0.5.2}/src/distributed_state_network/objects/peers_packet.py +0 -0
- {distributed_state_network-0.5.0 → distributed_state_network-0.5.2}/src/distributed_state_network/objects/signed_packet.py +0 -0
- {distributed_state_network-0.5.0 → distributed_state_network-0.5.2}/src/distributed_state_network/objects/state_packet.py +0 -0
- {distributed_state_network-0.5.0 → distributed_state_network-0.5.2}/src/distributed_state_network/util/__init__.py +0 -0
- {distributed_state_network-0.5.0 → distributed_state_network-0.5.2}/src/distributed_state_network/util/aes.py +0 -0
- {distributed_state_network-0.5.0 → distributed_state_network-0.5.2}/src/distributed_state_network/util/byte_helper.py +0 -0
- {distributed_state_network-0.5.0 → distributed_state_network-0.5.2}/src/distributed_state_network/util/ecdsa.py +0 -0
- {distributed_state_network-0.5.0 → distributed_state_network-0.5.2}/src/distributed_state_network/util/https.py +0 -0
- {distributed_state_network-0.5.0 → distributed_state_network-0.5.2}/src/distributed_state_network/util/key_manager.py +0 -0
- {distributed_state_network-0.5.0 → distributed_state_network-0.5.2}/technical.md +0 -0
- {distributed_state_network-0.5.0 → distributed_state_network-0.5.2}/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.2
|
|
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
|
{distributed_state_network-0.5.0 → distributed_state_network-0.5.2}/documentation/ds-node-config.md
RENAMED
|
@@ -12,6 +12,7 @@ from distributed_state_network import DSNodeConfig
|
|
|
12
12
|
class DSNodeConfig:
|
|
13
13
|
node_id: str
|
|
14
14
|
port: int
|
|
15
|
+
credential_dir: str
|
|
15
16
|
aes_key: str
|
|
16
17
|
bootstrap_nodes: List[Endpoint]
|
|
17
18
|
```
|
|
@@ -19,6 +20,7 @@ class DSNodeConfig:
|
|
|
19
20
|
### Attributes
|
|
20
21
|
- **node_id** (`str`): Unique identifier for the node
|
|
21
22
|
- **port** (`int`): Port number for the node to listen on (UDP)
|
|
23
|
+
- **credential_dir**: (`str`) directory to store ECDSA credentials (default: "[current_directory]/credentials")
|
|
22
24
|
- **aes_key** (`str`): Hexidecimal encoded AES key for network encryption
|
|
23
25
|
- **bootstrap_nodes** (`List[Endpoint]`): List of initial nodes to connect to when joining the network
|
|
24
26
|
|
|
@@ -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.2"
|
|
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"]
|
|
@@ -49,7 +49,7 @@ class DSNode:
|
|
|
49
49
|
self.version = version
|
|
50
50
|
self.server = None # Reference to the Flask server
|
|
51
51
|
|
|
52
|
-
self.cred_manager = CredentialManager(
|
|
52
|
+
self.cred_manager = CredentialManager(config.credential_dir, config.node_id)
|
|
53
53
|
self.cred_manager.generate_keys()
|
|
54
54
|
|
|
55
55
|
self.node_states = {
|
|
@@ -212,7 +212,9 @@ class DSNode:
|
|
|
212
212
|
def send_hello(self, con: Endpoint):
|
|
213
213
|
self.logger.info(f"HELLO => {con.to_string()}")
|
|
214
214
|
|
|
215
|
-
|
|
215
|
+
pkt = self.my_hello_packet()
|
|
216
|
+
pkt.detected_address = con.address
|
|
217
|
+
payload = pkt.to_bytes()
|
|
216
218
|
content = self.send_http_request(con, MSG_HELLO, payload)
|
|
217
219
|
|
|
218
220
|
# Get the response packet
|
|
@@ -255,8 +257,6 @@ class DSNode:
|
|
|
255
257
|
|
|
256
258
|
if pkt.node_id not in self.address_book:
|
|
257
259
|
self.address_book[pkt.node_id] = pkt.connection
|
|
258
|
-
else:
|
|
259
|
-
return None
|
|
260
260
|
|
|
261
261
|
if pkt.node_id not in self.node_states:
|
|
262
262
|
self.node_states[pkt.node_id] = StatePacket(pkt.node_id, 0, b'', { })
|
|
@@ -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.2"
|
|
12
12
|
logging.basicConfig(level=logging.INFO)
|
|
13
13
|
|
|
14
14
|
# Silence Flask and Werkzeug logging
|
|
@@ -6,6 +6,7 @@ from distributed_state_network.objects.endpoint import Endpoint
|
|
|
6
6
|
@dataclass(frozen=True)
|
|
7
7
|
class DSNodeConfig:
|
|
8
8
|
node_id: str
|
|
9
|
+
credential_dir: str
|
|
9
10
|
port: int
|
|
10
11
|
aes_key: str | None
|
|
11
12
|
bootstrap_nodes: List[Endpoint]
|
|
@@ -14,6 +15,7 @@ class DSNodeConfig:
|
|
|
14
15
|
def from_dict(data: Dict) -> 'DSNodeConfig':
|
|
15
16
|
return DSNodeConfig(
|
|
16
17
|
data["node_id"],
|
|
18
|
+
data["credential_dir"] if "credential_dir" in data else "credentials",
|
|
17
19
|
data["port"],
|
|
18
20
|
data["aes_key"] if "aes_key" in data else None,
|
|
19
21
|
[Endpoint.from_json(e) for e in data["bootstrap_nodes"]]
|
|
@@ -19,7 +19,8 @@ def start_node(node_id: str, bootstrap_port: int = None, disconnect_cb: Optional
|
|
|
19
19
|
args = {
|
|
20
20
|
"node_id": node_id,
|
|
21
21
|
"port": current_port,
|
|
22
|
-
"aes_key": aes_key
|
|
22
|
+
"aes_key": aes_key,
|
|
23
|
+
"credential_dir": "credentials"
|
|
23
24
|
}
|
|
24
25
|
current_port += 1
|
|
25
26
|
if bootstrap_port is not None:
|
{distributed_state_network-0.5.0 → distributed_state_network-0.5.2}/.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.0 → distributed_state_network-0.5.2}/documentation/ds-node-server.md
RENAMED
|
File without changes
|
{distributed_state_network-0.5.0 → distributed_state_network-0.5.2}/documentation/ds-node.md
RENAMED
|
File without changes
|
{distributed_state_network-0.5.0 → distributed_state_network-0.5.2}/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
|