-
Notifications
You must be signed in to change notification settings - Fork 34
Nostr Console Best Practices
The simplest way to start nostr console is
./nostr_console_exe -k <private key in hex>
or
./nostr_console_exe --prikey=<private key in hex>
Once it starts, the basic flow of the Nostr Console application is the following: Once you invoke the application with a --prikey option, it allows you to use this app as a Nostr client, where you can send events, message etc, as well as read them.
After you exit the app for the first time ( at end of its first invocation) the app will store all the events it has received in a file in pwd which by default is named "all_nostr_events.txt". The name does not imply that it has ALL nostr events, but only it has all the events that have been received by this client till now.
On next invocations, the app will read events from the file, and also fetch new events from the relays. And if it gets new events, it will show them as notifications.
The name of file is controlled by --file flag. Which will prove useful when you want to use the client with multiple accounts.
On windows, you can easily create a shortcut on desktop or anywhere else. A shortcut to Nostr Console executable, with arguments as required, will make it easy for you to invoke the application by just a click. An example of how it looks like is seen here.
Similar steps can be taken in other operating systems, though their shortcuts may take different forms and even different names.
A single instance of Nostr Console can only handle or work with a single account. However, you can invoke multiple nostr console applications with different accounts at the same time, and all those applications will work independently. Its important in such cases to give different --file arguments to each invocation ( otherwise multiple instances will/may write to same file and corrupt it).
One can also create multiple shortcuts, where each shortcut is for a different account.
On Windows, this is a useful console program, and it even prints emojis.
It can be invoked through a shortcut too, whose command line would look like (you'd need to change the nostr_console_win64.exe path and even the wt.exe path though):
C:\Users\Vishal\AppData\Local\Microsoft\WindowsApps\wt.exe C:\Users\GitHub\nostr_console\bin\nostr_console_win64.exe --file=account1_events_file.txt --prikey=deadbeafdeadbeafdeadbeafdeadbeafdeadbeafdeadbeafdeadbeafdeadbeaf
The --width=N will make the application use N number of columns in the terminal. The default is 120. So if you see lot of screen empty on left and right of the displayed text, then you can use this setting to make it use more screen. This thread has some screenshots too.
Typing the following command on bash/linux will take you straight to the '#nostr console' public channel ( whose channel id starts with 52ca). You can add your --prikey too.
It first gives specific inputs to the app, then makes the app take input from stdin.
{ echo -e "3\n1\n52ca" ; cat /dev/stdin; } | ./nostr_console_elf64
using same principles, you can go to any public channel or your direct message inbox, or encrypted channel etc.