diff --git a/script/lilith_spawns.py b/script/lilith_spawns.py old mode 100644 new mode 100755 index 009826861..f6ec83c3d --- a/script/lilith_spawns.py +++ b/script/lilith_spawns.py @@ -1,3 +1,4 @@ +#!/usr/bin/python # This file is part of DarkFi (https://dark.fi) # # Copyright (C) 2020-2024 Dyne.org foundation @@ -16,7 +17,6 @@ # along with this program. If not, see . import asyncio, json, random, sys, time - class JsonRpc: async def start(self, server, port): @@ -105,5 +105,4 @@ async def main(argv): print(f" {host}") await rpc.stop() - asyncio.run(main(sys.argv)) diff --git a/script/node_get-info.py b/script/node_get-info.py old mode 100644 new mode 100755 index 504c6291b..5aeccb45e --- a/script/node_get-info.py +++ b/script/node_get-info.py @@ -1,3 +1,4 @@ +#!/usr/bin/python # This file is part of DarkFi (https://dark.fi) # # Copyright (C) 2020-2024 Dyne.org foundation @@ -16,7 +17,6 @@ # along with this program. If not, see . import asyncio, json, random, sys, time - class JsonRpc: async def start(self, server, port): @@ -71,7 +71,6 @@ class JsonRpc: async def dnet_subscribe_events(self): return await self._subscribe("dnet.subscribe_events", []) - async def main(argv): rpc = JsonRpc() while True: @@ -121,5 +120,4 @@ async def main(argv): await rpc.stop() - asyncio.run(main(sys.argv)) diff --git a/script/nodetool.py b/script/nodetool.py old mode 100644 new mode 100755 index 3ba3d003d..11e48d53a --- a/script/nodetool.py +++ b/script/nodetool.py @@ -1,3 +1,4 @@ +#!/usr/bin/python # This file is part of DarkFi (https://dark.fi) # # Copyright (C) 2020-2024 Dyne.org foundation @@ -16,7 +17,6 @@ # along with this program. If not, see . import asyncio, json, random, sys, time - class JsonRpc: async def start(self, server, port): @@ -71,7 +71,6 @@ class JsonRpc: async def dnet_subscribe_events(self): return await self._subscribe("dnet.subscribe_events", []) - async def main(argv): rpc = JsonRpc() while True: @@ -130,5 +129,4 @@ async def main(argv): await rpc.dnet_switch(False) await rpc.stop() - asyncio.run(main(sys.argv)) diff --git a/script/tor-test.py b/script/tor-test.py new file mode 100755 index 000000000..a802706c3 --- /dev/null +++ b/script/tor-test.py @@ -0,0 +1,29 @@ +#!/usr/bin/python +# This file is part of DarkFi (https://dark.fi) +# +# Copyright (C) 2020-2024 Dyne.org foundation +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . + +# Tests if your local tor node is working + +# pip install pysocks +import socks +import socket +socks.set_default_proxy(socks.SOCKS5, "127.0.0.1", 9050) +socket.socket = socks.socksocket +import requests +response = requests.get("https://myip.wtf/text") +print(response.content) +