Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor using @filecoin-station/spark-impact-evaluator #321

Merged
merged 1 commit into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 3 additions & 21 deletions docs/impact-evaluator.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ update the services mentioned in this document.
## contract

- Add address to https://www.notion.so/pl-strflt/Addresses-c1140fd90af94388a9bfbd4f4da2a377#5dda4b1708054349af91fa356e58b950
- Replace CLI contract address
- Replace Node.js API contract address and publish to NPM
- Send FIL rewards to the contract

## Telemetry
Expand All @@ -15,30 +15,12 @@ update the services mentioned in this document.
- Test your changes with `telegraf --config telegraf.conf --test`
- Push to `main` to deploy

## `spark-evaluate`

- Replace `0x` contract address https://github.com/filecoin-station/spark-evaluate/blob/main/lib/config.js
- Replace ABI https://github.com/filecoin-station/spark-evaluate/blob/main/lib/abi.json
- Push to `main` to deploy

## `spark-api`

- Replace `0x` contract address https://github.com/filecoin-station/spark-api/blob/main/spark-publish/ie-contract-config.js
- Replace ABI https://github.com/filecoin-station/spark-api/blob/main/spark-publish/abi.json
- Push to `main` to deploy

## `site-backend`

- Replace `0x` contract address https://github.com/filecoin-station/site-backend/blob/main/lib/getFilEarned.ts
- Test your changes
- Push to `main` to deploy

## Station Desktop

- Replace `0x` contract address
- Replace ABI `abi.json`

## Station Core
## Remaining projects

- Replace `0x` contract address
- Replace ABI `abi.json`
- Merge and release Dependabot PRs (once available)
7 changes: 4 additions & 3 deletions lib/ie-contract.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ethers } from 'ethers'
import { IE_CONTRACT_ABI, IE_CONTRACT_ADDRESS, RPC_URL, GLIF_TOKEN } from '../spark-publish/ie-contract-config.js'
import { RPC_URL, GLIF_TOKEN } from '../spark-publish/ie-contract-config.js'
import * as SparkImpactEvaluator from '@filecoin-station/spark-impact-evaluator'

const fetchRequest = new ethers.FetchRequest(RPC_URL)
fetchRequest.setHeader('Authorization', `Bearer ${GLIF_TOKEN}`)
Expand All @@ -11,7 +12,7 @@ const provider = new ethers.JsonRpcProvider(fetchRequest, undefined, {
// provider.on('debug', d => console.log('[ethers:debug %s] %s %o', new Date().toISOString().split('T')[1], d.action, d.payload ?? d.result))

export const createMeridianContract = async () => new ethers.Contract(
IE_CONTRACT_ADDRESS,
IE_CONTRACT_ABI,
SparkImpactEvaluator.ADDRESS,
SparkImpactEvaluator.ABI,
provider
)
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"varint": "^6.0.0"
},
"dependencies": {
"@filecoin-station/spark-impact-evaluator": "^1.0.0",
"@glif/filecoin-address": "^3.0.5",
"@sentry/node": "^8.5.0",
"compare-versions": "^6.1.0",
Expand Down
Loading