On Thu, Oct 19, 2023 at 03:16:37AM +0000, Daniel D'Aquino wrote:
> On Oct 17, 2023, at 16:09, William Casarin <
jb...@jb55.com> wrote:
>> On Mon, Oct 16, 2023 at 10:16:42PM +0000, Daniel D'Aquino wrote:
>>> If I need to generate test events in the future, do you have any
>>> recommendations of tools I can use to conveniently generate/fetch
>>> valid and signed Nostr JSON events (such as profile events)? (I
>>> currently can easily do it for normal notes via Damus UI, but not
>>> for profile events or other special events yet)
>>
>> I wrote
https://github.com/jb55/nostril (C),
>>
>> fiatjaf wrote nak:
https://github.com/fiatjaf/nak (Go)
>
>Awesome! This is great, thanks!
I forgot nostcat:
https://github.com/blakejakopovic/nostcat
Example:
$ nostril query -k 0 -l 1 -a $(bech32 -d npub1xtscya34g58tk0z605fvr788k263gsu6cy9x0mhnm87echrgufzsevkk5s | xxd -p -c100) |
nostcat wss://
relay.damus.io |
jq '.[2].content | fromjson'
Returns:
{"banner":"
https://nostr.build/i/3d6f22d45d95ecc2c19b1acdec57aa15f2dba9c423b536e26fc62707c125f557.jpg","display_name":"William","name":"jb55","picture":"
https://cdn.jb55.com/img/red-me.jpg","nip05":"_@
jb55.com","lud16":"
jb...@jb55.com","website":"
https://damus.io","about":"I made damus, npubs and zaps. banned by apple & the ccp. my notes are not for sale."}
nostril-query is a script in my nostril repo.
$ nostril query -k 0 -l 1 -a $(bech32 -d npub1xtscya34g58tk0z605fvr788k263gsu6cy9x0mhnm87echrgufzsevkk5s | xxd -p -c100)
["REQ", "nostril-query", {"authors": ["32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245"], "limit": 1, "kinds": [0]}]
as you can see nostril query generates queries for nostcat.
Where bech32 is
https://github.com/cmoog/bech32
I wrapped bech32 with a script called npub:
#!/bin/sh sh
bech32 -d "$@" | xxd -p -c100
So you can just do:
$ nostril query -k 0 -l 1 -a $(npub npub1xtscya34g58tk0z605fvr788k263gsu6cy9x0mhnm87echrgufzsevkk5s)
Although I should eventually just add nevent/npub/note/nprofile support to nostril...
Cheers,
Will