Code Monkey home page Code Monkey logo

nostr_console's Introduction

nostr_console

Nostr console client using Dart

This is an experimental or pre-alpha software made to show or know what a Nostr network client would look like. It works 90% of the time everytime; less when relays are not working perfectly.

todo

  • allow faster startup with an argument or config
  • menu should honour --width, its extending way beyond
  • after going to a dm room, screen doesn't clear
  • in url expansions, the likes string is shown in same line which is wrong
  • fix: users who don't have kind 0 or kind 3 are not searchable in menu 8 and 9 in Social network.
  • kind 7 tags are messed up. for example for reaction: 066cdb716e250069c4078565c9d9046af483c43bbd8497aad9c60d41ec462034 and 137289198ff1c57a14711d87b059e5fc5f9b11b257672503595ac31bad450a22
  • fix count of events shown per relay in app stats
  • [-] read prikey from file; create it too using new feature --genkey
  • allow special character input, and 256 limit info
  • fix --help that's dated
  • support bech32 keys
  • (showing tick for now) A F for friend or follow should be shown after each name that's a follow of the logged in user. F1 if the name is follow of a follow, and F2 if next level.
  • due to extra color related bytes, reactions in highlighted threads are shifted a lot to left. fix that.
  • increase author id to 5 and event id shown to 6 from 3 and 4 respectively
  • add new relays ( zbd, coinos, radixrat)
  • fix issue where need to go back into main menu to update the feed
  • show lightning invoice as qr code
  • in mention expansion, if p tag is not found in user store, then its left as #[n], whereas it should be replaced by the pubkey
  • notifications should show mentions too ( it does not yet)
  • notifications , option 3, is shown only for one entry in whole thread
  • hashtag regexp should have underscore (seems to be working fine)
  • add more default users. improve who is fetched.
  • when seeing a profile, if they have liked something, then likes after their name are shown white

other longer term todo

  • parallel connections to relays in different isolate
  • build appimage for linux use
  • have spam rules file, which user can add and block spam

Running Nostr Console using Docker

First check out or unzip the code to a directory, cd to that directory, and from there type the following commands: (make sure Docker desktop is running in the background)

docker build  -t nostr_console .

Then run using

docker run -it nostr_console start

Prebuilt Docker Images

Prebuilt docker image from the main branch of this repository can be found here.

docker pull ghcr.io/vishalxl/nostr_console:main

and then

docker run -it ghcr.io/vishalxl/nostr_console:main

Use

Easiest way to run nostr_console: Go to releases and get an executable for your platform.

Otherwise do following:

  1. Install Flutter SDK, or Dart SDK
  2. git clone this repository
  3. From the project folder, run command dart pub get which gets all the dependencies
  4. Run command dart run bin/nostr_console.dart, which will run it with default settings.
  5. Further you can create an executable for your platform by dart compile exe bin/nostr_console.dart which will create an executable for your platform. You can invoke that exe with required parameters. On Windows, you can create a shortcut to it with your desired command line arguments mentioned in it.

Usage:

usage: dart run bin/nostr_console.dart [OPTIONS] 

  OPTIONS

      -k, --prikey  <private key>   The nsec or hex private key of user you want to 'log in' as.
      -p, --pubkey  <public key>    The npub or hex public key of user whose events and feed are shown. When given,
                                    posts/replies can't be sent because for that a private key is needed.
      -r, --relay   <relay urls>    The comma separated relay urls that are used as relays. If given, these are used
                                    rather than the default relays.
      -f, --file    <filename>      Read from given file, if it is present, and at the end of the program execution, write
                                    to it all the events (including the ones read, and any new received). Even if not given,
                                    the default is to read from and write to all_nostr_events.txt . Can be turned off by
                                    the --disable-file flag
      -d, --days    <N as num>      The latest number of days for which events are shown. Default is 1.
      --request <REQ string>        This request is sent verbatim to the default relay. It can be used to recieve all events
                                    from a relay. If not provided, then events for default or given user are shown.
      -s, --disable-file            When turned on, even the default filename is not read from.
      -t, --translate               Translate some of the recent posts using Google translate site ( and not api). Google
                                    is accessed for any translation request only if this flag is present, and not otherwise.
      -l, --lnqr                    Flag, if set any LN invoices starting with LNBC will be printed as a QR code. Will set
                                    width to 140, which can be reset if needed with the --width argument. Wider
                                    space is needed for some qr codes.
      -g, --location <location>     The given value is added as a 'location' tag with every kind 1 post made. g in shortcut
                                    standing for geographic location.
      -h, --help                    Print help/usage message and exit.
      -v, --version                 Print version and exit.

  UI Options
      -a, --align  <left>           When "left" is given as option to this argument, then the text is aligned to left. By
                                    default the posts or text is aligned to the center of the terminal.
      -w, --width  <width as num>   This specifies how wide you want the text to be, in number of columns. Default is 96.
                                    Cant be less than 60.
      -m, --maxdepth <depth as num> The maximum depth to which the threads can be displayed. Minimum is 2 and
                                    maximum allowed is 12.
      -c, --color  <color>          Color option can be green, cyan, white, black, red and blue.

  Advanced
      -y, --difficulty <number>     The difficulty number in bits, only for kind 1 messages. Tne next larger number divisible
                                    by 4 is taken as difficulty. Can't be more than 32 bits, because otherwise it typically
                                    takes too much time. Minimum and default is 0, which means no difficulty.
      -e, --overwrite               Will over write the file with all the events that were read from file, and all newly
                                    received. Is useful when the file has to be cleared of old unused events. A backup should
                                    be made just in case of original file before invoking.

