Create Edges Table
- Run the following command the
psql
shell to delete any previously createdxmr_bigraph_edges
table.DROP TABLE xmr_bigraph_edges;
Note: We delete the previously created
xmr_bigraph_edges
to recover disk space. The table occupies about 20 GB. If you have ample disk space available, you can skip the deletion. But remember to create the table in the next step with a name different fromxmr_bigraph_edges
. For example, you can usexmr_bigraph_edges_hardfork
. - Create the
xmr_bigraph_edges
table by running the following query in thepsql
shell. This query consider transactions upto block height 2530000.CREATE TABLE xmr_bigraph_edges AS SELECT xk.id as keyimage_id, xo.id as output_id, xo.amount as output_amount, xo.index as output_index FROM (SELECT id, ring_amount, UNNEST(fork_indices) AS index FROM xmr_keyimages WHERE ring_amount = 0 AND block_height <= 2530000) AS xk INNER JOIN xmr_outputs xo ON xk.ring_amount = xo.amount AND xk.index = xo.index;
Note: The only difference between the above query and the RingCT one in the previous Create Edges Table section is that the
ring_indices
column is replaced with thefork_indices
column. Of course, the block height there was 1541236 to reproduce the results from Yu et al's FC 2019 paper.