-
Notifications
You must be signed in to change notification settings - Fork 30
Integrate blockchain data [ECR-4175] #1393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrate blockchain data [ECR-4175] #1393
Conversation
wip: description
Add Node#withServiceData for symmetry with Testkit and TransactionContext.
Rename to have consistent naming in BD accessors: - Testkit - TransactionContext - Node
BlockchainData#fromRawAccess cannot be invoked with mock tests as it will invoke the native code with an invalid handle. Hence the code that needs to instantiate BD from Access has to use the factory.
[skip ci]
exonum-java-binding/CHANGELOG.md
Outdated
the service to which it is provided and allows modification only to the data | ||
of that service. The service data is automatically isolated via namespaces, | ||
with a service name followed by a dot as a prefix. (#1393) | ||
- `Prefixed` and `ReadonlyFork` database Accesses. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR ref?
* @param instanceName the name of the service instance to which data to provide access | ||
* <p>The namespace is equal to the service instance name. | ||
* | ||
* @param serviceName the name of the service instance to which data to provide access |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the sentence looks complicated a little bit.
"service instance name for providing data access to"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original seems to be more exact, but I agree it is a little complex, though can't think how to simplify it.
* Creates a new owning blockchain data. | ||
* | ||
* @param nativeHandle a handle to the native BlockchainData object | ||
* @param cleaner a cleaner to register the destructor\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @param cleaner a cleaner to register the destructor\ | |
* @param cleaner a cleaner to register the destructor |
|
Overview
Added BlockchainData — an object providing access to all categories of persistent data stored in the database: the executing service data, other services’ data, Exonum Core data.
BlockchainData is a service-specific object — it remembers the service to which it is provided and allows modification only to the data of that service. The service data is automatically isolated via namespaces, with a service name followed by a dot as a prefix.
Node is also made a service-specific interface — and now provides BlockchainData.
NodeProxy is no longer a Node, as it works with Snapshots.
Removed AbstractService#createDataSchema — just use the schema constructor/factory method. Also, with BlockchainData and Prefixed access it makes more sense to support injecting TransactionContext components (Jira tbd).
See: https://jira.bf.local/browse/ECR-4175
Definition of Done