mirror of
https://github.com/urbit/shrub.git
synced 2024-12-19 16:51:42 +03:00
wip
This commit is contained in:
parent
a066d6f337
commit
449b760e4f
@ -8,7 +8,7 @@
|
||||
$% state-0
|
||||
==
|
||||
::
|
||||
+$ state-0 [%0 counter=@]
|
||||
+$ state-0 [%0 =status]
|
||||
::
|
||||
+$ card card:agent:gall
|
||||
::
|
||||
@ -17,6 +17,7 @@
|
||||
=| state-0
|
||||
=* state -
|
||||
^- agent:gall
|
||||
=<
|
||||
|_ =bowl:gall
|
||||
+* this .
|
||||
def ~(. (default-agent this %|) bowl)
|
||||
@ -38,14 +39,13 @@
|
||||
++ on-poke
|
||||
|= [=mark =vase]
|
||||
^- (quip card _this)
|
||||
?+ mark (on-poke:def mark vase)
|
||||
%noun
|
||||
?+ q.vase (on-poke:def mark vase)
|
||||
%status
|
||||
:_ this
|
||||
~[[%pass / %agent [our.bowl %btc-node-hook] %poke %btc-node-hook-action !>([%ping ~])]]
|
||||
:: TODO only allow poke if we are a host (in status)
|
||||
=^ cards state
|
||||
?+ mark (on-poke:def mark vase)
|
||||
%btc-bridge-command
|
||||
(handle-command:hc !<(command vase))
|
||||
==
|
||||
==
|
||||
[cards this]
|
||||
::
|
||||
++ on-watch on-watch:def
|
||||
++ on-leave on-leave:def
|
||||
@ -67,3 +67,10 @@
|
||||
++ on-fail on-fail:def
|
||||
--
|
||||
:: helper core
|
||||
|_ =bowl:gall
|
||||
++ handle-command
|
||||
|= comm=command
|
||||
^- (quip card _state)
|
||||
~& >>> comm
|
||||
`state
|
||||
--
|
||||
|
@ -1,7 +0,0 @@
|
||||
/+ btca=btc-address
|
||||
:- %say
|
||||
|= [[now=@da eny=@uvJ bec=beak] [zpub=tape ~] ~]
|
||||
:- %noun
|
||||
=/ pp=(unit parsed-xpub:btca)
|
||||
(parse-zpub:btca zpub)
|
||||
pp
|
19
gen/btc-bridge/command.hoon
Normal file
19
gen/btc-bridge/command.hoon
Normal file
@ -0,0 +1,19 @@
|
||||
:: Sends a command to the BTC Bridge
|
||||
::
|
||||
:: Commands:
|
||||
::
|
||||
::
|
||||
::
|
||||
/- *btc-bridge
|
||||
::
|
||||
:- %say
|
||||
|= $: [now=@da eny=@uvJ =beak]
|
||||
[[comm=command ~] ~]
|
||||
==
|
||||
:- %btc-bridge-command
|
||||
?+ -.comm ~| [%unsupported-command -.comm] !!
|
||||
%connect-as-host comm
|
||||
%connect-as-client comm
|
||||
%add-clients comm
|
||||
%broadcast-tx comm
|
||||
==
|
@ -7,11 +7,15 @@
|
||||
[%client connected=? host=ship]
|
||||
==
|
||||
+$ action
|
||||
$% [%connect-as-host =credentials]
|
||||
[%connect-as-client host=ship]
|
||||
[%check-status ~]
|
||||
$% [%check-status ~]
|
||||
[%balance =address]
|
||||
[%transactions =address]
|
||||
==
|
||||
::
|
||||
+$ command
|
||||
$% [%connect-as-host =credentials]
|
||||
[%connect-as-client host=ship]
|
||||
[%add-clients clients=(set ship)]
|
||||
[%broadcast-tx =tx]
|
||||
==
|
||||
--
|
||||
|
Loading…
Reference in New Issue
Block a user