watch commands

This commit is contained in:
timlucmiptev 2020-10-02 14:05:41 +03:00 committed by ixv
parent 48183e57be
commit 5375f216c6
4 changed files with 23 additions and 4 deletions

View File

@ -41,16 +41,21 @@
?+ mark (on-poke:def mark vase)
%noun
?+ q.vase (on-poke:def mark vase)
%send-tx
~& >>> %send-tx
`this
%status
:_ this
~[[%pass / %agent [our.bowl %btc-node-hook] %poke %btc-node-hook-action !>([%get-block-count ~])]]
==
==
::
++ on-watch on-watch:def
++ on-leave on-leave:def
++ on-peek on-peek:def
++ on-agent on-agent:def
++ on-agent
|= [=wire =sign:agent:gall]
^- (quip card _this)
:: ?+ (on-agent:def wire sign)
~& >> "{<sign>}"
`this
++ on-arvo on-arvo:def
++ on-fail on-fail:def
--

View File

@ -117,6 +117,12 @@
%credentials
:_ state(endpoint url.comm, user user.comm, pass pass.comm)
[%pass / %arvo %d %flog [%text "credentials updated..."]]~
%watch
~& >> comm
`state(watched-calls (~(put in watched-calls) call.comm))
%unwatch
~& >> comm
`state(watched-calls (~(del in watched-calls) call.comm))
==
::
++ httr-to-rpc-response

View File

@ -13,4 +13,6 @@
:- %btc-node-hook-command
?+ -.comm ~| [%unsupported-command -.comm] !!
%credentials comm
%watch comm
%unwatch comm
==

View File

@ -2020,6 +2020,12 @@
$% :: Loads RPC node URL+credentials
::
[%credentials url=@t user=@t pass=@t]
:: Adds an RPC call to the set of calls that trigger a broadcast to subscribers
::
[%watch call=term]
:: Removes an RPC call from the set of calls that trigger a broadcast to subscribers
::
[%unwatch call=term]
:: TODO: Sync data/wallets...
::
[%sync ~]