Sybil Test Utility

Description
This is a simple PHP program that takes an edited/pre-formatted Asciidoc document, splits it into the specific sections or chapters defined (based upon the first and second level headers, for further levels, please use the Alexandria client), generates a curated publication from that file, and writes it to the relays selected.
I've since begun to expand it, to keep up with the development of our web GUI.
Directions
Prerequisites
You will need to have php (including php-cli) and composer installed on the machine and configured.
Then run
composer install
to download the dependencies to a vendor folder and create the composer.lock file.If you do not yet have the yaml PECL library installed, run
sudo apt-get install php-yaml
.Then enter
php --ini
and look for the entryLoaded Configuration File
that contains the filepath to the php.ini file.Enter
sudo nano <filepath>
and add the line, at the bottomextension=yaml.so
and restart the terminal.If using VS Code or Codium, you will need to also go to File > Preferences > Settings. Search for stubs, click the Edit settings in json link, and then add yaml to the stubs list.
Save your Bech32 nsec in the environment variable with
export NOSTR_SECRET_KEY=nsec123
.Open the folder user and edit the file relays.yml containing your list of relays. We recommend keeping wss://thecitadel.nostr1.com in your list and adding at least one other, that you have write access to. If you remove all relays, the Citadel relay will be used as default.
a
tags will always contain thecitadel relay as the relay hint.
Curated Publications (30040)
Open the file in the user folder called 30040_settings_template.yml, read the descriptions of the event tags at the top, and then copy out the
////<<YAML>>
section.Paste the section beneath the document header (=) of your publication. The publication file should be located at in the top/root folder, be formatted in Asciidoc, and have an
.adoc
ending.Edit the information within that yaml section and remove/add any optional tags.
If you like, you can do the same for each 1st-level header (==). That will give the 30041 events more-customized tags. Otherwise, they derive their tags from the 30040 index event.
On the command line, enter the program name, the command, and the name of your publication file.
php Sybil.php publication MyShortBook.adoc
All of the events will be added to the eventsCreated.txt file.
The 30040 eventID will be sent to stdout (usually the command line) in the form of an njump hyperlink. The link will not work, if you wrote to a local relay, but you can still see the eventID.
Longform Articles (30023)
Open the file in the user folder called 30023_settings_template.yml, read the descriptions of the event tags at the top, and then copy out the
////<<YAML>>
section.Paste the section above the first header (#) in your article file. The article file should be located at in the top/root folder, be formatted in Markdown and have an
.md
ending.Edit the information within that yaml section and remove/add any optional tags.
On the command line, enter the program name, the command, and the name of your article file.
php Sybil.php longform MyArticle.md
All of the events will be added to the eventsCreated.txt file.
The 30023 eventID will be sent to stdout (usually the command line) in the form of an njump hyperlink. The link will not work, if you wrote to a local relay, but you can still see the eventID.
Wiki Pages (30818)
Open the file in the user folder called 30818_settings_template.yml, read the descriptions of the event tags at the top, and then copy out the
////<<YAML>>
section.Paste the section above the first header (=) in your wiki file. The wiki file should be located at in the top/root folder, be formatted in Asciidoc, and have an
.adoc
ending.Edit the information within that yaml section and remove/add any optional tags.
On the command line, enter the program name, the command, and the name of your wiki file.
php Sybil.php wiki WikiPage.adoc
All of the events will be added to the eventsCreated.txt file.
The 30818 eventID will be sent to stdout (usually the command line) in the form of an njump hyperlink. The link will not work, if you wrote to a local relay, but you can still see the eventID.
Utilities
The following utilities are available:
Fetch
Takes the argument hex eventID and looks for it in the standard relay set.
php Sybil.php fetch 108657...
Delete
Takes the argument hex eventID and sends a deletion request to the standard relay set.
php Sybil.php delete 108657...
Broadcast
Takes the argument hex eventID, fetches the event, and broadcasts it to the standard relay set.
php Sybil.php broadcast 108657...
Automated Tests
To check that everything is installed correctly, you can run
./vendor/bin/phpunit src/
to see the unit and integration tests, if you have PHPUnit installed.
Example
If you go to next-alexandria, you can then see the publications which you have produced, so long as you have published them to wss://thecitadel.nostr1.com or one of your npub's outbox relays.
An example of a typical document, produced with this tool, is the test file AesopsFables_testfile_a.adoc
which looks like this:

And produces a book, like this:




Contact information
If you have any questions, comments, or zaps, then please feel free to contact me on Nostr. My npub is npub1l5sga6xg72phsz5422ykujprejwud075ggrr3z2hwyrfgr7eylqstegx9z.
Or use the issues on the GitCitadel homepage