include negentropy protocol version in NIP-11 and landing page

This commit is contained in:
Doug Hoyte
2024-09-04 23:31:25 -04:00
parent 3016a9bb7a
commit 150ea1b887
2 changed files with 8 additions and 1 deletions

View File

@ -56,6 +56,7 @@ void RelayServer::runWebsocket(ThreadPool<MsgWebsocket>::Thread &thr) {
{ "supported_nips", supportedNips }, { "supported_nips", supportedNips },
{ "software", "git+https://github.com/hoytech/strfry.git" }, { "software", "git+https://github.com/hoytech/strfry.git" },
{ "version", APP_GIT_VERSION }, { "version", APP_GIT_VERSION },
{ "negentropy", negentropy::PROTOCOL_VERSION - 0x60 },
{ "limitation", tao::json::value({ { "limitation", tao::json::value({
{ "max_message_length", cfg().relay__maxWebsocketPayloadSize }, { "max_message_length", cfg().relay__maxWebsocketPayloadSize },
{ "max_subscriptions", cfg().relay__maxSubsPerConnection }, { "max_subscriptions", cfg().relay__maxSubsPerConnection },
@ -81,7 +82,8 @@ void RelayServer::runWebsocket(ThreadPool<MsgWebsocket>::Thread &thr) {
struct { struct {
std::string supportedNips; std::string supportedNips;
std::string version; std::string version;
} ctx = { tao::json::to_string(supportedNips), APP_GIT_VERSION }; uint64_t negentropy;
} ctx = { tao::json::to_string(supportedNips), APP_GIT_VERSION, negentropy::PROTOCOL_VERSION - 0x60 };
rendered = preGenerateHttpResponse("text/html", ::strfrytmpl::landing(ctx).str); rendered = preGenerateHttpResponse("text/html", ::strfrytmpl::landing(ctx).str);
ver = cfg().version(); ver = cfg().version();

View File

@ -155,6 +155,11 @@
<td>Supported NIPs</td> <td>Supported NIPs</td>
<td>$(ctx.supportedNips)</td> <td>$(ctx.supportedNips)</td>
</tr> </tr>
<tr>
<td><a href="https://github.com/hoytech/negentropy">negentropy</a></td>
<td>$(ctx.negentropy)</td>
</tr>
</table> </table>
</body> </body>
</html> </html>