Command line examples

To 'login' as a user with private key K:

nostr_console.exe  --prikey=K

To get ALL the latest messages on relays for last 3 days (on bash shell which allows backtick execution), for user with private key K:

nostr_console.exe  --prikey=K --request=`echo "[\"REQ\",\"l\",{\"since\":$(date -d '-3 day' +%s)}]"`

To get all encrypted messages:

./nostr_console_elf64 --prikey=K --request='["REQ","cn",{"limit":20000,"kinds":[104,140,141,142],"since":1663417739}]' # run on linux/bash

To run unit tests using Dart, in main/top level directory, run:

dart run test  -r expanded

Troubleshooting

In case program is not sending events:

  1. Make sure you are running the latest version. ( versions from 0.2.6 to 0.2.9 were very unstable)
  2. Delete or backup the events file. Specially if its is more than 50 MB or has more than 50k events.
  3. Right after starting, go to social network menu, and press 1 or such menu a couple of times (to print events) to allow some background processing, so that events can be processed. Once all "notifications" or new events have come in, then try sending your event(s)

In case program is not fetching events:

  1. Give it other or more relays' using --relay argument.
  2. If event file is more than 50 MB, delete/backup it and start again.

Configuring Proxy

When you are in an network which blocks outgoing HTTPS (e.g. company firewall), but there is a proxy you can set environment variable before running nostr_console. Examples below use authentication. Drop username:password if not required.

Linux

$ export HTTP_PROXY=http://username:[email protected]:1234
$ export HTTPS_PROXY=http://username:[email protected]:5678

To make permanent add to your shell profile, e.g. ~/.bashrc or to /etc/profile.d/

Windows

C:\setx HTTP_PROXY=http://username:[email protected]:1234
C:\setx HTTPS_PROXY=http://username:[email protected]:5678

Using setx to set an environment variable changes the value used in both the current command prompt session and all command prompt sessions that you create after running the command. It does not affect other command shells that are already running at the time you run the command.

Use set to set an environment variable changes the value used until the end of the current command prompt session, or until you set the variable to a different value.

Tor proxy

TOR can be used as a HTTP proxy with HTTPTunnelPort instead of just SOCKS5.

Screenshots

2022-12-02 (5)

Showing Social network thread with re-shifting to left where threads are re-alignment to left for easier reading.

2022-12-02 (6)

Public channels overview with menu

2022-12-02 (7)

How public channels look like as of mid late 2022, with --translate flag automatically translating into English.

Contact

Nostr Telegram Channel

Nostr Console Telegram channel

Nostr Pulic Channel 52cab2e3e504ad6447d284b85b5cc601ca0613b151641e77facfec851c2ca816

nostr_console's People

Contributors

aarondewes avatar cercatrova21 avatar git-sgmoore avatar jesterhodl avatar sven-hash avatar vishalxl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nostr_console's Issues

--prikey option should be removed

--prikey option should be removed as it's a security breach, IMHO.

What about having this shown to every user logged into the system?

$ ps ax | grep nostr
 553521 pts/1    Sl+    0:02 ./nostr_console_elf64 --prikey 680a0693d62e04198472d6def92b801d11fbd417f223000d45f4bbb1e6a3a851

Private key should be imperatively passed over a dotfile in HOME DIR.

For private key 1 when sending a DM the application crashes

One issue here is that the inbox is shown with id 0000

One of the events 0b9 can be seen here

Here is traceback:


Type user public key, or their name, or their 1st few letters; or type 'x' to cancel: 0000
                                           ---------- 000 (0000000000000000000000000000000000000000000000000000000000000000) ----------

                                   0b948d23cf8be30d23d859331d9e85055c6ba4b005c259b799b1f481e5513f8e     07:04 PM May 20        poll_bot: ???
                                   38fd1c36faa02d375aa324b59fccc1c0d5e3364018370605a9d761143f9325c4     07:05 PM May 20        poll_bot: ???

Type message; or type 'x' to exit, or press <enter> to refresh: test
Unhandled exception:
Invalid argument(s): Invalid point compression
#0      ECCurve.decompressPoint (package:pointycastle/ecc/ecc_fp.dart:356:7)
#1      ECCurveBase.decodePoint (package:pointycastle/ecc/ecc_base.dart:215:13)
#2      Kepler.loadPublicKey (package:kepler/src/kepler.dart:149:29)
#3      Kepler.rawSecret (package:kepler/src/kepler.dart:162:23)
#4      Kepler.byteSecret (package:kepler/src/kepler.dart:173:20)
#5      myEncryptRaw (package:nostr_console/event_ds.dart:1538:27)
#6      myEncrypt (package:nostr_console/event_ds.dart:1531:27)
#7      sendDirectMessage (package:nostr_console/console_ui.dart:133:42)
#8      PrivateMenuUI (package:nostr_console/console_ui.dart:1182:25)
<asynchronous suspension>
#9      mainMenuUi (package:nostr_console/console_ui.dart:1295:11)
<asynchronous suspension>

