Comments (6)
Here is a simple implementation that detects what operations need to be applied in order to syncrhonize a block database with the one from the bitcoin node: LedgerSynchronizationStatusService#getSyncingStatus.
While the code is in Scala, the comments should give you the idea of how it works:
/**
* Lets define some values:
* - The candidate is the block that needs to be stored.
* - The latestLedgerBlock is the newer block that is stored.
* - The LCA is the least common ancestor between both chains.
*
* There are some trivial cases to handle:
* - There are no blocks stored, just sync everything.
* - The candidate is already stored, just ignore it.
*
* So, let's assume that:
* - The candidate is not stored.
* - We have at least a block stored (latestLedgerBlock).
* - The LCA is on the candidate's chain, and on our stored blocks.
*
* Then, we can apply the candidate by rolling back until the LCA, then, applying missing blocks until catching up
* the candidate.
*
* @param candidate the block that we need to store
* @return the state that needs to be applied in order to store the candidate block
*/
from sidetree.
Resolution logic is independent of late-publishing of operations. And are tests written for roll-back detection and handling. Will rename this to be more of an documentation issue instead.
from sidetree.
Non normative section with text.
from sidetree.
What happens when I publish on ledger, but not on CAS... then later on CAS, and history changes... is it a feature, or is it a defect...
from sidetree.
@csuwildcat need to add language about how to address this, and handle the new version history.
from sidetree.
Done
from sidetree.
Related Issues (20)
- Confusing wording for patch "id" properties HOT 2
- Unable to create -and- update a DID until anchoring of each operation? HOT 18
- How to we replace or recover the did if we lost the key or forgot the mnemonic phrase? HOT 6
- Editorial feedback
- Contexts need updated to produce valid JSON-LD DID Documents HOT 5
- API data model should support passing in the "controller" property
- Anchor tags in spec don't work HOT 2
- Run local node with IPFS write error HOT 4
- Update operations commit-reveal chain may lead to an unresolvable DID HOT 5
- Only the Provisional Proof File prunable? HOT 2
- Missing DID READ operation in Sidetree v1.0.0 spec. HOT 1
- Cannot write to IPFS v0.11 HOT 1
- Support ietf-json-patch HOT 3
- Sidetree doesn't allow array for serviceEndpoint property (incompatile with DIDComm) HOT 4
- Spec states "deltaHash" but all test vectors use "delta" HOT 1
- Base64URL needs to be more clearly specified
- Long-Form DID & Short-Form DID Identity ambiguity HOT 6
- Split sidetree implementation into a new repo HOT 1
- Chain-specific guidance (or even parameterization) should be spelled out in a mandatory section of each method's spec
- v1.1 features list HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sidetree.