This code base provides a CLI for running and interacting various data production algorithms which are then collected by another service and saved to the blockchain.
You should run `pip install -r requirements.txt`
You should also run setup.py to install sentiment analysis data for the twitter sentiment analyzer.
Each feed may itself require separate setup.
See the /feeds directory and the readme.md files therein
siwa.py - provides CLI interface / thread handlingsiwa_logging.py log handler to log to SQLiteendpoint.py http/json endpoint, run automatically via siwa CLI, or standaloneall_feeds.py - all enabled datafeeds from feeds/feeds/data_feed.py - defines class structure shared by all datafeedsfeeds/*.py - e.g. gauss.py - defines an individual datafeedendpoint example: http://127.0.0.1:16556/datafeed/gauss
(you may need to pre-populate by running gauss for a second)
Siwa has an exposed metrics/ endpoint. This endpoint shalle be consumed and scraped by a Prometheus server hosted by Overlay.
In local development, the metrics endpoint should be accessible at the following URLs:
If Siwa was ran using bare Python:
http://127.0.0.1:16556/metrics
If Siwa was ran using docker-compose:
http://127.0.0.1:81/metrics
In production deployment, Siwa's metrics endpoint should be exposed and accessible to the Prometheus server.
prometheus_metrics.py: This is where Prometheus metrics are initialized.
endpoint.py: This is where the Prometheus metrics endpoint is defined.
apis/csgoskins.py: This is where the csgo-related metrics are updated. Refer to the code snippet below, specifically the line that says "prometheus_metrics.csgo_index_gauge.set(index)".
def get_index(self, df, caps):
# Get caps
df = df.merge(caps, on=self.MARKET_HASH_NAME_KEY, how='inner')
...
# Set prometheus metric to index
print(f'Set prometheus metric to index {index}')
prometheus_metrics.csgo_index_gauge.set(index)
return index
Content type
Image
Digest
sha256:b07b1402a…
Size
754.8 MB
Last updated
11 months ago
docker pull translucentlink/siwa:0.0.48