Skip to content

Commit

Permalink
allow to reset indexer
Browse files Browse the repository at this point in the history
  • Loading branch information
wighawag committed Nov 26, 2023
1 parent 10bb3a0 commit 490ddfb
Show file tree
Hide file tree
Showing 32 changed files with 177 additions and 20 deletions.
6 changes: 6 additions & 0 deletions examples/event-processor-bleeps/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# event-processor-bleeps

## 0.0.53

### Patch Changes

- ethereum-indexer-js-processor@0.6.27

## 0.0.52

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/event-processor-bleeps/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "event-processor-bleeps",
"private": true,
"version": "0.0.52",
"version": "0.0.53",
"description": "",
"type": "module",
"main": "dist/index.cjs",
Expand Down
6 changes: 6 additions & 0 deletions examples/event-processor-conquest-eth/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# event-processor-conquest-eth

## 0.0.53

### Patch Changes

- ethereum-indexer-js-processor@0.6.27

## 0.0.52

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/event-processor-conquest-eth/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "event-processor-conquest-eth",
"private": true,
"version": "0.0.52",
"version": "0.0.53",
"description": "",
"type": "module",
"main": "dist/index.cjs",
Expand Down
6 changes: 6 additions & 0 deletions examples/event-processor-conquest-fplay/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# event-processor-conquest-fplay

## 0.0.53

### Patch Changes

- ethereum-indexer-js-processor@0.6.27

## 0.0.52

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/event-processor-conquest-fplay/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "event-processor-conquest-fplay",
"private": true,
"version": "0.0.52",
"version": "0.0.53",
"description": "",
"type": "module",
"main": "dist/index.cjs",
Expand Down
6 changes: 6 additions & 0 deletions examples/event-processor-nfts/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# event-processor-nfts

## 0.0.53

### Patch Changes

- ethereum-indexer-js-processor@0.6.27

## 0.0.52

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/event-processor-nfts/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "event-processor-nfts",
"private": true,
"version": "0.0.52",
"version": "0.0.53",
"description": "",
"type": "module",
"main": "dist/index.cjs",
Expand Down
12 changes: 12 additions & 0 deletions examples/mud/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# web-demo

## 0.1.59

### Patch Changes

- Updated dependencies
- ethereum-indexer-browser@0.6.28
- ethereum-indexer@0.6.18
- ethereum-indexer-js-processor@0.6.27
- event-processor-bleeps@0.0.53
- event-processor-conquest-eth@0.0.53
- event-processor-nfts@0.0.53

## 0.1.58

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/mud/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mud-demo",
"private": true,
"version": "0.1.58",
"version": "0.1.59",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
11 changes: 11 additions & 0 deletions examples/web-demo/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# web-demo

## 0.1.59

### Patch Changes

- Updated dependencies
- ethereum-indexer-browser@0.6.28
- ethereum-indexer@0.6.18
- event-processor-bleeps@0.0.53
- event-processor-conquest-eth@0.0.53
- event-processor-nfts@0.0.53

## 0.1.58

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/web-demo/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "web-demo",
"private": true,
"version": "0.1.58",
"version": "0.1.59",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
8 changes: 8 additions & 0 deletions packages/ethereum-indexer-browser/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# ethereum-indexer-browser

## 0.6.28

### Patch Changes

- allow to reset indexer
- Updated dependencies
- ethereum-indexer@0.6.18

## 0.6.27

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/ethereum-indexer-browser/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ethereum-indexer-browser",
"version": "0.6.27",
"version": "0.6.28",
"publishConfig": {
"access": "public"
},
Expand Down
8 changes: 8 additions & 0 deletions packages/ethereum-indexer-browser/src/IndexerState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,13 @@ export function createIndexerState<ABI extends Abi, ProcessResultType, Processor
}
}

function reset() {
if (!indexer) {
throw new Error(`no indexer`);
}
return indexer.reset()
}

