Low level storj protocol reference implementation.
Setup
Windows
Download latest windows release from github.
Extract the zip file to the folder where you wish to have it installed.
$ storjnode.exe --help
Linux (Ubuntu/Mint/Debian)
Install client
$ sudo pip install storjnode $ storjnode --help
Update client
$ sudo pip install storjnode --upgrade $ storjnode --help
OSX
Install client
$ brew install python $ rehash $ pip install storjnode $ storjnode --help
Update client
$ pip install storjnode --upgrade $ storjnode --help
Python usage examples
Normal usage
Starting and using a node in python.
#!/usr/bin/env python
# from examples/usage.py
import time
import signal
import storjnode
from crochet import setup, TimeoutError
# start twisted via crochet and remove twisted handler
setup()
signal.signal(signal.SIGINT, signal.default_int_handler)
# start node (use bitcoin wif or hwif as node key)
node_key = "KzygUeD8qXaKBFdJWMk9c6AVib89keoZFBNdFBsj73kYZfAc4n1j"
node = storjnode.network.Node(node_key)
try:
print("Giving nodes some time to find peers.")
time.sleep(storjnode.network.WALK_TIMEOUT)
# The blocking node interface is very simple and behaves like a dict.
node["examplekey"] = "examplevalue" # put key value pair into DHT
retrieved = node["examplekey"] # retrieve value by key from DHT
print("{key} => {value}".format(key="examplekey", value=retrieved))
except TimeoutError:
print("Got timeout error")
except KeyboardInterrupt:
pass
finally:
print("Stopping node")
node.stop()
Multinode usage
Using more then one node in a python script.
If your are using more then one node in a single script, you must assign them different ports.
See examples/network/multinode.py
Node messaging
Relay messages are sent to the node nearest the receiver in the routing table that accepts the relay message. This continues until it reaches the destination or the nearest node to the receiver is reached.
Because messages are always relayed only to reachable nodes in the current routing table, there is a fare chance nodes behind a NAT can be reached if it is connected to the network.
See examples/network/relay_message.py
Network mapping
You can crawl the network to create a map of the network. Generating a graph of the network is also possable (though not reccomended for networks with many nodes).
See examples/network/map_network.py
Metadata
Release files for storjnode 0.0.21
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| storjnode-0.0.21-py2-none-any.whl | Python 2 | none | any | Details |
Release files / storjnode-0.0.21-py2-none-any.whl
| Download URL | storjnode-0.0.21-py2-none-any.whl |
|---|---|
| Size | 93.4 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
ee8ac59b64f0e4edb06118d017af363c613cd3dacec3ac153917ca2a31590403
|
|
BLAKE2b-256 checksum How to use checksums |
4ecfec3fb80ba6ead5afaa892c58bada95ebc7a0cc40a668321acbdaca13135f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for storjnode 0.0.21
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.