Skip to content
This repository has been archived by the owner on Aug 16, 2021. It is now read-only.

Allow required indexes to be specified using IndexStore settings #458

Merged
merged 6 commits into from
Sep 15, 2017

Conversation

quantumagi
Copy link
Contributor

This allows the IndexStore indexes to be configured using the feature options mechanism.

See PR #329

this.session.Transaction.Insert<string, string>("Common", index.Table, index.ToString());
this.session.Transaction.Commit();
var transactions = new List<(Transaction, Block)>();
foreach (var row in transaction.SelectForward<byte[], Block>("Block"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah you have to reindex the entire store, this might be a very long operation no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be a very long operation on the first run, for a new index, unless the block table is empty at the time... On subsequent runs the index will already exist and will keep pace with changes. Nevertheless it may be possible to improve on this despite the single-threaded requirements. Such an approach would involve building the new index in the background and only committing it once it had been fully built.

Copy link
Contributor Author

@quantumagi quantumagi Sep 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The above "improvement" must be weighed against the fact that we don't really want to start the "block explorer" node, including the block explorer, before all indexes are aligned with the tip... Also, given a hypothetical StratisExplorerD with fixed indexes via feature options, this situation can only arise during development anyway OR if the index folder is deleted without also deleting the blocks folder.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fine its a long operation there is no escaping that we just need to make sure the node is displaying progress some how.

{
FullNode node;

if (options != null && options.Contains("IndexStore"))
if (callback != null)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting approach

@dangershony dangershony merged commit 98e8432 into stratisproject:master Sep 15, 2017
@quantumagi quantumagi deleted the explorer branch September 18, 2017 10:41
codingupastorm added a commit to codingupastorm/StratisBitcoinFullNode that referenced this pull request Jul 8, 2020
…a-thumbprints

Private data allowing individual thumbprints
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants