From 8ef372f1c013122e08e33b42c0cde9724bd6b34f Mon Sep 17 00:00:00 2001 From: timlucmiptev Date: Mon, 12 Oct 2020 11:26:43 +0300 Subject: [PATCH] ported RPC actions --- app/btc-bridge.hoon | 3 ++- gen/btc-bridge/rpc-action.hoon | 13 +++++++++++++ sur/btc-bridge.hoon | 20 +++++++++++++++++++- 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 gen/btc-bridge/rpc-action.hoon diff --git a/app/btc-bridge.hoon b/app/btc-bridge.hoon index ff16c2620b..0ecc344e28 100644 --- a/app/btc-bridge.hoon +++ b/app/btc-bridge.hoon @@ -46,7 +46,8 @@ ?+ mark (on-poke:def mark vase) %btc-bridge-command (handle-command:hc !<(command vase)) - %btc-bridge-action + %btc-bridge-rpc-action + ~& > !<(rpc-action vase) `state == [cards this] diff --git a/gen/btc-bridge/rpc-action.hoon b/gen/btc-bridge/rpc-action.hoon new file mode 100644 index 0000000000..b0955b681b --- /dev/null +++ b/gen/btc-bridge/rpc-action.hoon @@ -0,0 +1,13 @@ +:: Sends a raw RPC action to the BTC Bridge +:: +:: Commands: +:: +:: +:: +/- *btc-bridge +:: +:- %say +|= $: [now=@da eny=@uvJ =beak] + [[ract=rpc-action ~] ~] +== +[%btc-bridge-rpc-action ract] diff --git a/sur/btc-bridge.hoon b/sur/btc-bridge.hoon index 500d350999..4a3277728b 100644 --- a/sur/btc-bridge.hoon +++ b/sur/btc-bridge.hoon @@ -1,4 +1,5 @@ -/- *btc +/- *btc, bnh=btc-node-hook + |% +$ credentials [rpc-url=@t rpc-user=@t rpc-password=@t] +$ status @@ -17,4 +18,21 @@ [%connect-as-client host=ship] [%allow-clients users=(set ship)] == ++$ rpc-action + $% [%erpc action:electrum:rpc] + [%brpc action:bitcoin-core:rpc] + == +++ rpc + |% + ++ electrum + |% + +$ action + $% [%timluc ~] + == + -- + ++ bitcoin-core + |% + +$ action btc-node-hook-action:bnh + -- + -- --