2022-03-26 00:17:45 +03:00
|
|
|
:: naive-csv: produces csv file containing L2 transaction data
|
2022-03-15 21:40:41 +03:00
|
|
|
::
|
2022-03-26 00:17:45 +03:00
|
|
|
:: takes in the network to use and the ethereum node url to grab data from.
|
|
|
|
:: it starts with the azimuth snapshot and scries the logs from %azimuth.
|
|
|
|
:: it then produces a csv file containing the following data on L2
|
|
|
|
:: transactions:
|
2022-03-15 21:40:41 +03:00
|
|
|
::
|
2022-03-26 00:17:45 +03:00
|
|
|
:: - block number
|
|
|
|
:: - timestamp
|
|
|
|
:: - roller address
|
|
|
|
:: - roll hash
|
|
|
|
:: - tx hash
|
|
|
|
:: - sending ship
|
|
|
|
:: - sending proxy
|
|
|
|
:: - nonce
|
|
|
|
:: - gas price
|
|
|
|
:: - length of input data
|
|
|
|
:: - success or failure
|
|
|
|
:: - function name
|
|
|
|
:: - spawning ship (^sein:title)
|
2022-03-23 00:15:07 +03:00
|
|
|
::
|
2022-03-26 00:17:45 +03:00
|
|
|
:: A lot of the data-scrounging here is stuff that %roller already keeps track
|
|
|
|
:: of. We could just scry it from there, but then this thread needs to be run
|
|
|
|
:: on the roller ship. So we rebuild the list of historical transactions
|
|
|
|
:: ourselves so that this can run from any ship.
|
2022-03-16 02:11:54 +03:00
|
|
|
::
|
2022-03-17 21:13:54 +03:00
|
|
|
/- dice,
|
|
|
|
spider
|
2022-03-15 21:40:41 +03:00
|
|
|
::
|
|
|
|
/+ dice,
|
|
|
|
ethereum,
|
|
|
|
ethio,
|
|
|
|
naive,
|
2022-03-17 21:13:54 +03:00
|
|
|
naive-tx=naive-transactions,
|
2022-03-15 21:40:41 +03:00
|
|
|
*strandio
|
2022-03-17 21:13:54 +03:00
|
|
|
:: starting snapshot. this may not be the right starting point once we have
|
|
|
|
:: clay tombstoning and the snapshot may be updated
|
2022-04-06 18:44:28 +03:00
|
|
|
::
|
2022-03-17 21:13:54 +03:00
|
|
|
/* snap %azimuth-snapshot /app/azimuth/version-0/azimuth-snapshot
|
|
|
|
::
|
2022-03-15 21:40:41 +03:00
|
|
|
=, strand=strand:spider
|
|
|
|
=, jael
|
|
|
|
::
|
|
|
|
^- thread:spider
|
|
|
|
=< process-logs
|
|
|
|
=>
|
|
|
|
|%
|
|
|
|
:: imported logs is cast as $events
|
2022-03-23 00:15:07 +03:00
|
|
|
+$ events (list event-log:rpc:ethereum)
|
2022-03-17 19:23:00 +03:00
|
|
|
+$ address address:naive :: @ux
|
2022-03-17 19:51:54 +03:00
|
|
|
+$ keccak @ux :: used for transaction and roll hashes
|
2022-03-17 19:23:00 +03:00
|
|
|
+$ blocknum number:block :: @udblocknumber
|
2022-04-06 18:44:28 +03:00
|
|
|
+$ net net:dice :: ?(%mainnet %ropsten %local %default)
|
|
|
|
+$ roll-dat :: all data required for each roll
|
|
|
|
[[gas=@ud sender=address] =effects:naive]
|
|
|
|
+$ block-dat :: all data required for each block
|
|
|
|
[timestamp=@da rolls=(map keccak roll-dat)]
|
|
|
|
+$ block-map (map blocknum block-dat)
|
2022-03-25 01:20:31 +03:00
|
|
|
+$ rolls-map (map blocknum (map keccak effects:naive))
|
2022-03-16 02:11:54 +03:00
|
|
|
::
|
2022-04-06 17:51:07 +03:00
|
|
|
+$ action
|
|
|
|
$? %transfer-point
|
|
|
|
%spawn
|
|
|
|
%configure-keys
|
|
|
|
%escape
|
|
|
|
%cancel-escape
|
|
|
|
%adopt
|
|
|
|
%reject
|
|
|
|
%detach
|
|
|
|
%set-management-proxy
|
|
|
|
%set-spawn-proxy
|
|
|
|
%set-transfer-proxy
|
|
|
|
==
|
2022-03-15 21:40:41 +03:00
|
|
|
::
|
2022-04-06 18:44:28 +03:00
|
|
|
+$ tx-data
|
2022-04-06 18:55:20 +03:00
|
|
|
$: =blocknum
|
2022-04-06 18:44:28 +03:00
|
|
|
timestamp=@da
|
|
|
|
roller=address
|
|
|
|
roll-hash=keccak
|
|
|
|
tx-hash=keccak
|
|
|
|
sender=ship
|
|
|
|
proxy=proxy:naive
|
|
|
|
nonce=nonce:naive
|
|
|
|
gas=@ud
|
|
|
|
length=@ux
|
|
|
|
suc=?
|
|
|
|
=action
|
|
|
|
parent=ship
|
|
|
|
==
|
2022-03-15 21:40:41 +03:00
|
|
|
--
|
2022-03-16 02:11:54 +03:00
|
|
|
::
|
2022-03-15 21:40:41 +03:00
|
|
|
|%
|
2022-03-25 01:20:31 +03:00
|
|
|
:: +process-logs is the main process. it grabs the azimuth snapshop, runs
|
|
|
|
:: +naive on the logs, grabs the timestamps and gas costs for each roll,
|
|
|
|
:: then flattens them into a list of $tx-data and saves them to disk.
|
2022-04-06 18:44:28 +03:00
|
|
|
::
|
2022-03-15 21:40:41 +03:00
|
|
|
++ process-logs
|
|
|
|
|= arg=vase
|
2022-03-25 01:20:31 +03:00
|
|
|
=+ !<([~ =net node-url=@t] arg)
|
|
|
|
=/ pax=path /naive-exports/csv :: data will be saved here
|
2022-03-15 21:40:41 +03:00
|
|
|
=/ m (strand ,vase)
|
|
|
|
^- form:m
|
2022-03-25 02:12:54 +03:00
|
|
|
;< =events bind:m (scry events /gx/azimuth/logs/noun)
|
2022-03-17 19:23:00 +03:00
|
|
|
=/ [naive-contract=address chain-id=@]
|
2022-03-15 21:40:41 +03:00
|
|
|
[naive chain-id]:(get-network:dice net)
|
2022-03-17 21:13:54 +03:00
|
|
|
=/ snap=snap-state:dice snap
|
2022-03-25 01:20:31 +03:00
|
|
|
::
|
2022-03-26 00:04:45 +03:00
|
|
|
;< ~ bind:m
|
2022-03-26 00:17:45 +03:00
|
|
|
%- flog-text %+ weld "naive-csv: processing {<net>} ethereum logs "
|
2022-03-26 00:04:45 +03:00
|
|
|
"with {<(lent events)>} events"
|
2022-03-25 01:20:31 +03:00
|
|
|
=/ =rolls-map
|
2022-03-25 02:12:54 +03:00
|
|
|
(compute-effects nas.snap events net naive-contract chain-id)
|
2022-03-26 00:17:45 +03:00
|
|
|
;< ~ bind:m (flog-text "naive-csv: getting timestamps")
|
2022-03-26 00:04:45 +03:00
|
|
|
;< tim=thread-result bind:m
|
2022-03-25 23:17:40 +03:00
|
|
|
%+ await-thread %eth-get-timestamps
|
|
|
|
!>([node-url ~(tap in ~(key by rolls-map))])
|
|
|
|
=/ timestamps %- ~(gas by *(map blocknum @da))
|
2022-03-26 00:04:45 +03:00
|
|
|
?- tim
|
|
|
|
[%.y *] ;;((list [@ud @da]) q.p.tim)
|
2022-04-06 18:50:44 +03:00
|
|
|
[%.n *]
|
|
|
|
=> (mean 'naive-csv: %eth-get-timestamps failed' p.tim)
|
|
|
|
!!
|
2022-03-25 23:17:40 +03:00
|
|
|
==
|
2022-03-26 00:04:45 +03:00
|
|
|
;< ~ bind:m (flog-text "naive-csv: got timestamps")
|
2022-03-26 00:17:45 +03:00
|
|
|
;< ~ bind:m (flog-text "naive-csv: getting tx receipts")
|
2022-03-26 00:04:45 +03:00
|
|
|
;< gaz=thread-result bind:m
|
|
|
|
%+ await-thread %eth-get-tx-receipts
|
|
|
|
!>([node-url (get-roll-hashes rolls-map)])
|
|
|
|
=/ gas-sender %- ~(gas by *(map keccak [gas=@ud sender=address]))
|
|
|
|
?- gaz
|
|
|
|
[%.y *] (parse-gas-sender ;;((list [@t json]) q.p.gaz))
|
2022-04-06 18:50:44 +03:00
|
|
|
[%.n *]
|
|
|
|
=> (mean 'naive-csv: %eth-tx-receipts failed' p.gaz)
|
|
|
|
!!
|
2022-03-26 00:04:45 +03:00
|
|
|
==
|
|
|
|
;< ~ bind:m (flog-text "naive-csv: got tx receipts")
|
2022-03-25 01:20:31 +03:00
|
|
|
=/ csv=(list cord)
|
2022-03-26 00:04:45 +03:00
|
|
|
(make-csv (flatten (collate-roll-data rolls-map timestamps gas-sender)))
|
2022-03-25 01:20:31 +03:00
|
|
|
;< ~ bind:m (export-csv csv pax)
|
2022-03-26 00:17:45 +03:00
|
|
|
;< ~ bind:m (flog-text :(weld "naive-csv: csv saved to %" (spud pax) "/"))
|
2022-03-17 21:13:54 +03:00
|
|
|
::
|
2022-03-26 00:17:45 +03:00
|
|
|
(pure:m !>(~))
|
2022-03-25 01:20:31 +03:00
|
|
|
:: +collate-roll-data throws naive:effects, timestamps, and gas costs into
|
|
|
|
:: one $block-map
|
2022-04-06 18:44:28 +03:00
|
|
|
::
|
2022-03-16 03:05:25 +03:00
|
|
|
++ collate-roll-data
|
2022-03-25 01:20:31 +03:00
|
|
|
|= $: =rolls-map
|
2022-03-17 19:23:00 +03:00
|
|
|
timestamps=(map blocknum @da)
|
2022-03-25 01:20:31 +03:00
|
|
|
roll-receipts=(map keccak [gas=@ud sender=address])
|
2022-03-16 03:05:25 +03:00
|
|
|
==
|
2022-04-06 18:55:20 +03:00
|
|
|
=/ blocknums=(list blocknum) ~(tap in ~(key by rolls-map))
|
2022-03-23 00:15:07 +03:00
|
|
|
=| =block-map
|
2022-03-18 00:16:09 +03:00
|
|
|
^+ block-map
|
2022-03-16 03:05:25 +03:00
|
|
|
|-
|
2022-04-06 18:55:20 +03:00
|
|
|
?~ blocknums block-map
|
|
|
|
=/ =blocknum i.blocknums
|
2022-03-18 00:16:09 +03:00
|
|
|
=/ rolls=(map keccak [[gas=@ud sender=address] =effects:naive])
|
|
|
|
%- ~(gas by *(map keccak [[gas=@ud sender=address] =effects:naive]))
|
2022-04-06 18:55:20 +03:00
|
|
|
%+ turn ~(tap in ~(key by (~(got by rolls-map) blocknum)))
|
2022-03-18 00:16:09 +03:00
|
|
|
|= txh=keccak
|
2022-03-25 01:20:31 +03:00
|
|
|
:+ txh
|
|
|
|
(~(got by roll-receipts) txh)
|
2022-04-06 18:55:20 +03:00
|
|
|
(~(got by (~(got by rolls-map) blocknum)) txh)
|
2022-03-16 03:05:25 +03:00
|
|
|
%= $
|
2022-04-06 18:55:20 +03:00
|
|
|
blocknums t.blocknums
|
2022-03-25 01:20:31 +03:00
|
|
|
block-map %+ ~(put by block-map)
|
2022-04-06 18:55:20 +03:00
|
|
|
blocknum
|
|
|
|
[(~(got by timestamps) blocknum) rolls]
|
2022-03-16 03:05:25 +03:00
|
|
|
==
|
2022-03-25 01:20:31 +03:00
|
|
|
:: +flatten takes a $block-map and creates a $tx-data for every transaction
|
|
|
|
:: in every roll, returned as a (list tx-data)
|
2022-04-06 18:44:28 +03:00
|
|
|
::
|
2022-03-25 01:20:31 +03:00
|
|
|
++ flatten
|
2022-03-23 00:15:07 +03:00
|
|
|
|= =block-map
|
2022-04-06 18:44:28 +03:00
|
|
|
=/ blocks=(list [blocknum block-dat]) ~(tap by block-map)
|
2022-03-23 00:15:07 +03:00
|
|
|
=| tx-list=(list tx-data)
|
|
|
|
^+ tx-list
|
2022-03-25 01:20:31 +03:00
|
|
|
:: recurse through the list of blocks, getting the rolls submitted in that
|
|
|
|
:: block, their timestamp, and the gas price of that roll
|
2022-04-06 18:44:28 +03:00
|
|
|
::
|
2022-03-25 01:20:31 +03:00
|
|
|
|-
|
2022-04-06 18:44:28 +03:00
|
|
|
=* block-loop $
|
2022-03-23 00:15:07 +03:00
|
|
|
?~ blocks tx-list
|
2022-04-06 18:44:28 +03:00
|
|
|
=/ block=[=blocknum =block-dat] i.blocks
|
|
|
|
=/ roll-list=(list [=keccak =roll-dat]) ~(tap by rolls.block-dat.block)
|
2022-03-23 00:15:07 +03:00
|
|
|
=| block-tx-list=(list tx-data)
|
|
|
|
:: recurse through each roll, getting the transaction data from the effects
|
2022-04-06 18:44:28 +03:00
|
|
|
::
|
2022-03-23 00:15:07 +03:00
|
|
|
|-
|
2022-04-06 18:44:28 +03:00
|
|
|
=* roll-loop $
|
2022-03-23 00:15:07 +03:00
|
|
|
?~ roll-list
|
2022-04-06 18:44:28 +03:00
|
|
|
%= block-loop
|
|
|
|
blocks t.blocks
|
2022-03-23 00:15:07 +03:00
|
|
|
tx-list (welp tx-list block-tx-list)
|
|
|
|
==
|
2022-04-06 18:44:28 +03:00
|
|
|
=/ roll=[=keccak =roll-dat] i.roll-list
|
2022-03-23 00:15:07 +03:00
|
|
|
:: recurse through the list of effects, building up transaction data as we
|
|
|
|
:: go. there's a choice here to use the effects, or the submitted
|
|
|
|
:: raw-tx. the effects include whether or not a transaction failed,
|
|
|
|
:: which is important data not a part of the submitted raw-tx. we
|
|
|
|
:: could determine this ourselves, but we build the effects anyways when
|
|
|
|
:: computing the state transitions, so we may as well use them.
|
|
|
|
::
|
|
|
|
:: an individual transaction results in up to 3 diffs: a %nonce, a %tx, and
|
|
|
|
:: a %point. they always appear in this order. successful transactions
|
|
|
|
:: always have all 3, while failed transactions only have %nonce and %tx.
|
|
|
|
:: note that the nonce listed is always the expected nonce - we can't know
|
|
|
|
:: what nonce was actually submitted without the private key of the signer.
|
2022-04-06 18:44:28 +03:00
|
|
|
::
|
2022-03-23 00:15:07 +03:00
|
|
|
=| roll-tx-list=(list tx-data)
|
2022-04-06 19:10:00 +03:00
|
|
|
=| =tx-data
|
2022-03-23 00:15:07 +03:00
|
|
|
=| nonce-and-tx=[_| _|]
|
|
|
|
|-
|
2022-04-06 18:44:28 +03:00
|
|
|
=* effect-loop $
|
2022-04-06 19:10:00 +03:00
|
|
|
:: if we are processing a new transaction, initialize the parts of tx-data
|
|
|
|
:: that are identical for every transaction in the roll
|
|
|
|
=? tx-data =([| |] nonce-and-tx)
|
|
|
|
:* blocknum.block timestamp.block-dat.block sender.roll-dat.roll
|
|
|
|
keccak.roll *keccak *ship *proxy:naive *nonce:naive
|
|
|
|
gas.roll-dat.roll *@ | *action *ship
|
|
|
|
==
|
2022-03-23 00:15:07 +03:00
|
|
|
:: if we've gotten both the %nonce and %tx diff from a transaction, add the
|
|
|
|
:: tx-data to the list of tx for the roll
|
2022-04-06 18:44:28 +03:00
|
|
|
::
|
2022-03-23 00:15:07 +03:00
|
|
|
?: =([& &] nonce-and-tx)
|
2022-04-06 18:44:28 +03:00
|
|
|
%= effect-loop
|
2022-03-23 00:15:07 +03:00
|
|
|
nonce-and-tx [| |]
|
2022-03-25 18:22:26 +03:00
|
|
|
roll-tx-list (snoc roll-tx-list tx-data)
|
2022-03-23 00:15:07 +03:00
|
|
|
==
|
|
|
|
:: if we've finished looping through the effects, add the tx list from the
|
|
|
|
:: roll to the list of tx for the block
|
2022-04-06 18:44:28 +03:00
|
|
|
::
|
|
|
|
?~ effects.roll-dat.roll
|
|
|
|
%= roll-loop
|
2022-03-23 00:15:07 +03:00
|
|
|
roll-list t.roll-list
|
|
|
|
block-tx-list (welp block-tx-list roll-tx-list)
|
|
|
|
==
|
|
|
|
::
|
2022-04-06 18:44:28 +03:00
|
|
|
=/ =diff:naive i.effects.roll-dat.roll
|
2022-04-06 19:10:00 +03:00
|
|
|
:: we ignore %operator, %dns, %point diffs
|
|
|
|
::
|
2022-03-23 00:15:07 +03:00
|
|
|
?+ diff
|
2022-04-06 19:10:00 +03:00
|
|
|
$(effects.roll-dat.roll t.effects.roll-dat.roll)
|
2022-03-25 01:20:31 +03:00
|
|
|
:: %nonce is always the first diff from a given transaction.
|
2022-04-06 18:44:28 +03:00
|
|
|
::
|
2022-03-23 00:15:07 +03:00
|
|
|
[%nonce *]
|
2022-04-06 18:44:28 +03:00
|
|
|
%= effect-loop
|
|
|
|
-.nonce-and-tx &
|
|
|
|
sender.tx-data ship.diff
|
|
|
|
nonce.tx-data nonce.diff
|
|
|
|
proxy.tx-data proxy.diff
|
|
|
|
parent.tx-data (^sein:title ship.diff)
|
|
|
|
effects.roll-dat.roll t.effects.roll-dat.roll
|
2022-03-23 00:15:07 +03:00
|
|
|
==
|
2022-03-25 01:20:31 +03:00
|
|
|
:: %tx is always the second diff from a given transaction.
|
2022-04-06 18:44:28 +03:00
|
|
|
::
|
2022-03-23 00:15:07 +03:00
|
|
|
[%tx *]
|
2022-04-06 18:44:28 +03:00
|
|
|
%= effect-loop
|
2022-03-23 01:04:34 +03:00
|
|
|
+.nonce-and-tx &
|
2022-04-06 18:44:28 +03:00
|
|
|
effects.roll-dat.roll t.effects.roll-dat.roll
|
|
|
|
action.tx-data +<.tx.raw-tx.diff
|
|
|
|
suc.tx-data ?~ err.diff & |
|
|
|
|
length.tx-data `@`-.raw.raw-tx.diff
|
|
|
|
tx-hash.tx-data (hash-raw-tx:naive-tx raw-tx.diff)
|
2022-03-23 00:15:07 +03:00
|
|
|
==
|
|
|
|
==
|
|
|
|
::
|
2022-03-26 00:04:45 +03:00
|
|
|
++ parse-gas-sender
|
|
|
|
|= res=(list [@t json])
|
|
|
|
^- (list [=keccak [gas=@ud sender=address]])
|
|
|
|
%+ turn res
|
|
|
|
|= [id=@t =json]
|
|
|
|
^- [=keccak [gas=@ud sender=address]]
|
|
|
|
:- (hex-to-num:ethereum id)
|
|
|
|
:- %- parse-hex-result:rpc:ethereum
|
2022-03-16 01:09:07 +03:00
|
|
|
~| json
|
|
|
|
?> ?=(%o -.json)
|
2022-04-06 19:16:57 +03:00
|
|
|
(~(got by p.json) 'effectiveGasPrice') :: gas used in wei
|
2022-03-26 00:04:45 +03:00
|
|
|
%- parse-hex-result:rpc:ethereum
|
|
|
|
~| json
|
|
|
|
?> ?=(%o -.json)
|
|
|
|
(~(got by p.json) 'from')
|
2022-03-25 01:20:31 +03:00
|
|
|
:: +get-roll-hashes makes a list of hashes of all transactions from $rolls-map
|
2022-04-06 18:44:28 +03:00
|
|
|
::
|
2022-03-25 01:20:31 +03:00
|
|
|
++ get-roll-hashes
|
|
|
|
|= =rolls-map ^- (list keccak)
|
|
|
|
%- zing
|
|
|
|
%+ turn ~(val by rolls-map)
|
|
|
|
|= a=(map keccak effects:naive)
|
|
|
|
~(tap in ~(key by a))
|
|
|
|
:: +compute-effects calls +naive to compute the state transitions for all
|
|
|
|
:: logs, but it returns a map that only has the effects for L2 transactions,
|
|
|
|
:: leaving out L1 transactions. we need to compute all of them in order to
|
|
|
|
:: determine whether the transactions were valid.
|
2022-04-06 18:44:28 +03:00
|
|
|
::
|
2022-03-25 01:20:31 +03:00
|
|
|
++ compute-effects
|
2022-03-17 21:13:54 +03:00
|
|
|
|= $: nas=^state:naive
|
2022-03-25 02:12:54 +03:00
|
|
|
=events
|
2022-03-17 21:13:54 +03:00
|
|
|
=net
|
|
|
|
naive-contract=address
|
|
|
|
chain-id=@ud
|
|
|
|
==
|
2022-03-25 01:20:31 +03:00
|
|
|
=| out=rolls-map
|
2022-03-17 21:13:54 +03:00
|
|
|
^+ out
|
|
|
|
::
|
|
|
|
|-
|
2022-03-25 02:12:54 +03:00
|
|
|
?~ events out
|
|
|
|
=/ log=event-log:rpc:ethereum i.events
|
2022-03-17 21:13:54 +03:00
|
|
|
?~ mined.log
|
2022-03-26 00:17:45 +03:00
|
|
|
~& >> 'naive-csv: empty log'
|
2022-03-25 02:12:54 +03:00
|
|
|
$(events t.events)
|
2022-04-06 18:55:20 +03:00
|
|
|
=/ =blocknum block-number.u.mined.log
|
2022-03-17 21:13:54 +03:00
|
|
|
=/ =^input:naive
|
2022-04-06 18:55:20 +03:00
|
|
|
:- blocknum
|
2022-03-17 21:13:54 +03:00
|
|
|
?. =(naive-contract address.log)
|
|
|
|
:- %log
|
|
|
|
[address.log (data-to-hex:dice data.log) topics.log]
|
|
|
|
?~ input.u.mined.log
|
2022-03-26 00:17:45 +03:00
|
|
|
~& >> 'naive-csv: empty L2 transaction'
|
2022-03-17 21:13:54 +03:00
|
|
|
[%bat *@]
|
|
|
|
[%bat u.input.u.mined.log]
|
|
|
|
=^ =effects:naive nas
|
|
|
|
(%*(. naive lac |) verifier:naive-tx chain-id nas input)
|
|
|
|
%= $
|
2022-03-25 02:12:54 +03:00
|
|
|
events t.events
|
2022-03-17 21:13:54 +03:00
|
|
|
out ?. =(%bat +<.input)
|
2022-03-18 00:16:09 +03:00
|
|
|
out :: skip L1 logs
|
2022-04-06 18:55:20 +03:00
|
|
|
=/ cur (~(get by out) blocknum)
|
2022-03-25 01:20:31 +03:00
|
|
|
?~ cur
|
2022-04-06 18:55:20 +03:00
|
|
|
%+ ~(put by out) blocknum
|
2022-03-18 00:16:09 +03:00
|
|
|
(my [[transaction-hash.u.mined.log effects]~])
|
2022-04-06 18:55:20 +03:00
|
|
|
%+ ~(put by out) blocknum
|
2022-04-06 17:51:07 +03:00
|
|
|
(~(put by u.cur) transaction-hash.u.mined.log effects)
|
2022-03-16 02:11:54 +03:00
|
|
|
==
|
2022-03-25 01:20:31 +03:00
|
|
|
:: +export-csv writes a (list cord) as csv to disk at .pax
|
2022-04-06 18:44:28 +03:00
|
|
|
::
|
2022-03-25 01:20:31 +03:00
|
|
|
++ export-csv
|
|
|
|
|= [in=(list cord) pax=path]
|
|
|
|
=/ m (strand ,~)
|
|
|
|
^- form:m
|
|
|
|
;< =bowl:spider bind:m get-bowl
|
|
|
|
=- (send-raw-card %pass / %arvo %c %info -)
|
|
|
|
%+ foal:space:userlib
|
2022-03-25 18:28:45 +03:00
|
|
|
;: weld
|
|
|
|
/(scot %p our.bowl)/base/(scot %da now.bowl)
|
|
|
|
pax
|
|
|
|
/(scot %da now.bowl)/txt
|
|
|
|
==
|
2022-03-25 01:20:31 +03:00
|
|
|
[%txt !>(in)]
|
|
|
|
:: +make-csv takes in a (list tx-data) and makes it into a (list cord) to be
|
|
|
|
:: saved as a csv file
|
2022-04-06 18:44:28 +03:00
|
|
|
::
|
2022-03-25 01:20:31 +03:00
|
|
|
++ make-csv
|
|
|
|
|= in=(list tx-data)
|
|
|
|
^- (list cord)
|
|
|
|
:- %- crip
|
|
|
|
;: weld
|
|
|
|
"block number,"
|
|
|
|
"timestamp,"
|
|
|
|
"roller address,"
|
|
|
|
"roll hash,"
|
|
|
|
"tx hash,"
|
|
|
|
"sending ship,"
|
|
|
|
"sending proxy,"
|
|
|
|
"nonce,"
|
|
|
|
"gas price,"
|
|
|
|
"length of input data,"
|
|
|
|
"success or failure,"
|
2022-03-25 18:22:26 +03:00
|
|
|
"function name,"
|
|
|
|
"parent"
|
2022-03-25 01:20:31 +03:00
|
|
|
==
|
|
|
|
%+ turn in
|
|
|
|
|= =tx-data
|
|
|
|
%- crip
|
|
|
|
;: weld
|
2022-04-06 19:18:24 +03:00
|
|
|
(scow %ud blocknum.tx-data) ","
|
2022-03-25 01:20:31 +03:00
|
|
|
(scow %da timestamp.tx-data) ","
|
|
|
|
(scow %ux roller.tx-data) ","
|
|
|
|
(scow %ux roll-hash.tx-data) ","
|
|
|
|
(scow %ux tx-hash.tx-data) ","
|
|
|
|
(scow %p sender.tx-data) ","
|
|
|
|
(scow %tas proxy.tx-data) ","
|
|
|
|
(scow %ud nonce.tx-data) ","
|
|
|
|
(scow %ud gas.tx-data) ","
|
|
|
|
(scow %ux length.tx-data) ","
|
|
|
|
(scow %f suc.tx-data) ","
|
2022-03-25 18:22:26 +03:00
|
|
|
(scow %tas action.tx-data) ","
|
|
|
|
(scow %p parent.tx-data)
|
2022-03-25 01:20:31 +03:00
|
|
|
==
|
2022-03-15 21:40:41 +03:00
|
|
|
--
|