async function _auto_index() {
setSyncing({autoIndexing: true});
try {
Expand Down Expand Up @@ -352,6 +359,7 @@ export function createIndexerState<ABI extends Abi, ProcessResultType, Processor
indexMoreAndCatchupIfNeeded,
startAutoIndexing,
stopAutoIndexing,
reset,
updateProcessor(newProcessor: EventProcessorWithInitialState<ABI, ProcessResultType, ProcessorConfig>) {
if (!indexer) {
throw new Error(`no indexer setup, call init`);
Expand Down
8 changes: 8 additions & 0 deletions packages/ethereum-indexer-cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# ethereum-indexer-cli

## 0.6.23

### Patch Changes

- Updated dependencies
- ethereum-indexer@0.6.18
- ethereum-indexer-utils@0.6.11

## 0.6.22

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/ethereum-indexer-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ethereum-indexer-cli",
"version": "0.6.22",
"version": "0.6.23",
"description": "",
"keywords": [],
"author": "",
Expand Down
8 changes: 8 additions & 0 deletions packages/ethereum-indexer-db-processors/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# ethereum-indexer-db-processors

## 0.6.18

### Patch Changes

- Updated dependencies
- ethereum-indexer@0.6.18
- ethereum-indexer-db-utils@0.6.18

## 0.6.17

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/ethereum-indexer-db-processors/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ethereum-indexer-db-processors",
"version": "0.6.17",
"version": "0.6.18",
"description": "",
"publishConfig": {
"access": "public"
Expand Down
7 changes: 7 additions & 0 deletions packages/ethereum-indexer-db-utils/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# ethereum-indexer-db-utils

## 0.6.18

### Patch Changes

- Updated dependencies
- ethereum-indexer@0.6.18

## 0.6.17

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/ethereum-indexer-db-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ethereum-indexer-db-utils",
"version": "0.6.17",
"version": "0.6.18",
"description": "",
"publishConfig": {
"access": "public"
Expand Down
7 changes: 7 additions & 0 deletions packages/ethereum-indexer-fs-cache/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# ethereum-indexer-fs-event-store

## 0.6.18

### Patch Changes

- Updated dependencies
- ethereum-indexer@0.6.18

## 0.6.17

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/ethereum-indexer-fs-cache/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ethereum-indexer-fs-cache",
"version": "0.6.17",
"version": "0.6.18",
"description": "",
"publishConfig": {
"access": "public"
Expand Down
7 changes: 7 additions & 0 deletions packages/ethereum-indexer-js-processor/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# ethereum-indexer-js-processor

## 0.6.27

### Patch Changes

- Updated dependencies
- ethereum-indexer@0.6.18

## 0.6.26

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/ethereum-indexer-js-processor/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ethereum-indexer-js-processor",
"version": "0.6.26",
"version": "0.6.27",
"description": "",
"keywords": [],
"author": "",
Expand Down
10 changes: 10 additions & 0 deletions packages/ethereum-indexer-server/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# ethereum-indexer-server

## 0.6.26

### Patch Changes

- Updated dependencies
- ethereum-indexer@0.6.18
- ethereum-indexer-db-utils@0.6.18
- ethereum-indexer-fs-cache@0.6.18
- ethereum-indexer-utils@0.6.11

## 0.6.25

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/ethereum-indexer-server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ethereum-indexer-server",
"version": "0.6.25",
"version": "0.6.26",
"description": "",
"keywords": [],
"author": "",
Expand Down
8 changes: 8 additions & 0 deletions packages/ethereum-indexer-streams/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# ethereum-indexer-server

## 0.6.23

### Patch Changes

- Updated dependencies
- ethereum-indexer@0.6.18
- ethereum-indexer-utils@0.6.11

## 0.6.22

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/ethereum-indexer-streams/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ethereum-indexer-streams",
"version": "0.6.22",
"version": "0.6.23",
"description": "",
"keywords": [],
"author": "",
Expand Down
6 changes: 6 additions & 0 deletions packages/ethereum-indexer/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# ethereum-indexer

## 0.6.18

### Patch Changes

- allow to reset indexer

## 0.6.17

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/ethereum-indexer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ethereum-indexer",
"version": "0.6.17",
"version": "0.6.18",
"publishConfig": {
"access": "public"
},
Expand Down
Loading

0 comments on commit 490ddfb

Please sign in to comment.