Add support for Zeronet network (ipk package) with support for decentralized .bit domain zone using Namecoin cryptocurrency. There is information on the internet about how to run zeronet via python (https://github.com/HelloZeroNet/ZeroNet/issues/1106, but I haven't checked), but I want a full implementation and optimization for OpenWRT
Best get on with it then hadn't you? Once you've created and tested a suitable package you can submit it for inclusion into OpenWRT.
I have never created programmes and have no experience in it and am not interested in it. I wrote this text with the hope that OpenWrt developers will be interested in my idea and they will implement it
but someone else should be ?
there's no such thing as a free lunch.
I understand that. I just suggested an idea that can be implemented for OpenWrt, and let OpenWrt developers decide whether to implement it or not. There's a "Feature Requests" section for a reason
It appears to be pure Python, so it does not need to be built, you can just copy it to your system and run it after installing python3
. There is mention of dependency on two Python libraries msgpack
and gevent
. The former is already an OpenWrt package python3-msgpack
. If gevent
is pure Python it can be readily installed at runtime with pip
.
This will require significant hardware such as an x86 system or plastic router with ARM processor with at least 256/512 flash/RAM and a large external disk.
A pure Python application is always going to run under the Python interpreter. About the only "optimization" might be to write a simple init.d script to automatically start it as a service and restart it if it dies.
do experiments
root@OpenWrt:~# opkg install python3-pysha3_1.0.2-1_aarch64_generic.ipk
Installing python3-pysha3 (1.0.2-1) to root...
Configuring python3-pysha3.
root@OpenWrt:~# ls
ZeroNet-py3
ZeroNet-py3.zip
cpanm
geekflare.key
perl
perl-app-cpanminus_1.7047+perl5.38-1_aarch64_generic.ipk
perl.zip
py3
python3-pysha3-src_1.0.2-1_aarch64_generic.ipk
python3-pysha3_1.0.2-1_aarch64_generic.ipk
root@OpenWrt:~# cd ZeroNet-py3
root@OpenWrt:~/ZeroNet-py3# pip install -r requirements.txt
Ignoring gevent: markers 'python_version <= "3.6"' don't match your environment
Ignoring greenlet: markers 'python_version <= "3.6"' don't match your environment
Requirement already satisfied: gevent>=20.9.0 in /usr/lib/python3.11/site-packages (from -r requirements.txt (line 3)) (23.9.1)
Requirement already satisfied: msgpack>=0.4.4 in /usr/lib/python3.11/site-packages (from -r requirements.txt (line 4)) (1.0.5)
Collecting base58 (from -r requirements.txt (line 5))
Using cached base58-2.1.1-py3-none-any.whl (5.6 kB)
Collecting merkletools (from -r requirements.txt (line 6))
Using cached merkletools-1.0.3-py3-none-any.whl
Collecting rsa (from -r requirements.txt (line 7))
Using cached rsa-4.9-py3-none-any.whl (34 kB)
Collecting PySocks>=1.6.8 (from -r requirements.txt (line 8))
Using cached PySocks-1.7.1-py3-none-any.whl (16 kB)
Collecting pyasn1 (from -r requirements.txt (line 9))
Obtaining dependency information for pyasn1 from https://files.pythonhosted.org/packages/d1/75/4686d2872bf2fc0b37917cbc8bbf0dd3a5cdb0990799be1b9cbf1e1eb733/pyasn1-0.5.1-py2.py3-none-any.whl.metadata
Using cached pyasn1-0.5.1-py2.py3-none-any.whl.metadata (8.6 kB)
Collecting websocket_client (from -r requirements.txt (line 10))
Obtaining dependency information for websocket_client from https://files.pythonhosted.org/packages/1e/70/1e88138a9afbed1d37093b85f0bebc3011623c4f47c166431599fe9d6c93/websocket_client-1.7.0-py3-none-any.whl.metadata
Using cached websocket_client-1.7.0-py3-none-any.whl.metadata (7.9 kB)
Collecting gevent-ws (from -r requirements.txt (line 11))
Using cached gevent_ws-2.1.0-py3-none-any.whl (6.1 kB)
Collecting coincurve (from -r requirements.txt (line 12))
Using cached coincurve-18.0.0-cp311-cp311-musllinux_1_1_aarch64.whl (1.5 MB)
Collecting maxminddb (from -r requirements.txt (line 13))
Using cached maxminddb-2.5.1-py3-none-any.whl
Requirement already satisfied: zope.event in /usr/lib/python3.11/site-packages (from gevent>=20.9.0->-r requirements.txt (line 3)) (5.0)
Requirement already satisfied: zope.interface in /usr/lib/python3.11/site-packages (from gevent>=20.9.0->-r requirements.txt (line 3)) (6.1)
Requirement already satisfied: greenlet>=3.0rc3 in /usr/lib/python3.11/site-packages (from gevent>=20.9.0->-r requirements.txt (line 3)) (3.0.2)
Requirement already satisfied: pysha3>=1.0b1 in /usr/lib/python3.11/site-packages (from merkletools->-r requirements.txt (line 6)) (1.0.2)
Collecting asn1crypto (from coincurve->-r requirements.txt (line 12))
Using cached asn1crypto-1.5.1-py2.py3-none-any.whl (105 kB)
Requirement already satisfied: cffi>=1.3.0 in /usr/lib/python3.11/site-packages (from coincurve->-r requirements.txt (line 12)) (1.16.0)
Requirement already satisfied: setuptools>=68.2.2 in /usr/lib/python3.11/site-packages
(from maxminddb->-r requirements.txt (line 13)) (69.0.2)
Requirement already satisfied: pycparser in /usr/lib/python3.11/site-packages (from cffi>=1.3.0->coincurve->-r requirements.txt (line 12)) (2.21)
Using cached pyasn1-0.5.1-py2.py3-none-any.whl (84 kB)
Using cached websocket_client-1.7.0-py3-none-any.whl (58 kB)
Installing collected packages: asn1crypto, websocket_client, PySocks, pyasn1, merkletools, maxminddb, gevent-ws, base58, rsa, coincurve
Successfully installed PySocks-1.7.1 asn1crypto-1.5.1 base58-2.1.1 coincurve-18.0.0 gevent-ws-2.1.0 maxminddb-2.5.1 merkletools-1.0.3 pyasn1-0.5.1 rsa-4.9 websocket_client-1.7.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
root@OpenWrt:~/ZeroNet-py3# python3 zeronet.py
- Starting ZeroNet...
[21:33:48] - Libsecpk256k1 loaded: Lib in 0.116s
[21:33:49] - Version: 0.7.2 r4555, Python 3.11.6 (main, Dec 13 2023, 16:34:19) [GCC 12.3.0], Gevent: 23.9.1
[21:33:49] - Creating FileServer....
[21:33:49] FileServer Getting random port in range 10000-40000...
[21:33:49] FileServer Found unused random port: 33456
[21:33:49] - Creating UiServer....
[21:33:49] SiteManager Loading sites... (cleanup: True, startup: True)
[21:33:49] Site:1Name2..hM9F ContentDb not initialized, load files from filesystem...
[21:33:49] - Removing old SSL certs...
[21:33:49] - Starting servers....
[21:33:49] Ui.UiServer --------------------------------------
[21:33:49] Ui.UiServer Web interface: http://127.0.0.1:43110/
[21:33:49] Ui.UiServer --------------------------------------
[21:33:53] TorManager Disabling Tor, because error while accessing Tor proxy at port 127.0.0.1:9050: Error ([Errno 111] Connection refused)
[21:33:59] PeerPortchecker Checked port 33456 (ipv4) using checkIpfingerprints result:
{'ip': '139.162.44.24', 'opened': False} in 5.284s
[21:33:59] PeerPortchecker Trying to open port using UpnpPunch...
[21:34:09] ConnServer Server port opened ipv4: False, ipv6: None
Zeronet (python) is too large for OpenWrt. Zeronet (python) version is full of unnecessary stuff: Changelog text file, License text file, optimisation for different archeitecture, optimisation for different operating systems Windows, Ubuntu etc., uncompressed png images, unnecessary spaces in css/html files, #comments in the code, psd (photoshop) files
what do you want to achieve?
what do you want?
Routers usually have little memory, so every kilobyte counts. In general, my goal was to try to access everything I could. Blocked sites, Tor, I2p, Yggdrasil, Opennic, Zeronet. I see the optimal variant from these lists for myself is not to use Yggdrasil Zeronet to preserve the stability of the OpenWrt firmware and to avoid memory clogging
It is not recommended to use a router