K on Nostr: sometimes i had some ideas and i don't hace enough time to work on them or implement ...
sometimes i had some ideas and i don't hace enough time to work on them or implement them.
i decided to explain one of them here and anyone who is interested can work on it.
as you know #khatru is a dynamic and flexible framework to develop nostr relays. and you have full control over new events, filters, connections and... using functions and interfaces.
for exmaple using the same functions and interfaces you can define an interface to database to write/read notes or blossom server to store/retrieve blobs.
in these cases, you have some database and blob storage protocols that are well known and common. so a library like eventstore or blobstore is out there:
https://github.com/kehiy/blobstore
https://github.com/fiatjaf/eventstore
on the other hand we have nip-86 management apis for relays which is very helpful and important. it's supported on khatru and customizeable in the same way.
which you can define and use it like how i did it in the #alienos :
https://github.com/dezh-tech/alienos/blob/main/management.go
https://github.com/dezh-tech/alienos/blob/03cad6536260f9d9f8c4e11d5f327a064aa5d5c6/main.go#L137
the #idea is to export this functionality and provide it as a package. so, khatru relays can support nip-86 without writing code from scratch.
more improvements: instead of using a management json file like me, you can use an event store interface and store your data in form of nostr events in relay database.
cc Anthony Accioly (nprofile…0p5w) fiatjaf (nprofile…dlnm) and other khatru devs.
#note #golang #go
i decided to explain one of them here and anyone who is interested can work on it.
as you know #khatru is a dynamic and flexible framework to develop nostr relays. and you have full control over new events, filters, connections and... using functions and interfaces.
for exmaple using the same functions and interfaces you can define an interface to database to write/read notes or blossom server to store/retrieve blobs.
in these cases, you have some database and blob storage protocols that are well known and common. so a library like eventstore or blobstore is out there:
https://github.com/kehiy/blobstore
https://github.com/fiatjaf/eventstore
on the other hand we have nip-86 management apis for relays which is very helpful and important. it's supported on khatru and customizeable in the same way.
which you can define and use it like how i did it in the #alienos :
https://github.com/dezh-tech/alienos/blob/main/management.go
https://github.com/dezh-tech/alienos/blob/03cad6536260f9d9f8c4e11d5f327a064aa5d5c6/main.go#L137
the #idea is to export this functionality and provide it as a package. so, khatru relays can support nip-86 without writing code from scratch.
more improvements: instead of using a management json file like me, you can use an event store interface and store your data in form of nostr events in relay database.
cc Anthony Accioly (nprofile…0p5w) fiatjaf (nprofile…dlnm) and other khatru devs.
#note #golang #go