Why Nostr? What is Njump?
2024-09-22 22:38:47

mleku on Nostr: not sure why it doesn't exist because it's so simple, but using i've created a really ...

not sure why it doesn't exist because it's so simple, but using https://github.com/go-simple/env i've created a really simple config system that you can:

- get a list of parameters with "help" "-h" and most of the other common help flags

- automatically looks for a `.env` file where it is configured to store data, which can be overridden using environment (this is a chicken and egg problem with flags)

- can have parameters specified in the command line, but not recommended, by use of prefix (better to put into `.env` file or use "export" or "set" whatever your shell uses for security reasons) - i intend to later be able to manually set a relay nsec for the chatbot, best to do this with the environment anyway, as kernel process command lines can otherwise leak this info to unprivileged processes in the same namespace

i've spent many an hour of my life fucking around with stupid flag libraries and configuration file parsers and for what end?

still probably not fixed - LND and BTCD both have problems whereby config files are not actually parsing some of the fields, and you have to set them in the command line, wtf

with this scheme it's dead simple, it's built into the OS (even windows has this shit), the "parser" for the env file literally just splits the file by line breaks, then by equals `=` and trims excess space off everything and this then stands in place of the OS reader so you can make a config file that is just KEY=VALUE one per line, also dead simple, also can be even imported by the shell upon launch of the application instead of using this very simple feature i just wrote in like half an hour

that's it, the end, no more features for this part of my relay now, and you will be happy (because you can make your own extra nicknacks for this, mostly following along the same style as fiatjaf/relayer, though using a faster, binary-string oriented nostr codec library that is much much faster, and a binary encoder for the database that is the fastest existing

mainly also because it's the simplest, also, just like this config system

simple > featureful

simple > expressive

plaintext > binary (isn't that why nostr uses JSON tho?)
Author Public Key
npub1fjqqy4a93z5zsjwsfxqhc2764kvykfdyttvldkkkdera8dr78vhsmmleku