
graphsense/graphsense-lib
API developmentこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
A central repository for Python utility functions and all components that interact with the GraphSense backend.
概要
A comprehensive Python library for the GraphSense crypto-analytics platform. It provides database access, data ingestion, maintenance tools, and analysis capabilities for cryptocurrency transactions and networks. This library uses optional dependencies. Use graphsense-lib[all] to install all features. The web API requires two backend connections: a cluster (blockchain data) and a (PostgreSQL). You can configure them via environment variables or a YAML config file. Point CONFIG_FILE to a REST-specific config (see instance/config.yaml for a full example): If you already have a .graphsense.yaml (or ~/.graphsense.yaml) for the CLI, you can add a web key containing the REST config. The app will pick it up automatically without setting CONFIG_FILE: explicit config_file param > CONFIG_FILE env var > ./instance/config.yaml > .graphsense.yaml web key > env vars only. Any string value in a config file may reference environment variables with ${VAR}. This works in both the CLI config (.
README
以下は原文 README の抜粋です。原文を見る。
GraphSense Library
A comprehensive Python library for the GraphSense crypto-analytics platform. It provides database access, data ingestion, maintenance tools, and analysis capabilities for cryptocurrency transactions and networks.
Note: This library uses optional dependencies. Use
graphsense-lib[all]to install all features.
Quick Start
Installation
# Install with all features
uv add graphsense-lib[all]
# Install from source
git clone https://github.com/graphsense/graphsense-lib.git
cd graphsense-lib
make install
Serving the REST API locally
The web API requires two backend connections: a Cassandra cluster (blockchain data) and a TagStore (PostgreSQL). You can configure them via environment variables or a YAML config file.
Option A: Environment variables only
GS_CASSANDRA_ASYNC_NODES='[""]' \
GRAPHSENSE_TAGSTORE_READ_URL='postgresql+asyncpg://:@:/tagstore' \
GS_CASSANDRA_ASYNC_CURRENCIES='{"btc":{"raw": "btc_raw", "transformed": "btc_transformed"},"eth":{}}' \
uv run --extra web uvicorn graphsenselib.web.app:create_app --factory --host localhost --port 9000 --reload
Option B: YAML config file
Point CONFIG_FILE to a REST-specific config (see instance/config.yaml for a full example):
CONFIG_FILE=./instance/config.yaml make serve-web
Or without Make:
CONFIG_FILE=./instance/config.yaml \
uv run --extra web uvicorn graphsenselib.web.app:create_app --factory --host localhost --port 9000 --reload
Option C: .graphsense.yaml with a web key
If you already have a .graphsense.yaml (or ~/.graphsense.yaml) for the CLI, you can add a web key containing the REST config. The app will pick it up automatically without setting CONFIG_FILE:
# .graphsense.yaml
environments:
# ... your existing CLI config ...
web:
database:
nodes: [""]
currencies:
btc:
eth:
gs-tagstore:
url: "postgresql+asyncpg://:@:/tagstore"
make serve-web
Config resolution order: explicit config_file param > CONFIG_FILE env var > ./instance/config.yaml > .graphsense.yaml web key > env vars only.
Environment variable substitution in YAML
推奨ツール
別のキーワードを試すか、フィルタを外してください。
インストール
npx skillfish add graphsense/graphsense-lib