astreum 0.1.19__py3-none-any.whl → 0.2.0__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.
Potentially problematic release.
This version of astreum might be problematic. Click here for more details.
- astreum/__init__.py +1 -2
- astreum/{node → _node}/__init__.py +1 -1
- astreum/{node → _node}/relay/envelope.py +1 -1
- astreum/{node → _node}/relay/message.py +1 -1
- astreum/{node → _node}/storage/merkle.py +65 -65
- astreum/{node → _node}/storage/patricia.py +3 -3
- astreum/{node → _node}/storage/storage.py +2 -0
- astreum/{node → _node}/utils.py +1 -1
- astreum/{node → _node}/validation/account.py +3 -3
- astreum/{node → _node}/validation/transaction.py +3 -3
- astreum/lispeum/__init__.py +2 -0
- astreum/lispeum/parser.py +1 -1
- astreum/machine/environment.py +0 -25
- astreum/node.py +1021 -0
- astreum-0.2.0.dist-info/METADATA +144 -0
- astreum-0.2.0.dist-info/RECORD +57 -0
- {astreum-0.1.19.dist-info → astreum-0.2.0.dist-info}/WHEEL +1 -1
- astreum/node/storage/__init__.py +0 -13
- astreum-0.1.19.dist-info/METADATA +0 -90
- astreum-0.1.19.dist-info/RECORD +0 -57
- /astreum/{node → _node}/relay/__init__.py +0 -0
- /astreum/{node → _node}/relay/bucket.py +0 -0
- /astreum/{node → _node}/relay/peer.py +0 -0
- /astreum/{node → _node}/relay/route.py +0 -0
- /astreum/{node/crypto → _node/storage}/__init__.py +0 -0
- /astreum/{node → _node}/storage/utils.py +0 -0
- /astreum/{node → _node}/validation/__init__.py +0 -0
- /astreum/{node → _node}/validation/_block/__init__.py +0 -0
- /astreum/{node → _node}/validation/_block/create.py +0 -0
- /astreum/{node → _node}/validation/_block/model.py +0 -0
- /astreum/{node → _node}/validation/_block/validate.py +0 -0
- /astreum/{node → _node}/validation/block.py +0 -0
- /astreum/{node → _node}/validation/constants.py +0 -0
- /astreum/{node → _node}/validation/stake.py +0 -0
- /astreum/{node → _node}/validation/vdf.py +0 -0
- /astreum/{utils → crypto}/__init__.py +0 -0
- /astreum/{node/crypto → crypto}/ed25519.py +0 -0
- /astreum/{node/crypto → crypto}/x25519.py +0 -0
- /astreum/{utils/bytes_format.py → format.py} +0 -0
- {astreum-0.1.19.dist-info → astreum-0.2.0.dist-info}/licenses/LICENSE +0 -0
- {astreum-0.1.19.dist-info → astreum-0.2.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: astreum
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Python library to interact with the Astreum blockchain and its Lispeum virtual machine.
|
|
5
|
+
Author-email: "Roy R. O. Okello" <roy@stelar.xyz>
|
|
6
|
+
Project-URL: Homepage, https://github.com/astreum/lib
|
|
7
|
+
Project-URL: Issues, https://github.com/astreum/lib/issues
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.8
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Requires-Dist: pycryptodomex==3.21.0
|
|
15
|
+
Requires-Dist: cryptography==44.0.2
|
|
16
|
+
Requires-Dist: blake3==1.0.4
|
|
17
|
+
Dynamic: license-file
|
|
18
|
+
|
|
19
|
+
# Astreum Python Library
|
|
20
|
+
|
|
21
|
+
Python library to interact with the Astreum blockchain and its Lispeum virtual machine.
|
|
22
|
+
|
|
23
|
+
[View on PyPI](https://pypi.org/project/astreum/)
|
|
24
|
+
|
|
25
|
+
## Configuration
|
|
26
|
+
|
|
27
|
+
When initializing an `astreum.Node`, pass a dictionary with any of the options below. Only the parameters you want to override need to be present – everything else falls back to its default.
|
|
28
|
+
|
|
29
|
+
### Core Configuration
|
|
30
|
+
|
|
31
|
+
| Parameter | Type | Default | Description |
|
|
32
|
+
| -------------- | ---- | ------- | ----------- |
|
|
33
|
+
| `machine-only` | bool | `True` | When |
|
|
34
|
+
|
|
35
|
+
| |
|
|
36
|
+
| - |
|
|
37
|
+
|
|
38
|
+
| **True** the node starts in *machine‑only* mode: no storage subsystem and no relay networking – only the Lispeum VM. Set to **False** to enable storage and relay features. | | | |
|
|
39
|
+
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- | -------------- | ------------------------------------------------------------------------------------------------------------------------ |
|
|
40
|
+
| `relay_secret_key` | hex string | Auto‑generated | Ed25519 private key that identifies the node on the network. If omitted a fresh keypair is generated and kept in‑memory. |
|
|
41
|
+
| `validation_secret_key` | hex string | `None` | X25519 private key that lets the node participate in the validation route. Leave unset for a non‑validator node. |
|
|
42
|
+
| `storage_path` | string | `None` | Directory where objects are persisted. If *None* the node uses an in‑memory store. |
|
|
43
|
+
| `storage_get_relay_timeout` | float | `5` | Seconds to wait for an object requested from peers before timing‑out. |
|
|
44
|
+
|
|
45
|
+
### Networking
|
|
46
|
+
|
|
47
|
+
| Parameter | Type | Default | Description |
|
|
48
|
+
| --------------- | ----------------------- | ------- | ----------------------------------------------------------------------------------- |
|
|
49
|
+
| `use_ipv6` | bool | `False` | Listen on IPv6 as well as IPv4. |
|
|
50
|
+
| `incoming_port` | int | `7373` | UDP port the relay binds to. |
|
|
51
|
+
| `bootstrap` | list\[tuple\[str, int]] | `[]` | Initial peers used to join the network, e.g. `[ ("bootstrap.astreum.org", 7373) ]`. |
|
|
52
|
+
|
|
53
|
+
> **Note**
|
|
54
|
+
> The peer‑to‑peer *route* used for object discovery is always enabled.
|
|
55
|
+
> If `validation_secret_key` is provided the node automatically joins the validation route too.
|
|
56
|
+
|
|
57
|
+
### Example
|
|
58
|
+
|
|
59
|
+
```python
|
|
60
|
+
from astreum.node import Node
|
|
61
|
+
|
|
62
|
+
config = {
|
|
63
|
+
"machine-only": False, # run full node
|
|
64
|
+
"relay_secret_key": "ab…cd", # optional – hex encoded
|
|
65
|
+
"validation_secret_key": "12…34", # optional – validator
|
|
66
|
+
"storage_path": "./data/node1",
|
|
67
|
+
"storage_get_relay_timeout": 5,
|
|
68
|
+
"incoming_port": 7373,
|
|
69
|
+
"use_ipv6": False,
|
|
70
|
+
"bootstrap": [
|
|
71
|
+
("bootstrap.astreum.org", 7373),
|
|
72
|
+
("127.0.0.1", 7374)
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
node = Node(config)
|
|
77
|
+
# … your code …
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Lispeum Machine Quickstart
|
|
81
|
+
|
|
82
|
+
The Lispeum virtual machine (VM) is embedded inside `astreum.Node`. You feed it Lispeum source text, and the node tokenizes, parses, and **evaluates** the resulting AST inside an isolated *session* (lexical environment).
|
|
83
|
+
|
|
84
|
+
```python
|
|
85
|
+
from astreum.node import Node
|
|
86
|
+
from astreum.machine.tokenizer import tokenize
|
|
87
|
+
from astreum.machine.parser import parse
|
|
88
|
+
|
|
89
|
+
# 1. Spin‑up a stand‑alone VM (machine‑only node).
|
|
90
|
+
node = Node({"machine-only": True})
|
|
91
|
+
|
|
92
|
+
# 2. Create a fresh session (environment).
|
|
93
|
+
session_id = node.machine_session_create()
|
|
94
|
+
|
|
95
|
+
# 3. Convert Lispeum source → Expr AST.
|
|
96
|
+
source = '(+ 1 (* 2 3))'
|
|
97
|
+
expr, _ = parse(tokenize(source))
|
|
98
|
+
|
|
99
|
+
# 4. Evaluate inside that session.
|
|
100
|
+
env = node.sessions[session_id] # fetch the Env
|
|
101
|
+
result = node.machine_expr_eval(env, expr) # -> Expr.Integer(7)
|
|
102
|
+
|
|
103
|
+
print(result.value) # 7
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Handling errors
|
|
107
|
+
|
|
108
|
+
Both helpers raise `ParseError` (from `astreum.machine.error`) when something goes wrong:
|
|
109
|
+
|
|
110
|
+
* Unterminated string literals are caught by `tokenize` fileciteturn1file1
|
|
111
|
+
* Unexpected or missing parentheses are caught by `parse` fileciteturn1file0
|
|
112
|
+
|
|
113
|
+
Catch the exception to provide developer‑friendly diagnostics:
|
|
114
|
+
|
|
115
|
+
```python
|
|
116
|
+
try:
|
|
117
|
+
tokens = tokenize(bad_source)
|
|
118
|
+
expr, _ = parse(tokens)
|
|
119
|
+
except ParseError as e:
|
|
120
|
+
print("Parse failed:", e)
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Both helpers raise `ParseError` (from `astreum.machine.error`) when something goes wrong:
|
|
124
|
+
|
|
125
|
+
* Unterminated string literals are caught by `tokenize` fileciteturn1file1
|
|
126
|
+
* Unexpected or missing parentheses are caught by `parse` fileciteturn1file0
|
|
127
|
+
|
|
128
|
+
Catch the exception to provide developer‑friendly diagnostics:
|
|
129
|
+
|
|
130
|
+
```python
|
|
131
|
+
try:
|
|
132
|
+
tokens = tokenize(bad_source)
|
|
133
|
+
expr, _ = parse(tokens)
|
|
134
|
+
except ParseError as e:
|
|
135
|
+
print("Parse failed:", e)
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## Testing
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
python3 -m unittest discover -s tests
|
|
144
|
+
```
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
astreum/__init__.py,sha256=CmvAp8tPeAO6ZWFNCk0BZm5gcvvF6SMgNoh-g012-DY,21
|
|
2
|
+
astreum/format.py,sha256=X4tG5GGPweNCE54bHYkLFiuLTbmpy5upO_s1Cef-MGA,2711
|
|
3
|
+
astreum/node.py,sha256=2vMFFvdsXB8jIChM8x6rRJ5AOP5NIQteQGagFXeEKwQ,45283
|
|
4
|
+
astreum/_node/__init__.py,sha256=7yz1YHo0DCUgUQvJf75qdUo_ocl5-XZRU-Vc2NhcvJs,18639
|
|
5
|
+
astreum/_node/utils.py,sha256=Zj4NtbmJ9CWFO3oBvYYauwOiLcpd219qCyGvgTw9Lak,704
|
|
6
|
+
astreum/_node/relay/__init__.py,sha256=A6br8QSGLW7qmKYBJNIC4bEf5QMzLBFaa_FH3MaOJrs,15069
|
|
7
|
+
astreum/_node/relay/bucket.py,sha256=pcmollbbM-xeHlmDxLZnzvf0Ut-9v9RoN6SijYiQuu8,2893
|
|
8
|
+
astreum/_node/relay/envelope.py,sha256=PYpYPd03GqdOK7ovU35MHiWFvSTsM3fTW_ycdnB7UIM,10025
|
|
9
|
+
astreum/_node/relay/message.py,sha256=nShIJ1WUFlqLnv_AFJWLBdbuldoy-sWT2aXcXWB3zKg,2875
|
|
10
|
+
astreum/_node/relay/peer.py,sha256=DlvTR9j0BZQ1dW-p_9UGgfLvQqwNdpNLMSCYEW4FhyI,5899
|
|
11
|
+
astreum/_node/relay/route.py,sha256=fyOSsAe1mfsCVeN6LtQ_OEUEb1FiC5dobZBEJKNGU9U,5814
|
|
12
|
+
astreum/_node/storage/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
|
+
astreum/_node/storage/merkle.py,sha256=XCQBrHbwI0FuPTCUwHOy-Kva3uWbvCdw_-13hRPf1UI,10219
|
|
14
|
+
astreum/_node/storage/patricia.py,sha256=tynxn_qETCU9X7yJdeh_0GHpC8Pzcoq4CWrSZlMUeRc,11546
|
|
15
|
+
astreum/_node/storage/storage.py,sha256=K9i9_Z1z47uH_f1ZeFmyh3Xh9VyM_zdcPo1Jaj3KqeI,10096
|
|
16
|
+
astreum/_node/storage/utils.py,sha256=CxKH9GbW31aVYs2Hwg1SirCykSnH_3_JisEayDrpOvY,5169
|
|
17
|
+
astreum/_node/validation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
|
+
astreum/_node/validation/account.py,sha256=m2hEpJPzGWPL00mfbmeX15xbLqSId0fYoVDF74bNcdw,3620
|
|
19
|
+
astreum/_node/validation/block.py,sha256=KRvlpLZOmgJ3WJaSHsbk7ryh2Z1NsC2z-RWKWh1quBE,444
|
|
20
|
+
astreum/_node/validation/constants.py,sha256=ImIdLZFtMKx1iWg60YssEKl2tdDqZQnIa2JaJE6CX0o,422
|
|
21
|
+
astreum/_node/validation/stake.py,sha256=Z9EPM-X9c92fpsZIYsdVpvgz4DhxQViPM-RDktWUZq8,7141
|
|
22
|
+
astreum/_node/validation/transaction.py,sha256=T8joGoXR6hZp7i5JiYklDpJ8C-HTTT9twWNMku3caMo,4671
|
|
23
|
+
astreum/_node/validation/vdf.py,sha256=HDdnqn9O_LicfE7SNCmncawKoR-ojLyjlpn74OvRNOU,2194
|
|
24
|
+
astreum/_node/validation/_block/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
25
|
+
astreum/_node/validation/_block/create.py,sha256=apD9h92b9Y146zeppSzKNk_NJPgyBy7FhxoEkypQQNk,2515
|
|
26
|
+
astreum/_node/validation/_block/model.py,sha256=d7x3_tX2MPLnGODL_5_vNjQfLdYa405blc-zL9o8HFA,2589
|
|
27
|
+
astreum/_node/validation/_block/validate.py,sha256=niLexCNhEwUJLclyrdNZSvHcVa_J6jlu7J3FiWY7XBU,6232
|
|
28
|
+
astreum/crypto/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
29
|
+
astreum/crypto/ed25519.py,sha256=FRnvlN0kZlxn4j-sJKl-C9tqiz_0z4LZyXLj3KIj1TQ,1760
|
|
30
|
+
astreum/crypto/x25519.py,sha256=i29v4BmwKRcbz9E7NKqFDQyxzFtJUqN0St9jd7GS1uA,1137
|
|
31
|
+
astreum/lispeum/__init__.py,sha256=XgIdZNcO9AQhUF0prKZ_RdZzJ_FGedDmOelKVAI8dJk,56
|
|
32
|
+
astreum/lispeum/expression.py,sha256=3zOEoXFHpzEFUIi1clONY55WYAh5K0YkYhaLmtvQj0I,2939
|
|
33
|
+
astreum/lispeum/parser.py,sha256=cs8h-4Qb_7S-Lm5yYzwidB5RJQAKSvPhBdYaH7i4tLA,1177
|
|
34
|
+
astreum/lispeum/storage.py,sha256=l_ch4Ch180FvduaSe71bG4-68E8oojsZSvcsU3Eu3so,13836
|
|
35
|
+
astreum/lispeum/tokenizer.py,sha256=4obr1Jt-k1TqhsImHWUn7adQl9Ks5_VmcEFOTlQwocQ,1437
|
|
36
|
+
astreum/lispeum/utils.py,sha256=R68KoM_HdEDQeowxWJUswAgdHdwrfrlsB1zwuZURaVg,279
|
|
37
|
+
astreum/lispeum/special/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
38
|
+
astreum/lispeum/special/definition.py,sha256=ukQJ-Mz57bpqbTPQiwmevdE4uxec3Zt--apT3VhUYqU,840
|
|
39
|
+
astreum/lispeum/special/list/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
40
|
+
astreum/lispeum/special/list/all.py,sha256=deTsq7fO5wLpLrfXcAWl_Vd-DPqk39qOltPI2eY2qkw,1054
|
|
41
|
+
astreum/lispeum/special/list/any.py,sha256=1ZjlWvYHPKOk1uiJqqeDLR2LxF52d4m7-FmBv-zBWN4,1053
|
|
42
|
+
astreum/lispeum/special/list/fold.py,sha256=GyjOS5RqSbC9BLgMPIsJSIRbsBmB90Jucw_rWH8SixA,933
|
|
43
|
+
astreum/lispeum/special/list/get.py,sha256=dHTL0DPkXzKBrKDA2ecnmZxRTsLlCdeDKOwMT1fenaM,644
|
|
44
|
+
astreum/lispeum/special/list/insert.py,sha256=bjTE3QXqk2USL710uu81wCCBcH1LFkuMb0iUVAOEj0g,712
|
|
45
|
+
astreum/lispeum/special/list/map.py,sha256=vFfORKM0p2_AUUY6gsqeQZ3QL3fgc0tHtIyK2-Crp9A,966
|
|
46
|
+
astreum/lispeum/special/list/position.py,sha256=1EcD5fzfjUCUhHCk8iotFoWdeE9Z2RjjNPdg250GD2o,1073
|
|
47
|
+
astreum/lispeum/special/list/remove.py,sha256=EPhkWFwyKG8HyWPheVvtxCvMaEGvODFUbx7h1fli_hg,690
|
|
48
|
+
astreum/lispeum/special/number/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
49
|
+
astreum/lispeum/special/number/addition.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
50
|
+
astreum/machine/__init__.py,sha256=GOdZl1tS9uIJHbq5WVcplifMDPDLQroX7CVew-K2YbA,15262
|
|
51
|
+
astreum/machine/environment.py,sha256=QsRaDtAIwlkH8Cn-F7Zzuvx2eXcwLys2M5vdsP1omrI,84
|
|
52
|
+
astreum/machine/error.py,sha256=MvqBaZZt33rNELNhUJ2lER3TE3aS8WVqsWF2hz2AwoA,38
|
|
53
|
+
astreum-0.2.0.dist-info/licenses/LICENSE,sha256=gYBvRDP-cPLmTyJhvZ346QkrYW_eleke4Z2Yyyu43eQ,1089
|
|
54
|
+
astreum-0.2.0.dist-info/METADATA,sha256=qoHAambsXz5VThOB2Bk4l11Y0P05yHDTagwArONyLTI,6539
|
|
55
|
+
astreum-0.2.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
56
|
+
astreum-0.2.0.dist-info/top_level.txt,sha256=1EG1GmkOk3NPmUA98FZNdKouhRyget-KiFiMk0i2Uz0,8
|
|
57
|
+
astreum-0.2.0.dist-info/RECORD,,
|
astreum/node/storage/__init__.py
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Storage utilities for the Astreum node.
|
|
3
|
-
"""
|
|
4
|
-
|
|
5
|
-
from .merkle import MerkleTree, MerkleProof, MerkleNode
|
|
6
|
-
from .merkle import find_first, find_all, map, binary_search
|
|
7
|
-
from .storage import Storage
|
|
8
|
-
|
|
9
|
-
__all__ = [
|
|
10
|
-
"MerkleTree", "MerkleProof", "MerkleNode",
|
|
11
|
-
"find_first", "find_all", "map", "binary_search",
|
|
12
|
-
"Storage"
|
|
13
|
-
]
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: astreum
|
|
3
|
-
Version: 0.1.19
|
|
4
|
-
Summary: Python library to interact with the Astreum blockchain and its Lispeum virtual machine.
|
|
5
|
-
Author-email: "Roy R. O. Okello" <roy@stelar.xyz>
|
|
6
|
-
Project-URL: Homepage, https://github.com/astreum/lib
|
|
7
|
-
Project-URL: Issues, https://github.com/astreum/lib/issues
|
|
8
|
-
Classifier: Programming Language :: Python :: 3
|
|
9
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
-
Classifier: Operating System :: OS Independent
|
|
11
|
-
Requires-Python: >=3.8
|
|
12
|
-
Description-Content-Type: text/markdown
|
|
13
|
-
License-File: LICENSE
|
|
14
|
-
Requires-Dist: pycryptodomex==3.21.0
|
|
15
|
-
Requires-Dist: cryptography==44.0.2
|
|
16
|
-
Requires-Dist: blake3==1.0.4
|
|
17
|
-
Dynamic: license-file
|
|
18
|
-
|
|
19
|
-
# lib
|
|
20
|
-
|
|
21
|
-
Python library to interact with the Astreum blockchain and its Lispeum virtual machine.
|
|
22
|
-
|
|
23
|
-
[View on PyPI](https://pypi.org/project/astreum/)
|
|
24
|
-
|
|
25
|
-
## Configuration
|
|
26
|
-
|
|
27
|
-
When initializing an Astreum Node, you need to provide a configuration dictionary. Below are the available configuration parameters:
|
|
28
|
-
|
|
29
|
-
### Node Configuration
|
|
30
|
-
|
|
31
|
-
| Parameter | Type | Default | Description |
|
|
32
|
-
|-----------|------|---------|-------------|
|
|
33
|
-
| `relay_private_key` | string | Auto-generated | Hex string of Ed25519 private key for network identity. If not provided, a new keypair will be generated automatically |
|
|
34
|
-
| `validation_private_key` | string | None | Hex string of Ed25519 private key for block validation. If provided, the node will join the validation route automatically |
|
|
35
|
-
| `storage_path` | string | "storage" | Path to store data |
|
|
36
|
-
| `max_storage_space` | int | 1073741824 (1GB) | Maximum storage space in bytes |
|
|
37
|
-
| `max_object_recursion` | int | 50 | Maximum recursion depth for resolving nested objects |
|
|
38
|
-
|
|
39
|
-
### Network Configuration
|
|
40
|
-
|
|
41
|
-
| Parameter | Type | Default | Description |
|
|
42
|
-
|-----------|------|---------|-------------|
|
|
43
|
-
| `use_ipv6` | bool | False | Whether to use IPv6 (True) or IPv4 (False) |
|
|
44
|
-
| `incoming_port` | int | 7373 | Port to listen for incoming messages |
|
|
45
|
-
| `max_message_size` | int | 65536 | Maximum size of UDP datagrams in bytes |
|
|
46
|
-
| `num_workers` | int | 4 | Number of worker threads for message processing |
|
|
47
|
-
| `network_request_timeout` | float | 5.0 | Maximum time (in seconds) to wait for network object requests |
|
|
48
|
-
|
|
49
|
-
### Route Configuration
|
|
50
|
-
|
|
51
|
-
| Parameter | Type | Default | Description |
|
|
52
|
-
|-----------|------|---------|-------------|
|
|
53
|
-
| `validation_route` | bool | False | Whether to participate in the block validation route (automatically set to True if validation_private_key is provided) |
|
|
54
|
-
| `bootstrap_peers` | list | [] | List of bootstrap peers in the format `[("hostname", port), ...]` |
|
|
55
|
-
|
|
56
|
-
> **Note:** The peer route is always enabled as it's necessary for object discovery and retrieval.
|
|
57
|
-
|
|
58
|
-
### Example Usage
|
|
59
|
-
|
|
60
|
-
```python
|
|
61
|
-
from astreum.node import Node
|
|
62
|
-
|
|
63
|
-
# Configuration dictionary
|
|
64
|
-
config = {
|
|
65
|
-
"relay_private_key": "relay-private-key-hex-string",
|
|
66
|
-
"validation_private_key": "validation-private-key-hex-string", # Optional, for validator nodes
|
|
67
|
-
"storage_path": "./data/node1",
|
|
68
|
-
"incoming_port": 7373,
|
|
69
|
-
"use_ipv6": False,
|
|
70
|
-
"bootstrap_peers": [
|
|
71
|
-
("bootstrap.astreum.org", 7373),
|
|
72
|
-
("127.0.0.1", 7374)
|
|
73
|
-
]
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
# Initialize the node with config
|
|
77
|
-
node = Node(config)
|
|
78
|
-
|
|
79
|
-
# Start the node
|
|
80
|
-
node.start()
|
|
81
|
-
|
|
82
|
-
# ... use the node ...
|
|
83
|
-
|
|
84
|
-
# Stop the node when done
|
|
85
|
-
node.stop()
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
## Testing
|
|
89
|
-
|
|
90
|
-
python3 -m unittest discover -s tests
|
astreum-0.1.19.dist-info/RECORD
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
astreum/__init__.py,sha256=di8SwGUW1lNKUwvNWCjH9eLmz__sk1SbtuNZVjjpRe4,59
|
|
2
|
-
astreum/lispeum/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
-
astreum/lispeum/expression.py,sha256=3zOEoXFHpzEFUIi1clONY55WYAh5K0YkYhaLmtvQj0I,2939
|
|
4
|
-
astreum/lispeum/parser.py,sha256=SU8mjPj1ub4xQbU4CeX15HmKZAj4vI6TeefX2B72VCo,1191
|
|
5
|
-
astreum/lispeum/storage.py,sha256=l_ch4Ch180FvduaSe71bG4-68E8oojsZSvcsU3Eu3so,13836
|
|
6
|
-
astreum/lispeum/tokenizer.py,sha256=4obr1Jt-k1TqhsImHWUn7adQl9Ks5_VmcEFOTlQwocQ,1437
|
|
7
|
-
astreum/lispeum/utils.py,sha256=R68KoM_HdEDQeowxWJUswAgdHdwrfrlsB1zwuZURaVg,279
|
|
8
|
-
astreum/lispeum/special/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
-
astreum/lispeum/special/definition.py,sha256=ukQJ-Mz57bpqbTPQiwmevdE4uxec3Zt--apT3VhUYqU,840
|
|
10
|
-
astreum/lispeum/special/list/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
|
-
astreum/lispeum/special/list/all.py,sha256=deTsq7fO5wLpLrfXcAWl_Vd-DPqk39qOltPI2eY2qkw,1054
|
|
12
|
-
astreum/lispeum/special/list/any.py,sha256=1ZjlWvYHPKOk1uiJqqeDLR2LxF52d4m7-FmBv-zBWN4,1053
|
|
13
|
-
astreum/lispeum/special/list/fold.py,sha256=GyjOS5RqSbC9BLgMPIsJSIRbsBmB90Jucw_rWH8SixA,933
|
|
14
|
-
astreum/lispeum/special/list/get.py,sha256=dHTL0DPkXzKBrKDA2ecnmZxRTsLlCdeDKOwMT1fenaM,644
|
|
15
|
-
astreum/lispeum/special/list/insert.py,sha256=bjTE3QXqk2USL710uu81wCCBcH1LFkuMb0iUVAOEj0g,712
|
|
16
|
-
astreum/lispeum/special/list/map.py,sha256=vFfORKM0p2_AUUY6gsqeQZ3QL3fgc0tHtIyK2-Crp9A,966
|
|
17
|
-
astreum/lispeum/special/list/position.py,sha256=1EcD5fzfjUCUhHCk8iotFoWdeE9Z2RjjNPdg250GD2o,1073
|
|
18
|
-
astreum/lispeum/special/list/remove.py,sha256=EPhkWFwyKG8HyWPheVvtxCvMaEGvODFUbx7h1fli_hg,690
|
|
19
|
-
astreum/lispeum/special/number/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
|
-
astreum/lispeum/special/number/addition.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
21
|
-
astreum/machine/__init__.py,sha256=GOdZl1tS9uIJHbq5WVcplifMDPDLQroX7CVew-K2YbA,15262
|
|
22
|
-
astreum/machine/environment.py,sha256=K0084U6B7wwjrDZ9b2_7cEcbBzsB7UOy_Zpbrr7B3GY,834
|
|
23
|
-
astreum/machine/error.py,sha256=MvqBaZZt33rNELNhUJ2lER3TE3aS8WVqsWF2hz2AwoA,38
|
|
24
|
-
astreum/node/__init__.py,sha256=obb-ap7YuRrMblNN7IAK79xEq__9aNBVzt1ciSTMvoU,18631
|
|
25
|
-
astreum/node/utils.py,sha256=amGhNYHVMjvAO-9vBRAcim-S5LlLSRudqooBN-XPdm4,702
|
|
26
|
-
astreum/node/crypto/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
27
|
-
astreum/node/crypto/ed25519.py,sha256=FRnvlN0kZlxn4j-sJKl-C9tqiz_0z4LZyXLj3KIj1TQ,1760
|
|
28
|
-
astreum/node/crypto/x25519.py,sha256=i29v4BmwKRcbz9E7NKqFDQyxzFtJUqN0St9jd7GS1uA,1137
|
|
29
|
-
astreum/node/relay/__init__.py,sha256=A6br8QSGLW7qmKYBJNIC4bEf5QMzLBFaa_FH3MaOJrs,15069
|
|
30
|
-
astreum/node/relay/bucket.py,sha256=pcmollbbM-xeHlmDxLZnzvf0Ut-9v9RoN6SijYiQuu8,2893
|
|
31
|
-
astreum/node/relay/envelope.py,sha256=sDKsIvJruQKLWgWs92sx1mCjMHF7yQVoLguPygw2Pz8,10037
|
|
32
|
-
astreum/node/relay/message.py,sha256=uezmGjNaQK4fZmYQLCHd2YpiosaaFb8DOa3H58HS1jA,2887
|
|
33
|
-
astreum/node/relay/peer.py,sha256=DlvTR9j0BZQ1dW-p_9UGgfLvQqwNdpNLMSCYEW4FhyI,5899
|
|
34
|
-
astreum/node/relay/route.py,sha256=fyOSsAe1mfsCVeN6LtQ_OEUEb1FiC5dobZBEJKNGU9U,5814
|
|
35
|
-
astreum/node/storage/__init__.py,sha256=eJL7ILUGKSKDhXZqkn3Rk5TUza39vIcwPwAW_AaIHTk,326
|
|
36
|
-
astreum/node/storage/merkle.py,sha256=sC7gfxPDUBgv3iiFs5PyxPgYbC4CoE-If5TQvkuoTGU,10295
|
|
37
|
-
astreum/node/storage/patricia.py,sha256=zP4whShdB7yOFcEPLE1-1PIFfx_LdK8DyMSadnF0KT0,11588
|
|
38
|
-
astreum/node/storage/storage.py,sha256=czJDhRK2rQxjOo88fhZ6j10f55RW8hWp1qq7c4yur6Y,10086
|
|
39
|
-
astreum/node/storage/utils.py,sha256=CxKH9GbW31aVYs2Hwg1SirCykSnH_3_JisEayDrpOvY,5169
|
|
40
|
-
astreum/node/validation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
41
|
-
astreum/node/validation/account.py,sha256=mKbJSi3sfQ5K9a4zwgdyPGqT3gXHekI55yDDVpzcolo,3650
|
|
42
|
-
astreum/node/validation/block.py,sha256=KRvlpLZOmgJ3WJaSHsbk7ryh2Z1NsC2z-RWKWh1quBE,444
|
|
43
|
-
astreum/node/validation/constants.py,sha256=ImIdLZFtMKx1iWg60YssEKl2tdDqZQnIa2JaJE6CX0o,422
|
|
44
|
-
astreum/node/validation/stake.py,sha256=Z9EPM-X9c92fpsZIYsdVpvgz4DhxQViPM-RDktWUZq8,7141
|
|
45
|
-
astreum/node/validation/transaction.py,sha256=Lovx1CWIxL45glFU-LBDxI1argBLxSmDAcg1TteaOlY,4701
|
|
46
|
-
astreum/node/validation/vdf.py,sha256=HDdnqn9O_LicfE7SNCmncawKoR-ojLyjlpn74OvRNOU,2194
|
|
47
|
-
astreum/node/validation/_block/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
48
|
-
astreum/node/validation/_block/create.py,sha256=apD9h92b9Y146zeppSzKNk_NJPgyBy7FhxoEkypQQNk,2515
|
|
49
|
-
astreum/node/validation/_block/model.py,sha256=d7x3_tX2MPLnGODL_5_vNjQfLdYa405blc-zL9o8HFA,2589
|
|
50
|
-
astreum/node/validation/_block/validate.py,sha256=niLexCNhEwUJLclyrdNZSvHcVa_J6jlu7J3FiWY7XBU,6232
|
|
51
|
-
astreum/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
52
|
-
astreum/utils/bytes_format.py,sha256=X4tG5GGPweNCE54bHYkLFiuLTbmpy5upO_s1Cef-MGA,2711
|
|
53
|
-
astreum-0.1.19.dist-info/licenses/LICENSE,sha256=gYBvRDP-cPLmTyJhvZ346QkrYW_eleke4Z2Yyyu43eQ,1089
|
|
54
|
-
astreum-0.1.19.dist-info/METADATA,sha256=MvTCByomvRA9Tf_iCyOyxeGCsSnNyHSrtoRChhbx0ls,3312
|
|
55
|
-
astreum-0.1.19.dist-info/WHEEL,sha256=wXxTzcEDnjrTwFYjLPcsW_7_XihufBwmpiBeiXNBGEA,91
|
|
56
|
-
astreum-0.1.19.dist-info/top_level.txt,sha256=1EG1GmkOk3NPmUA98FZNdKouhRyget-KiFiMk0i2Uz0,8
|
|
57
|
-
astreum-0.1.19.dist-info/RECORD,,
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|