Issue is that this account has sent a DM to a pubkey with 64 zeros. Solution is to put in test so that messages to such pubkeys aren't taken as valid.

FR: Notifcations Main Menu option

I propose a new Main Menu option: 3. Notifications
When I click 3, I get a chronological list of the last messages to me that I can then choose to reply to or not. This might even be better to put as #1 or #2 in the main menu, as when I log in, the first thing I want to see are notifications so I can reply to any threads looking for my input, only after I've replied to those, do I want to go to the Display feed.

Exception is not being caught if connection failes in Relay connect

Following is seen as of right now

... 498549ba698f7ccffb724071c3c2aa747ec3fb89cde5055404ba55327875de5645bd4645cb1b"}]
["EOSE","latest"]
Unhandled exception:
WebSocketException: Connection to 'https://nostr.rocks:0#' was not upgraded to websocket
#0      _WebSocketImpl.connect (dart:_http/websocket_impl.dart:1011:41)
#1      WebSocket.connect (dart:_http/websocket.dart:320:22)
#2      Relays.connect (package:nostr_console/relays.dart:36:25)
#3      getFeed (package:nostr_console/relays.dart:83:12)
#4      main.<anonymous closure> (file:///C:/Users/Vishal/source/dart/nostr_console/bin/nostr_console.dart:24:9)
#5      new Future.delayed.<anonymous closure> (dart:async/future.dart:424:39)
#6      Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:18:15)
#7      _Timer._runTimers (dart:isolate-patch/timer_impl.dart:398:19)
#8      _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:429:5)
#9      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192:12)

Google translate is giving unhandled exception and crashing the application

Unhandled exception:
Connection closed before full header was received
#0      IOClient.send (package:http/src/io_client.dart:90:7)
<asynchronous suspension>
#1      BaseClient._sendUnstreamed (package:http/src/base_client.dart:93:32)
<asynchronous suspension>
#2      _withClient (package:http/http.dart:164:12)
<asynchronous suspension>
#3      GoogleTranslator.translate (package:translator/src/google_translator.dart:51:18)
<asynchronous suspension>

[BUG] Unable to select full Event ID when replying to multiple Event ID's with six leading zeros (Eg: PoW 25 event)

Issue Description

I created two PoW post/reply events consisting of 6 leading zeros '000000' in the event ID by performing a --difficulty PoW of 25 leading zero bits. Nostr_Console currently displays event ID's of posts and replies of up to 6 characters in length. So, if I had to reply the third time and entered '000000' in the event ID input where it says -'Type id of event to reply to (leave blank to make a new post; type x to cancel)' it will only reply to the latest Event ID that begins with '000000', instead of informing the user that it found duplicate event ID's that began with '000000'. Ideally, the console should provide the user with the full length event ID's of the duplicate event ID's so that the user can select and copy/paste them for their next reply/response as a choice.

Steps to Reproduce

  1. Create A new PoW 25 leading zero post. This should display the event ID '000000'
    image

  2. Reply to the above post with another PoW 25 leading zero reply. This should display the event iD '000000' for the reply post.
    image

  3. Create another reply post, Nostr_Console should ask you to input the Event ID to reply to. Enter '000000'. However, it responds directly to the reply created in point 2 instead of providing the user the option to view the complete event ID of the events that have duplicate event ID's that begin with '000000' and selecting them to reply to the appropriate one.
    image

Expected Result

Provide the user a list of duplicate Event ID's that have the same initial 6 characters of the Event ID. This way the user can select, copy/paste the entire Event ID to respond to the right post that they desire.

I feel one way to handle this would be to also show the last 6 characters of the event ID apart from the beginning 6 separated with a delimiter like ':' (colon) or ellipses '....' Eg: 000000:25436d or 000000...25436d. The user can then copy that and Nostr_Console could accept that shortened event ID as an input for replying to posts or creating posts.

Example reproduction details
Event ID: 0000000862cc44026e6609e5886c7384dc6c237a43739d2a0171d2046425436d
Note ID: note1qqqqqzrze3zqymnxp8jcsmrnsnwxcgm6gdee62spw8fqgep9gdks4x9d3n

Test Environment Details

  • OS: Arch Linux
  • Nostr_Console version: Main Branch latest Git commit (v0.3.4-beta)
  • Execution Method: Docker

Unhandled exception

it's actually printing out 18 global threads but immediately dies right after saying either
Unhandled exception:
HandshakeException: Connection terminated during handshake
or
Unhandled exception:
HttpException: Connection closed before full header was received, uri = https://relay.damus.io:0

my client doesn't seem to load all the events from "all_nostr_events.txt"

When I run nostr_console.exe with --relay wss://nostr-pub.wellorder.net,wss://relay.damus.io,wss://relay.nostr.info,wss://nostr-relay.wlvs.space,wss://nostr.radixrat.com

it doesn't always load all the posts/replies (i only notice because I check in my 2. social, 5. replies/likes, and 6. friends). It will have some of the messages Non: Event not loaded . I will also notice that certain people I'm following don't have their friendly name, it didn't load those either.

This seems to be a little different, if i specify --request="["REQ","cn",{"limit":200000,"kinds":[0,1,3,4,104,140,141,142],"since":1668984662}]"

