Skip to content

Commit

Permalink
feat(mon): set up chain-mon package
Browse files Browse the repository at this point in the history
Sets up the chain-mon package by adapting the drippie-mon package. All
new chain monitoring services will be placed in chain-mon instead.
  • Loading branch information
smartcontracts committed Jan 31, 2023
1 parent a49e104 commit 4ee0efc
Show file tree
Hide file tree
Showing 21 changed files with 57 additions and 48 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -846,9 +846,9 @@ workflows:
requires:
- yarn-monorepo
- js-lint-test:
name: drippie-mon-tests
coverage_flag: drippie-mon-tests
package_name: drippie-mon
name: chain-mon-tests
coverage_flag: chain-mon-tests
package_name: chain-mon
dependencies: "(common-ts|contracts-periphery|core-utils|sdk)"
requires:
- yarn-monorepo
Expand Down
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/packages/contracts-periphery @ethereum-optimism/contract-reviewers
/packages/core-utils @ethereum-optimism/legacy-reviewers
/packages/data-transport-layer @ethereum-optimism/legacy-reviewers
/packages/drippie-mon @smartcontracts
/packages/chain-mon @smartcontracts
/packages/fault-detector @ethereum-optimism/legacy-reviewers
/packages/hardhat-deploy-config @ethereum-optimism/legacy-reviewers
/packages/message-relayer @ethereum-optimism/legacy-reviewers
Expand Down
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"changeProcessCWD": true
},
{
"directory": "packages/drippie-mon",
"directory": "packages/chain-mon",
"changeProcessCWD": true
},
{
Expand All @@ -45,4 +45,4 @@
"eslint.format.enable": true,
"editorconfig.generateAuto": false,
"files.trimTrailingWhitespace": true
}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Refer to the Directory Structure section below to understand which packages are
│ ├── <a href="./packages/contracts-periphery">contracts-periphery</a>: Peripheral contracts for Optimism
│ ├── <a href="./packages/core-utils">core-utils</a>: Low-level utilities that make building Optimism easier
│ ├── <a href="./packages/data-transport-layer">data-transport-layer</a>: Service for indexing Optimism-related L1 data
│ ├── <a href="./packages/drippie-mon">drippie-mon</a>: Service for monitoring Drippie instances
│ ├── <a href="./packages/chain-mon">chain-mon</a>: Chain monitoring services
│ ├── <a href="./packages/fault-detector">fault-detector</a>: Service for detecting Sequencer faults
│ ├── <a href="./packages/message-relayer">message-relayer</a>: Tool for automatically relaying L1<>L2 messages in development
│ ├── <a href="./packages/replica-healthcheck">replica-healthcheck</a>: Service for monitoring the health of a replica node
Expand Down
2 changes: 1 addition & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ flag_management:
- name: actor-tests-tests
- name: contracts-periphery-tests
- name: dtl-tests
- name: drippie-mon-tests
- name: chain-mon-tests
- name: fault-detector-tests
- name: message-relayer-tests
- name: replica-healthcheck-tests
Expand Down
6 changes: 3 additions & 3 deletions ops/docker/Dockerfile.packages
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ COPY packages/hardhat-deploy-config/package.json ./packages/hardhat-deploy-confi
COPY packages/message-relayer/package.json ./packages/message-relayer/package.json
COPY packages/fault-detector/package.json ./packages/fault-detector/package.json
COPY packages/replica-healthcheck/package.json ./packages/replica-healthcheck/package.json
COPY packages/drippie-mon/package.json ./packages/drippie-mon/package.json
COPY packages/chain-mon/package.json ./packages/chain-mon/package.json
COPY packages/balance-monitor/package.json ./packages/balance-monitor/package.json
COPY packages/two-step-monitor/package.json ./packages/two-step-monitor/package.json
COPY integration-tests/package.json ./integration-tests/package.json
Expand Down Expand Up @@ -106,8 +106,8 @@ WORKDIR /opt/optimism/packages/replica-healthcheck
ENTRYPOINT ["npm", "run", "start"]

FROM base as drippie-mon
WORKDIR /opt/optimism/packages/drippie-mon
ENTRYPOINT ["npm", "run", "start"]
WORKDIR /opt/optimism/packages/chain-mon
ENTRYPOINT ["npm", "run", "start:drippie-mon"]

FROM base as balance-monitor
WORKDIR /opt/optimism/packages/balance-monitor
Expand Down
File renamed without changes.
9 changes: 9 additions & 0 deletions packages/chain-mon/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
###############################################################################
# ↓ drippie-mon ↓ #
###############################################################################

# RPC pointing to network where Drippie is deployed
DRIPPIE_MON__RPC=

# Address of the Drippie contract
DRIPPIE_MON__DRIPPIE_ADDRESS=
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
30 changes: 30 additions & 0 deletions packages/chain-mon/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# @eth-optimism/chain-mon

[![codecov](https://codecov.io/gh/ethereum-optimism/optimism/branch/develop/graph/badge.svg?token=0VTG7PG7YR&flag=chain-mon-tests)](https://codecov.io/gh/ethereum-optimism/optimism)

`chain-mon` is a collection of chain monitoring services.

## Installation

Clone, install, and build the Optimism monorepo:

```
git clone https://github.com/ethereum-optimism/optimism.git
yarn install
yarn build
```

## Running a service

Copy `.env.example` into a new file named `.env`, then set the environment variables listed there depending on the service you want to run.
Once your environment variables have been set, run via:

```
yarn start:<service name>
```

For example, to run `drippie-mon`, execute:

```
yarn start:drippie-mon
```
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"private": true,
"name": "@eth-optimism/drippie-mon",
"version": "0.4.3",
"description": "[Optimism] Service for monitoring Drippie instances",
"name": "@eth-optimism/chain-mon",
"version": "0.1.0",
"description": "[Optimism] Chain monitoring services",
"main": "dist/index",
"types": "dist/index",
"files": [
"dist/*"
],
"scripts": {
"start": "ts-node ./src/service.ts",
"start:drippie-mon": "ts-node ./src/drippie-mon/service.ts",
"test:coverage": "echo 'No tests defined.'",
"build": "tsc -p ./tsconfig.json",
"clean": "rimraf dist/ ./tsconfig.tsbuildinfo",
Expand All @@ -21,10 +21,9 @@
"keywords": [
"optimism",
"ethereum",
"drippie",
"monitoring"
],
"homepage": "https://github.com/ethereum-optimism/optimism/tree/develop/packages/drippie-mon#readme",
"homepage": "https://github.com/ethereum-optimism/optimism/tree/develop/packages/chain-mon#readme",
"license": "MIT",
"author": "Optimism PBC",
"repository": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Provider } from '@ethersproject/abstract-provider'
import { ethers } from 'ethers'
import * as DrippieArtifact from '@eth-optimism/contracts-periphery/artifacts/contracts/universal/drippie/Drippie.sol/Drippie.json'

import { version } from '../package.json'
import { version } from '../../package.json'

type DrippieMonOptions = {
rpc: Provider
Expand Down
1 change: 1 addition & 0 deletions packages/chain-mon/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './drippie-mon/service'
File renamed without changes.
5 changes: 0 additions & 5 deletions packages/drippie-mon/.env.example

This file was deleted.

24 changes: 0 additions & 24 deletions packages/drippie-mon/README.md

This file was deleted.

1 change: 0 additions & 1 deletion packages/drippie-mon/src/index.ts

This file was deleted.

0 comments on commit 4ee0efc

Please sign in to comment.