Open icristescu opened 3 years ago
Is this something that just needs to be updated in irmin-pack
by calling Store.Repo.heads
in the check-self-contained
command?
If not, how does tezos store the current heads
?
Both :) We need to update the check-self-contained
but also figure out how to get the current head. I'm not sure how do this though.
You can have a look at snapshot import
command which if given --block
as argument it uses it as the head; otherwise it looks into the block store for the latest head.
Something else that might help is that a tezos-client
can connect by rpc to a tezos-node
and get the list of current heads ./tezos-client rpc get /chains/main/blocks
(you can also check this online).
So this where I would start, hopefully it helps.
It looks like there is this Store.init
function which returns a store
value that can be converted to a Store.chain_store
which has a current_head
field and a known_heads
function. Now I just need to figure out how to get the genesis hash to pass to init
check_self_contained
has an optional argumenthead
which is not used in the cli: for tezos this is a problem because they are not using the branch store, so we need to look for the current head in the store and pass it on thecheck_self_contained
function.