Skip to content

Commit

Permalink
refactor: Support the AnchorEvent model in latest spec
Browse files Browse the repository at this point in the history
Also change the 'not found' error in the IPFS client to persistent so that the Observer doesn't retry processing a non-existent anchor forever.

closes #674

Signed-off-by: Bob Stasyszyn <Bob.Stasyszyn@securekey.com>
  • Loading branch information
bstasyszyn committed Oct 7, 2021
1 parent 48ee87d commit c142bfe
Show file tree
Hide file tree
Showing 73 changed files with 4,806 additions and 4,692 deletions.
46 changes: 23 additions & 23 deletions cmd/orb-server/startcmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -586,13 +586,13 @@ func startOrbServices(parameters *orbParameters) error {

proofHandler := proof.New(
&proof.Providers{
VCStore: vcStore,
VCStatusStore: vcStatusStore,
MonitoringSvc: monitoringSvc,
DocLoader: orbDocumentLoader,
WitnessStore: witnessProofStore,
WitnessPolicy: witnessPolicy,
Metrics: metrics.Get(),
AnchorEventStore: vcStore,
StatusStore: vcStatusStore,
MonitoringSvc: monitoringSvc,
DocLoader: orbDocumentLoader,
WitnessStore: witnessProofStore,
WitnessPolicy: witnessPolicy,
Metrics: metrics.Get(),
},
pubSub)

Expand Down Expand Up @@ -624,7 +624,7 @@ func startOrbServices(parameters *orbParameters) error {
AnchorLinkStore: anchorLinkStore,
}

o, err := observer.New(providers, observer.WithDiscoveryDomain(parameters.discoveryDomain))
o, err := observer.New(apConfig.ServiceIRI, providers, observer.WithDiscoveryDomain(parameters.discoveryDomain))
if err != nil {
return fmt.Errorf("failed to create observer: %s", err.Error())
}
Expand All @@ -635,7 +635,7 @@ func startOrbServices(parameters *orbParameters) error {
apStore, t, apSigVerifier, pubSub, apClient, resourceResolver, metrics.Get(),
apspi.WithProofHandler(proofHandler),
apspi.WithWitness(witness),
apspi.WithAnchorCredentialHandler(credential.New(
apspi.WithAnchorEventHandler(credential.New(
o.Publisher(), casResolver, orbDocumentLoader, monitoringSvc, parameters.maxWitnessDelay,
)),
// TODO: Define the following ActivityPub handlers.
Expand All @@ -651,19 +651,19 @@ func startOrbServices(parameters *orbParameters) error {
o.Start()

anchorWriterProviders := &writer.Providers{
AnchorGraph: anchorGraph,
DidAnchors: didAnchors,
AnchorBuilder: vcBuilder,
VCStore: vcStore,
VCStatusStore: vcStatusStore,
OpProcessor: opProcessor,
Outbox: activityPubService.Outbox(),
Witness: witness,
Signer: vcSigner,
MonitoringSvc: monitoringSvc,
ActivityStore: apStore,
WitnessStore: witnessProofStore,
WFClient: wfClient,
AnchorGraph: anchorGraph,
DidAnchors: didAnchors,
AnchorBuilder: vcBuilder,
AnchorEventStore: vcStore,
VCStatusStore: vcStatusStore,
OpProcessor: opProcessor,
Outbox: activityPubService.Outbox(),
Witness: witness,
Signer: vcSigner,
MonitoringSvc: monitoringSvc,
ActivityStore: apStore,
WitnessStore: witnessProofStore,
WFClient: wfClient,
}

anchorWriter, err := writer.New(parameters.didNamespace,
Expand All @@ -672,7 +672,7 @@ func startOrbServices(parameters *orbParameters) error {
o.Publisher(), pubSub,
parameters.maxWitnessDelay,
parameters.signWithLocalWitness,
orbDocumentLoader, resourceResolver,
resourceResolver,
metrics.Get())
if err != nil {
return fmt.Errorf("failed to create writer: %s", err.Error())
Expand Down
Loading

0 comments on commit c142bfe

Please sign in to comment.