shrub/pkg/arvo/sur/dice.hoon

97 lines
1.8 KiB
Plaintext
Raw Normal View History

:: dice: structures for L2 rollers
::
2021-05-21 16:07:08 +03:00
/+ naive, ethereum
::
|%
2021-11-10 19:46:22 +03:00
+$ owner [=proxy:naive =address:naive]
+$ owners (jug owner ship)
+$ sponsors (map ship [residents=(set ship) requests=(set ship)])
+$ net ?(%mainnet %ropsten %local %default)
::
+$ config
$% [%frequency frequency=@dr]
[%setkey pk=@]
[%endpoint endpoint=@t =net]
[%resend-time time=@dr]
[%update-rate rate=@dr]
[%slice slice=@dr]
[%quota quota=@ud]
==
::
2021-11-10 19:46:22 +03:00
+$ indices
$: nas=^state:naive
own=owners
spo=sponsors
==
::
+$ azimuth-config
$: refresh-rate=@dr
==
::
+$ roller-config
$: next-batch=time
frequency=@dr
resend-time=@dr
update-rate=@dr
contract=@ux
chain-id=@
slice=@dr
quota=@ud
==
::
2021-05-21 16:07:08 +03:00
+$ keccak @ux
::
2021-08-04 16:53:57 +03:00
+$ status
?(%unknown %pending %sending %confirmed %failed %cancelled)
2021-08-04 16:53:57 +03:00
::
2021-05-21 16:07:08 +03:00
+$ tx-status
2021-08-04 16:53:57 +03:00
$: =status
2021-05-21 16:07:08 +03:00
pointer=(unit l1-tx-pointer)
==
::
+$ l1-tx-pointer
$: =address:ethereum
nonce=@ud
==
::
+$ l2-tx
$? %transfer-point
%spawn
%configure-keys
%escape
%cancel-escape
%adopt
%reject
%detach
%set-management-proxy
%set-spawn-proxy
%set-transfer-proxy
==
::
2021-08-22 19:23:30 +03:00
+$ update
2021-08-27 16:59:10 +03:00
$% [%point =ship =point:naive new=owner old=(unit owner)]
[%tx =address:ethereum =roll-tx]
2021-08-22 19:23:30 +03:00
==
::
+$ hist-tx [p=time q=roll-tx]
+$ roll-tx [=ship =status hash=keccak type=l2-tx]
+$ pend-tx [force=? =address:naive =time =raw-tx:naive]
+$ send-tx [next-gas-price=@ud sent=? txs=(list raw-tx:naive)]
2021-05-21 16:07:08 +03:00
+$ part-tx
$% [%raw raw=octs]
[%don =tx:naive]
[%ful raw=octs =tx:naive] ::TODO redundant?
==
::
+$ rpc-send-roll
$: endpoint=@t
contract=address:ethereum
chain-id=@
pk=@
::
nonce=@ud
next-gas-price=@ud
txs=(list raw-tx:naive)
==
--