Add ZMQ-PUB support for webhooks (#75)

This commit is contained in:
Lee *!* Clagett
2023-07-30 13:27:22 -04:00
committed by Lee *!* Clagett
parent d59fed6da2
commit 15e2be618a
11 changed files with 238 additions and 22 deletions

View File

@@ -177,3 +177,4 @@ namespace lws
}
} // lws

View File

@@ -263,7 +263,7 @@ namespace db
map_webhook_value(dest, source, payment_id);
}
void write_bytes(wire::json_writer& dest, const webhook_tx_confirmation& self)
void write_bytes(wire::writer& dest, const webhook_tx_confirmation& self)
{
crypto::hash8 payment_id;
static_assert(sizeof(payment_id) == sizeof(self.value.first.payment_id), "bad memcpy");

View File

@@ -299,7 +299,7 @@ namespace db
webhook_value value;
output tx_info;
};
void write_bytes(wire::json_writer&, const webhook_tx_confirmation&);
void write_bytes(wire::writer&, const webhook_tx_confirmation&);
//! References a specific output that triggered a webhook
struct webhook_output

View File

@@ -2192,6 +2192,7 @@ namespace db
expect<void> storage::add_webhook(const webhook_type type, const account_address& address, const webhook_value& event)
{
if (event.second.url != "zmq")
{
epee::net_utils::http::url_content url{};
if (event.second.url.empty() || !epee::net_utils::parse_url(event.second.url, url))