Then the replies and etc are all filled in, and friends names are filled in.

After playing around a lot and quitting and restarting, I notice that nostr_console only loads 4955 posts, regardless how big my all_nostr_events.txt is (right now it's a whopping 1.1Gb of events).

Reading events from default file.......read 4955 posts from file all_nostr_events.txt

I also noticed, everytime I quit, it's appending 8000+ posts, so why would it only load 4955? There has to be more than that in the file..

Appended 21338 new events to file "all_nostr_events.txt" of which 7998 are posts.

Lmk if I can provide any more info..

Investigate and fix "null is not of subtype string" crash seen in processIncomingEvents

To attach pic later

Unhandled exception:
type 'Null' is not a subtype of type 'String'
#0      Store.handleChannelEvents (package:nostr_console/tree_ds.dart:815)                                #1      Store.processIncomingEvent.<anonymous closure> (package:nostr_console/tree_ds.dart:1508)          #2      SetMixin.forEach (dart:collection/set.dart:142)                                                   #3      Store.processIncomingEvent (package:nostr_console/tree_ds.dart:1445)
#4      processAnyIncomingEvents.<anonymous closure> (package:nostr_console/console_ui.dart:27)
#5      new Future.delayed.<anonymous closure> (dart:async/future.dart:424)
#6      Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:18)
#7      _Timer._runTimers (dart:isolate-patch/timer_impl.dart:398)
#8      _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:429)
#9      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192)

[Feature Request] Add options to View Broadcasted relays for events and re-broadcast events

Could we add an option to view the list of relays that have seen or not seen the Event ID's that were published by the user or anyone else's event ID's as well. I feel this could be useful to know if our events / posts / notes / DM's were broadcasted to the relays were use or if they need re-broadcasting in case a relay was unreachable or down or if the relay does some restrictions or event handling.

It could be placed under the Other options menu as two different options 'View event broadcast info' and 'Broadcast Event'. The former option could be used to input an Event ID or Note ID and get a list of seen and unseen relays (relays that have seen or not seen the event amongst your added relays).

The latter option could allow the user to input event ID's to broadcast to relays that haven't seen it. Possible allow a comma separated user input of event ID's if multiple event ID's need to be re-broadcasted.

Errors on compile under MacOS

I'm not familiar with dart, so I ran brew install dart-sdk, then executed dart run bin/nostr_console.dart. Maybe I should know to manually install packages, but here's the output:

Error: Couldn't resolve the package 'bip340' in 'package:bip340/bip340.dart'.
Error: Couldn't resolve the package 'nostr_console' in 'package:nostr_console/event_ds.dart'.
Error: Couldn't resolve the package 'nostr_console' in 'package:nostr_console/tree_ds.dart'.
Error: Couldn't resolve the package 'nostr_console' in 'package:nostr_console/relays.dart'.
Error: Couldn't resolve the package 'nostr_console' in 'package:nostr_console/console_ui.dart'.
Error: Couldn't resolve the package 'args' in 'package:args/args.dart'.
nostr_console.dart:2:8: Error: Not found: 'package:bip340/bip340.dart'
import 'package:bip340/bip340.dart';
       ^
nostr_console.dart:4:8: Error: Not found: 'package:nostr_console/event_ds.dart'
import 'package:nostr_console/event_ds.dart';
       ^
nostr_console.dart:5:8: Error: Not found: 'package:nostr_console/tree_ds.dart'
import 'package:nostr_console/tree_ds.dart';
       ^
nostr_console.dart:6:8: Error: Not found: 'package:nostr_console/relays.dart'
import 'package:nostr_console/relays.dart';
       ^

[BUG] User profile followers consisting of five Leading zeros unidentifiable because of duplicates

Issue Description

Viewing a users profile consisting of followers with five leading zeros makes it impossible to uniquely identify the actual follower or those they follow because of duplicates.

Steps to Reproduce

  1. Use option 9 to Show user profile and enter pubkey of the user (d4843f4c280abba3d43d84ed7924b2567d7c166f5e72985b9f06d355601b5d78) belonging to EzoFox.
  2. Both the following and follower users are listed. Those beginning with five zeros '00000' are not uniquely identifiable because of duplicates.

image

Expected Result

Need to way to uniquely identify all duplicate followers and following users with PoW leading zero's in their hex pubkey. Same applies to npub's if the npubs are eventually also displayed in Nostr_Console in future updates. One way would be to display the beginning 4-5 digits and ending 4-5 digits of the hex pubkey (and same in the case of npub characters) separated by a delimiter like ':' colon or '...' ellipses. Eg: 00000:217qa, 00000:18s7j....

This way the user can copy that shortened hex or npub and paste it on option 8 to follow a new contact. This would also mean the Follow a new contact would need to accept such a format of shortened npub or hexpubkey.

The other option would be to display the complete following and follower hex Pubkey ID's / npub ID's on formatted on separate lines instead of a comma separated list. Those who have usernames/handles with NIP05 verification can also be displayed for easily finding such users and then following them or mentioning them.

Example reproduction details
Pubkey: npub16jzr7npgp2a684pasnkhjf9j2e7hc9n0teefskulqmf42cqmt4uqwszk52
HexPubkey: d4843f4c280abba3d43d84ed7924b2567d7c166f5e72985b9f06d355601b5d78

Test Environment Details

  • OS: Arch Linux
  • Nostr_Console version: Main Branch latest Git commit (v0.3.4-beta)
  • Execution Method: Docker

[Feature Request] Display relays of users when a user is looked up under Show user profile

When viewing a users profile under the option Social Network Menu > 9. Show user profile, along with the current information about following, followers, pubkey information and profile details, it would be nice to also show that users added relays.

Since such users notes would be transmitted to other relays that you may or may not have, and if you would like to connect/add it yourself while launching nostr_console so that you don't miss their notes/posts if a situation arises where some of your common relays are down or unreachable.

Sort public channels by specific field

Preferably, total number of messages, but optionally, by some other field such as name or timestamp of latest message.

Example below in which lots of the spam single-message groups obscure larger groups like "Bitcoin Heidelberg"

                                 All Public Channels


Channel Name                       id                Num of Messages     Latest Message
--------------------------------------------------------------------------------------------------------------
#plebchain                         plebchain #t      37                  Plebs, where you at?   - ₿its McGee ⚡️ 13% bitcoineer
Nostr                              25e5c8            1781                morning                -      Lurusan
#nostr                             nostr #t          12                  Any #nostr relays in   -        ae5f6
#bitcoin                           bitcoin #t        26                  I think I'll stack s   -    DerekRoss
#hope                              hope #t           1                   #Bitcoin is #HOPE 🙏   -      marcelo
nostr_console                      52cab2            28                  was expcting a ~/.no   -   le chiffre
#bitcoinnostr                      bitcoinnostr #t   5                   What up? #bitcoinnos   - satoshistore
#633                               633 #t            1                   &#477;l&#387;u&#592;   -       Michoe
#652                               652 #t            1                   &#477;l&#387;u&#592;   -       Michoe
#7433                              7433 #t           1                   &#477;l&#387;u&#592;   -       Michoe
#607                               607 #t            1                   &#477;l&#387;u&#592;   -       Michoe
#623                               623 #t            1                   &#477;l&#387;u&#592;   -       Michoe
#647                               647 #t            1                   &#477;l&#387;u&#592;   -       Michoe
#613                               613 #t            1                   &#477;l&#387;u&#592;   -       Michoe
#387                               387 #t            1                   &#477;l&#387;u&#592;   -       Michoe
#477                               477 #t            1                   &#477;l&#387;u&#592;   -       Michoe
#8516                              8516 #t           1                   &#477;l&#387;u&#592;   -       Michoe
#592                               592 #t            1                   &#477;l&#387;u&#592;   -       Michoe
#pow                               pow #t            1                   Any use of energy wh   -        b9304
#noderunner                        noderunner #t     1                   Fellow #plebchain #n   - personwhothinks
#medicine                          medicine #t       1                   Love the idea… Bitco   -        4d18d
#tipfornote                        tipfornote #t     2                   Fascinating early da   -  LIVEFOREVER
#facts                             facts #t          1                   #facts                 -        2c188
#useyourbrain                      useyourbrain #t   4                   USE YOUR BRAIN  ASK    -    Nano-Maxi
#redpiiled                         redpiiled #t      4                   USE YOUR BRAIN  ASK    -    Nano-Maxi
#useyourbrainhttps                 useyourbrainhttp  1                   USE YOUR BRAIN  ASK    -    Nano-Maxi
#introductions                     introductions #t  1                   #introductions I am    -        53989
nostr.crew                         5b156a            10                  do przyczajonych roz   -        66b6b
#nostrpebs                         nostrpebs #t      1                   should i add as many   -       satman
test1234                           f24a02            5                   Gggg                   -        57a64
#automateeverything                automateeverythi  1                   Civilization advance   -        7a78f
#redpilled                         redpilled #t      1                   yeah wait still ever   -    Nano-Maxi
#lightning                         lightning #t      1                   My humble small busi   -  SatsFaction
#local                             local #t          1                   are cashtags a thing   -        7277d
#p2p                               p2p #t            1                   are cashtags a thing   -        7277d
#dvt                               dvt #t            1                   How about ssv networ   - 小树林jutou (L,3)(💙,🧡) solstarter.eth.lens 🛸
#blebchain                         blebchain #t      1                   Don‘t Trust, Verify!   -         Mane
#shss                              shss #t           1                   GM. #SHSS              -        fd0bc
test                               d02e5f            0
test                               9f7d1a            0
#damus                             damus #t          1                   #nostr #damus it wou   -      marcelo
#plepchain                         plepchain #t      1                   #plepchain             -         Mane
#welcome                           welcome #t        1                   #welcome 🙏            -     Matthew
#work                              work #t           1                   Work view.  #work #w   -       merton
#stacksats                         stacksats #t      1                   Work view.  #work #w   -       merton
#worklife                          worklife #t       1                   Work view.  #work #w   -       merton
#noderunners                       noderunners #t    1                   The Wall needs inbou   -        98b62
#twitterfiles                      twitterfiles #t   1                   Glad to see that my    -        abab5
#buddycheck                        buddycheck #t     1                   As the festivities w   -      jason ⚡
#mentalwellness                    mentalwellness #  1                   As the festivities w   -      jason ⚡
#plebs4plebs                       plebs4plebs #t    1                   As the festivities w   -      jason ⚡
#gold                              gold #t           1                   https://nostr.build/   -        b9304
Asturias 2140                      a22fb3            2                   Hola collacios, esto   -  CachopoCoin
#nostriches                        nostriches #t     1                   Good Morning #nostri   - Intuitive Guy ⚡
DuckyScan                          416961            0
Bitcoiners Germany                 0be7d9            0
tezt chat                          81fbd2            1                   heyhey                 -         d503
Bitcoin Heidelberg                 15439f            0
Bitcoin2140                        4211fc            61                  GM, misma pregunta,    -       Romina

[Feature Request] Show connection status of relays apart from events received in Application Stats

The Server Connection info located in Other options Menu > 5. Application Stats currently displays the list of added relays and the number of events received. Some relays have 0 events received, which could indicate that they are either down, not reachable or don't have any events at all.

image

However, for those that already have events received, but that may have become unreachable later or down, there is currently not a way to determine that through the application stats. Might be good to add a 'Status' column and display Connected, Checking or Disconnected status codes for each of the added relays. This way a I feel a decision can be made by the user to add new relays or remove unreliable relays if needed for their events to be relayed.

[BUG] Mulitple invoices in a single note/post show up with one QR code

Issue Description

If multiple invoices are added in a post/note/reply they show up with only a single QR code when using the -l or --lnqr parameter to view QR codes for LN invoices.

Steps to Reproduce

  1. Run Nostr_Console with -l or --lnqr parameter
  2. Create a new Post with multiple LN Invoices (In my case three LN Invoices) separated by a single space
  3. View your posts / replies in which the multiple LN Invoices exist.
  4. Only one LNQR is displayed instead of three.
  5. View the same on Damus iOS client and it shows up as three LN invoices to pay.

Screenshots from Nostr_Console:
image
image

Screenshots from Damus iOS for comparison of expected output:
image

Example reproduction details
Event ID: d13f320ee9f9f7a1bcb5030d1edded59421445266cab2cb76ebbad2c238c02dc
Note ID: note16ylnyrhfl8m6r094qvx3ah0dt9ppg3fxdj4jedmwhwkjcguvqtwqyc5d2r

Expected result

Display multiple QR codes depending on the number of LN invoices pasted in a note/post/reply.

Test Environment Details

  • OS: Arch Linux
  • Nostr_Console version: Main Branch latest Git commit (v0.3.4-beta)
  • Execution Method: Docker

--genkey option creation

A --genkey option should be a plus to avoid asking user to create their Private Key manually with

$ openssl rand -hex 32

At start a dotfile must be searched if not existing, then a Warning must be written (if not Error instead).
When private key is created and stored in dotfile, then dotfile should be verified to be owned by the user and file mode must be 600.

Public key with 0 at beginning can't be handled by Nostr Console

If a private key generates a public that has 0's at the beginning, the application does not generate the correct signature or hash, with the result that such accounts can't really work with this application right now.

On sending a kind 1 post, this account's event will be invalid and will be rejected by relays.

On creating an encrypted room by such account, the application crashes.

An example private/public key pair is is c39a51b254c6d0ee022083c271afb4bba3e9ac8b004b7577200f31d6f44d96ef / 000006ed14c0337a42e434cf926252bc77b8788b58d78e8be43f416a43ea771a

originally reported by Sabah.

[Feature Request] Unfollow a contact

Option 8 on the Social Network menu currently lets us follow new contacts by Username or Pubkey. It would be also nice to add the unfollow option based on the user input parameters.

FR: spread menu to fewer lines

If I have a full screen terminal/console, spread the main menu at the bottom along 2-3 lines at most, so I get more feed based content on my screen. 10 lines taken up all the time is unnecessary

Docker: unable to prepare context

I ran the given command to try nostr console - sudo docker build -t nostr_console .

But I keep getting the below error.
unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /home/asinode/Dockerfile: no such file or directory

Docker is surely enabled and running when I checked systemctl status docker.

I ran all this from home folder (~). And the docker installation is fine.

$ sudo docker run hello-world

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

Below are the hidden files I have on the home folder. And there is no file such as Dockerfile as suggested in several other forums. Not sure if I am supposed to have this file within the home folder.

$ ll -a
-rw-------.  1 asinode asinode 9994 Dec 16 15:38 .bash_history
-rw-r--r--.  1 asinode asinode   18 Sep 27 18:25 .bash_logout
-rw-r--r--.  1 asinode asinode  141 Sep 27 18:25 .bash_profile
-rw-r--r--.  1 asinode asinode  492 Sep 27 18:25 .bashrc
drwxr-xr-x. 34 asinode asinode 4096 Dec 16 15:44 .cache
drwxr-xr-x. 31 asinode asinode 4096 Dec 16 15:49 .config
drwxr-xr-x.  6 asinode asinode 4096 Dec 16 15:23 .docker
drwx------.  3 asinode asinode 4096 Dec  6 17:52 .gnome
drwx------.  6 asinode asinode 4096 Dec  2 00:21 .gnupg
-rw-r--r--.  1 asinode asinode    0 Dec 16 15:42 .gtkrc-2.0
-rw-r--r--.  1 asinode asinode  321 Dec 16 15:42 .gtkrc-2.0-kde4
-rw-------.  1 asinode asinode   20 Dec 16 15:46 .lesshst
drwxr-xr-x.  4 asinode asinode 4096 Dec  1 22:39 .local
drwxr-xr-x.  5 asinode asinode 4096 Dec  1 22:41 .mozilla
drwx------.  3 asinode asinode 4096 Dec  1 23:19 .pki
drwxr-xr-x.  2 asinode asinode 4096 Dec  1 22:39 Public
drwxr-xr-x.  3 asinode asinode 4096 Dec  6 18:35 .shutter

drwx------.  4 asinode asinode 4096 Dec  2 00:21 .thunderbird

Is there any more info I need to provide here? Please see if you can advise a solution to this. Thanks.

[BUG?] Post/reply timestamp displayed is in GMT in comparison to user timezone/system time

Issue Description

Creating any post/replies on Nostr_Console displays the time in GMT on console. It can be a bit confusing for the end user viewing the timestamps comparing it to their system time (in my case [GMT-05:00] / EST) and knowing when they actually made the post.

Steps to Reproduce

  1. Create a new post/reply on Nostr_Console.
  2. Review the post time and date in comparison to system time or created_at time in the metadata. There's a different of +5 hours (for me).

Screenshots from Nostr_Console:
image

Metadata created_at date/time:
image
1672697081 Epoch unix time = GMT: Monday, January 2, 2023 10:04:41 PM

Expected output:

Monday, January 2, 2023 5:04:41 PM (GMT-05:00). Need to perform conversion of the GMT time to user's timezone and display in the post timestamp.

Example reproduction details
Event ID: 02c17553731d7746800881043f1854b95d5cbdea4028d0b2020a16cb5da32f1e
Note ID: note1qtqh25mnr4m5dqqgsyzr7xz5h9w4e002gq5dpvszpgtvkhdr9u0qk5z5gy

Test Environment Details

  • OS: Arch Linux
  • Nostr_Console version: Main Branch latest Git commit (v0.3.4-beta)
  • Execution Method: Docker

[Feature Request] Add Edit Profile options to configure Bitcoing Lightning tips (LNURL or LN Address)

Certain clients like Damus and Bija provide the ability to add/set a Bitcoin Lightning tips (LNURL or LN Address) to the user's profile. Anyone can then visit their profiles and click on the Lightning icon ⚡ to make payments/tips with their LN wallets.

It would be good to allow the user to add a new LNURL or LN Address to their profile.

Current options to edit the profile are limited to the following:
image

Add a new option - "Enter Bitcoin Lightning tips LNURL/LN Address. Leave blank if unknown/none". Validate to ensure that it does not overwrite existing defined LNURL/LNAddress if the user leaves it blank (indicating to Nostr_Console that no changes are needed).

Also, once this feature is added it would be good to generate and display LNURL QR codes with the entire LNURL to copy or only the LN Address if the LN address is set. This should be located under the submenu - Social Networks > 9. Show user profile when a user profile information is displayed after looking it up.

Handle retweets and replies

Nostr console can't see any comment other than the top comment, which is with id b1ae6c7ba21b456be32a0fc5ac1957a69b06e18780252e913cd3b5455ee0df55

2022-11-11

Readlinesync() isn't working in docker image

For newly added bin/helloworld.dart, the run is like:


PS > dart run .\bin\helloworld.dart
Enter your name, anon: vishal
Hello vishal

PS > docker run   nostr_console
Enter your name, anon:
Should not print this if readlineSync works.

PS >

The difference is that inside docker image, the readlineSync function doesn't return anything.

Certificate verify failed when connecting to nostr-relay.freeberty.net

sending request ["REQ","latest",{ "authors": ["1f5cd0b7618dcd0b4040e0daa1e6719ae9e4b5c0822fc5f47ed55725e08b6564"], "limit": 20  } ] to wss://nostr.onsats.org
waiting for feed to come in
Error: Could not connect to wss://nostr-relay.freeberty.net
Unhandled exception:
HandshakeException: Handshake error in client (OS Error:
        CERTIFICATE_VERIFY_FAILED: self signed certificate(../../third_party/boringssl/src/ssl/handshake.cc:393))
#0      _SecureFilterImpl._handshake (dart:io-patch/secure_socket_patch.dart:99:46)
#1      _SecureFilterImpl.handshake (dart:io-patch/secure_socket_patch.dart:142:25)
#2      _RawSecureSocket._secureHandshake (dart:io/secure_socket.dart:911:54)
#3      _RawSecureSocket._tryFilter (dart:io/secure_socket.dart:1040:19)
<asynchronous suspension>

Allow for special chars in input

I just tried nostr console and after typing "re" (miss clicked) and then correcting to "é" my message got screwed up. It was showing up correctly on my side, but was sent differently

Minor ux issue for those using english international I guess.

image

[Feature Request] Support boosts/re-post

To maintain client uniform functions it would be nice to add support for boots/reposts.

Quoting post Feature

Currently few other clients allow reposting/boosting notes or event ID's by using ampersand '&' or the at symbol '@' before the Note ID or Event ID. It would be good to support the same on Nostr_Console by allowing to boost using either Note ID and/or Event ID so that the end user has the flexibility to choose. Event ID's are probably easiest to quote on Nostr_Console because of the 6 abbreviated unique strings.

Only a single post can be boosted at a time.

Unhandled exception: type 'Null' is not a subtype of type 'String'

Waiting for user posts to come in........done
Waiting for feed to come in..............done
Unhandled exception:
type 'Null' is not a subtype of type 'String'
#0      Store.handleChannelEvents (package:nostr_console/tree_ds.dart:815)
#1      new Store.fromEvents.<anonymous closure> (package:nostr_console/tree_ds.dart:1263)
#2      _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:617)
#3      new Store.fromEvents (package:nostr_console/tree_ds.dart:1254)
#4      getTree (package:nostr_console/tree_ds.dart:2723)
#5      main.<anonymous closure>.<anonymous closure> (file:///work/bin/nostr_console.dart:426)
#6      new Future.delayed.<anonymous closure> (dart:async/future.dart:424)
#7      Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:18)
#8      _Timer._runTimers (dart:isolate-patch/timer_impl.dart:398)
#9      _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:429)
#10     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192)

Channel messages and replies are not working

Nostr console does not properly handle kind 42 messages with more than one e tag or the one with replies too.

It shows each reply in a new room with an event Id of the message replied to, rather than in its proper room.

Solution: to fix it, but meanwhile disabling channels in latest check in.

Unhandled Exception / Handshake Exception : `Handshake error in client` HANDSHAKE_FAILURE_ON_CLIENT_HELLO

Hi Folks, I'm getting the following error, running the latest release on Windows.

Waiting for user posts to come in.....Unhandled exception:
HandshakeException: Handshake error in client (OS Error:
        SSLV3_ALERT_HANDSHAKE_FAILURE(../../third_party/boringssl/src/ssl/tls_record.cc:594)
        HANDSHAKE_FAILURE_ON_CLIENT_HELLO(../../third_party/boringssl/src/ssl/handshake.cc:644))
#0      _SecureFilterImpl._handshake (dart:io-patch/secure_socket_patch.dart:99)
#1      _SecureFilterImpl.handshake (dart:io-patch/secure_socket_patch.dart:142)
#2      _RawSecureSocket._secureHandshake (dart:io/secure_socket.dart:911)
#3      _RawSecureSocket._tryFilter (dart:io/secure_socket.dart:1040)
<asynchronous suspension>

Does anybody know how to fix?

New install just passing in private and public key as parameters

dart run bin/nostr_console.dart -p thekey -k theprivkey

Going to use the provided private key
Going to use default file to read from and store events: all_nostr_events.txt
Reading events from default file.......read 0 posts from file all_nostr_events.txt
Waiting for user posts to come in........done
Waiting for feed to come in..............done
Unhandled exception:
RangeError (end): Invalid value: Not in inclusive range 0..3: -1
#0 RangeError.checkValidRange (dart:core/errors.dart:363:9)
#1 _StringBase.substring (dart:core-patch/string_patch.dart:400:27)
#2 EventData.decryptDirectMessage (package:nostr_console/event_ds.dart:296:27)
#3 EventData.translateAndExpandMentions (package:nostr_console/event_ds.dart:253:27)
#4 Store.handleDirectMessages (package:nostr_console/tree_ds.dart:783:24)
#5 new Store.fromEvents. (package:nostr_console/tree_ds.dart:845:9)
#6 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:617:13)
#7 new Store.fromEvents (package:nostr_console/tree_ds.dart:829:24)
#8 getTree (package:nostr_console/tree_ds.dart:2105:24)
#9 main.. (file:///D:/Apps/nostr_console/bin/nostr_console.dart:312:26)
#10 new Future.delayed. (dart:async/future.dart:424:39)
#11 Timer._createTimer. (dart:async-patch/timer_patch.dart:18:15)
#12 _Timer._runTimers (dart:isolate-patch/timer_impl.dart:398:19)
#13 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192:12)

unable to make a post, no errors?

Trying to create a new post in the social menu. My post never shows up in the list of my posts? I'm passing in a relay, and private key. All seems to work, just not posts. Likes work, and replies work..

edit: likes might not work.. hm, actually not sure if any of the post stuff works..

edit2: running master branch

Conflicting IDs when truncated at 4?

I haven't been able to totally debug this, but I think the IDs as displayed in nostr_console may be too short to avoid conflicts given the increased usage.

I attempted to send a delete request for id "20c2" and received the response
Invalid Event Id(s). Kindly enter a more unique id.

Since the console truncates the ID at 4 I went to another client and was able to send the delete request using more characters. I assume there was a conflicting ID, but didn't have to tools to find it. Maybe worth upping the default length of ID display in the terminal?

[Feature Request] Support quoting posts/replies

To maintain client uniform functions it would be nice to add support for quoting posts/replies.

Quoting post Feature

Currently few other clients allow quoting notes or event ID's by using ampersand '&' or the at symbol '@' before the Note ID or Event ID. It would be good to support the same on Nostr_Console by allowing to quote using either Note ID and/or Event ID so that the end user has the flexibility to choose. Event ID's are probably easiest to quote on Nostr_Console because of the 6 abbreviated unique strings.

If multiple posts are quoted in a single user post, make sure that the user needs to enter at least a single space after each quote. For example

@/&<quote-note-or-event-id1><space>@/&<quote-note-or-event-id2>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.