Skip to content
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

Read only ledger flag #364

Merged
merged 11 commits into from
Feb 15, 2020
Merged

Conversation

ianco
Copy link
Contributor

@ianco ianco commented Feb 6, 2020

Add a parameter to set the ledger to "read only"

Agent will throw an exception for any attempted ledger write operations

EXCEPT a "DID update endpoint" will be silently ignored

@codecov-io
Copy link

codecov-io commented Feb 6, 2020

Codecov Report

Merging #364 into master will decrease coverage by 0.03%.
The diff coverage is 50%.

@@            Coverage Diff             @@
##           master     #364      +/-   ##
==========================================
- Coverage   89.17%   89.14%   -0.04%     
==========================================
  Files         236      236              
  Lines       11218    11222       +4     
==========================================
  Hits        10004    10004              
- Misses       1214     1218       +4

@swcurran
Copy link
Contributor

swcurran commented Feb 6, 2020

Is the last point about the DID update endpoint a joke? That's the one that caused the problem. I guess I have to look at the code.

@swcurran
Copy link
Contributor

swcurran commented Feb 6, 2020

I guess it is not a joke. I don't understand. Let's go to a call.

Copy link
Contributor

@swcurran swcurran left a comment

Choose a reason for hiding this comment

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

The point of this change is to block all writes so that writes are only done when expected.

@ianco
Copy link
Contributor Author

ianco commented Feb 6, 2020

The call to update the did endpoint is made from within the agent:

https://github.com/hyperledger/aries-cloudagent-python/blob/master/aries_cloudagent/config/ledger.py#L78

It's not invoked from the controller.

So the options are to:

  • ignore this call when in "read only" mode

Or:

  • refactor the code so the controller invokes this call directly

@swcurran
Copy link
Contributor

swcurran commented Feb 6, 2020 via email

@ianco
Copy link
Contributor Author

ianco commented Feb 8, 2020

Set "read_only" to False in "provision" mode and to True in "start" mode.

Made "endpoint" parameter available in "provision" mode.

Added a "--dev-provision" flag to allow some provision activities in "start" mode to support local development (specifically to allow creation of schemas and credential definitions).

@ianco ianco marked this pull request as ready for review February 8, 2020 16:50
@ianco
Copy link
Contributor Author

ianco commented Feb 8, 2020

The point of this change is to block all writes so that writes are only done when expected.

Done

@ianco ianco closed this Feb 8, 2020
@ianco ianco reopened this Feb 8, 2020
@ianco ianco dismissed swcurran’s stale review February 8, 2020 16:52

Done, "aca-py start" will block all ledger updates, unless "--dev-provision" is also provided

@swcurran swcurran merged commit ab8097d into openwallet-foundation:master Feb 15, 2020
@ianco ianco deleted the read-only-ledger branch December 2, 2020 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants