Skip to content

Commit

Permalink
feat: add env var for disabling anchoring
Browse files Browse the repository at this point in the history
  • Loading branch information
smrz2001 committed Oct 1, 2024
1 parent 6491d12 commit a80437a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/core/src/state-management/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,10 @@ export class Repository {
if (state$.value.anchorStatus == AnchorStatus.ANCHORED) {
return
}
if (process.env.CERAMIC_DISABLE_ANCHORING === 'true') {
this.logger.debug(`Anchor requested for stream ${state$.id} but anchoring is disabled`)
return
}

const anchorEvent = await this.anchorService.requestAnchor(state$.id, state$.tip)
// Don't wait on handling the anchor event, let that happen in the background.
Expand Down

0 comments on commit a80437a

Please sign in to comment.