Skip to content

Commit 5781403

Browse files
move files and fix weird workaround with proper more stack
1 parent a00137c commit 5781403

8 files changed

+6
-8
lines changed

internal_filesystem/lib/websocket_nostr_receive.py renamed to draft_code/websocket_nostr_receive.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,12 @@ def printevents():
4040
print(f"at the start, thread stack used: {micropython.stack_use()}")
4141
print("relaymanager")
4242
relay_manager = RelayManager()
43-
time.sleep(3)
4443
#relay_manager.add_relay("wss://nostr-pub.wellorder.net")
4544
print("relaymanager adding")
46-
#relay_manager.add_relay("wss://relay.damus.io")
45+
relay_manager.add_relay("wss://relay.damus.io")
4746
relay_manager.add_relay("wss://relay.primal.net")
48-
time.sleep(3)
4947
print("relaymanager subscribing")
5048
relay_manager.add_subscription(subscription_id, filters)
51-
time.sleep(3) # allow the connections to open
5249
print("opening connections") # after this, CPU usage goes high and stays there
5350
relay_manager.open_connections({"cert_reqs": ssl.CERT_NONE}) # NOTE: This disables ssl certificate verification
5451
time.sleep(2) # allow the connections to open
File renamed without changes.
File renamed without changes.

internal_filesystem/lib/websocket_raw_nostr_test.py_worked_without_ping_payload renamed to draft_code/websocket_raw_nostr_test.py_worked_without_ping_payload

File renamed without changes.

internal_filesystem/lib/websocket_raw_nostr_test.py_worked_without_ping_payload_still_works renamed to draft_code/websocket_raw_nostr_test.py_worked_without_ping_payload_still_works

File renamed without changes.

internal_filesystem/lib/threading.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def start(self):
1717
#_thread.stack_size(10*1024) # might not be enough
1818
#stacksize = 12*1024
1919
# small stack sizes 8KB gives segfault directly
20-
stacksize = 12*1024
20+
stacksize = 24*1024
2121
print(f"starting thread with stacksize {stacksize}")
2222
_thread.stack_size(stacksize)
2323
_thread.start_new_thread(self.run, ())

internal_filesystem/main.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ def dummy():
2323
apps.auto_connect()
2424
else:
2525
# On unix/desktop, at least 24KB of stack size is needed in the REPL to make nostr work there
26-
import _thread
27-
_thread.stack_size(24*1024) # on unix/desktop, at least 24KB is needed for doing nostr connections from the REPL
28-
_thread.start_new_thread(dummy, ()) # not just setting the stack_size but actually starting a thread to apply this globally
26+
#import _thread
27+
#_thread.stack_size(24*1024) # on unix/desktop, at least 24KB is needed for doing nostr connections from the REPL
28+
#_thread.start_new_thread(dummy, ()) # not just setting the stack_size but actually starting a thread to apply this globally
29+
pass
2930

3031
apps.restart_launcher()
3132

0 commit comments

Comments
 (0)