Skip to content

Commit

Permalink
let specify genesisHash as source param, useful for local chain
Browse files Browse the repository at this point in the history
  • Loading branch information
wighawag committed Nov 25, 2023
1 parent 4cd00f5 commit 51e38ee
Show file tree
Hide file tree
Showing 35 changed files with 157 additions and 17 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.44

### Patch Changes

- ethereum-indexer-js-processor@0.6.18

## 0.0.43

### 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.43",
"version": "0.0.44",
"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.44

### Patch Changes

- ethereum-indexer-js-processor@0.6.18

## 0.0.43

### 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.43",
"version": "0.0.44",
"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.44

### Patch Changes

- ethereum-indexer-js-processor@0.6.18

## 0.0.43

### 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.43",
"version": "0.0.44",
"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.44

### Patch Changes

- ethereum-indexer-js-processor@0.6.18

## 0.0.43

### 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.43",
"version": "0.0.44",
"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.43

### Patch Changes

- Updated dependencies
- ethereum-indexer@0.6.13
- ethereum-indexer-browser@0.6.15
- ethereum-indexer-js-processor@0.6.18
- event-processor-bleeps@0.0.44
- event-processor-conquest-eth@0.0.44
- event-processor-nfts@0.0.44

## 0.1.42

### 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.42",
"version": "0.1.43",
"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.43

### Patch Changes

- Updated dependencies
- ethereum-indexer@0.6.13
- ethereum-indexer-browser@0.6.15
- event-processor-bleeps@0.0.44
- event-processor-conquest-eth@0.0.44
- event-processor-nfts@0.0.44

## 0.1.42

### 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.42",
"version": "0.1.43",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
7 changes: 7 additions & 0 deletions packages/ethereum-indexer-browser/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# ethereum-indexer-browser

## 0.6.15

### Patch Changes

- Updated dependencies
- ethereum-indexer@0.6.13

## 0.6.14

### 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.14",
"version": "0.6.15",
"publishConfig": {
"access": "public"
},
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.18

### Patch Changes

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

## 0.6.17

### 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.17",
"version": "0.6.18",
"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.13

### Patch Changes

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

## 0.6.12

### 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.12",
"version": "0.6.13",
"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.13

### Patch Changes

- Updated dependencies
- ethereum-indexer@0.6.13

## 0.6.12

### 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.12",
"version": "0.6.13",
"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.13

### Patch Changes

- Updated dependencies
- ethereum-indexer@0.6.13

## 0.6.12

### 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.12",
"version": "0.6.13",
"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.18

### Patch Changes

- Updated dependencies
- ethereum-indexer@0.6.13

## 0.6.17

### 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.17",
"version": "0.6.18",
"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.21

### Patch Changes

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

## 0.6.20

### 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.20",
"version": "0.6.21",
"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.18

### Patch Changes

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

## 0.6.17

### 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.17",
"version": "0.6.18",
"description": "",
"keywords": [],
"author": "",
Expand Down
6 changes: 6 additions & 0 deletions packages/ethereum-indexer-utils/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# ethereum-indexer-utils

## 0.6.11

### Patch Changes

- let specify genesisHash as source param, useful for local chain

## 0.6.10

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/ethereum-indexer-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ethereum-indexer-utils",
"version": "0.6.10",
"version": "0.6.11",
"description": "",
"publishConfig": {
"access": "public"
Expand Down
12 changes: 11 additions & 1 deletion packages/ethereum-indexer-utils/src/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export function loadContractsFromFile<ABI extends Abi>(file: string): IndexingSo
contracts: Object.keys(contracts.contracts).map(
(name) => (contracts as any).contracts[name],
),
genesisHash: contracts.genesisHash
}
}

Expand All @@ -49,12 +50,20 @@ export function loadContractsFromFolder<ABI extends Abi>(folder: string): Indexi
const contractsAdded: {[address: string]: {index: number}} = {};
const contractsData: ContractData<ABI>[] = [];
const files = fs.readdirSync(folder);
let chainId = undefined;
let genesisHash: `0x${string}` | undefined = undefined;
let chainId: string | undefined = undefined;
for (const file of files) {
if (file === '.chainId') {
chainId = fs.readFileSync(path.join(folder, file), 'utf8');
continue;
}
if (file === '.chain') {
const str = fs.readFileSync(path.join(folder, file), 'utf8');
const {chainId: chainIdFromFile, genesisHash: genesisHashFromFile} = JSON.parse(str);
chainId = chainIdFromFile;
genesisHash = genesisHashFromFile;
continue;
}
if (!file.endsWith('.json')) {
continue;
}
Expand Down Expand Up @@ -92,5 +101,6 @@ export function loadContractsFromFolder<ABI extends Abi>(folder: string): Indexi
return {
chainId,
contracts: contractsData,
genesisHash
};
}
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.13

### Patch Changes

- let specify genesisHash as source param, useful for local chain

## 0.6.12

### 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.12",
"version": "0.6.13",
"publishConfig": {
"access": "public"
},
Expand Down
Loading

0 comments on commit 51e38ee

Please sign in to comment.