kopia lustrzana https://github.com/bugout-dev/moonstream
Merge branch 'main' into cu-nft-dashboard-data-pipeline
commit
043b39f9d0
|
@ -23,7 +23,7 @@ set -eu
|
|||
|
||||
if [ ! -d "$PYTHON_ENV_DIR" ]; then
|
||||
echo -e "${PREFIX_WARN} Dierectory with Python environment doesn't exist, generating..."
|
||||
sudo -u ubuntu python3.8 -m venv "${PYTHON_ENV_DIR}"
|
||||
python3.9 -m venv "${PYTHON_ENV_DIR}"
|
||||
fi
|
||||
|
||||
echo
|
||||
|
@ -34,12 +34,12 @@ echo -e "${PREFIX_INFO} Upgrading Python pip and setuptools"
|
|||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Installing Python dependencies"
|
||||
"${PIP}" install moonworm
|
||||
"${PIP}" install moonworm==0.2.4
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Moonworm watch Unicorns service definition with ${MOONWORM_WATCH_UNICORNS_MAINNET_SERVICE_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${MOONWORM_WATCH_UNICORNS_MAINNET_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MOONWORM_WATCH_UNICORNS_MAINNET_SERVICE_FILE}" "/etc/systemd/system/${MOONWORM_WATCH_UNICORNS_MAINNET_SERVICE_FILE}"
|
||||
systemctl daemon-reload
|
||||
systemctl restart "${MOONWORM_WATCH_UNICORNS_MAINNET_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MOONWORM_WATCH_UNICORNS_MAINNET_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MOONWORM_WATCH_UNICORNS_MAINNET_SERVICE_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${MOONWORM_WATCH_UNICORNS_MAINNET_SERVICE_FILE}"
|
||||
|
|
|
@ -80,7 +80,7 @@ echo
|
|||
echo -e "${PREFIX_INFO} Building executable Ethereum transaction pool crawler script with Go"
|
||||
EXEC_DIR=$(pwd)
|
||||
cd "${APP_CRAWLERS_DIR}/txpool"
|
||||
HOME=/root /usr/local/go/bin/go build -o "${APP_CRAWLERS_DIR}/txpool/txpool" "${APP_CRAWLERS_DIR}/txpool/main.go"
|
||||
HOME=/home/ubuntu /usr/local/go/bin/go build -o "${APP_CRAWLERS_DIR}/txpool/txpool" "${APP_CRAWLERS_DIR}/txpool/main.go"
|
||||
cd "${EXEC_DIR}"
|
||||
|
||||
echo
|
||||
|
@ -96,13 +96,14 @@ echo -e "${PREFIX_INFO} Installing Python dependencies"
|
|||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Install checkenv"
|
||||
HOME=/root /usr/local/go/bin/go install github.com/bugout-dev/checkenv@latest
|
||||
HOME=/home/ubuntu /usr/local/go/bin/go install github.com/bugout-dev/checkenv@latest
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Retrieving addition deployment parameters"
|
||||
mkdir -p "${SECRETS_DIR}"
|
||||
AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION}" /root/go/bin/checkenv show aws_ssm+moonstream:true > "${PARAMETERS_ENV_PATH}"
|
||||
AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION}" /home/ubuntu/go/bin/checkenv show aws_ssm+moonstream:true > "${PARAMETERS_ENV_PATH}"
|
||||
chmod 0640 "${PARAMETERS_ENV_PATH}"
|
||||
|
||||
echo
|
||||
echo
|
||||
|
@ -113,215 +114,212 @@ echo
|
|||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Moonstream crawlers HTTP API server service definition with ${MOONCRAWL_SERVICE_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${MOONCRAWL_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MOONCRAWL_SERVICE_FILE}" "/etc/systemd/system/${MOONCRAWL_SERVICE_FILE}"
|
||||
systemctl daemon-reload
|
||||
systemctl restart --no-block "${MOONCRAWL_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MOONCRAWL_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MOONCRAWL_SERVICE_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${MOONCRAWL_SERVICE_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Ethereum block with transactions syncronizer service definition with ${ETHEREUM_SYNCHRONIZE_SERVICE_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${ETHEREUM_SYNCHRONIZE_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ETHEREUM_SYNCHRONIZE_SERVICE_FILE}" "/etc/systemd/system/${ETHEREUM_SYNCHRONIZE_SERVICE_FILE}"
|
||||
systemctl daemon-reload
|
||||
systemctl restart --no-block "${ETHEREUM_SYNCHRONIZE_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ETHEREUM_SYNCHRONIZE_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ETHEREUM_SYNCHRONIZE_SERVICE_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ETHEREUM_SYNCHRONIZE_SERVICE_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Ethereum trending service and timer with: ${ETHEREUM_TRENDING_SERVICE_FILE}, ${ETHEREUM_TRENDING_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${ETHEREUM_TRENDING_SERVICE_FILE}" "${SCRIPT_DIR}/${ETHEREUM_TRENDING_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ETHEREUM_TRENDING_SERVICE_FILE}" "/etc/systemd/system/${ETHEREUM_TRENDING_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ETHEREUM_TRENDING_TIMER_FILE}" "/etc/systemd/system/${ETHEREUM_TRENDING_TIMER_FILE}"
|
||||
systemctl daemon-reload
|
||||
systemctl restart --no-block "${ETHEREUM_TRENDING_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ETHEREUM_TRENDING_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ETHEREUM_TRENDING_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ETHEREUM_TRENDING_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${ETHEREUM_TRENDING_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ETHEREUM_TRENDING_TIMER_FILE}"
|
||||
|
||||
# echo
|
||||
# echo
|
||||
# echo -e "${PREFIX_INFO} Replacing existing Ethereum transaction pool crawler service definition with ${ETHEREUM_TXPOOL_SERVICE_FILE}"
|
||||
# chmod 644 "${SCRIPT_DIR}/${ETHEREUM_TXPOOL_SERVICE_FILE}"
|
||||
# cp "${SCRIPT_DIR}/${ETHEREUM_TXPOOL_SERVICE_FILE}" "/etc/systemd/system/${ETHEREUM_TXPOOL_SERVICE_FILE}"
|
||||
# systemctl daemon-reload
|
||||
# systemctl restart "${ETHEREUM_TXPOOL_SERVICE_FILE}"
|
||||
# cp "${SCRIPT_DIR}/${ETHEREUM_TXPOOL_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ETHEREUM_TXPOOL_SERVICE_FILE}"
|
||||
# XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
# XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ETHEREUM_TXPOOL_SERVICE_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Ethereum missing service and timer with: ${ETHEREUM_MISSING_SERVICE_FILE}, ${ETHEREUM_MISSING_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${ETHEREUM_MISSING_SERVICE_FILE}" "${SCRIPT_DIR}/${ETHEREUM_MISSING_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ETHEREUM_MISSING_SERVICE_FILE}" "/etc/systemd/system/${ETHEREUM_MISSING_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ETHEREUM_MISSING_TIMER_FILE}" "/etc/systemd/system/${ETHEREUM_MISSING_TIMER_FILE}"
|
||||
systemctl daemon-reload
|
||||
systemctl restart --no-block "${ETHEREUM_MISSING_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ETHEREUM_MISSING_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ETHEREUM_MISSING_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ETHEREUM_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${ETHEREUM_MISSING_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ETHEREUM_MISSING_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Ethereum moonworm crawler service definition with ${ETHEREUM_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${ETHEREUM_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ETHEREUM_MOONWORM_CRAWLER_SERVICE_FILE}" "/etc/systemd/system/${ETHEREUM_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
systemctl daemon-reload
|
||||
systemctl restart --no-block "${ETHEREUM_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ETHEREUM_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ETHEREUM_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ETHEREUM_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Polygon block with transactions syncronizer service definition with ${POLYGON_SYNCHRONIZE_SERVICE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${POLYGON_SYNCHRONIZE_SERVICE}"
|
||||
cp "${SCRIPT_DIR}/${POLYGON_SYNCHRONIZE_SERVICE}" "/etc/systemd/system/${POLYGON_SYNCHRONIZE_SERVICE}"
|
||||
systemctl daemon-reload
|
||||
systemctl restart --no-block "${POLYGON_SYNCHRONIZE_SERVICE}"
|
||||
cp "${SCRIPT_DIR}/${POLYGON_SYNCHRONIZE_SERVICE}" "/home/ubuntu/.config/systemd/user/${POLYGON_SYNCHRONIZE_SERVICE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${POLYGON_SYNCHRONIZE_SERVICE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Polygon missing service and timer with: ${POLYGON_MISSING_SERVICE_FILE}, ${POLYGON_MISSING_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${POLYGON_MISSING_SERVICE_FILE}" "${SCRIPT_DIR}/${POLYGON_MISSING_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${POLYGON_MISSING_SERVICE_FILE}" "/etc/systemd/system/${POLYGON_MISSING_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${POLYGON_MISSING_TIMER_FILE}" "/etc/systemd/system/${POLYGON_MISSING_TIMER_FILE}"
|
||||
systemctl daemon-reload
|
||||
systemctl restart --no-block "${POLYGON_MISSING_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${POLYGON_MISSING_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${POLYGON_MISSING_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${POLYGON_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${POLYGON_MISSING_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${POLYGON_MISSING_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Polygon statistics dashbord service and timer with: ${POLYGON_STATISTICS_SERVICE_FILE}, ${POLYGON_STATISTICS_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${POLYGON_STATISTICS_SERVICE_FILE}" "${SCRIPT_DIR}/${POLYGON_STATISTICS_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${POLYGON_STATISTICS_SERVICE_FILE}" "/etc/systemd/system/${POLYGON_STATISTICS_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${POLYGON_STATISTICS_TIMER_FILE}" "/etc/systemd/system/${POLYGON_STATISTICS_TIMER_FILE}"
|
||||
systemctl daemon-reload
|
||||
systemctl restart --no-block "${POLYGON_STATISTICS_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${POLYGON_STATISTICS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${POLYGON_STATISTICS_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${POLYGON_STATISTICS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${POLYGON_STATISTICS_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${POLYGON_STATISTICS_TIMER_FILE}"
|
||||
|
||||
# echo
|
||||
# echo
|
||||
# echo -e "${PREFIX_INFO} Replacing existing Polygon transaction pool crawler service definition with ${POLYGON_TXPOOL_SERVICE_FILE}"
|
||||
# chmod 644 "${SCRIPT_DIR}/${POLYGON_TXPOOL_SERVICE_FILE}"
|
||||
# cp "${SCRIPT_DIR}/${POLYGON_TXPOOL_SERVICE_FILE}" "/etc/systemd/system/${POLYGON_TXPOOL_SERVICE_FILE}"
|
||||
# systemctl daemon-reload
|
||||
# systemctl restart --no-block "${POLYGON_TXPOOL_SERVICE_FILE}"
|
||||
# cp "${SCRIPT_DIR}/${POLYGON_TXPOOL_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${POLYGON_TXPOOL_SERVICE_FILE}"
|
||||
# XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
# XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${POLYGON_TXPOOL_SERVICE_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Polygon moonworm crawler service definition with ${POLYGON_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${POLYGON_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${POLYGON_MOONWORM_CRAWLER_SERVICE_FILE}" "/etc/systemd/system/${POLYGON_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
systemctl daemon-reload
|
||||
systemctl restart --no-block "${POLYGON_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Mumbai block with transactions syncronizer service definition with ${MUMBAI_SYNCHRONIZE_SERVICE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${MUMBAI_SYNCHRONIZE_SERVICE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_SYNCHRONIZE_SERVICE}" "/etc/systemd/system/${MUMBAI_SYNCHRONIZE_SERVICE}"
|
||||
systemctl daemon-reload
|
||||
systemctl restart --no-block "${MUMBAI_SYNCHRONIZE_SERVICE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Mumbai missing service and timer with: ${MUMBAI_MISSING_SERVICE_FILE}, ${MUMBAI_MISSING_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${MUMBAI_MISSING_SERVICE_FILE}" "${SCRIPT_DIR}/${MUMBAI_MISSING_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_MISSING_SERVICE_FILE}" "/etc/systemd/system/${MUMBAI_MISSING_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_MISSING_TIMER_FILE}" "/etc/systemd/system/${MUMBAI_MISSING_TIMER_FILE}"
|
||||
systemctl daemon-reload
|
||||
systemctl restart --no-block "${MUMBAI_MISSING_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Mumbai moonworm crawler service definition with ${MUMBAI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${MUMBAI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_MOONWORM_CRAWLER_SERVICE_FILE}" "/etc/systemd/system/${MUMBAI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
systemctl daemon-reload
|
||||
systemctl restart --no-block "${MUMBAI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing XDai block with transactions syncronizer service definition with ${XDAI_SYNCHRONIZE_SERVICE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${XDAI_SYNCHRONIZE_SERVICE}"
|
||||
cp "${SCRIPT_DIR}/${XDAI_SYNCHRONIZE_SERVICE}" "/etc/systemd/system/${XDAI_SYNCHRONIZE_SERVICE}"
|
||||
systemctl daemon-reload
|
||||
systemctl restart --no-block "${XDAI_SYNCHRONIZE_SERVICE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing XDai missing service and timer with: ${XDAI_MISSING_SERVICE_FILE}, ${XDAI_MISSING_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${XDAI_MISSING_SERVICE_FILE}" "${SCRIPT_DIR}/${XDAI_MISSING_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${XDAI_MISSING_SERVICE_FILE}" "/etc/systemd/system/${XDAI_MISSING_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${XDAI_MISSING_TIMER_FILE}" "/etc/systemd/system/${XDAI_MISSING_TIMER_FILE}"
|
||||
systemctl daemon-reload
|
||||
systemctl restart --no-block "${XDAI_MISSING_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing XDai statistics dashbord service and timer with: ${XDAI_STATISTICS_SERVICE_FILE}, ${XDAI_STATISTICS_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${XDAI_STATISTICS_SERVICE_FILE}" "${SCRIPT_DIR}/${XDAI_STATISTICS_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${XDAI_STATISTICS_SERVICE_FILE}" "/etc/systemd/system/${XDAI_STATISTICS_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${XDAI_STATISTICS_TIMER_FILE}" "/etc/systemd/system/${XDAI_STATISTICS_TIMER_FILE}"
|
||||
systemctl daemon-reload
|
||||
systemctl restart --no-block "${XDAI_STATISTICS_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing XDai moonworm crawler service definition with ${XDAI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${XDAI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${XDAI_MOONWORM_CRAWLER_SERVICE_FILE}" "/etc/systemd/system/${XDAI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
systemctl daemon-reload
|
||||
systemctl restart --no-block "${XDAI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${POLYGON_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${POLYGON_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${POLYGON_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Polygon state service and timer with: ${POLYGON_STATE_SERVICE_FILE}, ${POLYGON_STATE_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${POLYGON_STATE_SERVICE_FILE}" "${SCRIPT_DIR}/${POLYGON_STATE_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${POLYGON_STATE_SERVICE_FILE}" "/etc/systemd/system/${POLYGON_STATE_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${POLYGON_STATE_TIMER_FILE}" "/etc/systemd/system/${POLYGON_STATE_TIMER_FILE}"
|
||||
systemctl daemon-reload
|
||||
systemctl restart --no-block "${POLYGON_STATE_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${POLYGON_STATE_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${POLYGON_STATE_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${POLYGON_STATE_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${POLYGON_STATE_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${POLYGON_STATE_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Polygon state clean service and timer with: ${POLYGON_STATE_CLEAN_SERVICE_FILE}, ${POLYGON_STATE_CLEAN_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${POLYGON_STATE_CLEAN_SERVICE_FILE}" "${SCRIPT_DIR}/${POLYGON_STATE_CLEAN_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${POLYGON_STATE_CLEAN_SERVICE_FILE}" "/etc/systemd/system/${POLYGON_STATE_CLEAN_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${POLYGON_STATE_CLEAN_TIMER_FILE}" "/etc/systemd/system/${POLYGON_STATE_CLEAN_TIMER_FILE}"
|
||||
systemctl daemon-reload
|
||||
systemctl restart --no-block "${POLYGON_STATE_CLEAN_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${POLYGON_STATE_CLEAN_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${POLYGON_STATE_CLEAN_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${POLYGON_STATE_CLEAN_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${POLYGON_STATE_CLEAN_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${POLYGON_STATE_CLEAN_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Polygon metadata service and timer with: ${POLYGON_METADATA_SERVICE_FILE}, ${POLYGON_METADATA_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${POLYGON_METADATA_SERVICE_FILE}" "${SCRIPT_DIR}/${POLYGON_METADATA_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${POLYGON_METADATA_SERVICE_FILE}" "/etc/systemd/system/${POLYGON_METADATA_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${POLYGON_METADATA_TIMER_FILE}" "/etc/systemd/system/${POLYGON_METADATA_TIMER_FILE}"
|
||||
systemctl daemon-reload
|
||||
systemctl restart --no-block "${POLYGON_METADATA_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${POLYGON_METADATA_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${POLYGON_METADATA_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${POLYGON_METADATA_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${POLYGON_METADATA_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${POLYGON_METADATA_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Polygon CU reports tokenonomics service and timer with: ${POLYGON_CU_REPORTS_TOKENONOMICS_SERVICE_FILE}, ${POLYGON_CU_REPORTS_TOKENONOMICS_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${POLYGON_CU_REPORTS_TOKENONOMICS_SERVICE_FILE}" "${SCRIPT_DIR}/${POLYGON_CU_REPORTS_TOKENONOMICS_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${POLYGON_CU_REPORTS_TOKENONOMICS_SERVICE_FILE}" "/etc/systemd/system/${POLYGON_CU_REPORTS_TOKENONOMICS_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${POLYGON_CU_REPORTS_TOKENONOMICS_TIMER_FILE}" "/etc/systemd/system/${POLYGON_CU_REPORTS_TOKENONOMICS_TIMER_FILE}"
|
||||
systemctl daemon-reload
|
||||
systemctl restart --no-block "${POLYGON_CU_REPORTS_TOKENONOMICS_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${POLYGON_CU_REPORTS_TOKENONOMICS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${POLYGON_CU_REPORTS_TOKENONOMICS_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${POLYGON_CU_REPORTS_TOKENONOMICS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${POLYGON_CU_REPORTS_TOKENONOMICS_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${POLYGON_CU_REPORTS_TOKENONOMICS_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Mumbai block with transactions syncronizer service definition with ${MUMBAI_SYNCHRONIZE_SERVICE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${MUMBAI_SYNCHRONIZE_SERVICE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_SYNCHRONIZE_SERVICE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_SYNCHRONIZE_SERVICE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${MUMBAI_SYNCHRONIZE_SERVICE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Mumbai missing service and timer with: ${MUMBAI_MISSING_SERVICE_FILE}, ${MUMBAI_MISSING_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${MUMBAI_MISSING_SERVICE_FILE}" "${SCRIPT_DIR}/${MUMBAI_MISSING_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_MISSING_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_MISSING_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_MISSING_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${MUMBAI_MISSING_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Mumbai moonworm crawler service definition with ${MUMBAI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${MUMBAI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${MUMBAI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing MUMBAI state service and timer with: ${MUMBAI_STATE_SERVICE_FILE}, ${MUMBAI_STATE_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${MUMBAI_STATE_SERVICE_FILE}" "${SCRIPT_DIR}/${MUMBAI_STATE_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_STATE_SERVICE_FILE}" "/etc/systemd/system/${MUMBAI_STATE_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_STATE_TIMER_FILE}" "/etc/systemd/system/${MUMBAI_STATE_TIMER_FILE}"
|
||||
systemctl daemon-reload
|
||||
systemctl restart --no-block "${MUMBAI_STATE_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_STATE_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_STATE_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_STATE_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_STATE_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${MUMBAI_STATE_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing MUMBAI state clean service and timer with: ${MUMBAI_STATE_CLEAN_SERVICE_FILE}, ${MUMBAI_STATE_CLEAN_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${MUMBAI_STATE_CLEAN_SERVICE_FILE}" "${SCRIPT_DIR}/${MUMBAI_STATE_CLEAN_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_STATE_CLEAN_SERVICE_FILE}" "/etc/systemd/system/${MUMBAI_STATE_CLEAN_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_STATE_CLEAN_TIMER_FILE}" "/etc/systemd/system/${MUMBAI_STATE_CLEAN_TIMER_FILE}"
|
||||
systemctl daemon-reload
|
||||
systemctl restart --no-block "${MUMBAI_STATE_CLEAN_TIMER_FILE}"
|
||||
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_STATE_CLEAN_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_STATE_CLEAN_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_STATE_CLEAN_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_STATE_CLEAN_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${MUMBAI_STATE_CLEAN_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing MUMBAI metadata service and timer with: ${MUMBAI_METADATA_SERVICE_FILE}, ${MUMBAI_METADATA_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${MUMBAI_METADATA_SERVICE_FILE}" "${SCRIPT_DIR}/${MUMBAI_METADATA_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_METADATA_SERVICE_FILE}" "/etc/systemd/system/${MUMBAI_METADATA_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_METADATA_TIMER_FILE}" "/etc/systemd/system/${MUMBAI_METADATA_TIMER_FILE}"
|
||||
systemctl daemon-reload
|
||||
systemctl restart --no-block "${MUMBAI_METADATA_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_METADATA_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_METADATA_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_METADATA_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_METADATA_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${MUMBAI_METADATA_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing XDai block with transactions syncronizer service definition with ${XDAI_SYNCHRONIZE_SERVICE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${XDAI_SYNCHRONIZE_SERVICE}"
|
||||
cp "${SCRIPT_DIR}/${XDAI_SYNCHRONIZE_SERVICE}" "/home/ubuntu/.config/systemd/user/${XDAI_SYNCHRONIZE_SERVICE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${XDAI_SYNCHRONIZE_SERVICE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing XDai missing service and timer with: ${XDAI_MISSING_SERVICE_FILE}, ${XDAI_MISSING_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${XDAI_MISSING_SERVICE_FILE}" "${SCRIPT_DIR}/${XDAI_MISSING_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${XDAI_MISSING_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${XDAI_MISSING_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${XDAI_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${XDAI_MISSING_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${XDAI_MISSING_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing XDai statistics dashbord service and timer with: ${XDAI_STATISTICS_SERVICE_FILE}, ${XDAI_STATISTICS_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${XDAI_STATISTICS_SERVICE_FILE}" "${SCRIPT_DIR}/${XDAI_STATISTICS_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${XDAI_STATISTICS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${XDAI_STATISTICS_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${XDAI_STATISTICS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${XDAI_STATISTICS_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${XDAI_STATISTICS_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing XDai moonworm crawler service definition with ${XDAI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${XDAI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${XDAI_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${XDAI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${XDAI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
|
|
|
@ -4,12 +4,8 @@ After=network.target
|
|||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
User=ubuntu
|
||||
Group=www-data
|
||||
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
|
||||
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler \
|
||||
--access-id "${NB_CONTROLLER_ACCESS_ID}" \
|
||||
blocks missing --blockchain ethereum -n
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler --access-id "${NB_CONTROLLER_ACCESS_ID}" blocks missing --blockchain ethereum -n
|
||||
CPUWeight=50
|
||||
SyslogIdentifier=ethereum-missing
|
||||
|
|
|
@ -5,8 +5,6 @@ StartLimitIntervalSec=300
|
|||
StartLimitBurst=3
|
||||
|
||||
[Service]
|
||||
User=ubuntu
|
||||
Group=www-data
|
||||
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
|
||||
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
|
||||
Restart=on-failure
|
||||
|
|
|
@ -7,13 +7,9 @@ After=network.target
|
|||
[Service]
|
||||
Restart=on-failure
|
||||
RestartSec=15s
|
||||
User=ubuntu
|
||||
Group=www-data
|
||||
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
|
||||
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler \
|
||||
--access-id "${NB_CONTROLLER_ACCESS_ID}" \
|
||||
blocks synchronize --blockchain ethereum -c 6 -j 2
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler --access-id "${NB_CONTROLLER_ACCESS_ID}" blocks synchronize --blockchain ethereum -c 6 -j 2
|
||||
CPUWeight=90
|
||||
SyslogIdentifier=ethereum-synchronize
|
||||
|
||||
|
|
|
@ -4,12 +4,8 @@ After=network.target
|
|||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
User=ubuntu
|
||||
Group=www-data
|
||||
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
|
||||
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler \
|
||||
--access-id "${NB_CONTROLLER_ACCESS_ID}" \
|
||||
trending
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler --access-id "${NB_CONTROLLER_ACCESS_ID}" trending
|
||||
CPUWeight=30
|
||||
SyslogIdentifier=ethereum-trending
|
||||
SyslogIdentifier=ethereum-trending
|
|
@ -5,17 +5,13 @@ StartLimitIntervalSec=300
|
|||
StartLimitBurst=3
|
||||
|
||||
[Service]
|
||||
User=ubuntu
|
||||
Group=www-data
|
||||
WorkingDirectory=/home/ubuntu/moonstream/crawlers/txpool
|
||||
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
|
||||
Restart=on-failure
|
||||
RestartSec=15s
|
||||
ExecStart=/home/ubuntu/moonstream/crawlers/txpool/txpool \
|
||||
-blockchain ethereum \
|
||||
-access-id "${NB_CONTROLLER_ACCESS_ID}"
|
||||
ExecStart=/home/ubuntu/moonstream/crawlers/txpool/txpool -blockchain ethereum -access-id "${NB_CONTROLLER_ACCESS_ID}"
|
||||
CPUWeight=30
|
||||
SyslogIdentifier=ethereum-txpool
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
WantedBy=multi-user.target
|
|
@ -5,8 +5,6 @@ StartLimitIntervalSec=300
|
|||
StartLimitBurst=3
|
||||
|
||||
[Service]
|
||||
User=ubuntu
|
||||
Group=www-data
|
||||
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
|
||||
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
|
||||
Restart=on-failure
|
||||
|
|
|
@ -1,18 +1,17 @@
|
|||
Description=Moonworm CryptoUnicorns watch
|
||||
After=network.target
|
||||
[Unit]
|
||||
Description=Moonworm CryptoUnicorns watch custom systemd service
|
||||
StartLimitIntervalSec=300
|
||||
StartLimitBurst=3
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
User=ubuntu
|
||||
Group=www-data
|
||||
WorkingDirectory=/home/ubuntu
|
||||
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
|
||||
Restart=on-failure
|
||||
RestartSec=15s
|
||||
WorkingDirectory=/home/ubuntu
|
||||
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
|
||||
ExecStart=/home/ubuntu/moonworm-env/bin/python -m moonworm.cli watch-cu -w "${MOONSTREAM_POLYGON_WEB3_PROVIDER_URI}?access_id=${NB_CONTROLLER_ACCESS_ID}&data_source=blockchain" -c 0xdC0479CC5BbA033B3e7De9F178607150B3AbCe1f -d 21418707 --confirmations 60
|
||||
CPUWeight=70
|
||||
SyslogIdentifier=moonworm-unicorns-mainnet
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
WantedBy=multi-user.target
|
|
@ -4,10 +4,8 @@ After=network.target
|
|||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
User=ubuntu
|
||||
Group=www-data
|
||||
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
|
||||
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.metadata_crawler.cli crawl --blockchain mumbai
|
||||
CPUWeight=60
|
||||
SyslogIdentifier=mumbai-metadata
|
||||
SyslogIdentifier=mumbai-metadata
|
|
@ -4,10 +4,8 @@ After=network.target
|
|||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
User=ubuntu
|
||||
Group=www-data
|
||||
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
|
||||
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler --access-id "${NB_CONTROLLER_ACCESS_ID}" blocks missing --blockchain mumbai -n
|
||||
CPUWeight=50
|
||||
SyslogIdentifier=mumbai-missing
|
||||
SyslogIdentifier=mumbai-missing
|
|
@ -5,8 +5,6 @@ StartLimitIntervalSec=300
|
|||
StartLimitBurst=3
|
||||
|
||||
[Service]
|
||||
User=ubuntu
|
||||
Group=www-data
|
||||
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
|
||||
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
|
||||
Restart=on-failure
|
||||
|
|
|
@ -4,10 +4,8 @@ After=network.target
|
|||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
User=ubuntu
|
||||
Group=www-data
|
||||
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
|
||||
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.state_crawler.cli --access-id "${NB_CONTROLLER_ACCESS_ID}" clean-state-labels --blockchain mumbai -N 10000
|
||||
CPUWeight=60
|
||||
SyslogIdentifier=mumbai-state-clean
|
||||
SyslogIdentifier=mumbai-state-clean
|
|
@ -4,10 +4,8 @@ After=network.target
|
|||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
User=ubuntu
|
||||
Group=www-data
|
||||
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
|
||||
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.state_crawler.cli --access-id "${NB_CONTROLLER_ACCESS_ID}" crawl-jobs --blockchain mumbai --infura --jobs-file /home/ubuntu/moonstream/crawlers/mooncrawl/mooncrawl/state_crawler/jobs/mumbai-jobs.json
|
||||
CPUWeight=60
|
||||
SyslogIdentifier=mumbai-state
|
||||
SyslogIdentifier=mumbai-state
|
|
@ -7,8 +7,6 @@ After=network.target
|
|||
[Service]
|
||||
Restart=on-failure
|
||||
RestartSec=15s
|
||||
User=ubuntu
|
||||
Group=www-data
|
||||
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
|
||||
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler --access-id "${NB_CONTROLLER_ACCESS_ID}" blocks synchronize --blockchain mumbai -c 60 -j 2
|
||||
|
@ -16,4 +14,4 @@ CPUWeight=90
|
|||
SyslogIdentifier=mumbai-synchronize
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
WantedBy=multi-user.target
|
|
@ -4,10 +4,8 @@ After=network.target
|
|||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
User=ubuntu
|
||||
Group=www-data
|
||||
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
|
||||
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.cu_reports_crawler.cli cu-reports --moonstream-token "${MOONSTREAM_PUBLIC_QUERIES_DATA_ACCESS_TOKEN}" queries run-tokenonomics
|
||||
CPUWeight=60
|
||||
SyslogIdentifier=polygon-cu-reports-tokenonomics
|
||||
SyslogIdentifier=polygon-cu-reports-tokenonomics
|
|
@ -4,10 +4,8 @@ After=network.target
|
|||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
User=ubuntu
|
||||
Group=www-data
|
||||
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
|
||||
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.metadata_crawler.cli crawl --blockchain polygon
|
||||
CPUWeight=60
|
||||
SyslogIdentifier=polygon-metadata
|
||||
SyslogIdentifier=polygon-metadata
|
|
@ -4,12 +4,8 @@ After=network.target
|
|||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
User=ubuntu
|
||||
Group=www-data
|
||||
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
|
||||
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler \
|
||||
--access-id "${NB_CONTROLLER_ACCESS_ID}" \
|
||||
blocks missing --blockchain polygon -n
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler --access-id "${NB_CONTROLLER_ACCESS_ID}" blocks missing --blockchain polygon -n
|
||||
CPUWeight=50
|
||||
SyslogIdentifier=polygon-missing
|
||||
SyslogIdentifier=polygon-missing
|
|
@ -5,15 +5,11 @@ StartLimitIntervalSec=300
|
|||
StartLimitBurst=3
|
||||
|
||||
[Service]
|
||||
User=ubuntu
|
||||
Group=www-data
|
||||
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
|
||||
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
|
||||
Restart=on-failure
|
||||
RestartSec=15s
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.moonworm_crawler.cli \
|
||||
--access-id "${NB_CONTROLLER_ACCESS_ID}" \
|
||||
crawl -b polygon
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.moonworm_crawler.cli --access-id "${NB_CONTROLLER_ACCESS_ID}" crawl -b polygon
|
||||
CPUWeight=70
|
||||
SyslogIdentifier=polygon-moonworm-crawler
|
||||
|
||||
|
|
|
@ -4,10 +4,8 @@ After=network.target
|
|||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
User=ubuntu
|
||||
Group=www-data
|
||||
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
|
||||
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.state_crawler.cli --access-id "${NB_CONTROLLER_ACCESS_ID}" clean-state-labels --blockchain polygon -N 10000
|
||||
CPUWeight=60
|
||||
SyslogIdentifier=polygon-state-clean
|
||||
SyslogIdentifier=polygon-state-clean
|
|
@ -4,10 +4,8 @@ After=network.target
|
|||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
User=ubuntu
|
||||
Group=www-data
|
||||
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
|
||||
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.state_crawler.cli --access-id "${NB_CONTROLLER_ACCESS_ID}" crawl-jobs --blockchain polygon --infura --jobs-file /home/ubuntu/moonstream/crawlers/mooncrawl/mooncrawl/state_crawler/jobs/polygon-jobs.json
|
||||
CPUWeight=60
|
||||
SyslogIdentifier=polygon-state
|
||||
SyslogIdentifier=polygon-state
|
|
@ -4,12 +4,8 @@ After=network.target
|
|||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
User=ubuntu
|
||||
Group=www-data
|
||||
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
|
||||
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.stats_worker.dashboard \
|
||||
--access-id "${NB_CONTROLLER_ACCESS_ID}" \
|
||||
generate --blockchain polygon
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.stats_worker.dashboard --access-id "${NB_CONTROLLER_ACCESS_ID}" generate --blockchain polygon
|
||||
CPUWeight=60
|
||||
SyslogIdentifier=polygon-statistics
|
||||
SyslogIdentifier=polygon-statistics
|
|
@ -7,15 +7,11 @@ After=network.target
|
|||
[Service]
|
||||
Restart=on-failure
|
||||
RestartSec=15s
|
||||
User=ubuntu
|
||||
Group=www-data
|
||||
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
|
||||
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler \
|
||||
--access-id "${NB_CONTROLLER_ACCESS_ID}" \
|
||||
blocks synchronize --blockchain polygon -c 60 -j 2
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler --access-id "${NB_CONTROLLER_ACCESS_ID}" blocks synchronize --blockchain polygon -c 60 -j 2
|
||||
CPUWeight=90
|
||||
SyslogIdentifier=polygon-synchronize
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
WantedBy=multi-user.target
|
|
@ -5,17 +5,13 @@ StartLimitIntervalSec=300
|
|||
StartLimitBurst=3
|
||||
|
||||
[Service]
|
||||
User=ubuntu
|
||||
Group=www-data
|
||||
WorkingDirectory=/home/ubuntu/moonstream/crawlers/txpool
|
||||
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
|
||||
Restart=on-failure
|
||||
RestartSec=15s
|
||||
ExecStart=/home/ubuntu/moonstream/crawlers/txpool/txpool \
|
||||
-blockchain polygon \
|
||||
-access-id "${NB_CONTROLLER_ACCESS_ID}"
|
||||
ExecStart=/home/ubuntu/moonstream/crawlers/txpool/txpool -blockchain polygon -access-id "${NB_CONTROLLER_ACCESS_ID}"
|
||||
CPUWeight=30
|
||||
SyslogIdentifier=polygon-txpool
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
WantedBy=multi-user.target
|
|
@ -4,12 +4,8 @@ After=network.target
|
|||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
User=ubuntu
|
||||
Group=www-data
|
||||
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
|
||||
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler \
|
||||
--access-id "${NB_CONTROLLER_ACCESS_ID}" \
|
||||
blocks missing --blockchain xdai -n
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler --access-id "${NB_CONTROLLER_ACCESS_ID}" blocks missing --blockchain xdai -n
|
||||
CPUWeight=50
|
||||
SyslogIdentifier=xdai-missing
|
|
@ -5,15 +5,11 @@ StartLimitIntervalSec=300
|
|||
StartLimitBurst=3
|
||||
|
||||
[Service]
|
||||
User=ubuntu
|
||||
Group=www-data
|
||||
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
|
||||
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
|
||||
Restart=on-failure
|
||||
RestartSec=15s
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.moonworm_crawler.cli \
|
||||
--access-id "${NB_CONTROLLER_ACCESS_ID}" \
|
||||
crawl -b xdai
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.moonworm_crawler.cli --access-id "${NB_CONTROLLER_ACCESS_ID}" crawl -b xdai
|
||||
CPUWeight=70
|
||||
SyslogIdentifier=xdai-moonworm-crawler
|
||||
|
||||
|
|
|
@ -4,12 +4,8 @@ After=network.target
|
|||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
User=ubuntu
|
||||
Group=www-data
|
||||
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
|
||||
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.stats_worker.dashboard \
|
||||
--access-id "${NB_CONTROLLER_ACCESS_ID}" \
|
||||
generate --blockchain xdai
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.stats_worker.dashboard --access-id "${NB_CONTROLLER_ACCESS_ID}" generate --blockchain xdai
|
||||
CPUWeight=60
|
||||
SyslogIdentifier=xdai-statistics
|
||||
SyslogIdentifier=xdai-statistics
|
|
@ -7,13 +7,9 @@ After=network.target
|
|||
[Service]
|
||||
Restart=on-failure
|
||||
RestartSec=15s
|
||||
User=ubuntu
|
||||
Group=www-data
|
||||
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
|
||||
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler \
|
||||
--access-id "${NB_CONTROLLER_ACCESS_ID}" \
|
||||
blocks synchronize --blockchain xdai -c 60 -j 2
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler --access-id "${NB_CONTROLLER_ACCESS_ID}" blocks synchronize --blockchain xdai -c 60 -j 2
|
||||
CPUWeight=90
|
||||
SyslogIdentifier=xdai-synchronize
|
||||
|
||||
|
|
|
@ -113,7 +113,6 @@ async def status_handler(
|
|||
s3_client = boto3.client("s3")
|
||||
|
||||
try:
|
||||
|
||||
background_tasks.add_task(
|
||||
dashboard.stats_generate_api_task,
|
||||
timescales=stats_update.timescales,
|
||||
|
@ -133,13 +132,11 @@ async def status_handler(
|
|||
for dashboard_subscription_filters in dashboard_resource.resource_data[
|
||||
"subscription_settings"
|
||||
]:
|
||||
|
||||
subscription = subscription_by_id[
|
||||
dashboard_subscription_filters["subscription_id"]
|
||||
]
|
||||
|
||||
for timescale in stats_update.timescales:
|
||||
|
||||
presigned_urls_response[subscription.id] = {}
|
||||
|
||||
try:
|
||||
|
@ -181,7 +178,6 @@ async def queries_data_update_handler(
|
|||
request_data: data.QueryDataUpdate,
|
||||
background_tasks: BackgroundTasks,
|
||||
) -> Dict[str, Any]:
|
||||
|
||||
s3_client = boto3.client("s3")
|
||||
|
||||
expected_query_parameters = text(request_data.query)._bindparams.keys()
|
||||
|
@ -213,7 +209,6 @@ async def queries_data_update_handler(
|
|||
raise MoonstreamHTTPException(status_code=500)
|
||||
|
||||
try:
|
||||
|
||||
background_tasks.add_task(
|
||||
queries.data_generate,
|
||||
bucket=MOONSTREAM_S3_QUERIES_BUCKET,
|
||||
|
|
|
@ -45,7 +45,6 @@ class NowResponse(BaseModel):
|
|||
|
||||
|
||||
class QueryDataUpdate(BaseModel):
|
||||
|
||||
file_type: str
|
||||
query: str
|
||||
params: Dict[str, Any] = Field(default_factory=dict)
|
||||
|
|
|
@ -35,6 +35,7 @@ from ..moonworm_crawler.event_crawler import Event, get_block_timestamp
|
|||
logging.basicConfig(level=logging.INFO)
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
# TODO: ADD VALUE!!!
|
||||
@dataclass
|
||||
class ExtededFunctionCall(ContractFunctionCall):
|
||||
|
@ -82,7 +83,6 @@ def add_function_calls_with_gas_price_to_session(
|
|||
blockchain_type: AvailableBlockchainType,
|
||||
label_name: str,
|
||||
) -> None:
|
||||
|
||||
label_model = get_label_model(blockchain_type)
|
||||
transactions_hashes_to_save = [
|
||||
function_call.transaction_hash for function_call in function_calls
|
||||
|
@ -152,7 +152,6 @@ def process_transaction(
|
|||
transaction: Dict[str, Any],
|
||||
blocks_cache: Dict[int, int],
|
||||
):
|
||||
|
||||
try:
|
||||
raw_function_call = contract.decode_function_input(transaction["input"])
|
||||
function_name = raw_function_call[0].fn_name
|
||||
|
@ -270,7 +269,6 @@ def populate_with_events(
|
|||
to_block: int,
|
||||
batch_size: int = 100,
|
||||
):
|
||||
|
||||
current_block = from_block
|
||||
|
||||
events_abi = [event for event in abi if event["type"] == "event"]
|
||||
|
|
|
@ -58,7 +58,6 @@ def identities_cmc_add_handler(args: argparse.Namespace) -> None:
|
|||
break
|
||||
|
||||
with yield_db_session_ctx() as db_session:
|
||||
|
||||
for coin in response["data"]:
|
||||
if coin["platform"] is not None:
|
||||
if (
|
||||
|
|
|
@ -1,26 +1,29 @@
|
|||
import argparse
|
||||
from contextlib import contextmanager
|
||||
import json
|
||||
from urllib.error import HTTPError
|
||||
import urllib.request
|
||||
import logging
|
||||
from typing import Dict, Any
|
||||
import random
|
||||
from typing import Dict, Any, List, Optional
|
||||
|
||||
from moonstreamdb.blockchain import AvailableBlockchainType
|
||||
from moonstreamdb.db import (
|
||||
MOONSTREAM_DB_URI,
|
||||
MOONSTREAM_POOL_SIZE,
|
||||
create_moonstream_engine,
|
||||
MOONSTREAM_DB_STATEMENT_TIMEOUT_MILLIS,
|
||||
MOONSTREAM_DB_URI_READ_ONLY,
|
||||
)
|
||||
from sqlalchemy.orm import sessionmaker
|
||||
from .db import (
|
||||
commit_session,
|
||||
get_uris_of_tokens,
|
||||
get_current_metadata_for_address,
|
||||
get_tokens_id_wich_may_updated,
|
||||
metadata_to_label,
|
||||
clean_labels_from_db,
|
||||
)
|
||||
from ..settings import (
|
||||
MOONSTREAM_STATE_CRAWLER_DB_STATEMENT_TIMEOUT_MILLIS,
|
||||
)
|
||||
from ..settings import MOONSTREAM_CRAWLERS_DB_STATEMENT_TIMEOUT_MILLIS
|
||||
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -29,8 +32,36 @@ logger = logging.getLogger(__name__)
|
|||
batch_size = 50
|
||||
|
||||
|
||||
def crawl_uri(metadata_uri: str) -> Any:
|
||||
@contextmanager
|
||||
def yield_session_maker(engine):
|
||||
SessionLocal = sessionmaker(bind=engine)
|
||||
session = SessionLocal()
|
||||
try:
|
||||
yield session
|
||||
finally:
|
||||
session.close()
|
||||
|
||||
|
||||
def leak_of_crawled_uri(
|
||||
ids: List[Optional[str]], leak_rate: float, maybe_updated: List[Optional[str]]
|
||||
) -> List[Optional[str]]:
|
||||
"""
|
||||
Leak only uri which may be updated.
|
||||
"""
|
||||
assert 0 <= leak_rate <= 1, "Leak rate must be between 0 and 1"
|
||||
|
||||
result = []
|
||||
|
||||
for id in ids:
|
||||
if id not in maybe_updated:
|
||||
result.append(id)
|
||||
elif random.random() > leak_rate:
|
||||
result.append(id)
|
||||
|
||||
return result
|
||||
|
||||
|
||||
def crawl_uri(metadata_uri: str) -> Any:
|
||||
"""
|
||||
Get metadata from URI
|
||||
"""
|
||||
|
@ -38,7 +69,6 @@ def crawl_uri(metadata_uri: str) -> Any:
|
|||
result = None
|
||||
while retry < 3:
|
||||
try:
|
||||
|
||||
response = urllib.request.urlopen(metadata_uri, timeout=10)
|
||||
|
||||
if response.status == 200:
|
||||
|
@ -58,8 +88,9 @@ def crawl_uri(metadata_uri: str) -> Any:
|
|||
return result
|
||||
|
||||
|
||||
def parse_metadata(blockchain_type: AvailableBlockchainType, batch_size: int):
|
||||
|
||||
def parse_metadata(
|
||||
blockchain_type: AvailableBlockchainType, batch_size: int, max_recrawl: int
|
||||
):
|
||||
"""
|
||||
Parse all metadata of tokens.
|
||||
"""
|
||||
|
@ -71,63 +102,135 @@ def parse_metadata(blockchain_type: AvailableBlockchainType, batch_size: int):
|
|||
MOONSTREAM_DB_URI,
|
||||
pool_pre_ping=True,
|
||||
pool_size=MOONSTREAM_POOL_SIZE,
|
||||
statement_timeout=MOONSTREAM_STATE_CRAWLER_DB_STATEMENT_TIMEOUT_MILLIS,
|
||||
statement_timeout=MOONSTREAM_CRAWLERS_DB_STATEMENT_TIMEOUT_MILLIS,
|
||||
)
|
||||
process_session = sessionmaker(bind=engine)
|
||||
db_session = process_session()
|
||||
|
||||
# run crawling of levels
|
||||
try:
|
||||
|
||||
uris_of_tokens = get_uris_of_tokens(db_session, blockchain_type)
|
||||
# create read only engine
|
||||
|
||||
tokens_uri_by_address: Dict[str, Any] = {}
|
||||
# Read only
|
||||
read_only_engine = create_moonstream_engine(
|
||||
url=MOONSTREAM_DB_URI_READ_ONLY,
|
||||
pool_size=MOONSTREAM_POOL_SIZE,
|
||||
statement_timeout=MOONSTREAM_CRAWLERS_DB_STATEMENT_TIMEOUT_MILLIS,
|
||||
pool_pre_ping=True,
|
||||
)
|
||||
|
||||
for token_uri_data in uris_of_tokens:
|
||||
if token_uri_data.address not in tokens_uri_by_address:
|
||||
tokens_uri_by_address[token_uri_data.address] = []
|
||||
tokens_uri_by_address[token_uri_data.address].append(token_uri_data)
|
||||
with yield_session_maker(engine=read_only_engine) as db_session_read_only:
|
||||
try:
|
||||
# get all tokens with uri
|
||||
logger.info("Requesting all tokens with uri from database")
|
||||
uris_of_tokens = get_uris_of_tokens(db_session_read_only, blockchain_type)
|
||||
|
||||
for address in tokens_uri_by_address:
|
||||
tokens_uri_by_address: Dict[str, Any] = {}
|
||||
|
||||
already_parsed = get_current_metadata_for_address(
|
||||
db_session=db_session, blockchain_type=blockchain_type, address=address
|
||||
)
|
||||
for token_uri_data in uris_of_tokens:
|
||||
if token_uri_data.address not in tokens_uri_by_address:
|
||||
tokens_uri_by_address[token_uri_data.address] = []
|
||||
tokens_uri_by_address[token_uri_data.address].append(token_uri_data)
|
||||
|
||||
for requests_chunk in [
|
||||
tokens_uri_by_address[address][i : i + batch_size]
|
||||
for i in range(0, len(tokens_uri_by_address[address]), batch_size)
|
||||
]:
|
||||
writed_labels = 0
|
||||
for token_uri_data in requests_chunk:
|
||||
for address in tokens_uri_by_address:
|
||||
logger.info(f"Starting to crawl metadata for address: {address}")
|
||||
|
||||
if token_uri_data.token_id not in already_parsed:
|
||||
metadata = crawl_uri(token_uri_data.token_uri)
|
||||
already_parsed = get_current_metadata_for_address(
|
||||
db_session=db_session_read_only,
|
||||
blockchain_type=blockchain_type,
|
||||
address=address,
|
||||
)
|
||||
|
||||
db_session.add(
|
||||
metadata_to_label(
|
||||
blockchain_type=blockchain_type,
|
||||
metadata=metadata,
|
||||
token_uri_data=token_uri_data,
|
||||
)
|
||||
maybe_updated = get_tokens_id_wich_may_updated(
|
||||
db_session=db_session_read_only,
|
||||
blockchain_type=blockchain_type,
|
||||
address=address,
|
||||
)
|
||||
leak_rate = 0.0
|
||||
|
||||
if len(maybe_updated) > 0:
|
||||
leak_rate = max_recrawl / len(maybe_updated)
|
||||
|
||||
if leak_rate > 1:
|
||||
leak_rate = 1
|
||||
|
||||
parsed_with_leak = leak_of_crawled_uri(
|
||||
already_parsed, leak_rate, maybe_updated
|
||||
)
|
||||
|
||||
logger.info(
|
||||
f"Leak rate: {leak_rate} for {address} with maybe updated {len(maybe_updated)}"
|
||||
)
|
||||
|
||||
logger.info(f"Already parsed: {len(already_parsed)} for {address}")
|
||||
|
||||
logger.info(
|
||||
f"Amount of tokens for crawl: {len(tokens_uri_by_address[address])- len(parsed_with_leak)} for {address}"
|
||||
)
|
||||
|
||||
# Remove already parsed tokens
|
||||
tokens_uri_by_address[address] = [
|
||||
token_uri_data
|
||||
for token_uri_data in tokens_uri_by_address[address]
|
||||
if token_uri_data.token_id not in parsed_with_leak
|
||||
]
|
||||
|
||||
for requests_chunk in [
|
||||
tokens_uri_by_address[address][i : i + batch_size]
|
||||
for i in range(0, len(tokens_uri_by_address[address]), batch_size)
|
||||
]:
|
||||
writed_labels = 0
|
||||
db_session.commit()
|
||||
|
||||
try:
|
||||
with db_session.begin():
|
||||
for token_uri_data in requests_chunk:
|
||||
metadata = crawl_uri(token_uri_data.token_uri)
|
||||
|
||||
db_session.add(
|
||||
metadata_to_label(
|
||||
blockchain_type=blockchain_type,
|
||||
metadata=metadata,
|
||||
token_uri_data=token_uri_data,
|
||||
)
|
||||
)
|
||||
writed_labels += 1
|
||||
|
||||
if writed_labels > 0:
|
||||
clean_labels_from_db(
|
||||
db_session=db_session,
|
||||
blockchain_type=blockchain_type,
|
||||
address=address,
|
||||
)
|
||||
logger.info(
|
||||
f"Write {writed_labels} labels for {address}"
|
||||
)
|
||||
# trasaction is commited here
|
||||
except Exception as err:
|
||||
logger.error(err)
|
||||
logger.error(
|
||||
f"Error while writing labels for address: {address}"
|
||||
)
|
||||
writed_labels += 1
|
||||
commit_session(db_session)
|
||||
logger.info(f"Write {writed_labels} labels for {address}")
|
||||
db_session.rollback()
|
||||
|
||||
finally:
|
||||
db_session.close()
|
||||
clean_labels_from_db(
|
||||
db_session=db_session,
|
||||
blockchain_type=blockchain_type,
|
||||
address=address,
|
||||
)
|
||||
|
||||
finally:
|
||||
db_session.close()
|
||||
|
||||
|
||||
def handle_crawl(args: argparse.Namespace) -> None:
|
||||
|
||||
"""
|
||||
Parse all metadata of tokens.
|
||||
"""
|
||||
|
||||
blockchain_type = AvailableBlockchainType(args.blockchain)
|
||||
|
||||
parse_metadata(blockchain_type, args.commit_batch_size)
|
||||
parse_metadata(blockchain_type, args.commit_batch_size, args.max_recrawl)
|
||||
|
||||
|
||||
def main() -> None:
|
||||
|
@ -154,6 +257,13 @@ def main() -> None:
|
|||
default=50,
|
||||
help="Amount of requests before commiting to database",
|
||||
)
|
||||
metadata_crawler_parser.add_argument(
|
||||
"--max-recrawl",
|
||||
"-m",
|
||||
type=int,
|
||||
default=300,
|
||||
help="Maximum amount of recrawling of already crawled tokens",
|
||||
)
|
||||
metadata_crawler_parser.set_defaults(func=handle_crawl)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
|
|
@ -6,7 +6,7 @@ from moonstreamdb.blockchain import AvailableBlockchainType, get_label_model
|
|||
from sqlalchemy.orm import Session
|
||||
|
||||
from ..data import TokenURIs
|
||||
from ..settings import VIEW_STATE_CRAWLER_LABEL, METADATA_CRAWLER_LABEL
|
||||
from ..settings import VIEW_STATE_CRAWLER_LABEL, METADATA_CRAWLER_LABEL, CRAWLER_LABEL
|
||||
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -18,7 +18,6 @@ def metadata_to_label(
|
|||
token_uri_data: TokenURIs,
|
||||
label_name=METADATA_CRAWLER_LABEL,
|
||||
):
|
||||
|
||||
"""
|
||||
Creates a label model.
|
||||
"""
|
||||
|
@ -62,7 +61,6 @@ def commit_session(db_session: Session) -> None:
|
|||
def get_uris_of_tokens(
|
||||
db_session: Session, blockchain_type: AvailableBlockchainType
|
||||
) -> List[TokenURIs]:
|
||||
|
||||
"""
|
||||
Get meatadata URIs.
|
||||
"""
|
||||
|
@ -139,3 +137,126 @@ def get_current_metadata_for_address(
|
|||
result = [data[0] for data in current_metadata]
|
||||
|
||||
return result
|
||||
|
||||
|
||||
def get_tokens_id_wich_may_updated(
|
||||
db_session: Session, blockchain_type: AvailableBlockchainType, address: str
|
||||
):
|
||||
"""
|
||||
Returns a list of tokens which may have updated information.
|
||||
|
||||
This function queries the database and returns all tokens that have had a transaction executed
|
||||
on them after the latest update of their metadata, excluding transactions with names 'safeTransferFrom',
|
||||
'approve' and 'transferFrom'.
|
||||
|
||||
TODO(Andrey): This function is not perfect, it may return tokens that have not been updated.
|
||||
One way for improvements it's get opcodes for all transactions and check if they update metadata storage.
|
||||
Required integration with entity API and opcodes crawler.
|
||||
"""
|
||||
|
||||
label_model = get_label_model(blockchain_type)
|
||||
|
||||
table = label_model.__tablename__
|
||||
|
||||
tokens = db_session.execute(
|
||||
"""
|
||||
with token_id_latest_events as (
|
||||
SELECT
|
||||
DISTINCT ON (
|
||||
label_data -> 'args' ->> 'tokenId',
|
||||
label_data ->> 'name'
|
||||
) label_data -> 'args' ->> 'tokenId' as token_id,
|
||||
label_data ->> 'name' as name,
|
||||
block_timestamp
|
||||
FROM
|
||||
{}
|
||||
where
|
||||
label = :moonworm_label
|
||||
and address = :address
|
||||
and label_data->> 'type' = 'tx_call'
|
||||
and label_data->>'status' = '1'
|
||||
and label_data ->> 'name' not in (
|
||||
'safeTransferFrom',
|
||||
'approve',
|
||||
'transferFrom'
|
||||
)
|
||||
ORDER BY
|
||||
(label_data -> 'args' ->> 'tokenId') ASC,
|
||||
(label_data ->> 'name') ASC,
|
||||
block_timestamp :: INT DESC,
|
||||
log_index :: INT DESC
|
||||
),
|
||||
metadata_state as (
|
||||
SELECT
|
||||
DISTINCT ON(label_data ->> 'token_id') label_data ->> 'token_id' as token_id,
|
||||
block_timestamp
|
||||
FROM
|
||||
{}
|
||||
WHERE
|
||||
address = :address
|
||||
AND label = :metadata_label
|
||||
ORDER BY
|
||||
label_data ->> 'token_id' ASC,
|
||||
block_number :: INT DESC
|
||||
)
|
||||
SELECT
|
||||
distinct token_id_latest_events.token_id
|
||||
FROM
|
||||
token_id_latest_events
|
||||
JOIN metadata_state ON token_id_latest_events.token_id = metadata_state.token_id
|
||||
WHERE
|
||||
token_id_latest_events.block_timestamp > metadata_state.block_timestamp
|
||||
""".format(
|
||||
table, table
|
||||
),
|
||||
{
|
||||
"address": address,
|
||||
"metadata_label": METADATA_CRAWLER_LABEL,
|
||||
"moonworm_label": CRAWLER_LABEL,
|
||||
},
|
||||
)
|
||||
|
||||
result = [data[0] for data in tokens]
|
||||
|
||||
return result
|
||||
|
||||
|
||||
def clean_labels_from_db(
|
||||
db_session: Session, blockchain_type: AvailableBlockchainType, address: str
|
||||
):
|
||||
"""
|
||||
Remove existing labels.
|
||||
But keep the latest one for each token.
|
||||
"""
|
||||
|
||||
label_model = get_label_model(blockchain_type)
|
||||
|
||||
table = label_model.__tablename__
|
||||
|
||||
db_session.execute(
|
||||
"""
|
||||
WITH lates_token_metadata AS (
|
||||
SELECT
|
||||
DISTINCT ON (label_data->>'token_id') label_data->>'token_id' AS token_id,
|
||||
id as id,
|
||||
block_number as block_number
|
||||
FROM
|
||||
{}
|
||||
WHERE
|
||||
label=:label
|
||||
AND address=:address
|
||||
ORDER BY
|
||||
label_data->>'token_id' ASC,
|
||||
block_number DESC
|
||||
)
|
||||
DELETE FROM
|
||||
{} USING lates_token_metadata
|
||||
WHERE
|
||||
label=:label
|
||||
AND address=:address
|
||||
AND {}.id not in (select id from lates_token_metadata) RETURNING {}.block_number;
|
||||
""".format(
|
||||
table, table, table, table
|
||||
),
|
||||
{"address": address, "label": METADATA_CRAWLER_LABEL},
|
||||
)
|
||||
|
|
|
@ -25,7 +25,6 @@ logger = logging.getLogger(__name__)
|
|||
|
||||
|
||||
def handle_crawl(args: argparse.Namespace) -> None:
|
||||
|
||||
blockchain_type = AvailableBlockchainType(args.blockchain_type)
|
||||
subscription_type = blockchain_type_to_subscription_type(blockchain_type)
|
||||
|
||||
|
|
|
@ -258,7 +258,6 @@ def make_function_call_crawl_jobs(
|
|||
method_signature_by_address[contract_address] = [method_signature]
|
||||
|
||||
else:
|
||||
|
||||
if method_signature not in method_signature_by_address[contract_address]:
|
||||
crawl_job_by_address[contract_address].contract_abi.append(abi)
|
||||
method_signature_by_address[contract_address].append(method_signature)
|
||||
|
|
|
@ -193,7 +193,6 @@ def add_function_calls_to_session(
|
|||
blockchain_type: AvailableBlockchainType,
|
||||
label_name=CRAWLER_LABEL,
|
||||
) -> None:
|
||||
|
||||
label_model = get_label_model(blockchain_type)
|
||||
transactions_hashes_to_save = [
|
||||
function_call.transaction_hash for function_call in function_calls
|
||||
|
|
|
@ -152,13 +152,11 @@ def _autoscale_crawl_events(
|
|||
batch_size: int = 1000,
|
||||
db_block_query_batch=10,
|
||||
) -> Tuple[List[Event], int]:
|
||||
|
||||
"""
|
||||
Crawl events with auto regulated batch_size.
|
||||
"""
|
||||
all_events = []
|
||||
for job in jobs:
|
||||
|
||||
raw_events, batch_size = moonworm_autoscale_crawl_events(
|
||||
web3,
|
||||
job.event_abi,
|
||||
|
|
|
@ -27,7 +27,6 @@ def _crawl_functions(
|
|||
from_block: int,
|
||||
to_block: int,
|
||||
) -> List[ContractFunctionCall]:
|
||||
|
||||
shared_state = MockState()
|
||||
|
||||
crawled_functions = []
|
||||
|
|
|
@ -62,7 +62,6 @@ def historical_crawler(
|
|||
|
||||
while start_block >= end_block:
|
||||
try:
|
||||
|
||||
time.sleep(min_sleep_time)
|
||||
|
||||
batch_end_block = max(
|
||||
|
@ -85,7 +84,6 @@ def historical_crawler(
|
|||
)
|
||||
|
||||
else:
|
||||
|
||||
all_events, max_blocks_batch = _autoscale_crawl_events(
|
||||
db_session=db_session,
|
||||
blockchain_type=blockchain_type,
|
||||
|
|
|
@ -59,6 +59,21 @@ except:
|
|||
f"Could not parse MOONSTREAM_QUERY_API_DB_STATEMENT_TIMEOUT_MILLIS as int: {MOONSTREAM_STATE_CRAWLER_DB_STATEMENT_TIMEOUT_MILLIS_RAW}"
|
||||
)
|
||||
|
||||
|
||||
MOONSTREAM_CRAWLERS_DB_STATEMENT_TIMEOUT_MILLIS = 60000
|
||||
MOONSTREAM_CRAWLERS_DB_STATEMENT_TIMEOUT_MILLIS_RAW = os.environ.get(
|
||||
"MOONSTREAM_CRAWLERS_DB_STATEMENT_TIMEOUT_MILLIS"
|
||||
)
|
||||
try:
|
||||
if MOONSTREAM_CRAWLERS_DB_STATEMENT_TIMEOUT_MILLIS_RAW is not None:
|
||||
MOONSTREAM_CRAWLERS_DB_STATEMENT_TIMEOUT_MILLIS = int(
|
||||
MOONSTREAM_CRAWLERS_DB_STATEMENT_TIMEOUT_MILLIS_RAW
|
||||
)
|
||||
except:
|
||||
raise Exception(
|
||||
f"Could not parse MOONSTREAM_CRAWLERS_DB_STATEMENT_TIMEOUT_MILLIS as int: {MOONSTREAM_CRAWLERS_DB_STATEMENT_TIMEOUT_MILLIS_RAW}"
|
||||
)
|
||||
|
||||
# Geth connection address
|
||||
MOONSTREAM_ETHEREUM_WEB3_PROVIDER_URI = os.environ.get(
|
||||
"MOONSTREAM_ETHEREUM_WEB3_PROVIDER_URI", ""
|
||||
|
|
|
@ -44,7 +44,6 @@ def make_multicall(
|
|||
block_timestamp: int,
|
||||
block_number: str = "latest",
|
||||
) -> Any:
|
||||
|
||||
multicall_calls = []
|
||||
|
||||
for call in calls:
|
||||
|
@ -140,11 +139,9 @@ def crawl_calls_level(
|
|||
max_batch_size=5000,
|
||||
min_batch_size=4,
|
||||
):
|
||||
|
||||
calls_of_level = []
|
||||
|
||||
for call in calls:
|
||||
|
||||
if call["generated_hash"] in responces:
|
||||
continue
|
||||
parameters = []
|
||||
|
@ -152,7 +149,6 @@ def crawl_calls_level(
|
|||
logger.info(f"Call: {json.dumps(call, indent=4)}")
|
||||
|
||||
for input in call["inputs"]:
|
||||
|
||||
if type(input["value"]) in (str, int):
|
||||
if input["value"] not in responces:
|
||||
parameters.append([input["value"]])
|
||||
|
@ -173,7 +169,6 @@ def crawl_calls_level(
|
|||
raise
|
||||
|
||||
for call_parameters in itertools.product(*parameters):
|
||||
|
||||
# hack for tuples product
|
||||
if len(call_parameters) == 1 and type(call_parameters[0]) == tuple:
|
||||
call_parameters = call_parameters[0]
|
||||
|
@ -191,10 +186,8 @@ def crawl_calls_level(
|
|||
retry = 0
|
||||
|
||||
while len(calls_of_level) > 0:
|
||||
|
||||
make_multicall_result = []
|
||||
try:
|
||||
|
||||
call_chunk = calls_of_level[:batch_size]
|
||||
|
||||
logger.info(
|
||||
|
@ -240,7 +233,6 @@ def crawl_calls_level(
|
|||
# results parsing and writing to database
|
||||
add_to_session_count = 0
|
||||
for result in make_multicall_result:
|
||||
|
||||
db_view = view_call_to_label(blockchain_type, result)
|
||||
db_session.add(db_view)
|
||||
add_to_session_count += 1
|
||||
|
@ -322,7 +314,6 @@ def parse_jobs(
|
|||
|
||||
for input in method_abi["inputs"]:
|
||||
if type(input["value"]) in (str, int, list):
|
||||
|
||||
abi["inputs"].append(input)
|
||||
|
||||
elif type(input["value"]) == dict:
|
||||
|
@ -346,7 +337,6 @@ def parse_jobs(
|
|||
calls[level] = []
|
||||
calls[level].append(abi)
|
||||
else:
|
||||
|
||||
level = 0
|
||||
|
||||
if not calls.get(level):
|
||||
|
@ -374,7 +364,6 @@ def parse_jobs(
|
|||
interfaces = {}
|
||||
|
||||
for contract_address in contracts_ABIs:
|
||||
|
||||
# collect abis for each contract
|
||||
abis = []
|
||||
|
||||
|
@ -422,7 +411,6 @@ def parse_jobs(
|
|||
)
|
||||
|
||||
for level in call_tree_levels:
|
||||
|
||||
logger.info(f"Crawl level: {level}")
|
||||
logger.info(f"Jobs amount: {len(calls[level])}")
|
||||
|
||||
|
@ -445,7 +433,6 @@ def parse_jobs(
|
|||
|
||||
|
||||
def handle_crawl(args: argparse.Namespace) -> None:
|
||||
|
||||
"""
|
||||
Ability to track states of the contracts.
|
||||
|
||||
|
@ -497,7 +484,6 @@ def parse_abi(args: argparse.Namespace) -> None:
|
|||
|
||||
|
||||
def clean_labels_handler(args: argparse.Namespace) -> None:
|
||||
|
||||
blockchain_type = AvailableBlockchainType(args.blockchain)
|
||||
|
||||
web3_client = _retry_connect_web3(
|
||||
|
|
|
@ -16,7 +16,6 @@ def view_call_to_label(
|
|||
call: Dict[str, Any],
|
||||
label_name=VIEW_STATE_CRAWLER_LABEL,
|
||||
):
|
||||
|
||||
"""
|
||||
Creates a label model.
|
||||
|
||||
|
|
|
@ -55,7 +55,6 @@ def get_nonce(web3: Web3, address: ChecksumAddress) -> Nonce:
|
|||
def submit_transaction(
|
||||
web3: Web3, transaction: Union[TxParams, Any], signer_private_key: str
|
||||
) -> HexBytes:
|
||||
|
||||
"""
|
||||
Signs and submits json transaction to blockchain from the name of signer
|
||||
"""
|
||||
|
|
|
@ -96,7 +96,6 @@ def push_statistics(
|
|||
bucket: str,
|
||||
dashboard_id: Union[UUID, str],
|
||||
) -> None:
|
||||
|
||||
result_bytes = json.dumps(statistics_data).encode("utf-8")
|
||||
result_key = f'{MOONSTREAM_S3_SMARTCONTRACTS_ABI_PREFIX}/{blockchain_by_subscription_id[subscription.resource_data["subscription_type_id"]]}/contracts_data/{subscription.resource_data["address"]}/{dashboard_id}/v1/{timescale}.json'
|
||||
|
||||
|
@ -122,7 +121,6 @@ def generate_data(
|
|||
metric_type: str,
|
||||
crawler_label: str,
|
||||
):
|
||||
|
||||
label_model = get_label_model(blockchain_type)
|
||||
|
||||
# create empty time series
|
||||
|
@ -223,7 +221,6 @@ def generate_data(
|
|||
response_labels: Dict[Any, Any] = {}
|
||||
|
||||
for created_date, label, count in labels_time_series:
|
||||
|
||||
if not response_labels.get(label):
|
||||
response_labels[label] = []
|
||||
|
||||
|
@ -269,7 +266,6 @@ def get_unique_address(
|
|||
def get_blocks_state(
|
||||
db_session: Session, blockchain_type: AvailableBlockchainType
|
||||
) -> Dict[str, int]:
|
||||
|
||||
"""
|
||||
Generate meta information about
|
||||
"""
|
||||
|
@ -325,7 +321,6 @@ def get_blocks_state(
|
|||
def generate_list_of_names(
|
||||
type: str, subscription_filters: Dict[str, Any], read_abi: bool, abi_json: Any
|
||||
):
|
||||
|
||||
"""
|
||||
Generate list of names for select from database by name field
|
||||
"""
|
||||
|
@ -333,7 +328,6 @@ def generate_list_of_names(
|
|||
if read_abi:
|
||||
names = [item["name"] for item in abi_json if item["type"] == type]
|
||||
else:
|
||||
|
||||
names = [
|
||||
item["name"]
|
||||
for item in subscription_filters[abi_type_to_dashboards_type[type]]
|
||||
|
@ -356,7 +350,6 @@ def process_external_merged(
|
|||
result: Dict[str, Any] = {}
|
||||
|
||||
for external_call_hash, external_call in external_calls.items():
|
||||
|
||||
try:
|
||||
func_input_abi = []
|
||||
input_args = []
|
||||
|
@ -540,7 +533,6 @@ def generate_web3_metrics(
|
|||
# TODO: Remove it if ABI already have correct web3_call signature.
|
||||
|
||||
if "HatchStartedEvent" in events:
|
||||
|
||||
extention_data.append(
|
||||
{
|
||||
"display_name": "Number of hatches started.",
|
||||
|
@ -557,7 +549,6 @@ def generate_web3_metrics(
|
|||
)
|
||||
|
||||
if "HatchFinishedEvent" in events:
|
||||
|
||||
extention_data.append(
|
||||
{
|
||||
"display_name": "Number of hatches finished.",
|
||||
|
@ -584,7 +575,6 @@ def stats_generate_handler(args: argparse.Namespace):
|
|||
blockchain_type = AvailableBlockchainType(args.blockchain)
|
||||
|
||||
with yield_db_read_only_session_ctx() as db_session:
|
||||
|
||||
start_time = time.time()
|
||||
|
||||
dashboard_resources: BugoutResources = bc.list_resources(
|
||||
|
@ -599,7 +589,6 @@ def stats_generate_handler(args: argparse.Namespace):
|
|||
available_subscriptions: List[BugoutResource] = []
|
||||
|
||||
for subscription_type in subscription_ids_by_blockchain[args.blockchain]:
|
||||
|
||||
# Create subscriptions dict for get subscriptions by id.
|
||||
blockchain_subscriptions: BugoutResources = bc.list_resources(
|
||||
token=MOONSTREAM_ADMIN_ACCESS_TOKEN,
|
||||
|
@ -646,7 +635,6 @@ def stats_generate_handler(args: argparse.Namespace):
|
|||
address_dashboard_id_subscription_id_tree: Dict[str, Any] = {}
|
||||
|
||||
for dashboard in dashboard_resources.resources:
|
||||
|
||||
for dashboard_subscription_filters in dashboard.resource_data[
|
||||
"subscription_settings"
|
||||
]:
|
||||
|
@ -750,7 +738,6 @@ def stats_generate_handler(args: argparse.Namespace):
|
|||
]
|
||||
if len(external_calls) > 0:
|
||||
for external_call in external_calls:
|
||||
|
||||
# create external_call selectors.
|
||||
# display_name not included in hash
|
||||
external_call_without_display_name = {
|
||||
|
@ -816,7 +803,6 @@ def stats_generate_handler(args: argparse.Namespace):
|
|||
)
|
||||
|
||||
for address in address_dashboard_id_subscription_id_tree.keys():
|
||||
|
||||
current_blocks_state = get_blocks_state(
|
||||
db_session=db_session, blockchain_type=blockchain_type
|
||||
)
|
||||
|
@ -868,15 +854,12 @@ def stats_generate_handler(args: argparse.Namespace):
|
|||
for dashboard_id in address_dashboard_id_subscription_id_tree[
|
||||
address
|
||||
]: # Dashboards loop for address
|
||||
|
||||
for (
|
||||
subscription_id
|
||||
) in address_dashboard_id_subscription_id_tree[address][
|
||||
dashboard_id
|
||||
]:
|
||||
|
||||
try:
|
||||
|
||||
extention_data = []
|
||||
|
||||
s3_subscription_data_object: Dict[str, Any] = {}
|
||||
|
@ -892,9 +875,7 @@ def stats_generate_handler(args: argparse.Namespace):
|
|||
) in merged_external_calls[dashboard_id][
|
||||
subscription_id
|
||||
].items():
|
||||
|
||||
if external_call_hash in external_calls_results:
|
||||
|
||||
extention_data.append(
|
||||
{
|
||||
"display_name": display_name,
|
||||
|
@ -995,7 +976,6 @@ def stats_generate_api_task(
|
|||
"""
|
||||
|
||||
with yield_db_read_only_session_ctx() as db_session:
|
||||
|
||||
logger.info(f"Amount of blockchain subscriptions: {len(subscription_by_id)}")
|
||||
|
||||
s3_client = boto3.client("s3")
|
||||
|
@ -1003,9 +983,7 @@ def stats_generate_api_task(
|
|||
for dashboard_subscription_filters in dashboard.resource_data[
|
||||
"subscription_settings"
|
||||
]:
|
||||
|
||||
try:
|
||||
|
||||
subscription_id = dashboard_subscription_filters["subscription_id"]
|
||||
|
||||
blockchain_type = AvailableBlockchainType(
|
||||
|
@ -1029,13 +1007,11 @@ def stats_generate_api_task(
|
|||
|
||||
# Read required events, functions and web3_call form ABI
|
||||
if not subscription_by_id[subscription_id].resource_data["abi"]:
|
||||
|
||||
methods = []
|
||||
events = []
|
||||
abi_json = {}
|
||||
|
||||
else:
|
||||
|
||||
bucket = subscription_by_id[subscription_id].resource_data["bucket"]
|
||||
key = subscription_by_id[subscription_id].resource_data["s3_path"]
|
||||
abi = s3_client.get_object(
|
||||
|
@ -1075,7 +1051,6 @@ def stats_generate_api_task(
|
|||
)
|
||||
|
||||
for timescale in timescales:
|
||||
|
||||
start_date = (
|
||||
datetime.utcnow() - timescales_delta[timescale]["timedelta"]
|
||||
)
|
||||
|
|
|
@ -32,7 +32,6 @@ class QueryNotValid(Exception):
|
|||
|
||||
|
||||
def push_statistics(s3: Any, data: Any, key: str, bucket: str) -> None:
|
||||
|
||||
s3.put_object(
|
||||
Body=data,
|
||||
Bucket=bucket,
|
||||
|
@ -55,7 +54,6 @@ def query_validation(query: str) -> str:
|
|||
|
||||
|
||||
def to_json_types(value):
|
||||
|
||||
if isinstance(value, (str, int, tuple, list, dict)):
|
||||
return value
|
||||
elif isinstance(value, set):
|
||||
|
@ -65,7 +63,6 @@ def to_json_types(value):
|
|||
|
||||
|
||||
def from_json_types(value):
|
||||
|
||||
if isinstance(value, (str, int, tuple, dict)):
|
||||
return value
|
||||
elif isinstance(value, list): # psycopg2 issue with list support
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import React, { useContext } from "react";
|
||||
import { Container, Heading } from "@chakra-ui/react";
|
||||
import { Container } from "@chakra-ui/react";
|
||||
import RouteButton from "../../src/components/RouteButton";
|
||||
import { getLayout, getLayoutProps } from "../../src/layouts/WideInfoPage";
|
||||
import { AWS_ASSETS_PATH } from "../../src/core/constants";
|
||||
|
@ -8,10 +8,10 @@ import UIContext from "../../src/core/providers/UIProvider/context";
|
|||
import AnalyticsContext from "../../src/core/providers/AnalyticsProvider/context";
|
||||
|
||||
const assets = {
|
||||
cryptoTraders: `${AWS_ASSETS_PATH}/crypto+traders.png`,
|
||||
lender: `${AWS_ASSETS_PATH}/lender.png`,
|
||||
DAO: `${AWS_ASSETS_PATH}/DAO .png`,
|
||||
NFT: `${AWS_ASSETS_PATH}/NFT.png`,
|
||||
airdrop: `${AWS_ASSETS_PATH}/airdrop.png`,
|
||||
openLootbox: `${AWS_ASSETS_PATH}/open-lootbox.png`,
|
||||
craftingRecipe: `${AWS_ASSETS_PATH}/crafting-recipe.png`,
|
||||
minigame: `${AWS_ASSETS_PATH}/minigame.png`,
|
||||
};
|
||||
|
||||
const Features = () => {
|
||||
|
@ -19,18 +19,10 @@ const Features = () => {
|
|||
const { buttonReport } = useContext(AnalyticsContext);
|
||||
|
||||
return (
|
||||
<Container
|
||||
id="container"
|
||||
maxW="container.xl"
|
||||
px={["10%", "10%", "7%", "0"]}
|
||||
mt="72px"
|
||||
>
|
||||
<Heading as="h1" hidden>
|
||||
Moonstream feautes
|
||||
</Heading>
|
||||
<Container id="container" maxW="1238" mt="142px" p="0px">
|
||||
{!ui.isMobileView && (
|
||||
<RouteButton
|
||||
variant="orangeAndBlue"
|
||||
variant="plainOrange"
|
||||
onClick={() => buttonReport("Learn More", "main")}
|
||||
href={"/discordleed"}
|
||||
isExternal
|
||||
|
@ -38,15 +30,16 @@ const Features = () => {
|
|||
fontSize={["md", "lg", "xl", "2xl", "3xl", "3xl"]}
|
||||
position="absolute"
|
||||
bottom="10px"
|
||||
right="5px"
|
||||
right="10px"
|
||||
>
|
||||
Learn More
|
||||
</RouteButton>
|
||||
)}
|
||||
<FeatureCard
|
||||
pt="0px"
|
||||
id="airdrops"
|
||||
headingText="Airdrops"
|
||||
image={assets["lender"]}
|
||||
image={assets["airdrop"]}
|
||||
cardOrder={1}
|
||||
isMobile={ui.isMobileView}
|
||||
onClick={() => buttonReport("Learn More", "airdrops")}
|
||||
|
@ -71,7 +64,7 @@ const Features = () => {
|
|||
<FeatureCard
|
||||
id="minigames"
|
||||
headingText="Minigames"
|
||||
image={assets["DAO"]}
|
||||
image={assets["minigame"]}
|
||||
cardOrder={-1}
|
||||
isMobile={ui.isMobileView}
|
||||
onClick={() => buttonReport("Learn More", "minigames")}
|
||||
|
@ -90,7 +83,7 @@ const Features = () => {
|
|||
<FeatureCard
|
||||
id="lootboxes"
|
||||
headingText="Lootboxes"
|
||||
image={assets["cryptoTraders"]}
|
||||
image={assets["openLootbox"]}
|
||||
cardOrder={1}
|
||||
isMobile={ui.isMobileView}
|
||||
onClick={() => buttonReport("Learn More", "lootboxes")}
|
||||
|
@ -109,9 +102,10 @@ const Features = () => {
|
|||
<FeatureCard
|
||||
id="crafting"
|
||||
headingText="Crafting"
|
||||
image={assets["NFT"]}
|
||||
image={assets["craftingRecipe"]}
|
||||
cardOrder={-1}
|
||||
isMobile={ui.isMobileView}
|
||||
pb="40px"
|
||||
onClick={() => buttonReport("Learn More", "crafting")}
|
||||
>
|
||||
<>
|
||||
|
|
|
@ -167,7 +167,7 @@ const Homepage = () => {
|
|||
align="center"
|
||||
justify="center"
|
||||
boxSize="full"
|
||||
pt={["130px", "152px"]}
|
||||
pt={["129px", "129px", "152px"]}
|
||||
pb={10}
|
||||
flexDir="column"
|
||||
>
|
||||
|
@ -180,15 +180,15 @@ const Homepage = () => {
|
|||
"landing"
|
||||
);
|
||||
}}
|
||||
mb="60px"
|
||||
mb={["40px", "40px", "60px"]}
|
||||
isExternal
|
||||
href="https://www.crypto-reporter.com/press-releases/moonstream-to-wins-techcrunch-pitch-off-earning-a-spot-at-disrupt-2023-39287/
|
||||
"
|
||||
>
|
||||
<ChakraImage
|
||||
src={assets.tech_crunch_winner}
|
||||
w="272px"
|
||||
h="59px"
|
||||
w={["213px", "213px", "272px"]}
|
||||
h={["49px", "49px", "59px"]}
|
||||
cursor="pointer"
|
||||
bg="#46C370"
|
||||
borderRadius="10px"
|
||||
|
|
|
@ -5,7 +5,7 @@ import { getLayout, getLayoutProps } from "../../src/layouts/WideInfoPage";
|
|||
|
||||
const PrivacyPolicy = () => (
|
||||
<Box mt="72px">
|
||||
<Box px="1.5rem" m="auto" mb={8} maxWidth="1199.98px" minHeight="60vh">
|
||||
<Box m="auto" mb={8} maxWidth="1238px" minHeight="60vh">
|
||||
<Heading my={8} as="h1">
|
||||
Privacy Policy for Moonstream
|
||||
</Heading>
|
||||
|
|
|
@ -48,10 +48,10 @@ const Team = () => {
|
|||
direction="column"
|
||||
alignItems="center"
|
||||
w="100%"
|
||||
maxW="1238"
|
||||
>
|
||||
<Stack mt="72px" mx={margin} maxW="1700px" w="100%">
|
||||
<Stack mt="142px" w="100%">
|
||||
<SimpleGrid
|
||||
px={12}
|
||||
alignItems="start"
|
||||
columns={{ base: 1, md: 2 }}
|
||||
mb={24}
|
||||
|
@ -85,19 +85,11 @@ const Team = () => {
|
|||
</Center>
|
||||
</SimpleGrid>
|
||||
</Stack>
|
||||
<Stack mx={margin} mb={6} mt={0} maxW="1700px" w="100%">
|
||||
<Heading
|
||||
as="h2"
|
||||
size="md"
|
||||
w="100%"
|
||||
px={12}
|
||||
pb={2}
|
||||
pt={0}
|
||||
borderTopRadius="xl"
|
||||
>
|
||||
<Stack mb={6} mt={0} w="100%">
|
||||
<Heading as="h2" size="md" w="100%" pb={2} pt={0} borderTopRadius="xl">
|
||||
Values that we share within our team:
|
||||
</Heading>
|
||||
<chakra.span pl={2} px={12} py={2}>
|
||||
<chakra.span pl={2} py={2}>
|
||||
<UnorderedList w="75%" pl={4}>
|
||||
<ListItem>
|
||||
<b>Be bold</b>
|
||||
|
@ -122,16 +114,15 @@ const Team = () => {
|
|||
</Text>
|
||||
</chakra.span>
|
||||
</Stack>
|
||||
<Stack mx={margin} mb={12} maxW="1700px" w="100%">
|
||||
<Heading as="h2" size="md" w="100%" px={12} py={2} borderTopRadius="xl">
|
||||
<Stack mb={12} w="100%">
|
||||
<Heading as="h2" size="md" w="100%" py={2} borderTopRadius="xl">
|
||||
Our engineering team
|
||||
</Heading>
|
||||
<Stack
|
||||
<Flex
|
||||
w="100%"
|
||||
direction={"row"}
|
||||
flexWrap="wrap"
|
||||
justifyContent="space-between"
|
||||
px={[3, 6, 12]}
|
||||
alignContent="left"
|
||||
>
|
||||
<TeamCard
|
||||
|
@ -173,18 +164,17 @@ const Team = () => {
|
|||
Enjoys soduku and its variants. Follows artificial intelligence scene for
|
||||
Chess and Go. Experiments with grilling recipes.`}
|
||||
/>
|
||||
</Stack>
|
||||
</Flex>
|
||||
</Stack>
|
||||
<Stack mx={margin} mb={12} maxW="1700px" w="100%">
|
||||
<Heading as="h2" size="md" w="100%" px={12} py={2} borderTopRadius="xl">
|
||||
<Stack mb={12} w="100%">
|
||||
<Heading as="h2" size="md" w="100%" py={2} borderTopRadius="xl">
|
||||
Our marketing and growth team
|
||||
</Heading>
|
||||
<Stack
|
||||
<Flex
|
||||
w="100%"
|
||||
direction={"row"}
|
||||
flexWrap="wrap"
|
||||
justifyContent="space-between"
|
||||
px={[3, 6, 12]}
|
||||
alignContent="left"
|
||||
>
|
||||
<TeamCard
|
||||
|
@ -220,7 +210,7 @@ const Team = () => {
|
|||
and ukulele. Loves meat, went from well done to blue
|
||||
rare in a few months.`}
|
||||
/>
|
||||
</Stack>
|
||||
</Flex>
|
||||
</Stack>
|
||||
</Flex>
|
||||
);
|
||||
|
|
|
@ -6,7 +6,7 @@ import { getLayout, getLayoutProps } from "../../src/layouts/WideInfoPage";
|
|||
|
||||
const TermsOfService = () => (
|
||||
<Box mt="72px">
|
||||
<Box px="1.5rem" m="auto" mb={8} maxWidth="1199.98px" minHeight="60vh">
|
||||
<Box m="auto" mb={8} maxWidth="1238" minHeight="60vh">
|
||||
<Heading textAlign="start" my={8} as="h1">
|
||||
Moonstream Terms of Service
|
||||
</Heading>
|
||||
|
|
|
@ -1,23 +1,24 @@
|
|||
import React from "react";
|
||||
import { VStack, Link, Heading, Icon } from "@chakra-ui/react";
|
||||
import { Flex, Heading } from "@chakra-ui/react";
|
||||
import { getLayout, getLayoutProps } from "../src/layouts/InfoPageLayout";
|
||||
import { MdPictureAsPdf } from "react-icons/md";
|
||||
import WhitepaperCard from "../src/components/molecules/WhitepaperCard";
|
||||
import { AWS_ASSETS_PATH } from "../src/core/constants";
|
||||
|
||||
const Papers = () => {
|
||||
return (
|
||||
<VStack>
|
||||
<Heading pb={12} pt="72px">
|
||||
<Flex direction="column" px="7%" width="100%" alignItems="center" pb="40px">
|
||||
<Heading pb={["40px", "40px", "60px"]} pt={["122px", "122px", "142px"]}>
|
||||
Whitepapers
|
||||
</Heading>
|
||||
<Link
|
||||
color="orange.1000"
|
||||
<WhitepaperCard
|
||||
maxW={["340px", "340px", "890px"]}
|
||||
href="https://github.com/bugout-dev/moonstream/blob/main/datasets/nfts/papers/ethereum-nfts.pdf"
|
||||
>
|
||||
An analysis of 7,020,950 NFT transactions on the Ethereum blockchain -
|
||||
October 22, 2021
|
||||
<Icon as={MdPictureAsPdf} color="red" display="inline-block" />
|
||||
</Link>
|
||||
</VStack>
|
||||
img={`${AWS_ASSETS_PATH}/nft_market_analysis_i.png`}
|
||||
title="An analysis of 7,020,950 NFT transactions on the Ethereum blockchain"
|
||||
date="October 22, 2021"
|
||||
text="We present the Ethereum NFTs dataset, a representation of the activity on the Ethereum non-fungible token (NFT) market between April 1, 2021 and September 25, 2021, constructed purely from on-chain data. This dataset consists of all 7 020 950 token mints and transfers across 727 102 accounts between block 12 150 245 and block 13 296 011."
|
||||
/>
|
||||
</Flex>
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
@ -187,6 +187,7 @@ const variantPlainOrange = () => {
|
|||
padding: "10px 30px",
|
||||
_hover: {
|
||||
backgroundColor: "#F4532F",
|
||||
textDecoration: "none",
|
||||
},
|
||||
_focus: {
|
||||
backgroundColor: "#F4532F",
|
||||
|
|
|
@ -27,8 +27,11 @@ const AccountIconButton = (props) => {
|
|||
colorScheme="inherit"
|
||||
as={IconButton}
|
||||
aria-label="Account menu"
|
||||
icon={<RiAccountCircleLine m={0} size="26px" />}
|
||||
icon={<RiAccountCircleLine size="26px" />}
|
||||
color="gray.100"
|
||||
h="26px"
|
||||
minW="26px"
|
||||
m="0px"
|
||||
/>
|
||||
<Portal>
|
||||
<MenuList
|
||||
|
|
|
@ -88,8 +88,8 @@ const Footer = () => {
|
|||
{!ui.isMobileView && (
|
||||
<>
|
||||
<Flex justifyContent="start">
|
||||
<Link href="//privacy-policy">Privacy policy</Link>
|
||||
<Link href="//tos" ml="20px">
|
||||
<Link href="/privacy-policy">Privacy policy</Link>
|
||||
<Link href="/tos" ml="20px">
|
||||
Terms of Service
|
||||
</Link>
|
||||
</Flex>
|
||||
|
|
|
@ -13,7 +13,6 @@ import {
|
|||
MenuItem,
|
||||
Portal,
|
||||
Text,
|
||||
Box,
|
||||
} from "@chakra-ui/react";
|
||||
|
||||
import { PAGETYPE, SITEMAP, PRIMARY_MOON_LOGO_URL } from "../core/constants";
|
||||
|
@ -22,6 +21,7 @@ import useModals from "../core/hooks/useModals";
|
|||
import UIContext from "../core/providers/UIProvider/context";
|
||||
import PlainButton from "./atoms/PlainButton";
|
||||
import ChakraAccountIconButton from "./AccountIconButton";
|
||||
import router from "next/router";
|
||||
|
||||
const LandingBarMobile = () => {
|
||||
const ui = useContext(UIContext);
|
||||
|
@ -32,14 +32,9 @@ const LandingBarMobile = () => {
|
|||
direction="column"
|
||||
width={"100%"}
|
||||
justifyContent={ui.isLoggedIn ? "center" : "space-between"}
|
||||
p="12px 7% 10px 7%"
|
||||
p="12px 7% 0px 7%"
|
||||
>
|
||||
<Flex
|
||||
width={"100%"}
|
||||
alignItems="center"
|
||||
flex="flex: 0 0 100%"
|
||||
mt={ui.isLoggedIn ? "0px" : "12px"}
|
||||
>
|
||||
<Flex width={"100%"} alignItems="center" flex="flex: 0 0 100%" mb="12px">
|
||||
<RouterLink href="/" passHref>
|
||||
<Link
|
||||
as={Image}
|
||||
|
@ -51,70 +46,62 @@ const LandingBarMobile = () => {
|
|||
/>
|
||||
</RouterLink>
|
||||
<Spacer />
|
||||
|
||||
{!ui.isLoggedIn && (
|
||||
<PlainButton
|
||||
style={{
|
||||
marginRight: "12px",
|
||||
fontSize: "14px",
|
||||
padding: "2px 10px",
|
||||
}}
|
||||
onClick={() => toggleModal({ type: MODAL_TYPES.SIGNUP })}
|
||||
>
|
||||
Sign up
|
||||
</PlainButton>
|
||||
)}
|
||||
{!ui.isLoggedIn && (
|
||||
<Text
|
||||
color="white"
|
||||
bg="transparent"
|
||||
onClick={() => toggleModal({ type: MODAL_TYPES.LOGIN })}
|
||||
fontWeight="400"
|
||||
p="0px"
|
||||
m="0px"
|
||||
_focus={{ backgroundColor: "transparent" }}
|
||||
_hover={{ backgroundColor: "transparent" }}
|
||||
>
|
||||
Log in
|
||||
</Text>
|
||||
)}
|
||||
{ui.isLoggedIn && (
|
||||
<RouterLink href="/welcome" passHref>
|
||||
<Box
|
||||
bg="orange.1000"
|
||||
alignSelf={"center"}
|
||||
as={Link}
|
||||
<Flex gap="12px" h="26px">
|
||||
<Text
|
||||
color="white"
|
||||
size="sm"
|
||||
fontWeight="700"
|
||||
borderRadius="15px"
|
||||
w="47px"
|
||||
h="25px"
|
||||
textAlign="center"
|
||||
fontSize="14px"
|
||||
bg="transparent"
|
||||
onClick={() => toggleModal({ type: MODAL_TYPES.LOGIN })}
|
||||
fontWeight="400"
|
||||
p="0px"
|
||||
m="0px"
|
||||
_focus={{ backgroundColor: "transparent" }}
|
||||
_hover={{ backgroundColor: "transparent" }}
|
||||
>
|
||||
<Text lineHeight="25px">App</Text>
|
||||
</Box>
|
||||
</RouterLink>
|
||||
Log in
|
||||
</Text>
|
||||
<PlainButton
|
||||
style={{
|
||||
fontSize: "14px",
|
||||
padding: "2px 10px",
|
||||
}}
|
||||
onClick={() => toggleModal({ type: MODAL_TYPES.SIGNUP })}
|
||||
>
|
||||
Sign up
|
||||
</PlainButton>
|
||||
</Flex>
|
||||
)}
|
||||
{ui.isLoggedIn && ui.isMobileView && (
|
||||
<>
|
||||
|
||||
{ui.isLoggedIn && (
|
||||
<Flex gap="12px">
|
||||
<PlainButton
|
||||
style={{
|
||||
fontSize: "14px",
|
||||
padding: "2px 10px",
|
||||
}}
|
||||
onClick={() => router.push("/welcome")}
|
||||
>
|
||||
App
|
||||
</PlainButton>
|
||||
|
||||
<ChakraAccountIconButton variant="link" colorScheme="orange" />
|
||||
</>
|
||||
</Flex>
|
||||
)}
|
||||
</Flex>
|
||||
<ButtonGroup
|
||||
justifyContent="center"
|
||||
w="100%"
|
||||
variant="link"
|
||||
// spacing={4}
|
||||
// flexGrow={0.5}
|
||||
gap="20px"
|
||||
py="10px"
|
||||
>
|
||||
{SITEMAP.map((item, idx) => {
|
||||
return (
|
||||
<React.Fragment key={`Fragment-${idx}`}>
|
||||
{item.type !== PAGETYPE.FOOTER_CATEGORY && item.children && (
|
||||
<Menu>
|
||||
<MenuButton variant="mobile" m="0px" p="0px" as={Button}>
|
||||
<MenuButton color="white" m="0px" p="0px" as={Button}>
|
||||
{item.title}
|
||||
</MenuButton>
|
||||
<Portal>
|
||||
|
|
|
@ -48,7 +48,12 @@ const LandingNavbar = () => {
|
|||
/>
|
||||
</RouterLink>
|
||||
</Flex>
|
||||
<ButtonGroup variant="link" spacing={4}>
|
||||
<ButtonGroup
|
||||
variant="link"
|
||||
spacing={4}
|
||||
width="100%"
|
||||
justifyContent="center"
|
||||
>
|
||||
{SITEMAP.map((item, idx) => {
|
||||
return (
|
||||
<React.Fragment key={`Fragment-${idx}`}>
|
||||
|
@ -124,8 +129,8 @@ const LandingNavbar = () => {
|
|||
);
|
||||
})}
|
||||
</ButtonGroup>
|
||||
<ButtonGroup variant="link" spacing={4} minW="160px">
|
||||
{ui.isLoggedIn && (
|
||||
{ui.isLoggedIn && (
|
||||
<Flex gap="20px">
|
||||
<RouterLink href="/welcome" passHref>
|
||||
<Box
|
||||
bg="orange.1000"
|
||||
|
@ -146,36 +151,43 @@ const LandingNavbar = () => {
|
|||
</Text>
|
||||
</Box>
|
||||
</RouterLink>
|
||||
)}
|
||||
{!ui.isLoggedIn && (
|
||||
<ChakraAccountIconButton
|
||||
variant="link"
|
||||
colorScheme="orange"
|
||||
h="32px"
|
||||
/>
|
||||
</Flex>
|
||||
)}
|
||||
|
||||
{!ui.isLoggedIn && (
|
||||
<Flex gap="20px" alignItems="center">
|
||||
<Text
|
||||
color="white"
|
||||
cursor="pointer"
|
||||
onClick={() => toggleModal({ type: MODAL_TYPES.LOGIN })}
|
||||
fontWeight="400"
|
||||
_hover={{ textDecoration: "underline" }}
|
||||
>
|
||||
Log in
|
||||
</Text>
|
||||
<Button
|
||||
bg="orange.1000"
|
||||
variant="solid"
|
||||
variant="plainOrange"
|
||||
borderRadius="15px"
|
||||
p="5px 10px"
|
||||
fontSize="16px"
|
||||
m="0px"
|
||||
h="32px"
|
||||
onClick={() => toggleModal({ type: MODAL_TYPES.SIGNUP })}
|
||||
size="sm"
|
||||
fontWeight="700"
|
||||
borderRadius="2xl"
|
||||
textColor="white"
|
||||
_hover={{
|
||||
backgroundColor: "#F4532F",
|
||||
}}
|
||||
>
|
||||
Sign up
|
||||
Sign up
|
||||
</Button>
|
||||
)}
|
||||
{!ui.isLoggedIn && (
|
||||
<Button
|
||||
color="white"
|
||||
onClick={() => toggleModal({ type: MODAL_TYPES.LOGIN })}
|
||||
fontWeight="400"
|
||||
>
|
||||
Log in
|
||||
</Button>
|
||||
)}
|
||||
{ui.isLoggedIn && (
|
||||
<ChakraAccountIconButton variant="link" colorScheme="orange" />
|
||||
)}
|
||||
</ButtonGroup>
|
||||
</Flex>
|
||||
)}
|
||||
</Flex>
|
||||
)}
|
||||
</>
|
||||
|
|
|
@ -15,8 +15,8 @@ const Navbar = () => {
|
|||
zIndex={1}
|
||||
alignItems="center"
|
||||
id="Navbar"
|
||||
minH={isMobileView && !isAppView ? "72px" : "62px"}
|
||||
maxH={isMobileView && !isAppView ? "72px" : "62px"}
|
||||
minH={isMobileView && !isAppView ? "89px" : "62px"}
|
||||
maxH={isMobileView && !isAppView ? "89px" : "62px"}
|
||||
bgColor={BACKGROUND_COLOR}
|
||||
borderBottom="1px solid white"
|
||||
direction="row"
|
||||
|
|
|
@ -22,7 +22,7 @@ export default function SocialProfileSimple({
|
|||
}) {
|
||||
const badgeBg = useColorModeValue("gray.50", "gray.800");
|
||||
return (
|
||||
<Center py={6} ml={2}>
|
||||
<Center py={6}>
|
||||
<Box
|
||||
maxW={"320px"}
|
||||
h="420px"
|
||||
|
|
|
@ -0,0 +1,63 @@
|
|||
import React from "react";
|
||||
import { Flex, Image, Text } from "@chakra-ui/react";
|
||||
|
||||
const WhitepaperCard = ({ img, title, date = "", text, href, ...props }) => {
|
||||
return (
|
||||
<Flex
|
||||
direction={["column", "column", "row"]}
|
||||
alignItems={["center", "center", "start"]}
|
||||
p="20px"
|
||||
bg="#353535"
|
||||
borderRadius="20px"
|
||||
gap="20px"
|
||||
{...props}
|
||||
>
|
||||
<Image
|
||||
src={img}
|
||||
w={["290px", "290px", "200px"]}
|
||||
h={["290px", "290px", "200px"]}
|
||||
borderRadius={["10px", "10px", "20px"]}
|
||||
cursor="pointer"
|
||||
onClick={() => {
|
||||
window.open(href);
|
||||
}}
|
||||
/>
|
||||
<Flex direction="column" gap="20px">
|
||||
<Text
|
||||
fontSize={["24px", "24px", "24px"]}
|
||||
fontWeight="700"
|
||||
maxW="500px"
|
||||
lineHeight="120%"
|
||||
>
|
||||
{title}
|
||||
</Text>
|
||||
<Flex direction="column" gap={["5px", "5px", "10px"]}>
|
||||
{date && (
|
||||
<Text fontSize={["14px", "14px", "16px"]} lineHeight="20px">
|
||||
{date}
|
||||
</Text>
|
||||
)}
|
||||
<Text fontSize={["16px", "16px", "18px"]} lineHeight="23px">
|
||||
{text}
|
||||
</Text>
|
||||
<Text
|
||||
href={href}
|
||||
maxW="fit-content"
|
||||
color="orange.1000"
|
||||
cursor="pointer"
|
||||
fontSize={["16px", "16px", "18px"]}
|
||||
fontWeight="700"
|
||||
_hover={{ color: "#F4532F" }}
|
||||
onClick={() => {
|
||||
window.open(href);
|
||||
}}
|
||||
>
|
||||
Read more
|
||||
</Text>
|
||||
</Flex>
|
||||
</Flex>
|
||||
</Flex>
|
||||
);
|
||||
};
|
||||
|
||||
export default WhitepaperCard;
|
|
@ -1,5 +1,5 @@
|
|||
import React, { useContext } from "react";
|
||||
import { Flex, Stack } from "@chakra-ui/react";
|
||||
import { Flex } from "@chakra-ui/react";
|
||||
import UIContext from "../core/providers/UIProvider/context";
|
||||
import { DEFAULT_METATAGS, BACKGROUND_COLOR } from "../core/constants";
|
||||
import { getLayout as getSiteLayout } from "./index";
|
||||
|
@ -7,7 +7,6 @@ import { getLayout as getSiteLayout } from "./index";
|
|||
const InfoPageLayout = ({ children }) => {
|
||||
const ui = useContext(UIContext);
|
||||
|
||||
const margin = ui.isMobileView ? "6%" : "22%";
|
||||
return (
|
||||
<Flex
|
||||
bgPos="bottom"
|
||||
|
@ -18,9 +17,7 @@ const InfoPageLayout = ({ children }) => {
|
|||
alignItems="center"
|
||||
w="100%"
|
||||
>
|
||||
<Stack mx={margin} my={[4, 6, 12]} maxW="1700px" textAlign="justify">
|
||||
{children}
|
||||
</Stack>
|
||||
{children}
|
||||
</Flex>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import React from "react";
|
||||
import { Flex, Stack } from "@chakra-ui/react";
|
||||
import { Flex } from "@chakra-ui/react";
|
||||
import { DEFAULT_METATAGS, BACKGROUND_COLOR } from "../core/constants";
|
||||
import { getLayout as getSiteLayout } from "./index";
|
||||
|
||||
|
@ -14,16 +14,9 @@ const InfoPageLayout = ({ children }) => {
|
|||
direction="column"
|
||||
alignItems="center"
|
||||
w="100%"
|
||||
px="7%"
|
||||
>
|
||||
<Stack
|
||||
mx={margin}
|
||||
my={[4, 6, 12]}
|
||||
maxW="1700px"
|
||||
textAlign="justify"
|
||||
minH={"100vh"}
|
||||
>
|
||||
{children}
|
||||
</Stack>
|
||||
{children}
|
||||
</Flex>
|
||||
);
|
||||
};
|
||||
|
|
Ładowanie…
Reference in New Issue