kopia lustrzana https://github.com/bugout-dev/moonstream
Organized sample, renamed s3 variable and web3_provider env changed
Func in web3_provider checks if env variable starts with http then it use it, otherwise it call route53 to fetch ip address of node.pull/473/head
rodzic
3de929c102
commit
3458186a1e
|
@ -0,0 +1,23 @@
|
|||
# Required environment variables
|
||||
export MOONSTREAM_DB_URI="postgresql://<username>:<password>@<db_host>:<db_port>/<db_name>"
|
||||
export MOONSTREAM_CORS_ALLOWED_ORIGINS="http://localhost:3000,https://moonstream.to,https://www.moonstream.to"
|
||||
export BUGOUT_BROOD_URL="https://auth.bugout.dev"
|
||||
export BUGOUT_SPIRE_URL="https://spire.bugout.dev"
|
||||
export MOONSTREAM_APPLICATION_ID="<issued_bugout_application_id>"
|
||||
export MOONSTREAM_ADMIN_ACCESS_TOKEN="<Access_token_to_application_resources>"
|
||||
export MOONSTREAM_POOL_SIZE=0
|
||||
|
||||
# Blockchain, txpool, whalewatch data depends variables
|
||||
export MOONSTREAM_DATA_JOURNAL_ID="<bugout_journal_id_to_store_blockchain_data>"
|
||||
export HUMBUG_TXPOOL_CLIENT_ID="<Bugout_Humbug_client_id_for_txpool_transactions_in_journal>"
|
||||
export MOONSTREAM_ETHEREUM_WEB3_PROVIDER_URI="https://<connection_path_uri_to_ethereum_node>"
|
||||
export MOONSTREAM_NODE_ETHEREUM_IPC_PORT=8545
|
||||
|
||||
# Set following parameters if AWS node instance and S3 smartcontracts configured
|
||||
export MOONSTREAM_INTERNAL_HOSTED_ZONE_ID="<moonstream_internal_hosted_zone_id>"
|
||||
export MOONSTREAM_S3_SMARTCONTRACTS_BUCKET="<AWS_S3_bucket_to_store_smart_contracts>"
|
||||
export MOONSTREAM_S3_SMARTCONTRACTS_ABI_BUCKET="<AWS_S3_bucket_to_store_smart_contracts_ABI>"
|
||||
export MOONSTREAM_S3_SMARTCONTRACTS_ABI_PREFIX="<Previx_for_AWS_S3_bucket_(prod,dev,..)>"
|
||||
|
||||
# Set the following variables in the most reasonable manner for your development environment
|
||||
export HUMBUG_REPORTER_BACKEND_TOKEN="<Bugout_umbug_token_for_crash_reports>"
|
|
@ -16,7 +16,7 @@ from sqlalchemy.orm import Session
|
|||
from .. import data
|
||||
from ..stream_queries import StreamQuery
|
||||
|
||||
from ..settings import ETHTXPOOL_HUMBUG_CLIENT_ID
|
||||
from ..settings import HUMBUG_TXPOOL_CLIENT_ID
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
logger.setLevel(logging.WARN)
|
||||
|
@ -382,7 +382,7 @@ ethereum_txpool_provider = EthereumTXPoolProvider(
|
|||
description=ethereum_txpool_description,
|
||||
default_time_interval_seconds=5,
|
||||
estimated_events_per_time_interval=50,
|
||||
tags=[f"client:{ETHTXPOOL_HUMBUG_CLIENT_ID}"],
|
||||
tags=[f"client:{HUMBUG_TXPOOL_CLIENT_ID}"],
|
||||
)
|
||||
|
||||
nft_summary_description = """Event provider for NFT market summaries.
|
||||
|
|
|
@ -39,14 +39,14 @@ DOCS_TARGET_PATH = "docs"
|
|||
|
||||
DEFAULT_STREAM_TIMEINTERVAL = 5 * 60
|
||||
|
||||
ETHTXPOOL_HUMBUG_CLIENT_ID = os.environ.get(
|
||||
"ETHTXPOOL_HUMBUG_CLIENT_ID", "client:ethereum-txpool-crawler-0"
|
||||
HUMBUG_TXPOOL_CLIENT_ID = os.environ.get(
|
||||
"HUMBUG_TXPOOL_CLIENT_ID", "client:ethereum-txpool-crawler-0"
|
||||
)
|
||||
|
||||
# S3 Bucket
|
||||
ETHERSCAN_SMARTCONTRACTS_BUCKET = os.environ.get("AWS_S3_SMARTCONTRACT_BUCKET")
|
||||
ETHERSCAN_SMARTCONTRACTS_BUCKET = os.environ.get("MOONSTREAM_S3_SMARTCONTRACTS_BUCKET")
|
||||
if ETHERSCAN_SMARTCONTRACTS_BUCKET is None:
|
||||
raise ValueError("AWS_S3_SMARTCONTRACT_BUCKET is not set")
|
||||
raise ValueError("MOONSTREAM_S3_SMARTCONTRACTS_BUCKET is not set")
|
||||
|
||||
MOONSTREAM_INTERNAL_HOSTED_ZONE_ID = os.environ.get(
|
||||
"MOONSTREAM_INTERNAL_HOSTED_ZONE_ID", ""
|
||||
|
|
|
@ -32,7 +32,7 @@ def fetch_web3_provider_ip():
|
|||
return record_value
|
||||
|
||||
|
||||
if not MOONSTREAM_ETHEREUM_WEB3_PROVIDER_URI.replace(".", "").isnumeric():
|
||||
if not MOONSTREAM_ETHEREUM_WEB3_PROVIDER_URI.startswith("http"):
|
||||
web3_provider_ip = fetch_web3_provider_ip()
|
||||
if web3_provider_ip is None:
|
||||
raise ValueError("Unable to extract web3 provider IP")
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
export MOONSTREAM_CORS_ALLOWED_ORIGINS="http://localhost:3000,https://moonstream.to,https://www.moonstream.to"
|
||||
export MOONSTREAM_APPLICATION_ID="<issued_bugout_application_id>"
|
||||
export MOONSTREAM_DATA_JOURNAL_ID="<bugout_journal_id_to_store_blockchain_data>"
|
||||
export MOONSTREAM_DB_URI="postgresql://<username>:<password>@<db_host>:<db_port>/<db_name>"
|
||||
export MOONSTREAM_POOL_SIZE=0
|
||||
export MOONSTREAM_ADMIN_ACCESS_TOKEN="<Access token to application resources>"
|
||||
export MOONSTREAM_INTERNAL_HOSTED_ZONE_ID="<moonstream_internal_hosted_zone_id>"
|
||||
export MOONSTREAM_ETHEREUM_WEB3_PROVIDER_URI="<connection_path_uri_to_ethereum_node>"
|
||||
export AWS_S3_SMARTCONTRACT_BUCKET="<AWS S3 bucket to store smart contracts>"
|
||||
export MOONSTREAM_S3_SMARTCONTRACTS_ABI_BUCKET="<AWS S3 bucket to store smart contracts ABI>"
|
||||
export MOONSTREAM_S3_SMARTCONTRACTS_ABI_PREFIX="<Previx for AWS S3 bucket (prod,dev,..)>"
|
||||
export BUGOUT_BROOD_URL="https://auth.bugout.dev"
|
||||
export BUGOUT_SPIRE_URL="https://spire.bugout.dev"
|
||||
export HUMBUG_REPORTER_BACKEND_TOKEN="<Bugout Humbug token for crash reports>"
|
||||
export ETHTXPOOL_HUMBUG_CLIENT_ID="<Bugout Humbug client id for txpool transactions in journal>"
|
|
@ -29,9 +29,9 @@ BASE_API_URL = "https://api.etherscan.io/api?module=contract&action=getsourcecod
|
|||
|
||||
ETHERSCAN_SMARTCONTRACTS_LABEL_NAME = "etherscan_smartcontract"
|
||||
|
||||
bucket = os.environ.get("AWS_S3_SMARTCONTRACT_BUCKET")
|
||||
bucket = os.environ.get("MOONSTREAM_S3_SMARTCONTRACTS_BUCKET")
|
||||
if bucket is None:
|
||||
raise ValueError("AWS_S3_SMARTCONTRACT_BUCKET must be set")
|
||||
raise ValueError("MOONSTREAM_S3_SMARTCONTRACTS_BUCKET must be set")
|
||||
|
||||
|
||||
@dataclass
|
||||
|
|
|
@ -8,7 +8,7 @@ export MOONSTREAM_NODE_POLYGON_IPC_PORT="8545"
|
|||
export MOONSTREAM_CRAWL_WORKERS=4
|
||||
export MOONSTREAM_DB_URI="postgresql://<username>:<password>@<db_host>:<db_port>/<db_name>"
|
||||
export MOONSTREAM_ETHERSCAN_TOKEN="<Token for etherscan>"
|
||||
export AWS_S3_SMARTCONTRACT_BUCKET="<AWS S3 bucket for smart contracts>"
|
||||
export MOONSTREAM_S3_SMARTCONTRACTS_BUCKET="<AWS S3 bucket for smart contracts>"
|
||||
export MOONSTREAM_S3_SMARTCONTRACTS_ABI_PREFIX="<Previx for AWS S3 bucket (prod,dev,..)>"
|
||||
export MOONSTREAM_HUMBUG_TOKEN="<Token for crawlers store data via Humbug>"
|
||||
export COINMARKETCAP_API_KEY="<API key to parse conmarketcap>"
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
# Required environment variables to work with database CLI
|
||||
export MOONSTREAM_DB_URI="postgresql://<username>:<password>@<db_host>:<db_port>/<db_name>"
|
||||
export MOONSTREAM_POOL_SIZE=0
|
Ładowanie…
Reference in New Issue