nostrtool icon indicating copy to clipboard operation
nostrtool copied to clipboard

How do I run locally?

Open statusquont opened this issue 2 years ago • 6 comments

I know I'm not supposed to enter private key data on the main site. So I downloaded the github code, but what are the requirements to run locally? And instructions anywhere? I was sort of expecting something similar to Ian Coleman's bip39-standalone.html https://github.com/iancoleman/bip39/releases that I can open in the browser and run.

I tried running src/templates/index.html in the browser but the buttons don't work.

statusquont avatar Jul 24 '23 05:07 statusquont

Ah, yes, the front end relies on a backend python server. I never finished the documentation but the basic steps are:

  • create the Docker container: docker-compose build
  • And run it: docker-compose up
  • At that point the backend server should be running locally and you can just point your browser to http://localhost:1237

kdmukai avatar Jul 25 '23 13:07 kdmukai

I think I made a little progress but then ran into this error:

File "/home/sq/Code/nostrtool/src/app.py", line 8, in from nostr.key import Bip39PrivateKey, PrivateKey, PublicKey ImportError: cannot import name 'Bip39PrivateKey' from 'nostr.key' (/home/sq/.local/lib/python3.10/site-packages/nostr/key.py)

statusquont avatar Jul 27 '23 08:07 statusquont

I get this error when I run docker-compose up on Debian:

~/Development/nostr/nostrtool$ docker-compose up
[+] Running 1/0
 ✔ Container nostrtool-flask-1  Created                                                                                                                            0.0s 
Attaching to nostrtool-flask-1
nostrtool-flask-1  | Traceback (most recent call last):
nostrtool-flask-1  |   File "/srv/.env/bin/flask", line 5, in <module>
nostrtool-flask-1  |     from flask.cli import main
nostrtool-flask-1  |   File "/srv/.env/lib/python3.9/site-packages/flask/__init__.py", line 5, in <module>
nostrtool-flask-1  |     from .app import Flask as Flask
nostrtool-flask-1  |   File "/srv/.env/lib/python3.9/site-packages/flask/app.py", line 30, in <module>
nostrtool-flask-1  |     from werkzeug.urls import url_quote
nostrtool-flask-1  | ImportError: cannot import name 'url_quote' from 'werkzeug.urls' (/srv/.env/lib/python3.9/site-packages/werkzeug/urls.py)
nostrtool-flask-1 exited with code 1

stodge avatar Dec 26 '23 01:12 stodge

I get this error when I run docker-compose up on Debian:

~/Development/nostr/nostrtool$ docker-compose up
[+] Running 1/0
 ✔ Container nostrtool-flask-1  Created                                                                                                                            0.0s 
Attaching to nostrtool-flask-1
nostrtool-flask-1  | Traceback (most recent call last):
nostrtool-flask-1  |   File "/srv/.env/bin/flask", line 5, in <module>
nostrtool-flask-1  |     from flask.cli import main
nostrtool-flask-1  |   File "/srv/.env/lib/python3.9/site-packages/flask/__init__.py", line 5, in <module>
nostrtool-flask-1  |     from .app import Flask as Flask
nostrtool-flask-1  |   File "/srv/.env/lib/python3.9/site-packages/flask/app.py", line 30, in <module>
nostrtool-flask-1  |     from werkzeug.urls import url_quote
nostrtool-flask-1  | ImportError: cannot import name 'url_quote' from 'werkzeug.urls' (/srv/.env/lib/python3.9/site-packages/werkzeug/urls.py)
nostrtool-flask-1 exited with code 1

same thing here

plebhash avatar Sep 23 '24 15:09 plebhash

If you are still experiencing the werkzeug.urls ImportError.. , I was. Try this work around.. add the following sed command line in the Dockerfile just before the line that has pip doing the read of the requirements doc...

RUN sed -i '/Flask==2.2.2/a Werkzeug==2.2.3' requirements.txt RUN /srv/.env/bin/pip install -r requirements.txt --no-cache-dir

Also, I use this command for when i build ..so I can see the progress of the building.. docker-compose --progress plain build --no-cache

good luck

rphilbrdigits avatar Dec 22 '24 19:12 rphilbrdigits

If you are still experiencing the werkzeug.urls ImportError.. , I was. Try this work around.. add the following sed command line in the Dockerfile just before the line that has pip doing the read of the requirements doc...

RUN sed -i '/Flask==2.2.2/a Werkzeug==2.2.3' requirements.txt RUN /srv/.env/bin/pip install -r requirements.txt --no-cache-dir

This worked! Thanks

Stargazer10101 avatar Apr 26 '25 08:04 Stargazer10101