refactor/docs: include nsec script in README and generate nsec directly

This commit is contained in:
P. Reis 2024-03-30 18:09:37 -03:00
parent 99b22ab726
commit 494193020e
2 changed files with 4 additions and 9 deletions

View File

@ -48,7 +48,7 @@ TODO
3. Download [Soapbox](https://dl.soapbox.pub/) or another web-based Mastodon client of your choice.
4. Put the frontend files inside the `public` directory.
5. Create an `.env` file.
6. Define `DITTO_NSEC=<value>` in your .env file. You can generate an nsec by installing [nak](https://github.com/fiatjaf/nak) and running `nak key generate | nak encode nsec`.
6. Define `DITTO_NSEC=<value>` in your .env file. You can generate an nsec by running `deno task nsec`.
7. Run `deno task dev`.
## License

View File

@ -1,11 +1,6 @@
import { generateSecretKey, nip19 } from 'npm:nostr-tools';
const encodedNsec = generateEncodedPrivateKey();
console.log(encodedNsec);
const sk = generateSecretKey();
const nsec = nip19.nsecEncode(sk);
function generateEncodedPrivateKey(): string {
const sk = generateSecretKey();
const nsec = nip19.nsecEncode(sk);
return nsec;
}
console.log(nsec);