Compare commits

...
5 Commits
Author SHA1 Message Date
nabarun 914b71c98a Add CI for publishing docker image (#3)
Reviewed-on: LaconicNetwork/azimuth-watcher-ts#3
Co-authored-by: Nabarun <nabarun@deepstacksoft.com>
Co-committed-by: Nabarun <nabarun@deepstacksoft.com>
2025-07-17 02:46:12 +00:00
prathamesh 08f08316cb Add generated docs (#2)
Part of https://www.notion.so/Implement-stacks-1b5a6b22d472806a82f5dafed6955138

Reviewed-on: LaconicNetwork/azimuth-watcher-ts#2
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
2025-06-11 08:46:56 +00:00
prathamesh 85be626f1c Add an example to query keys for a point (#1)
Part of https://www.notion.so/Subscription-API-for-scry-bindings-1c2a6b22d47280a98bb2e2d06496ac89

Reviewed-on: LaconicNetwork/azimuth-watcher-ts#1
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
2025-06-02 11:31:35 +00:00
nabarun 53be2a87c4 Update watchers to add event name filter in eventsInRange GQL query (#50)
* Update azimuth-watcher with latest watcher-ts version

* Update all watchers for event name filter

* Upgrade package version
2025-03-20 21:20:32 +05:30
nabarun 4927f2fba6 Update package versions to handle missing totalDifficulty in block data (#49)
* Update package versions to handle missing totalDifficulty

* Upgrade package versions
2025-03-11 15:43:37 +05:30
48 changed files with 558 additions and 228 deletions
+29
View File
@@ -0,0 +1,29 @@
name: Publish azimuth-watcher docker image on release
on:
release:
types: [published]
jobs:
build:
name: Run docker build and publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run docker build
run: docker build -t cerc/watcher-azimuth -f Dockerfile .
- name: Get the version
id: vars
run: |
echo "sha=$(echo ${GITHUB_SHA:0:7})" >> $GITHUB_OUTPUT
echo "tag=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_OUTPUT
- name: Tag docker image with SHA
run: docker tag cerc/watcher-azimuth git.vdb.to/laconicnetwork/cerc/watcher-azimuth:${{steps.vars.outputs.sha}}
- name: Tag docker image with release tag
run: docker tag git.vdb.to/laconicnetwork/cerc/watcher-azimuth:${{steps.vars.outputs.sha}} git.vdb.to/laconicnetwork/cerc/watcher-azimuth:${{steps.vars.outputs.tag}}
- name: Docker Login
run: echo ${{ secrets.CICD_PUBLISH_TOKEN }} | docker login https://git.vdb.to -u laconiccicd --password-stdin
- name: Docker Push SHA
run: docker push git.vdb.to/laconicnetwork/cerc/watcher-azimuth:${{steps.vars.outputs.sha}}
- name: Docker Push TAGGED
run: docker push git.vdb.to/laconicnetwork/cerc/watcher-azimuth:${{steps.vars.outputs.tag}}
+118
View File
@@ -0,0 +1,118 @@
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Project Overview
This is a monorepo containing blockchain watchers for the Azimuth PKI system used in Urbit identities. It watches multiple Ethereum contracts (Azimuth, Censures, Claims, ConditionalStarRelease, DelegatedSending, Ecliptic, LinearStarRelease, Polls) and provides GraphQL APIs for querying their state.
## Common Commands
### Building and Development
```bash
# Build all packages
yarn build
# or
lerna run build --stream
# Lint all packages (max warnings = 0)
yarn lint
# or
lerna run lint --stream -- --max-warnings=0
# Set versions across packages
yarn version:set
# or
lerna version --no-git-tag-version
```
### Individual Watcher Commands
Each watcher package supports these commands:
```bash
# Development server (with hot reload)
yarn server:dev
# Production server
yarn server
# Job runner (processes blockchain events)
yarn job-runner:dev # development
yarn job-runner # production
# Watch contract for events
yarn watch:contract
# Fill historical data
yarn fill
# Reset operations
yarn reset
# State management
yarn checkpoint:dev
yarn export-state:dev
yarn import-state:dev
# Utilities
yarn inspect-cid
yarn index-block
```
### Gateway Server
```bash
# Development gateway server (proxies to all watchers)
yarn server:dev
# Production gateway server
yarn server
```
## Architecture
### Monorepo Structure
- **Lerna-managed** yarn workspaces with 8 watcher packages + 1 gateway server
- Each watcher is a standalone service with its own database and GraphQL endpoint
- **Gateway server** acts as a unified GraphQL proxy that routes queries to appropriate watchers
### Watcher Packages
Each watcher follows identical structure:
- **Port allocation**: azimuth(3001), censures(3002), claims(3003), conditionalStarRelease(3004), delegatedSending(3005), ecliptic(3006), linearStarRelease(3007), polls(3008)
- **Database**: Individual PostgreSQL database per watcher
- **Configuration**: TOML files in `environments/` directory
- **Generated code**: Built from contract ABIs using `@cerc-io/codegen`
### Key Components Per Watcher
- `src/server.ts` - GraphQL server
- `src/job-runner.ts` - Event processing worker
- `src/indexer.ts` - Blockchain event indexing logic
- `src/resolvers.ts` - GraphQL resolvers
- `src/entity/` - TypeORM entities for all contract methods
- `src/gql/queries/` - GraphQL query definitions
- `src/cli/` - Command-line utilities for management
### Gateway Server Architecture
- **Schema stitching**: Combines all watcher schemas with prefixed field names
- **Health checking**: Monitors watcher availability before routing
- **Configuration**: `src/watchers.json` defines watcher endpoints and prefixes
- **GraphQL proxy**: Routes queries like `azimuthGetKeys` to azimuth-watcher at localhost:3001
### Data Flow
1. **Event Processing**: job-runner fetches Ethereum events → processes through indexer → stores in database
2. **Query Processing**: GraphQL queries → gateway server → appropriate watcher → database → response
3. **State Management**: Supports checkpointing, state export/import for data recovery
## Configuration Notes
### Environment Setup
- Each watcher requires PostgreSQL database (configurable in `environments/local.toml`)
- Requires Ethereum RPC endpoint (ipld-eth-server or standard RPC)
- Gateway server expects all watchers running on their designated ports
### Development Workflow
- Start individual watchers with `yarn server:dev` and `yarn job-runner:dev`
- Start gateway server for unified GraphQL endpoint
- Use `yarn fill` to sync historical blockchain data
- Monitor with debug logs using `DEBUG=vulcanize:*`
### Generated Watcher Creation
Watchers are generated using `@cerc-io/codegen` from contract ABIs. The process involves creating config.yaml files specifying contract paths, output folders, and generation modes (eth_call/storage/all).
+25
View File
@@ -0,0 +1,25 @@
FROM node:18.16.0-alpine3.16
RUN apk --update --no-cache add git python3 alpine-sdk jq
WORKDIR /app
COPY . .
# Get the latest Git commit hash and set it in package.json of all watchers
RUN COMMIT_HASH=$(git rev-parse HEAD) && \
find . -name 'package.json' -exec sh -c ' \
for packageFile; do \
jq --arg commitHash "$0" ".commitHash = \$commitHash" "$packageFile" > "$packageFile.tmp" && \
mv "$packageFile.tmp" "$packageFile"; \
done \
' "$COMMIT_HASH" {} \;
RUN echo "installing dependencies" && \
yarn
RUN echo "Building azimuth-watcher and gateway-server" && \
yarn build --scope @cerc-io/azimuth-watcher --scope @cerc-io/gateway-server
RUN echo "Install toml-js to update watcher config files" && \
yarn add --dev --ignore-workspace-root-check toml-js
+160 -77
View File
@@ -1,21 +1,143 @@
# azimuth-watcher-ts
Watcher for the Azimuth PKI on Ethereum, used in Urbit identities. Read more about Azimuth:
A comprehensive blockchain indexing and querying system for [Azimuth](https://docs.urbit.org/system/identity), Urbit's identity layer on Ethereum. This system monitors multiple Ethereum smart contracts that make up the Azimuth PKI and provides a unified GraphQL API for querying Urbit identity information.
- [https://developers.urbit.org/reference/azimuth/azimuth](https://developers.urbit.org/reference/azimuth/azimuth)
## What is Azimuth?
This app can be run using Stack Orchestrator:
Azimuth is Urbit's public key infrastructure (PKI) that lives on Ethereum. It's a set of smart contracts that manage Urbit identities called "points" (similar to usernames), their ownership, cryptographic keys, and hierarchical relationships. By storing identity data on Ethereum, the system is decentralized and censorship-resistant.
- [Azimuth stack](https://git.vdb.to/cerc-io/stack-orchestrator/src/branch/main/app/data/stacks/azimuth)
## What are Watchers?
It is also hosted [here](https://azimuth.dev.vdb.to/graphql)
Watchers are services that continuously monitor smart contracts on Ethereum, index their events and state changes, and provide efficient APIs for querying blockchain data. Instead of directly querying the Ethereum blockchain (which is slow and expensive), applications can query watchers for fast, indexed access to current and historical blockchain state.
## Usage
## System Architecture
Here are some example queries:
This system consists of **8 specialized watchers** that each monitor different Azimuth smart contracts:
- **azimuth-watcher** - Core identity operations (ownership, keys, sponsorship)
- **censures-watcher** - Reputation and censure system
- **claims-watcher** - On-chain claims and metadata
- **ecliptic-watcher** - Galaxy operations and governance
- **polls-watcher** - Voting and governance proposals
- **conditional-star-release-watcher** - Conditional star distribution
- **linear-star-release-watcher** - Linear star distribution
- **delegated-sending-watcher** - Delegated operations
Plus a **gateway server** that provides a unified GraphQL endpoint routing queries to the appropriate watcher.
## Hosted Service
A public instance is available at: **<https://azimuth.dev.vdb.to/graphql>**
You can also run the system locally using [Stack Orchestrator](https://git.vdb.to/cerc-io/stack-orchestrator/src/branch/main/app/data/stacks/azimuth).
## Common Use Cases
### Querying Urbit Point Information
The **azimuth-watcher** is the primary service for querying Urbit identity data. Here are the most common operations:
#### 1. Get Point Owner and Basic Info
```bash
# Check who owns a specific Urbit point
# Example:
curl 'https://azimuth.dev.vdb.to/graphql' \
-H 'Content-Type: application/json' \
--data-raw '{"query":"{ azimuthGetOwner(blockHash: \"latest\", contractAddress: \"0x223c067F8CF28ae173EE5CafEa60cA44C335fecB\", _point: 1234) { value } }"}' \
| jq
# Response:
# {
# "data": {
# "azimuthGetOwner": {
# "value": "0x4b22764F2Db640aB4d0Ecfd0F84344F3CB5C3715"
# }
# }
# }
```
#### 2. Get Cryptographic Keys for a Point
```bash
# Get encryption and authentication keys for networking
# Example:
curl 'https://azimuth.dev.vdb.to/graphql' \
-H 'Content-Type: application/json' \
--data-raw '{"query":"{ azimuthGetKeys(blockHash: \"latest\", contractAddress: \"0x223c067F8CF28ae173EE5CafEa60cA44C335fecB\", _point: 58213) { value { encryptionKey: value0 authenticationKey: value1 cryptoSuiteVersion: value2 keyRevisionNumber: value3 } } }"}' \
| jq
# Response:
# {
# "data": {
# "azimuthGetKeys": {
# "value": {
# "encryptionKey": "0xc248f759474b16192bd8bdca0bff1b8bff555cd3d118022095331d6d98690c6d",
# "authenticationKey": "0x21188bac08542730e1c4697636d6fa25968f404470ccf917756f05e28c69045a",
# "cryptoSuiteVersion": "1",
# "keyRevisionNumber": "1"
# }
# }
# }
# }
```
#### 3. Check Point Status
```bash
# Check if a point is active (booted) and has a sponsor
# Example:
curl 'https://azimuth.dev.vdb.to/graphql' \
-H 'Content-Type: application/json' \
--data-raw '{"query":"{ azimuthIsActive(blockHash: \"latest\", contractAddress: \"0x223c067F8CF28ae173EE5CafEa60cA44C335fecB\", _point: 1234) { value } azimuthHasSponsor(blockHash: \"latest\", contractAddress: \"0x223c067F8CF28ae173EE5CafEa60cA44C335fecB\", _point: 1234) { value } azimuthGetSponsor(blockHash: \"latest\", contractAddress: \"0x223c067F8CF28ae173EE5CafEa60cA44C335fecB\", _point: 1234) { value } }"}' \
| jq
# Response:
# {
# "data": {
# "azimuthIsActive": {
# "value": true
# },
# "azimuthHasSponsor": {
# "value": true
# },
# "azimuthGetSponsor": {
# "value": "210"
# }
# }
# }
```
#### 4. Get All Points Owned by an Address
```bash
# Find all Urbit points owned by an Ethereum address
# Example:
curl 'https://azimuth.dev.vdb.to/graphql' \
-H 'Content-Type: application/json' \
--data-raw '{"query":"{ azimuthGetOwnedPoints(blockHash: \"latest\", contractAddress: \"0x223c067F8CF28ae173EE5CafEa60cA44C335fecB\", _whose: \"0x1234567890123456789012345678901234567890\") { value } }"}' \
| jq
# Response:
# {
# "data": {
# "azimuthGetOwnedPoints": {
# "value": [
# "57965",
# "1234"
# ]
# }
# }
# }
```
#### 5. Multi-Watcher Queries
The gateway server allows querying multiple watchers in a single request:
```graphql
{
# Check point status (azimuth-watcher)
azimuthIsActive(
blockHash: "0x2461e78f075e618173c524b5ab4309111001517bb50cfd1b3505aed5433cf5f9"
contractAddress: "0x223c067F8CF28ae173EE5CafEa60cA44C335fecB"
@@ -23,13 +145,17 @@ Here are some example queries:
) {
value
}
# Check censure count (censures-watcher)
censuresGetCensuredByCount(
blockHash: "0x2461e78f075e618173c524b5ab4309111001517bb50cfd1b3505aed5433cf5f9"
contractAddress: "0x325f68d32BdEe6Ed86E7235ff2480e2A433D6189"
_who: 6054
) {
value
}
} }
# Find a claim (claims-watcher)
claimsFindClaim(
blockHash: "0x2461e78f075e618173c524b5ab4309111001517bb50cfd1b3505aed5433cf5f9"
contractAddress: "0xe7e7f69b34D7d9Bd8d61Fb22C33b22708947971A"
@@ -39,6 +165,8 @@ Here are some example queries:
) {
value
}
# Check star release balance (linear-star-release-watcher)
linearStarReleaseVerifyBalance(
blockHash: "0x2461e78f075e618173c524b5ab4309111001517bb50cfd1b3505aed5433cf5f9"
contractAddress: "0x86cd9cd0992F04231751E3761De45cEceA5d1801"
@@ -46,6 +174,8 @@ Here are some example queries:
) {
value
}
# Check conditional star release (conditional-star-release-watcher)
conditionalStarReleaseWithdrawLimit(
blockHash: "0x2461e78f075e618173c524b5ab4309111001517bb50cfd1b3505aed5433cf5f9"
contractAddress: "0x8C241098C3D3498Fe1261421633FD57986D74AeA"
@@ -54,12 +184,16 @@ Here are some example queries:
) {
value
}
# Check governance proposals (polls-watcher)
pollsGetUpgradeProposalCount(
blockHash: "0xeaf611fabbe604932d36b97c89955c091e9582e292b741ebf144962b9ff5c271"
contractAddress: "0x7fEcaB617c868Bb5996d99D95200D2Fa708218e4"
) {
value
}
# Check NFT balance (ecliptic-watcher)
eclipticBalanceOf(
blockHash: "0x5e82abbe6474caf7b5325022db1d1287ce352488b303685493289770484f54f4"
contractAddress: "0x33EeCbf908478C10614626A9D304bfe18B78DD73"
@@ -67,6 +201,8 @@ Here are some example queries:
) {
value
}
# Check delegation permissions (delegated-sending-watcher)
delegatedSendingCanSend(
blockHash: "0x2461e78f075e618173c524b5ab4309111001517bb50cfd1b3505aed5433cf5f9"
contractAddress: "0xf6b461fE1aD4bd2ce25B23Fe0aff2ac19B3dFA76"
@@ -78,81 +214,28 @@ Here are some example queries:
}
```
## Generate Watchers
### Understanding Query Parameters
Steps to generate Azimuth watchers using the code generator ([`@cerc-io/codegen`](https://github.com/cerc-io/watcher-ts/tree/v0.2.76/packages/codegen))
All queries require these standard parameters:
* Clone the original Azimuth repo for required contracts:
- **`blockHash`**: Use `"latest"` for current state, or a specific block hash for historical queries
- **`contractAddress`**: Azimuth contract address (`0x223c067F8CF28ae173EE5CafEa60cA44C335fecB`)
- **`_point`**: The Urbit point number you're querying
- **`_whose`**: Ethereum address when querying by owner
```bash
git clone git@github.com:urbit/azimuth.git
## How It Works
# Install dependencies
npm install
### Data Source
# Contracts are located in the contracts folder
```
The watchers continuously monitor Ethereum smart contracts by connecting to Ethereum RPC endpoint(s), indexing blockchain events and state changes.
* Setup `cerc-io/watcher-ts` repo:
### Data Flow
```bash
git clone git@github.com:cerc-io/watcher-ts.git
1. **Indexing**: Job runners fetch Ethereum events and blocks from RPC endpoint(s)
2. **Processing**: Events are processed and state changes stored in PostgreSQL databases
3. **Querying**: GraphQL servers provide fast, indexed access to current and historical blockchain state
4. **Gateway**: Unified endpoint routes queries to appropriate specialized watchers
# Install dependencies and build packages
yarn install && yarn build
```
### Storage
* Create a folder to place all the generated watchers in:
```bash
mkdir -p azimuth-watcher-ts/packages
```
* In `watcher-ts/packages/codegen`, create a `config.yaml` file with required codegen config for generating the watcher for a contract
For example, for `Azimuth` contract:
```yaml
# Contracts to watch (required).
contracts:
# Contract name.
- name: Azimuth
# Contract file path or an url.
path: /home/user/azimuth/contracts/Azimuth.sol
# Contract kind
kind: Azimuth
# Output folder path (logs output using `stdout` if not provided).
outputFolder: /home/user/azimuth-watcher-ts/packages/azimuth-watcher
# Code generation mode [eth_call | storage | all | none] (default: none).
mode: eth_call
# Kind of watcher [lazy | active] (default: active).
kind: active
# Watcher server port (default: 3008).
port: 3001
# Solc version to use (optional)
# If not defined, uses solc version listed in dependencies
solc: v0.4.24+commit.e67f0147
# Flatten the input contract file(s) [true | false] (default: true).
flatten: true
```
Note: Create `.sol` files with the contract code from Etherscan for [`ConditionalStarRelease`](https://etherscan.io/address/0x8C241098C3D3498Fe1261421633FD57986D74AeA#code), [`DelegatedSending`](https://etherscan.io/address/0xf6b461fe1ad4bd2ce25b23fe0aff2ac19b3dfa76#code), [`Ecliptic`](https://etherscan.io/address/ecliptic.eth#code) and [`LinearStarRelease`](https://etherscan.io/address/0x86cd9cd0992F04231751E3761De45cEceA5d1801#code) contracts and use the file path for `contracts.path`
* Run codegen command to generate the watcher:
```bash
# In watcher-ts/packages/codegen
yarn codegen --config-file ./config.yaml
```
* Update `contracts`, `outputFolder` and `port` fields in the config and re-run the codegen command for all other contracts
* Setup the parent folder `/home/user/azimuth-watcher-ts` where all the generated watchers are placed as a monorepo
* The [gateway GQL server](packages/gateway-server) can be used to proxy queries to their respective watchers
Each watcher maintains its own PostgreSQL database for efficient querying and data isolation.
+76
View File
@@ -0,0 +1,76 @@
# Generate Azimuth Watchers
* Clone the original Azimuth repo for required contracts:
```bash
git clone git@github.com:urbit/azimuth.git
# Install dependencies
npm install
# Contracts are located in the contracts folder
```
* Setup `cerc-io/watcher-ts` repo:
```bash
git clone git@github.com:cerc-io/watcher-ts.git
# Install dependencies and build packages
yarn install && yarn build
```
* Create a folder to place all the generated watchers in:
```bash
mkdir -p azimuth-watcher-ts/packages
```
* In `watcher-ts/packages/codegen`, create a `config.yaml` file with required codegen config for generating the watcher for a contract
For example, for `Azimuth` contract:
```yaml
# Contracts to watch (required).
contracts:
# Contract name.
- name: Azimuth
# Contract file path or an url.
path: /home/user/azimuth/contracts/Azimuth.sol
# Contract kind
kind: Azimuth
# Output folder path (logs output using `stdout` if not provided).
outputFolder: /home/user/azimuth-watcher-ts/packages/azimuth-watcher
# Code generation mode [eth_call | storage | all | none] (default: none).
mode: eth_call
# Kind of watcher [lazy | active] (default: active).
kind: active
# Watcher server port (default: 3008).
port: 3001
# Solc version to use (optional)
# If not defined, uses solc version listed in dependencies
solc: v0.4.24+commit.e67f0147
# Flatten the input contract file(s) [true | false] (default: true).
flatten: true
```
Note: Create `.sol` files with the contract code from Etherscan for [`ConditionalStarRelease`](https://etherscan.io/address/0x8C241098C3D3498Fe1261421633FD57986D74AeA#code), [`DelegatedSending`](https://etherscan.io/address/0xf6b461fe1ad4bd2ce25b23fe0aff2ac19b3dfa76#code), [`Ecliptic`](https://etherscan.io/address/ecliptic.eth#code) and [`LinearStarRelease`](https://etherscan.io/address/0x86cd9cd0992F04231751E3761De45cEceA5d1801#code) contracts and use the file path for `contracts.path`
* Run codegen command to generate the watcher:
```bash
# In watcher-ts/packages/codegen
yarn codegen --config-file ./config.yaml
```
* Update `contracts`, `outputFolder` and `port` fields in the config and re-run the codegen command for all other contracts
* Setup the parent folder `/home/user/azimuth-watcher-ts` where all the generated watchers are placed as a monorepo
* The [gateway GQL server](packages/gateway-server) can be used to proxy queries to their respective watchers
+1 -1
View File
@@ -3,6 +3,6 @@
"packages/*"
],
"useWorkspaces": true,
"version": "0.1.6",
"version": "0.1.10",
"npmClient": "yarn"
}
+5 -5
View File
@@ -1,6 +1,6 @@
{
"name": "@cerc-io/azimuth-watcher",
"version": "0.1.6",
"version": "0.1.10",
"description": "azimuth-watcher",
"private": true,
"main": "dist/index.js",
@@ -39,10 +39,10 @@
"homepage": "https://github.com/cerc-io/watcher-ts#readme",
"dependencies": {
"@apollo/client": "^3.3.19",
"@cerc-io/cli": "^0.2.98",
"@cerc-io/ipld-eth-client": "^0.2.98",
"@cerc-io/solidity-mapper": "^0.2.98",
"@cerc-io/util": "^0.2.98",
"@cerc-io/cli": "0.2.98-patch.2",
"@cerc-io/ipld-eth-client": "0.2.98-patch.2",
"@cerc-io/solidity-mapper": "0.2.98-patch.2",
"@cerc-io/util": "0.2.98-patch.2",
"@ethersproject/providers": "^5.4.4",
"debug": "^4.3.1",
"decimal.js": "^10.3.1",
+2 -2
View File
@@ -852,10 +852,10 @@ export class Database implements DatabaseInterface {
return this._baseDatabase.getProcessedBlockCountForRange(repo, fromBlockNumber, toBlockNumber);
}
async getEventsInRange (fromBlockNumber: number, toBlockNumber: number): Promise<Array<Event>> {
async getEventsInRange (fromBlockNumber: number, toBlockNumber: number, name?: string): Promise<Array<Event>> {
const repo = this._conn.getRepository(Event);
return this._baseDatabase.getEventsInRange(repo, fromBlockNumber, toBlockNumber);
return this._baseDatabase.getEventsInRange(repo, fromBlockNumber, toBlockNumber, name);
}
async saveEventEntity (queryRunner: QueryRunner, entity: Event): Promise<Event> {
+2 -2
View File
@@ -1733,8 +1733,8 @@ export class Indexer implements IndexerInterface {
return this._baseIndexer.getProcessedBlockCountForRange(fromBlockNumber, toBlockNumber);
}
async getEventsInRange (fromBlockNumber: number, toBlockNumber: number): Promise<Array<Event>> {
return this._baseIndexer.getEventsInRange(fromBlockNumber, toBlockNumber, this._serverConfig.gql.maxEventsBlockRange);
async getEventsInRange (fromBlockNumber: number, toBlockNumber: number, name?: string): Promise<Array<Event>> {
return this._baseIndexer.getEventsInRange(fromBlockNumber, toBlockNumber, this._serverConfig.gql.maxEventsBlockRange, name);
}
async getSyncStatus (): Promise<SyncStatus | undefined> {
+3 -3
View File
@@ -1103,10 +1103,10 @@ export const createResolvers = async (
eventsInRange: async (
_: any,
{ fromBlockNumber, toBlockNumber }: { fromBlockNumber: number, toBlockNumber: number },
{ fromBlockNumber, toBlockNumber, name }: { fromBlockNumber: number, toBlockNumber: number, name?: string },
expressContext: ExpressContext
) => {
log('eventsInRange', fromBlockNumber, toBlockNumber);
log('eventsInRange', fromBlockNumber, toBlockNumber, name);
return executeAndRecordMetrics(
indexer,
@@ -1124,7 +1124,7 @@ export const createResolvers = async (
throw new Error(`Block range should be between ${syncStatus.initialIndexedBlockNumber} and ${syncStatus.latestProcessedBlockNumber}`);
}
const events = await indexer.getEventsInRange(fromBlockNumber, toBlockNumber);
const events = await indexer.getEventsInRange(fromBlockNumber, toBlockNumber, name);
return events.map(event => indexer.getResultEvent(event));
}
);
+1 -1
View File
@@ -176,7 +176,7 @@ type SyncStatus {
type Query {
events(blockHash: String!, contractAddress: String!, name: String): [ResultEvent!]
eventsInRange(fromBlockNumber: Int!, toBlockNumber: Int!): [ResultEvent!]
eventsInRange(fromBlockNumber: Int!, toBlockNumber: Int!, name: String): [ResultEvent!]
isActive(blockHash: String!, contractAddress: String!, _point: BigInt!): ResultBoolean!
getKeys(blockHash: String!, contractAddress: String!, _point: BigInt!): ResultGetKeysType!
getKeyRevisionNumber(blockHash: String!, contractAddress: String!, _point: BigInt!): ResultBigInt!
+5 -5
View File
@@ -1,6 +1,6 @@
{
"name": "@cerc-io/censures-watcher",
"version": "0.1.6",
"version": "0.1.9",
"description": "censures-watcher",
"private": true,
"main": "dist/index.js",
@@ -39,10 +39,10 @@
"homepage": "https://github.com/cerc-io/watcher-ts#readme",
"dependencies": {
"@apollo/client": "^3.3.19",
"@cerc-io/cli": "^0.2.98",
"@cerc-io/ipld-eth-client": "^0.2.98",
"@cerc-io/solidity-mapper": "^0.2.98",
"@cerc-io/util": "^0.2.98",
"@cerc-io/cli": "0.2.98-patch.2",
"@cerc-io/ipld-eth-client": "0.2.98-patch.2",
"@cerc-io/solidity-mapper": "0.2.98-patch.2",
"@cerc-io/util": "0.2.98-patch.2",
"@ethersproject/providers": "^5.4.4",
"debug": "^4.3.1",
"decimal.js": "^10.3.1",
+2 -2
View File
@@ -199,10 +199,10 @@ export class Database implements DatabaseInterface {
return this._baseDatabase.getProcessedBlockCountForRange(repo, fromBlockNumber, toBlockNumber);
}
async getEventsInRange (fromBlockNumber: number, toBlockNumber: number): Promise<Array<Event>> {
async getEventsInRange (fromBlockNumber: number, toBlockNumber: number, name?: string): Promise<Array<Event>> {
const repo = this._conn.getRepository(Event);
return this._baseDatabase.getEventsInRange(repo, fromBlockNumber, toBlockNumber);
return this._baseDatabase.getEventsInRange(repo, fromBlockNumber, toBlockNumber, name);
}
async saveEventEntity (queryRunner: QueryRunner, entity: Event): Promise<Event> {
+2 -2
View File
@@ -511,8 +511,8 @@ export class Indexer implements IndexerInterface {
return this._baseIndexer.getProcessedBlockCountForRange(fromBlockNumber, toBlockNumber);
}
async getEventsInRange (fromBlockNumber: number, toBlockNumber: number): Promise<Array<Event>> {
return this._baseIndexer.getEventsInRange(fromBlockNumber, toBlockNumber, this._serverConfig.gql.maxEventsBlockRange);
async getEventsInRange (fromBlockNumber: number, toBlockNumber: number, name?: string): Promise<Array<Event>> {
return this._baseIndexer.getEventsInRange(fromBlockNumber, toBlockNumber, this._serverConfig.gql.maxEventsBlockRange, name);
}
async getSyncStatus (): Promise<SyncStatus | undefined> {
+3 -3
View File
@@ -223,10 +223,10 @@ export const createResolvers = async (
eventsInRange: async (
_: any,
{ fromBlockNumber, toBlockNumber }: { fromBlockNumber: number, toBlockNumber: number },
{ fromBlockNumber, toBlockNumber, name }: { fromBlockNumber: number, toBlockNumber: number, name?: string },
expressContext: ExpressContext
) => {
log('eventsInRange', fromBlockNumber, toBlockNumber);
log('eventsInRange', fromBlockNumber, toBlockNumber, name);
return executeAndRecordMetrics(
indexer,
@@ -244,7 +244,7 @@ export const createResolvers = async (
throw new Error(`Block range should be between ${syncStatus.initialIndexedBlockNumber} and ${syncStatus.latestProcessedBlockNumber}`);
}
const events = await indexer.getEventsInRange(fromBlockNumber, toBlockNumber);
const events = await indexer.getEventsInRange(fromBlockNumber, toBlockNumber, name);
return events.map(event => indexer.getResultEvent(event));
}
);
+1 -1
View File
@@ -87,7 +87,7 @@ type SyncStatus {
type Query {
events(blockHash: String!, contractAddress: String!, name: String): [ResultEvent!]
eventsInRange(fromBlockNumber: Int!, toBlockNumber: Int!): [ResultEvent!]
eventsInRange(fromBlockNumber: Int!, toBlockNumber: Int!, name: String): [ResultEvent!]
getCensuringCount(blockHash: String!, contractAddress: String!, _whose: Int!): ResultBigInt!
getCensuring(blockHash: String!, contractAddress: String!, _whose: Int!): ResultBigIntArray!
getCensuredByCount(blockHash: String!, contractAddress: String!, _who: Int!): ResultBigInt!
+5 -5
View File
@@ -1,6 +1,6 @@
{
"name": "@cerc-io/claims-watcher",
"version": "0.1.6",
"version": "0.1.9",
"description": "claims-watcher",
"private": true,
"main": "dist/index.js",
@@ -39,10 +39,10 @@
"homepage": "https://github.com/cerc-io/watcher-ts#readme",
"dependencies": {
"@apollo/client": "^3.3.19",
"@cerc-io/cli": "^0.2.98",
"@cerc-io/ipld-eth-client": "^0.2.98",
"@cerc-io/solidity-mapper": "^0.2.98",
"@cerc-io/util": "^0.2.98",
"@cerc-io/cli": "0.2.98-patch.2",
"@cerc-io/ipld-eth-client": "0.2.98-patch.2",
"@cerc-io/solidity-mapper": "0.2.98-patch.2",
"@cerc-io/util": "0.2.98-patch.2",
"@ethersproject/providers": "^5.4.4",
"debug": "^4.3.1",
"decimal.js": "^10.3.1",
+2 -2
View File
@@ -153,10 +153,10 @@ export class Database implements DatabaseInterface {
return this._baseDatabase.getProcessedBlockCountForRange(repo, fromBlockNumber, toBlockNumber);
}
async getEventsInRange (fromBlockNumber: number, toBlockNumber: number): Promise<Array<Event>> {
async getEventsInRange (fromBlockNumber: number, toBlockNumber: number, name?: string): Promise<Array<Event>> {
const repo = this._conn.getRepository(Event);
return this._baseDatabase.getEventsInRange(repo, fromBlockNumber, toBlockNumber);
return this._baseDatabase.getEventsInRange(repo, fromBlockNumber, toBlockNumber, name);
}
async saveEventEntity (queryRunner: QueryRunner, entity: Event): Promise<Event> {
+2 -2
View File
@@ -419,8 +419,8 @@ export class Indexer implements IndexerInterface {
return this._baseIndexer.getProcessedBlockCountForRange(fromBlockNumber, toBlockNumber);
}
async getEventsInRange (fromBlockNumber: number, toBlockNumber: number): Promise<Array<Event>> {
return this._baseIndexer.getEventsInRange(fromBlockNumber, toBlockNumber, this._serverConfig.gql.maxEventsBlockRange);
async getEventsInRange (fromBlockNumber: number, toBlockNumber: number, name?: string): Promise<Array<Event>> {
return this._baseIndexer.getEventsInRange(fromBlockNumber, toBlockNumber, this._serverConfig.gql.maxEventsBlockRange, name);
}
async getSyncStatus (): Promise<SyncStatus | undefined> {
+3 -3
View File
@@ -157,10 +157,10 @@ export const createResolvers = async (
eventsInRange: async (
_: any,
{ fromBlockNumber, toBlockNumber }: { fromBlockNumber: number, toBlockNumber: number },
{ fromBlockNumber, toBlockNumber, name }: { fromBlockNumber: number, toBlockNumber: number, name?: string },
expressContext: ExpressContext
) => {
log('eventsInRange', fromBlockNumber, toBlockNumber);
log('eventsInRange', fromBlockNumber, toBlockNumber, name);
return executeAndRecordMetrics(
indexer,
@@ -178,7 +178,7 @@ export const createResolvers = async (
throw new Error(`Block range should be between ${syncStatus.initialIndexedBlockNumber} and ${syncStatus.latestProcessedBlockNumber}`);
}
const events = await indexer.getEventsInRange(fromBlockNumber, toBlockNumber);
const events = await indexer.getEventsInRange(fromBlockNumber, toBlockNumber, name);
return events.map(event => indexer.getResultEvent(event));
}
);
+1 -1
View File
@@ -80,7 +80,7 @@ type SyncStatus {
type Query {
events(blockHash: String!, contractAddress: String!, name: String): [ResultEvent!]
eventsInRange(fromBlockNumber: Int!, toBlockNumber: Int!): [ResultEvent!]
eventsInRange(fromBlockNumber: Int!, toBlockNumber: Int!, name: String): [ResultEvent!]
findClaim(blockHash: String!, contractAddress: String!, _whose: BigInt!, _protocol: String!, _claim: String!): ResultInt!
getStateByCID(cid: String!): ResultState
getState(blockHash: String!, contractAddress: String!, kind: String): ResultState
@@ -1,6 +1,6 @@
{
"name": "@cerc-io/conditional-star-release-watcher",
"version": "0.1.6",
"version": "0.1.9",
"description": "conditional-star-release-watcher",
"private": true,
"main": "dist/index.js",
@@ -39,10 +39,10 @@
"homepage": "https://github.com/cerc-io/watcher-ts#readme",
"dependencies": {
"@apollo/client": "^3.3.19",
"@cerc-io/cli": "^0.2.98",
"@cerc-io/ipld-eth-client": "^0.2.98",
"@cerc-io/solidity-mapper": "^0.2.98",
"@cerc-io/util": "^0.2.98",
"@cerc-io/cli": "0.2.98-patch.2",
"@cerc-io/ipld-eth-client": "0.2.98-patch.2",
"@cerc-io/solidity-mapper": "0.2.98-patch.2",
"@cerc-io/util": "0.2.98-patch.2",
"@ethersproject/providers": "^5.4.4",
"debug": "^4.3.1",
"decimal.js": "^10.3.1",
@@ -298,10 +298,10 @@ export class Database implements DatabaseInterface {
return this._baseDatabase.getProcessedBlockCountForRange(repo, fromBlockNumber, toBlockNumber);
}
async getEventsInRange (fromBlockNumber: number, toBlockNumber: number): Promise<Array<Event>> {
async getEventsInRange (fromBlockNumber: number, toBlockNumber: number, name?: string): Promise<Array<Event>> {
const repo = this._conn.getRepository(Event);
return this._baseDatabase.getEventsInRange(repo, fromBlockNumber, toBlockNumber);
return this._baseDatabase.getEventsInRange(repo, fromBlockNumber, toBlockNumber, name);
}
async saveEventEntity (queryRunner: QueryRunner, entity: Event): Promise<Event> {
@@ -700,8 +700,8 @@ export class Indexer implements IndexerInterface {
return this._baseIndexer.getProcessedBlockCountForRange(fromBlockNumber, toBlockNumber);
}
async getEventsInRange (fromBlockNumber: number, toBlockNumber: number): Promise<Array<Event>> {
return this._baseIndexer.getEventsInRange(fromBlockNumber, toBlockNumber, this._serverConfig.gql.maxEventsBlockRange);
async getEventsInRange (fromBlockNumber: number, toBlockNumber: number, name?: string): Promise<Array<Event>> {
return this._baseIndexer.getEventsInRange(fromBlockNumber, toBlockNumber, this._serverConfig.gql.maxEventsBlockRange, name);
}
async getSyncStatus (): Promise<SyncStatus | undefined> {
@@ -355,10 +355,10 @@ export const createResolvers = async (
eventsInRange: async (
_: any,
{ fromBlockNumber, toBlockNumber }: { fromBlockNumber: number, toBlockNumber: number },
{ fromBlockNumber, toBlockNumber, name }: { fromBlockNumber: number, toBlockNumber: number, name?: string },
expressContext: ExpressContext
) => {
log('eventsInRange', fromBlockNumber, toBlockNumber);
log('eventsInRange', fromBlockNumber, toBlockNumber, name);
return executeAndRecordMetrics(
indexer,
@@ -376,7 +376,7 @@ export const createResolvers = async (
throw new Error(`Block range should be between ${syncStatus.initialIndexedBlockNumber} and ${syncStatus.latestProcessedBlockNumber}`);
}
const events = await indexer.getEventsInRange(fromBlockNumber, toBlockNumber);
const events = await indexer.getEventsInRange(fromBlockNumber, toBlockNumber, name);
return events.map(event => indexer.getResultEvent(event));
}
);
@@ -114,7 +114,7 @@ type SyncStatus {
type Query {
events(blockHash: String!, contractAddress: String!, name: String): [ResultEvent!]
eventsInRange(fromBlockNumber: Int!, toBlockNumber: Int!): [ResultEvent!]
eventsInRange(fromBlockNumber: Int!, toBlockNumber: Int!, name: String): [ResultEvent!]
withdrawLimit(blockHash: String!, contractAddress: String!, _participant: String!, _batch: Int!): ResultInt!
verifyBalance(blockHash: String!, contractAddress: String!, _participant: String!): ResultBoolean!
getBatches(blockHash: String!, contractAddress: String!, _participant: String!): ResultIntArray!
@@ -1,6 +1,6 @@
{
"name": "@cerc-io/delegated-sending-watcher",
"version": "0.1.6",
"version": "0.1.9",
"description": "delegated-sending-watcher",
"private": true,
"main": "dist/index.js",
@@ -39,10 +39,10 @@
"homepage": "https://github.com/cerc-io/watcher-ts#readme",
"dependencies": {
"@apollo/client": "^3.3.19",
"@cerc-io/cli": "^0.2.98",
"@cerc-io/ipld-eth-client": "^0.2.98",
"@cerc-io/solidity-mapper": "^0.2.98",
"@cerc-io/util": "^0.2.98",
"@cerc-io/cli": "0.2.98-patch.2",
"@cerc-io/ipld-eth-client": "0.2.98-patch.2",
"@cerc-io/solidity-mapper": "0.2.98-patch.2",
"@cerc-io/util": "0.2.98-patch.2",
"@ethersproject/providers": "^5.4.4",
"debug": "^4.3.1",
"decimal.js": "^10.3.1",
@@ -168,10 +168,10 @@ export class Database implements DatabaseInterface {
return this._baseDatabase.getProcessedBlockCountForRange(repo, fromBlockNumber, toBlockNumber);
}
async getEventsInRange (fromBlockNumber: number, toBlockNumber: number): Promise<Array<Event>> {
async getEventsInRange (fromBlockNumber: number, toBlockNumber: number, name?: string): Promise<Array<Event>> {
const repo = this._conn.getRepository(Event);
return this._baseDatabase.getEventsInRange(repo, fromBlockNumber, toBlockNumber);
return this._baseDatabase.getEventsInRange(repo, fromBlockNumber, toBlockNumber, name);
}
async saveEventEntity (queryRunner: QueryRunner, entity: Event): Promise<Event> {
@@ -449,8 +449,8 @@ export class Indexer implements IndexerInterface {
return this._baseIndexer.getProcessedBlockCountForRange(fromBlockNumber, toBlockNumber);
}
async getEventsInRange (fromBlockNumber: number, toBlockNumber: number): Promise<Array<Event>> {
return this._baseIndexer.getEventsInRange(fromBlockNumber, toBlockNumber, this._serverConfig.gql.maxEventsBlockRange);
async getEventsInRange (fromBlockNumber: number, toBlockNumber: number, name?: string): Promise<Array<Event>> {
return this._baseIndexer.getEventsInRange(fromBlockNumber, toBlockNumber, this._serverConfig.gql.maxEventsBlockRange, name);
}
async getSyncStatus (): Promise<SyncStatus | undefined> {
@@ -179,10 +179,10 @@ export const createResolvers = async (
eventsInRange: async (
_: any,
{ fromBlockNumber, toBlockNumber }: { fromBlockNumber: number, toBlockNumber: number },
{ fromBlockNumber, toBlockNumber, name }: { fromBlockNumber: number, toBlockNumber: number, name?: string },
expressContext: ExpressContext
) => {
log('eventsInRange', fromBlockNumber, toBlockNumber);
log('eventsInRange', fromBlockNumber, toBlockNumber, name);
return executeAndRecordMetrics(
indexer,
@@ -200,7 +200,7 @@ export const createResolvers = async (
throw new Error(`Block range should be between ${syncStatus.initialIndexedBlockNumber} and ${syncStatus.latestProcessedBlockNumber}`);
}
const events = await indexer.getEventsInRange(fromBlockNumber, toBlockNumber);
const events = await indexer.getEventsInRange(fromBlockNumber, toBlockNumber, name);
return events.map(event => indexer.getResultEvent(event));
}
);
@@ -75,7 +75,7 @@ type SyncStatus {
type Query {
events(blockHash: String!, contractAddress: String!, name: String): [ResultEvent!]
eventsInRange(fromBlockNumber: Int!, toBlockNumber: Int!): [ResultEvent!]
eventsInRange(fromBlockNumber: Int!, toBlockNumber: Int!, name: String): [ResultEvent!]
canSend(blockHash: String!, contractAddress: String!, _as: BigInt!, _point: BigInt!): ResultBoolean!
canReceive(blockHash: String!, contractAddress: String!, _recipient: String!): ResultBoolean!
getStateByCID(cid: String!): ResultState
+5 -5
View File
@@ -1,6 +1,6 @@
{
"name": "@cerc-io/ecliptic-watcher",
"version": "0.1.6",
"version": "0.1.9",
"description": "ecliptic-watcher",
"private": true,
"main": "dist/index.js",
@@ -39,10 +39,10 @@
"homepage": "https://github.com/cerc-io/watcher-ts#readme",
"dependencies": {
"@apollo/client": "^3.3.19",
"@cerc-io/cli": "^0.2.98",
"@cerc-io/ipld-eth-client": "^0.2.98",
"@cerc-io/solidity-mapper": "^0.2.98",
"@cerc-io/util": "^0.2.98",
"@cerc-io/cli": "0.2.98-patch.2",
"@cerc-io/ipld-eth-client": "0.2.98-patch.2",
"@cerc-io/solidity-mapper": "0.2.98-patch.2",
"@cerc-io/util": "0.2.98-patch.2",
"@ethersproject/providers": "^5.4.4",
"debug": "^4.3.1",
"decimal.js": "^10.3.1",
+2 -3
View File
@@ -314,10 +314,9 @@ export class Database implements DatabaseInterface {
return this._baseDatabase.getProcessedBlockCountForRange(repo, fromBlockNumber, toBlockNumber);
}
async getEventsInRange (fromBlockNumber: number, toBlockNumber: number): Promise<Array<Event>> {
async getEventsInRange (fromBlockNumber: number, toBlockNumber: number, name?: string): Promise<Array<Event>> {
const repo = this._conn.getRepository(Event);
return this._baseDatabase.getEventsInRange(repo, fromBlockNumber, toBlockNumber);
return this._baseDatabase.getEventsInRange(repo, fromBlockNumber, toBlockNumber, name);
}
async saveEventEntity (queryRunner: QueryRunner, entity: Event): Promise<Event> {
+2 -2
View File
@@ -721,8 +721,8 @@ export class Indexer implements IndexerInterface {
return this._baseIndexer.getProcessedBlockCountForRange(fromBlockNumber, toBlockNumber);
}
async getEventsInRange (fromBlockNumber: number, toBlockNumber: number): Promise<Array<Event>> {
return this._baseIndexer.getEventsInRange(fromBlockNumber, toBlockNumber, this._serverConfig.gql.maxEventsBlockRange);
async getEventsInRange (fromBlockNumber: number, toBlockNumber: number, name?: string): Promise<Array<Event>> {
return this._baseIndexer.getEventsInRange(fromBlockNumber, toBlockNumber, this._serverConfig.gql.maxEventsBlockRange, name);
}
async getSyncStatus (): Promise<SyncStatus | undefined> {
+3 -3
View File
@@ -377,10 +377,10 @@ export const createResolvers = async (
eventsInRange: async (
_: any,
{ fromBlockNumber, toBlockNumber }: { fromBlockNumber: number, toBlockNumber: number },
{ fromBlockNumber, toBlockNumber, name }: { fromBlockNumber: number, toBlockNumber: number, name?: string },
expressContext: ExpressContext
) => {
log('eventsInRange', fromBlockNumber, toBlockNumber);
log('eventsInRange', fromBlockNumber, toBlockNumber, name);
return executeAndRecordMetrics(
indexer,
@@ -398,7 +398,7 @@ export const createResolvers = async (
throw new Error(`Block range should be between ${syncStatus.initialIndexedBlockNumber} and ${syncStatus.latestProcessedBlockNumber}`);
}
const events = await indexer.getEventsInRange(fromBlockNumber, toBlockNumber);
const events = await indexer.getEventsInRange(fromBlockNumber, toBlockNumber, name);
return events.map(event => indexer.getResultEvent(event));
}
);
+1 -1
View File
@@ -108,7 +108,7 @@ type SyncStatus {
type Query {
events(blockHash: String!, contractAddress: String!, name: String): [ResultEvent!]
eventsInRange(fromBlockNumber: Int!, toBlockNumber: Int!): [ResultEvent!]
eventsInRange(fromBlockNumber: Int!, toBlockNumber: Int!, name: String): [ResultEvent!]
supportsInterface(blockHash: String!, contractAddress: String!, _interfaceId: String!): ResultBoolean!
name(blockHash: String!, contractAddress: String!): ResultString!
symbol(blockHash: String!, contractAddress: String!): ResultString!
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@cerc-io/gateway-server",
"version": "0.1.6",
"version": "0.1.9",
"main": "index.js",
"license": "AGPL-3.0",
"private": true,
@@ -1,6 +1,6 @@
{
"name": "@cerc-io/linear-star-release-watcher",
"version": "0.1.6",
"version": "0.1.9",
"description": "linear-star-release-watcher",
"private": true,
"main": "dist/index.js",
@@ -39,10 +39,10 @@
"homepage": "https://github.com/cerc-io/watcher-ts#readme",
"dependencies": {
"@apollo/client": "^3.3.19",
"@cerc-io/cli": "^0.2.98",
"@cerc-io/ipld-eth-client": "^0.2.98",
"@cerc-io/solidity-mapper": "^0.2.98",
"@cerc-io/util": "^0.2.98",
"@cerc-io/cli": "0.2.98-patch.2",
"@cerc-io/ipld-eth-client": "0.2.98-patch.2",
"@cerc-io/solidity-mapper": "0.2.98-patch.2",
"@cerc-io/util": "0.2.98-patch.2",
"@ethersproject/providers": "^5.4.4",
"debug": "^4.3.1",
"decimal.js": "^10.3.1",
@@ -183,10 +183,10 @@ export class Database implements DatabaseInterface {
return this._baseDatabase.getProcessedBlockCountForRange(repo, fromBlockNumber, toBlockNumber);
}
async getEventsInRange (fromBlockNumber: number, toBlockNumber: number): Promise<Array<Event>> {
async getEventsInRange (fromBlockNumber: number, toBlockNumber: number, name?: string): Promise<Array<Event>> {
const repo = this._conn.getRepository(Event);
return this._baseDatabase.getEventsInRange(repo, fromBlockNumber, toBlockNumber);
return this._baseDatabase.getEventsInRange(repo, fromBlockNumber, toBlockNumber, name);
}
async saveEventEntity (queryRunner: QueryRunner, entity: Event): Promise<Event> {
@@ -479,8 +479,8 @@ export class Indexer implements IndexerInterface {
return this._baseIndexer.getProcessedBlockCountForRange(fromBlockNumber, toBlockNumber);
}
async getEventsInRange (fromBlockNumber: number, toBlockNumber: number): Promise<Array<Event>> {
return this._baseIndexer.getEventsInRange(fromBlockNumber, toBlockNumber, this._serverConfig.gql.maxEventsBlockRange);
async getEventsInRange (fromBlockNumber: number, toBlockNumber: number, name?: string): Promise<Array<Event>> {
return this._baseIndexer.getEventsInRange(fromBlockNumber, toBlockNumber, this._serverConfig.gql.maxEventsBlockRange, name);
}
async getSyncStatus (): Promise<SyncStatus | undefined> {
@@ -201,10 +201,10 @@ export const createResolvers = async (
eventsInRange: async (
_: any,
{ fromBlockNumber, toBlockNumber }: { fromBlockNumber: number, toBlockNumber: number },
{ fromBlockNumber, toBlockNumber, name }: { fromBlockNumber: number, toBlockNumber: number, name?: string },
expressContext: ExpressContext
) => {
log('eventsInRange', fromBlockNumber, toBlockNumber);
log('eventsInRange', fromBlockNumber, toBlockNumber, name);
return executeAndRecordMetrics(
indexer,
@@ -222,7 +222,7 @@ export const createResolvers = async (
throw new Error(`Block range should be between ${syncStatus.initialIndexedBlockNumber} and ${syncStatus.latestProcessedBlockNumber}`);
}
const events = await indexer.getEventsInRange(fromBlockNumber, toBlockNumber);
const events = await indexer.getEventsInRange(fromBlockNumber, toBlockNumber, name);
return events.map(event => indexer.getResultEvent(event));
}
);
@@ -86,7 +86,7 @@ type SyncStatus {
type Query {
events(blockHash: String!, contractAddress: String!, name: String): [ResultEvent!]
eventsInRange(fromBlockNumber: Int!, toBlockNumber: Int!): [ResultEvent!]
eventsInRange(fromBlockNumber: Int!, toBlockNumber: Int!, name: String): [ResultEvent!]
withdrawLimit(blockHash: String!, contractAddress: String!, _participant: String!): ResultInt!
verifyBalance(blockHash: String!, contractAddress: String!, _participant: String!): ResultBoolean!
getRemainingStars(blockHash: String!, contractAddress: String!, _participant: String!): ResultIntArray!
+5 -5
View File
@@ -1,6 +1,6 @@
{
"name": "@cerc-io/polls-watcher",
"version": "0.1.6",
"version": "0.1.9",
"description": "polls-watcher",
"private": true,
"main": "dist/index.js",
@@ -39,10 +39,10 @@
"homepage": "https://github.com/cerc-io/watcher-ts#readme",
"dependencies": {
"@apollo/client": "^3.3.19",
"@cerc-io/cli": "^0.2.98",
"@cerc-io/ipld-eth-client": "^0.2.98",
"@cerc-io/solidity-mapper": "^0.2.98",
"@cerc-io/util": "^0.2.98",
"@cerc-io/cli": "0.2.98-patch.2",
"@cerc-io/ipld-eth-client": "0.2.98-patch.2",
"@cerc-io/solidity-mapper": "0.2.98-patch.2",
"@cerc-io/util": "0.2.98-patch.2",
"@ethersproject/providers": "^5.4.4",
"debug": "^4.3.1",
"decimal.js": "^10.3.1",
+2 -2
View File
@@ -244,10 +244,10 @@ export class Database implements DatabaseInterface {
return this._baseDatabase.getProcessedBlockCountForRange(repo, fromBlockNumber, toBlockNumber);
}
async getEventsInRange (fromBlockNumber: number, toBlockNumber: number): Promise<Array<Event>> {
async getEventsInRange (fromBlockNumber: number, toBlockNumber: number, name?: string): Promise<Array<Event>> {
const repo = this._conn.getRepository(Event);
return this._baseDatabase.getEventsInRange(repo, fromBlockNumber, toBlockNumber);
return this._baseDatabase.getEventsInRange(repo, fromBlockNumber, toBlockNumber, name);
}
async saveEventEntity (queryRunner: QueryRunner, entity: Event): Promise<Event> {
+2 -2
View File
@@ -601,8 +601,8 @@ export class Indexer implements IndexerInterface {
return this._baseIndexer.getProcessedBlockCountForRange(fromBlockNumber, toBlockNumber);
}
async getEventsInRange (fromBlockNumber: number, toBlockNumber: number): Promise<Array<Event>> {
return this._baseIndexer.getEventsInRange(fromBlockNumber, toBlockNumber, this._serverConfig.gql.maxEventsBlockRange);
async getEventsInRange (fromBlockNumber: number, toBlockNumber: number, name?: string): Promise<Array<Event>> {
return this._baseIndexer.getEventsInRange(fromBlockNumber, toBlockNumber, this._serverConfig.gql.maxEventsBlockRange, name);
}
async getSyncStatus (): Promise<SyncStatus | undefined> {
+3 -3
View File
@@ -289,10 +289,10 @@ export const createResolvers = async (
eventsInRange: async (
_: any,
{ fromBlockNumber, toBlockNumber }: { fromBlockNumber: number, toBlockNumber: number },
{ fromBlockNumber, toBlockNumber, name }: { fromBlockNumber: number, toBlockNumber: number, name?: string },
expressContext: ExpressContext
) => {
log('eventsInRange', fromBlockNumber, toBlockNumber);
log('eventsInRange', fromBlockNumber, toBlockNumber, name);
return executeAndRecordMetrics(
indexer,
@@ -310,7 +310,7 @@ export const createResolvers = async (
throw new Error(`Block range should be between ${syncStatus.initialIndexedBlockNumber} and ${syncStatus.latestProcessedBlockNumber}`);
}
const events = await indexer.getEventsInRange(fromBlockNumber, toBlockNumber);
const events = await indexer.getEventsInRange(fromBlockNumber, toBlockNumber, name);
return events.map(event => indexer.getResultEvent(event));
}
);
+1 -1
View File
@@ -102,7 +102,7 @@ type SyncStatus {
type Query {
events(blockHash: String!, contractAddress: String!, name: String): [ResultEvent!]
eventsInRange(fromBlockNumber: Int!, toBlockNumber: Int!): [ResultEvent!]
eventsInRange(fromBlockNumber: Int!, toBlockNumber: Int!, name: String): [ResultEvent!]
getUpgradeProposals(blockHash: String!, contractAddress: String!): ResultStringArray!
getUpgradeProposalCount(blockHash: String!, contractAddress: String!): ResultBigInt!
getDocumentProposals(blockHash: String!, contractAddress: String!): ResultStringArray!
+44 -44
View File
@@ -206,10 +206,10 @@
js-tokens "^4.0.0"
picocolors "^1.0.0"
"@cerc-io/cache@^0.2.98":
version "0.2.98"
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fcache/-/0.2.98/cache-0.2.98.tgz#acbd54b0e3b0379652020f3dac832ed04cf392dc"
integrity sha512-scrDlufZIs0DDehEUL+eaab4Rz2r4G2fgvy2USeY3AnItreXMgUwTUAR7pXqh3FOCuj9crNfysH09Et+49/F/w==
"@cerc-io/cache@^0.2.98-patch.2":
version "0.2.98-patch.2"
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fcache/-/0.2.98-patch.2/cache-0.2.98-patch.2.tgz#2be752e92aa42cc7c57ade5387fe950832d1e39a"
integrity sha512-0KkK+UsC9iBPt23iD1n8CRS5anp9JHeAy2K5/fHLmFccc58rC6jNi2J/U+mDQ3AkeojlqMvDkQc4w071der/Gw==
dependencies:
canonical-json "^0.0.4"
debug "^4.3.1"
@@ -217,19 +217,19 @@
fs-extra "^10.0.0"
level "^7.0.0"
"@cerc-io/cli@^0.2.98":
version "0.2.98"
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fcli/-/0.2.98/cli-0.2.98.tgz#b29046fe48260e3e465c240d0aa64da84ad2338d"
integrity sha512-d79Gm3YOLn+CEidPBHaQhm1zu873O75LnFyH7fbIOubC4cBDWQk+RdH5U+8jU4b54EPZeVRotSoo7rQ5V8HsDg==
"@cerc-io/cli@0.2.98-patch.2":
version "0.2.98-patch.2"
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fcli/-/0.2.98-patch.2/cli-0.2.98-patch.2.tgz#56e2130a40cd748cd7f045d66393e836cb2b3583"
integrity sha512-o3+Ryp0T/6TShd5gKFFtt67wBamtBpK0Ci/c87Yf8RiB7jPsXOILLvigJkhQWhnldvfCULyjWriy5L4dZ/j99w==
dependencies:
"@apollo/client" "^3.7.1"
"@cerc-io/cache" "^0.2.98"
"@cerc-io/ipld-eth-client" "^0.2.98"
"@cerc-io/cache" "^0.2.98-patch.2"
"@cerc-io/ipld-eth-client" "^0.2.98-patch.2"
"@cerc-io/libp2p" "^0.42.2-laconic-0.1.4"
"@cerc-io/nitro-node" "^0.1.15"
"@cerc-io/peer" "^0.2.98"
"@cerc-io/rpc-eth-client" "^0.2.98"
"@cerc-io/util" "^0.2.98"
"@cerc-io/peer" "0.2.98"
"@cerc-io/rpc-eth-client" "^0.2.98-patch.2"
"@cerc-io/util" "^0.2.98-patch.2"
"@ethersproject/providers" "^5.4.4"
"@graphql-tools/utils" "^9.1.1"
"@ipld/dag-cbor" "^8.0.0"
@@ -250,14 +250,14 @@
typeorm "0.2.37"
yargs "^17.0.1"
"@cerc-io/ipld-eth-client@^0.2.98":
version "0.2.98"
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fipld-eth-client/-/0.2.98/ipld-eth-client-0.2.98.tgz#c1a7128be1e81fb4d1ec9a9888b7e5e94ae710ac"
integrity sha512-qCnz7foqf+9+X/zEGAu5HGXlvzNwahcsKu6Rtreh8bxhR5VTuuF3KrEeFcQeL1Bhv5+w7KXs5I+ivEgo4ZvHSA==
"@cerc-io/ipld-eth-client@0.2.98-patch.2", "@cerc-io/ipld-eth-client@^0.2.98-patch.2":
version "0.2.98-patch.2"
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fipld-eth-client/-/0.2.98-patch.2/ipld-eth-client-0.2.98-patch.2.tgz#88feb90ff67dc6c4fa31f7bac64b34276b7aeccb"
integrity sha512-Dh4IcQHkIvxGotXS/WqUzADfP9W8eZqGyaoKGlSYMNnFLgU5CL8Atag4yhfiKqqMZX1qO4QEoAFQ0ABIh8KhSw==
dependencies:
"@apollo/client" "^3.7.1"
"@cerc-io/cache" "^0.2.98"
"@cerc-io/util" "^0.2.98"
"@cerc-io/cache" "^0.2.98-patch.2"
"@cerc-io/util" "^0.2.98-patch.2"
cross-fetch "^3.1.4"
debug "^4.3.1"
ethers "^5.4.4"
@@ -380,10 +380,10 @@
lodash "^4.17.21"
uint8arrays "^4.0.3"
"@cerc-io/peer@^0.2.65":
version "0.2.74"
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fpeer/-/0.2.74/peer-0.2.74.tgz#cc54e513e1857b04630f6b11e9a65dcdcc532790"
integrity sha512-l7y19KU0ZJtRkjTrgyzHj+0X8Zu9GO70Eg0AKMFrGmcFfHEfjKGmfWn0gYERNHSy5SGktOJAztAtd/dXARPpnw==
"@cerc-io/peer@0.2.98":
version "0.2.98"
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fpeer/-/0.2.98/peer-0.2.98.tgz#650c771be2a3767456f38c93cb86e6667f2867ec"
integrity sha512-b8sCTzFxfTgrlscNutBzML0y4rzkZvzjCpHDEp3P4fMRHIK9SM5o8yYaPS9g1NwoedjbLKCnCDrmaIGpLEbmqA==
dependencies:
"@cerc-io/libp2p" "^0.42.2-laconic-0.1.4"
"@cerc-io/prometheus-metrics" "1.1.4"
@@ -410,10 +410,10 @@
unique-names-generator "^4.7.1"
yargs "^17.0.1"
"@cerc-io/peer@^0.2.98":
version "0.2.98"
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fpeer/-/0.2.98/peer-0.2.98.tgz#650c771be2a3767456f38c93cb86e6667f2867ec"
integrity sha512-b8sCTzFxfTgrlscNutBzML0y4rzkZvzjCpHDEp3P4fMRHIK9SM5o8yYaPS9g1NwoedjbLKCnCDrmaIGpLEbmqA==
"@cerc-io/peer@^0.2.65":
version "0.2.74"
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fpeer/-/0.2.74/peer-0.2.74.tgz#cc54e513e1857b04630f6b11e9a65dcdcc532790"
integrity sha512-l7y19KU0ZJtRkjTrgyzHj+0X8Zu9GO70Eg0AKMFrGmcFfHEfjKGmfWn0gYERNHSy5SGktOJAztAtd/dXARPpnw==
dependencies:
"@cerc-io/libp2p" "^0.42.2-laconic-0.1.4"
"@cerc-io/prometheus-metrics" "1.1.4"
@@ -452,23 +452,23 @@
it-stream-types "^1.0.4"
promjs "^0.4.2"
"@cerc-io/rpc-eth-client@^0.2.98":
version "0.2.98"
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Frpc-eth-client/-/0.2.98/rpc-eth-client-0.2.98.tgz#005546cf25a245e60fa00b0c972239748ac1c29e"
integrity sha512-SjR621w5WxrhLsXyy17mTXo1UwvcPz9QPL4/mwQcwsvzDXoFff1bgxR7UGKInQG5QzGgwTJjAaozVqxQA1X3+g==
"@cerc-io/rpc-eth-client@^0.2.98-patch.2":
version "0.2.98-patch.2"
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Frpc-eth-client/-/0.2.98-patch.2/rpc-eth-client-0.2.98-patch.2.tgz#11499c754ec25b0705b102ae5cbf6cd4b81d9c3b"
integrity sha512-7VNuWLt82yoBsTk5Nz8LWuCZiqZ6WjsFWIK+9lAnRoHHrt7ojLq7LGTrzRlTFtkqt8DzwvHv5ktDOs2NuZHH8w==
dependencies:
"@cerc-io/cache" "^0.2.98"
"@cerc-io/ipld-eth-client" "^0.2.98"
"@cerc-io/util" "^0.2.98"
"@cerc-io/cache" "^0.2.98-patch.2"
"@cerc-io/ipld-eth-client" "^0.2.98-patch.2"
"@cerc-io/util" "^0.2.98-patch.2"
chai "^4.3.4"
ethers "^5.4.4"
left-pad "^1.3.0"
mocha "^8.4.0"
"@cerc-io/solidity-mapper@^0.2.98":
version "0.2.98"
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fsolidity-mapper/-/0.2.98/solidity-mapper-0.2.98.tgz#6fc8dfcaf872e31964a6cca1ea9fbd7900119f8a"
integrity sha512-RmGmcgN0fZEZU0r4q14qPm2hVHUK/OQVPIEgyLEbcStHXupYLaTn79li1WpURI7yeVuJ7mFVaauviWA2DeG7dw==
"@cerc-io/solidity-mapper@0.2.98-patch.2", "@cerc-io/solidity-mapper@^0.2.98-patch.2":
version "0.2.98-patch.2"
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fsolidity-mapper/-/0.2.98-patch.2/solidity-mapper-0.2.98-patch.2.tgz#6b82c09cc891cc47c56d00705d83039e65a84aee"
integrity sha512-sSxLfM+xuDJwGbW2ztho0Xog6XOMe9b7Z+XMOQT/PVpNhBUNiRZ9j5TnPrbKnCC8N132pVApo0FHzgROQYznbg==
dependencies:
dotenv "^10.0.0"
@@ -477,15 +477,15 @@
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fts-channel/-/1.0.3-ts-nitro-0.1.1/ts-channel-1.0.3-ts-nitro-0.1.1.tgz#0768781313a167295c0bf21307f47e02dc17e936"
integrity sha512-2jFICUSyffuZ+8+qRhXuLSJq4GJ6Y02wxiXoubH0Kzv2lIKkJtWICY1ZQQhtXAvP0ncAQB85WJHqtqwH8l7J3Q==
"@cerc-io/util@^0.2.98":
version "0.2.98"
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Futil/-/0.2.98/util-0.2.98.tgz#0bed961a20d43c8973d5b86b400086caa76d2d0a"
integrity sha512-s1St/bD9OjD3NIfx3gj1tDELgpiyxGl6le3mCs77jHM4KbEHW7pFjhe/5YsLXRvc5cIHwNsrCdOuSAIyVUtC2Q==
"@cerc-io/util@0.2.98-patch.2", "@cerc-io/util@^0.2.98-patch.2":
version "0.2.98-patch.2"
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Futil/-/0.2.98-patch.2/util-0.2.98-patch.2.tgz#f306d4087b55f87ac16731544a19fe482454eb20"
integrity sha512-oYjH7n+2ivf6/chDFRgAuwXeQk2ZW/ZnVWVzHMf9avQIdVLoQF7XU8fpfckKTHbMPek4yV8C+Mb3EmKwREpopQ==
dependencies:
"@apollo/utils.keyvaluecache" "^1.0.1"
"@cerc-io/nitro-node" "^0.1.15"
"@cerc-io/peer" "^0.2.98"
"@cerc-io/solidity-mapper" "^0.2.98"
"@cerc-io/peer" "0.2.98"
"@cerc-io/solidity-mapper" "^0.2.98-patch.2"
"@cerc-io/ts-channel" "1.0.3-ts-nitro-0.1.1"
"@ethersproject/properties" "^5.7.0"
"@ethersproject/providers" "^5.4.4"