ergoplatform / oracle-core

Core off-chain component of Oracle Pools
Apache License 2.0
61 stars 37 forks source link

Ditch scanIds.json and "load" scans from the node. #195

Open greenhat opened 1 year ago

greenhat commented 1 year ago

Motivation

from TG of the first public oracle v2 pool on testnet:

one thing about docker installs: it's best to mount a volume to keep the state, specifically the scanIDs.json file. If the oracle image is recreated and this file is not found, new scans will be registered on the node and old ones orphaned. Longer term maybe the oracle can parse the registered scans and recreate the scanIDs.json from the ones already registered instead of creating new ones. Dockerfile: https://gist.github.com/error1100/d28ff2fdda983dd0234871495526afd4 docker-compose.yml: https://gist.github.com/error1100/5bc6e03b7e86b24be51e0d6ff8271f9b

https://t.me/c/1629893971/298

One option to do it is by asking the node for all registered scans on start and try to recognize ours by their queries (token ids). The idea is to find a scan for each of our token ids (from configs) and for each not found - register a scan.