diff --git a/README.md b/README.md index dd0f4e3..04dfc0f 100644 --- a/README.md +++ b/README.md @@ -34,4 +34,42 @@ If you want to run the demo directly with golang from the root of the repo: ``` cd integrity go run . +``` + +## Completeness Demo + +The completenesss demo will verify the integrity of a list of datatrails events. + +This is achieved by checking that ONLY the events in the list exist on the log within a range +starting from the first event ending at the last event in the list. + +Every event in the list then has an inclusion proof generated. + +If all the inclusion proofs are verified successfully, we can say that the list of +datatrails events is complete and all are included on the merkle log. + +### Docker Demo +To run the completeness demo with docker: + +``` +docker run -v ./completeness:/usr/src/myapp -w /usr/src/myapp golang:1.22-alpine go run . +``` + +Where the docker command is run from the root of the repo. + +### Task Demo + +To run the demo with a task (https://taskfile.dev/installation/) rune: + +``` +task demos:completeness +``` + +### Go Demo + +If you want to run the demo directly with golang from the root of the repo: + +``` +cd completeness +go run . ``` \ No newline at end of file diff --git a/completeness/go.mod b/completeness/go.mod index c40231e..ba7a0f6 100644 --- a/completeness/go.mod +++ b/completeness/go.mod @@ -4,7 +4,7 @@ go 1.22 require ( github.com/datatrails/go-datatrails-common v0.16.1 - github.com/datatrails/go-datatrails-demos/logverification v0.0.3-0.20240530102756-109763df17b4 + github.com/datatrails/go-datatrails-demos/logverification v0.0.3-0.20240530114926-8e28942cc526 github.com/stretchr/testify v1.9.0 ) diff --git a/completeness/go.sum b/completeness/go.sum index d0fa1b0..b83207c 100644 --- a/completeness/go.sum +++ b/completeness/go.sum @@ -45,8 +45,8 @@ github.com/datatrails/go-datatrails-common v0.16.1 h1:kaNOwyu8EmBbIR44daWDiUZxBt github.com/datatrails/go-datatrails-common v0.16.1/go.mod h1:IEcuwUaFl+bI1tt30r+Ov2+nvpcAZH/kXmAPGFjkwT4= github.com/datatrails/go-datatrails-common-api-gen v0.4.8 h1:IzrhGHi9TyEASjk06QjsayjtpXYCKuDt78+ffLuOCNM= github.com/datatrails/go-datatrails-common-api-gen v0.4.8/go.mod h1:zlwFPJXYAK7yqgLtxKUgkF5gw9ddxoqWS+Ruhf+Ksw0= -github.com/datatrails/go-datatrails-demos/logverification v0.0.3-0.20240530102756-109763df17b4 h1:f8c13P302U0EA54FOQKMijUv7j8HuUMb5ohXByaSQIs= -github.com/datatrails/go-datatrails-demos/logverification v0.0.3-0.20240530102756-109763df17b4/go.mod h1:5uMSYrfH8l3RNtiu934BXhwym9TorhSp375O188MJrM= +github.com/datatrails/go-datatrails-demos/logverification v0.0.3-0.20240530114926-8e28942cc526 h1:S3/QdoZZsf+Q0fFGTPw+AL6ezHry0tsoL1ce+Mmbq8w= +github.com/datatrails/go-datatrails-demos/logverification v0.0.3-0.20240530114926-8e28942cc526/go.mod h1:5uMSYrfH8l3RNtiu934BXhwym9TorhSp375O188MJrM= github.com/datatrails/go-datatrails-merklelog/massifs v0.0.5 h1:HfOvtpydHxFeBs3CMLVn4tliHrxfusI5cX8n/y23lYI= github.com/datatrails/go-datatrails-merklelog/massifs v0.0.5/go.mod h1:9gVKGJXWmQru2TlWF7Ho+jVCQRJTZKoT2L7Lda1batI= github.com/datatrails/go-datatrails-merklelog/mmr v0.0.1 h1:XggMVejsJ72cAL/msjPhQUSQNeElSh/O1zZcvX4d4JU= diff --git a/taskfiles/Taskfile_demos.yml b/taskfiles/Taskfile_demos.yml index e2a3567..614e279 100644 --- a/taskfiles/Taskfile_demos.yml +++ b/taskfiles/Taskfile_demos.yml @@ -14,6 +14,14 @@ tasks: integrity: desc: "run the intgrity demo" dir: ../integrity + cmds: + - cmd: | + + go run . + + completeness: + desc: "run the completeness demo" + dir: ../completeness cmds: - cmd: |