Porównaj commity

...

1206 Commity

Autor SHA1 Wiadomość Data
Andrey Dolgolev 263ee77d22
Merge pull request #1081 from moonstream-to/add-address-selector-index
Add address selector index.
2024-06-06 13:25:24 +03:00
Andrey c9319cdbeb Fix duplicates. 2024-06-06 13:17:35 +03:00
Andrey 0f61a486bc Added indexes on another tables. 2024-06-06 13:04:51 +03:00
Andrey 1ab1a9cc38 Add address selector index. 2024-06-06 12:53:00 +03:00
Andrey Dolgolev cd7ab58ec1
Merge pull request #1079 from moonstream-to/fix-env
Change env name.
2024-06-03 22:33:19 +03:00
kompotkot a7712e405d Usage of regular db v3 and indexes too 2024-06-03 19:25:26 +00:00
Andrey 7de295bf0d Change env name. 2024-06-03 22:17:57 +03:00
Sergei Sumarokov 565e24231e
Merge pull request #1074 from moonstream-to/mdb-v3-ext-chains
Game7 Orbit, Arbitrum, Xai and Mantle blockchain mdb v3 models
2024-06-03 17:57:20 +03:00
kompotkot 34aba694c4 Updated version number 2024-06-03 14:56:44 +00:00
Sergei Sumarokov a1e3bb44fe
Merge pull request #1078 from moonstream-to/eng-chain-bn
Chain ID is big int
2024-06-03 10:37:27 +03:00
kompotkot b67e0eb908 Chain ID is big int 2024-06-03 07:34:50 +00:00
Andrey Dolgolev 7962bc1f90
Merge pull request #1075 from moonstream-to/add-historical-xai
Add Xai historical crawl.
2024-05-30 19:03:47 +03:00
Andrey 3a2c01f47b Add Xai historical crawl. 2024-05-30 16:17:10 +03:00
kompotkot 0d955a56c3 Game7 Orbit, Arbitrum, Xai and Mantle blockchain mdb v3 models 2024-05-29 13:21:31 +00:00
Andrey Dolgolev 62adb3becd
Merge pull request #1073 from moonstream-to/add-feeds-cu
Add new feeds.
2024-05-28 22:42:07 +03:00
Andrey 436ce38640 Add new feeds. 2024-05-28 20:59:41 +03:00
Andrey Dolgolev 6f29d15d07
Merge pull request #1070 from moonstream-to/alembic-indexes
Alembic for indexes
2024-05-28 16:59:18 +03:00
kompotkot 87985fd51e Black and isort fixes 2024-05-28 13:57:33 +00:00
Andrey 37c5b6e4cf Merge branch 'alembic-indexes' of github.com:moonstream-to/api into alembic-indexes 2024-05-28 16:53:12 +03:00
Andrey fa0b626683 Add missing jobs table. 2024-05-28 16:52:31 +03:00
kompotkot ead383414f Merge branch 'main' into alembic-indexes 2024-05-24 16:16:36 +00:00
Sergei Sumarokov 3634763d81
Merge pull request #1072 from moonstream-to/fix-scm-nix-commit
Fix scm nix commit rev
2024-05-24 19:16:11 +03:00
kompotkot a741ad720d Fix scm nix commit rev 2024-05-24 16:15:45 +00:00
kompotkot 6695a3b353 Merge branch 'main' into alembic-indexes 2024-05-24 16:01:16 +00:00
Sergei Sumarokov e27476ac53
Merge pull request #1071 from moonstream-to/mdbv3-scm
Initial scm for moonstreamdb-v3
2024-05-24 19:00:26 +03:00
kompotkot 12dc59ee9b Initial scm for moonstreamdb-v3 2024-05-24 15:59:35 +00:00
kompotkot 7faa533046 Pushed scm nix for mdb v3 2024-05-24 12:33:58 +00:00
Andrey d45333dc0e Delete old migration. 2024-05-23 18:01:39 +03:00
Andrey 776a97a8f2 Add nullable type for transactions. 2024-05-23 17:54:55 +03:00
Andrey abcdc9f7ed Rename 2024-05-23 17:16:48 +03:00
Andrey 19944c124f Add initial version of v3 index db structure. 2024-05-23 17:15:27 +03:00
kompotkot 7e346cc2ce Alembic for indexes 2024-05-22 11:58:26 +00:00
Andrey Dolgolev c35b88d25d
Merge pull request #1068 from moonstream-to/add-unique-indexes
Add uniqiue indexes for tx_call/event under seer label.
2024-05-20 12:27:48 +03:00
Andrey 95aec6bece Remove unrelated indexes. 2024-05-20 12:20:32 +03:00
Andrey 568250396d Shorter index names. 2024-05-20 12:06:26 +03:00
Andrey 54c83a371a Add uniqiue indexes for tx_call/event under seer label. 2024-05-18 13:04:12 +03:00
Andrey Dolgolev 1d4ef733c8
Merge pull request #1067 from moonstream-to/metadata-crawler-headers
Add headers.
2024-05-13 16:49:40 +03:00
Andrey 348d115819 Add headers. 2024-05-13 16:20:20 +03:00
Sergei Sumarokov 7db8b88a2f
Merge pull request #1064 from moonstream-to/arb-one-v3-migration
Arbitrum One for moonstreamdb v3 models
2024-05-13 15:31:57 +03:00
Andrey Dolgolev da2da94b55
Merge pull request #1066 from moonstream-to/add-surf-new-task
Add state task.
2024-05-11 12:32:25 +03:00
Andrey 18e650d233 Add changes. 2024-05-10 23:41:11 +03:00
kompotkot 27e9a2242f Arbitrum One for moonstreamdb v3 models 2024-05-10 10:40:20 +00:00
Sergei Sumarokov e2fb5b10e5
Merge pull request #1062 from moonstream-to/verify-call-requests-post
Verify if requests exists before push new list
2024-05-07 19:16:42 +03:00
Andrey Dolgolev 3e813a21bc
Merge pull request #1063 from moonstream-to/add-arbitrum-one
Add arbitrum one
2024-05-07 12:06:40 +03:00
Andrey 2c71082895 Merge branch 'add-arbitrum-one' of github.com:moonstream-to/api into add-arbitrum-one 2024-05-06 02:56:14 +03:00
kompotkot daf47028a4 Fix typo 2024-05-07 05:40:33 +00:00
kompotkot 15567735c9 Updated with arbitrum one env.py for migration 2024-05-07 05:30:00 +00:00
kompotkot 516e507123 Common deployment script for crawlers with arbitrum one 2024-05-07 05:25:02 +00:00
Andrey af1ad369a9 Add migration script. 2024-05-06 02:48:22 +03:00
Andrey 819e0b18b2 Add deploy scripts. 2024-05-05 23:54:49 +03:00
Andrey 63383a40e2 Add Arbitrum one. 2024-05-05 20:30:18 +03:00
kompotkot 9a31d145e0 Check metatx endpoint for duplicates 2024-05-02 16:51:49 +00:00
kompotkot f6e541edab Fix for data name which conflicts with import 2024-05-01 10:23:03 +00:00
kompotkot e1c62d9932 List of existing requests check moved to its own route 2024-05-01 10:20:25 +00:00
kompotkot 12345e42a3 Checksum address and check contract owner 2024-04-30 12:13:05 +00:00
kompotkot e700efff5b Verify if requests exists before push new list 2024-04-30 11:02:40 +00:00
Andrey Dolgolev 135af1765c
Merge pull request #1061 from moonstream-to/zksync-label-data-name-index
Add zksync address label_data name index
2024-04-29 16:41:09 +03:00
Andrey 6874ff62f4 Bump version. 2024-04-29 16:38:17 +03:00
Andrey 8506995513 Add migration. 2024-04-29 15:30:18 +03:00
Sergei Sumarokov 2caaa82953
Merge pull request #1059 from moonstream-to/mdbv3-new-b-db-engine-imprv
New blockchains, improvements for db engine class
2024-04-25 12:33:18 +03:00
Sergei Sumarokov 3299380916
Merge pull request #1060 from moonstream-to/ro-get-leaderboards
Leaderboards endpoint uses RO db connection
2024-04-23 16:37:19 +03:00
kompotkot 03a6601ded Leaderboards endpoint uses RO db connection 2024-04-23 13:31:31 +00:00
kompotkot 1bb23eeda4 New blockchains, improvements for db engine class 2024-04-22 09:39:19 +00:00
Sergei Sumarokov 262ea4c792
Merge pull request #1058 from moonstream-to/fix-name-apex
Fix typo for crawler monitoring
2024-04-17 16:07:54 +03:00
kompotkot a6ba053f10 Fix typo for crawler monitoring 2024-04-17 13:07:14 +00:00
Andrey Dolgolev f3a3601a88
Merge pull request #1057 from moonstream-to/add-arbitrum-apex
Add arbitrum apex
2024-04-17 15:49:56 +03:00
kompotkot f6bc86f082 Split deploy for apex and removed mumbai 2024-04-17 12:44:44 +00:00
Andrey 3eb0301304 Add multicall. 2024-04-17 04:41:35 +03:00
Andrey a74d5ce76c Add changes. 2024-04-17 04:39:12 +03:00
Andrey a31ce2c588 add blockchain. 2024-04-17 04:27:28 +03:00
Andrey 0854656a6e Add monitoring -service 2024-04-17 04:23:00 +03:00
Andrey 3721ec9f6f Merge branch 'main' into add-arbitrum-apex 2024-04-17 04:20:04 +03:00
Andrey 3bd8a68bd7 Add migration file. 2024-04-17 04:14:36 +03:00
Andrey c42d8ccd10 Add deploy changes. 2024-04-17 03:48:18 +03:00
Andrey a15b2f94ed Fix Networks mapping. 2024-04-17 03:33:44 +03:00
Andrey ce628b6e0b Add crawlers and api. 2024-04-17 03:08:54 +03:00
Andrey 44764abdaa Added deploy scripts. 2024-04-17 02:48:04 +03:00
Andrey c64eec10f6 Add migration swith from proof_of_play to proofofplay. 2024-04-17 02:38:04 +03:00
Andrey 911f7e7ebe Update db module. 2024-04-16 00:04:05 +03:00
Sergei Sumarokov 3cab309c42
Merge pull request #1056 from moonstream-to/fix-arb-sepoila-engine
Fixed typo for arbitrum sepolia
2024-04-15 20:51:07 +03:00
kompotkot 8d1f5f4b4c Fixed typo for arbitrum sepolia 2024-04-15 17:49:59 +00:00
Sergei Sumarokov f5ff9427fe
Merge pull request #1055 from moonstream-to/metatx-new-blockchains
Extended blockchains list for engineapi
2024-04-15 20:39:47 +03:00
kompotkot 9a5bc824c4 Extended blockchains list for engineapi 2024-04-15 17:33:37 +00:00
Sergei Sumarokov 41787fafaa
Merge pull request #1054 from moonstream-to/fix-checkenv-limit
Fix for checkenv limit
2024-04-15 14:16:05 +03:00
kompotkot e5f324b841 Fix for checkenv limit 2024-04-15 11:15:16 +00:00
Sergei Sumarokov 1d0fcda13c
Merge pull request #1053 from moonstream-to/amoy-blockchain
Amoy blockchain support
2024-04-15 14:02:33 +03:00
kompotkot bf653b3202 Amoy deployment and actual monitoring for moonworm crawlers 2024-04-15 08:32:27 +00:00
kompotkot 8a556b0b1f Amoy blockchain migration 2024-04-15 08:07:09 +00:00
kompotkot 6a773965b2 Amoy blockchain and subscriptions moved to mdb package 2024-04-15 08:05:54 +00:00
kompotkot 525abb8a5f Amoy for mooncrawl 2024-04-15 08:05:26 +00:00
kompotkot 3d81cb79fc Amoy for moonstreamapi 2024-04-15 08:04:44 +00:00
Sergei Sumarokov 50d7c826be
Merge pull request #1052 from moonstream-to/fix-mdbv3-init
Fix with init package installation
2024-04-11 15:26:28 +03:00
kompotkot ece119afdd Fix with init package installation 2024-04-11 12:16:20 +00:00
Sergei Sumarokov 13054433da
Merge pull request #1051 from moonstream-to/fix-checenv-restriction
Fix checkenv restriction
2024-04-10 17:31:55 +03:00
kompotkot 9bb392dc0b Lost moonstream package added 2024-04-10 14:31:22 +00:00
kompotkot df3365167a Fix checkenv restriction 2024-04-10 14:24:07 +00:00
Sergei Sumarokov becb5b8843
Merge pull request #1050 from moonstream-to/mapi-new-blockchains
Updated blockchains support list
2024-04-10 17:08:52 +03:00
kompotkot c4e313e15c Added lost variables for blockchains 2024-04-10 13:06:47 +00:00
kompotkot 2221b45bc9 Updated blockchains support list 2024-04-10 12:39:19 +00:00
Sergei Sumarokov 163049b9b6
Merge pull request #1049 from moonstream-to/blast-crawlers-init
Blast crawlers init
2024-04-10 14:54:46 +03:00
Sergei Sumarokov 7994da519b
Merge pull request #1048 from moonstream-to/blast-db-init
Blast and Blast Sepolia blockchains at database
2024-04-10 14:53:02 +03:00
kompotkot f84788a6c1 Deployment for blast blockchains 2024-04-10 11:34:10 +00:00
kompotkot 784ff2a740 Blast and Blast Sepolia crawling support 2024-04-10 11:22:25 +00:00
kompotkot 49b49153ac Blast and Blast Sepolia blockchains at database 2024-04-10 10:02:19 +00:00
Sergei Sumarokov 25fc91569d
Merge pull request #1047 from moonstream-to/fix-nb-env
Fix rewrite env params for nodebalancer
2024-04-10 11:06:08 +03:00
kompotkot c06d9df61b Fix rewrite env params for nodebalancer 2024-04-10 08:05:23 +00:00
Sergei Sumarokov 7ec2ee5003
Merge pull request #1046 from moonstream-to/mdbv3-pypi-release
Moonstream DB V3 release workflow
2024-04-08 17:25:13 +03:00
kompotkot 23b20284f9 Moonstream DB V3 release workflow 2024-04-08 14:24:20 +00:00
Sergei Sumarokov 1f31738b44
Merge pull request #1030 from moonstream-to/mdb-v3-init
Initial version of moonstreamdb-v3
2024-04-08 17:18:46 +03:00
Andrey Dolgolev c139c488c1
Merge pull request #1045 from moonstream-to/usage-bugout-reports
Usage bugout reports
2024-04-04 11:31:42 +03:00
Andrey 1e0ce12634 Add changes. 2024-04-02 20:31:48 +03:00
Andrey 220e7f1a7d Bump version. 2024-04-02 19:32:04 +03:00
Andrey aa08db0473 Fix 2024-04-02 19:27:54 +03:00
Andrey c3dc91b0f5 Add changes. 2024-04-02 19:13:56 +03:00
Andrey 4a41852bea Add Bugout integration. 2024-04-02 18:16:01 +03:00
Andrey Dolgolev d22606508e
Merge pull request #1044 from moonstream-to/add-ipfs-gateaway
Add ipfs gateaway for metadata crawler.
2024-04-02 13:59:47 +03:00
Andrey 46c708db4c Add ipfs gateaway for metadata crawler. 2024-04-02 13:56:44 +03:00
Andrey Dolgolev d235d3b9a7
Merge pull request #831 from moonstream-to/biling-cli
Biling cli
2024-04-01 16:35:56 +03:00
Andrey 474ee11a2f Bump version. 2024-04-01 16:28:06 +03:00
Andrey 6f210a2a69 Rename MOONSTREAM_PUBLIC_QUERIES_TOKEN -> MOONSTREAM_PUBLIC_QUERIES_DATA_ACCESS_TOKEN . 2024-04-01 16:26:40 +03:00
kompotkot 640a8d12a0 Updated migration with starknet and avalanche 2024-04-01 13:17:50 +00:00
Andrey 6923754115 Add changes and logger messages. 2024-04-01 13:56:41 +03:00
Andrey cc5791578d Replace billing to usage. 2024-04-01 13:14:46 +03:00
Andrey f9258b2eee Merge branch 'main' into biling-cli 2024-04-01 13:02:21 +03:00
Andrey b5f14d5759 Merge branch 'main' into biling-cli 2024-04-01 13:01:36 +03:00
Sergei Sumarokov 19a17f83e2
Merge pull request #1043 from moonstream-to/fix-avalanche-db
Fix avalanche
2024-04-01 12:56:14 +03:00
kompotkot 5ab43d398e Bumped for dep moonstreamdb version 2024-04-01 09:55:05 +00:00
kompotkot e406fc5b8a Avalanche db long data fix 2024-04-01 09:54:21 +00:00
kompotkot 8af25265b3 Moonworm crawler fix jobs max 2024-04-01 09:51:55 +00:00
kompotkot b8846f49e2 Removed zksync-era-testnet services 2024-04-01 09:10:17 +00:00
kompotkot d85870b525 Starknet models 2024-03-30 09:49:05 +03:00
Sergei Sumarokov cbbac43d05
Merge pull request #1042 from moonstream-to/fix-historical-crawlers
Zksync sepolia services
2024-03-28 20:55:15 +03:00
kompotkot f60eb178b9 Zksync sepolia services 2024-03-28 17:54:16 +00:00
Sergei Sumarokov e6989aba3d
Merge pull request #1041 from moonstream-to/fix-deploy-bash
Fix deploy-basic for crawlers
2024-03-28 20:35:00 +03:00
kompotkot 7f620e997b Fix deploy-basic for crawlers 2024-03-28 17:34:24 +00:00
Sergei Sumarokov 45acffa709
Merge pull request #1040 from moonstream-to/avalanche-services
Avalanche service files
2024-03-28 20:13:01 +03:00
kompotkot 0a092e6fac Avalanche service files 2024-03-28 17:12:04 +00:00
Sergei Sumarokov c832392b24
Merge pull request #1039 from moonstream-to/fix-versions
Version fixes
2024-03-28 19:51:15 +03:00
kompotkot 966eaec1e0 Version fixes 2024-03-28 16:50:41 +00:00
Sergei Sumarokov cff438e0bb
Merge pull request #1031 from moonstream-to/xai-testnet
Add xai testnet.
2024-03-28 19:48:10 +03:00
kompotkot 52712aba3b Fixed migration for xai sepolia from avalanche 2024-03-28 16:45:24 +00:00
kompotkot 5cf319305b Deployments split 2024-03-28 16:43:53 +00:00
kompotkot 67e540b069 Fixes after merge with 0.4 2024-03-28 16:10:40 +00:00
kompotkot 8196912e6e Merge branch 'main' into xai-testnet 2024-03-28 15:59:39 +00:00
Sergei Sumarokov 0b9e4b1008
Merge pull request #1038 from moonstream-to/zk-sepolia-no-access-id
Switch from access-id to web3-uri, zksync sepolia and avalanche
2024-03-28 16:48:09 +03:00
kompotkot 3b0729f439 Zksync sepolia moonworm service 2024-03-28 13:47:36 +00:00
kompotkot f103d6fac8 Bumped version 2024-03-28 13:40:35 +00:00
kompotkot fe6bba86d2 Switch from access-id to web3-uri, zksync sepolia and avalanche 2024-03-28 13:37:45 +00:00
Sergei Sumarokov e8051972f0
Merge pull request #1037 from moonstream-to/db-avalanche-zk-era-sepolia
Models for Avalanche and zk era sepolia blockchains
2024-03-28 15:43:57 +03:00
kompotkot d4db66c551 Models for Avalanche and zk era sepolia blockchains 2024-03-28 12:17:20 +00:00
Andrey Dolgolev 160d7d8209
Merge pull request #1036 from moonstream-to/add-surf-task
Add ethereum metadata task.
2024-03-28 13:10:45 +02:00
kompotkot 5030865ef1 Allow to specify schema in engine 2024-03-28 08:20:41 +00:00
Andrey 6b6b08533c Add ethreum metadata task. 2024-03-27 22:03:27 +02:00
Andrey Dolgolev a90f73ad39
Merge pull request #1035 from moonstream-to/moonworm-crawler-fixes
Moonworm crawler fixes
2024-03-26 14:16:43 +02:00
kompotkot 51f6e5d02e Alembic migrations in package 2024-03-26 09:38:40 +00:00
Andrey e96bb59965 Replace != None -> isnot(None) more readable. 2024-03-25 14:06:57 +02:00
Andrey 4dead75827 Bump version. 2024-03-25 13:29:11 +02:00
Andrey fa87560385 Add fixes. 2024-03-25 13:27:56 +02:00
kompotkot 44b656fb9b Optimized db.py for future use 2024-03-25 10:58:54 +00:00
kompotkot d0cd24dd5f Fixed package import 2024-03-25 10:47:28 +00:00
kompotkot 650d45a334 Some fixes for correct packaging 2024-03-21 15:24:59 +00:00
Andrey Dolgolev e243442f5c
Merge pull request #1034 from moonstream-to/fix-is-contract
Icorrect response from getCode will set is_contract to zero.
2024-03-20 18:47:32 +02:00
Andrey da0f089c0d Replace to warning. 2024-03-20 18:47:00 +02:00
Andrey d7281b6d14 Icorrect response from getCode will set is_contract to zero. 2024-03-20 18:34:10 +02:00
Sergei Sumarokov d5d46c7521
Merge pull request #1033 from moonstream-to/removed-wyrm-crawler
Removed wyrm crawler services
2024-03-19 16:36:22 +03:00
kompotkot b09cc626c9 Removed wyrm crawler services 2024-03-19 13:30:42 +00:00
Sergei Sumarokov bf447b46dd
Merge pull request #1032 from moonstream-to/crawlers-monitoring-ext
Extended list of moonworm crawlers to monitor
2024-03-14 20:09:12 +03:00
kompotkot 93252308f4 Extended list of moonworm crawlers to monitor 2024-03-14 17:07:12 +00:00
kompotkot f913ec73ae Initial version of moonstreamdb-v3 2024-03-14 13:05:07 +00:00
Andrey 7de9bda100 Add alembic migration. 2024-03-14 01:13:24 +02:00
Andrey c6b689a9a2 Fix sample env. 2024-03-14 00:51:56 +02:00
Andrey 4a9034a117 Add fixes. 2024-03-14 00:49:34 +02:00
Andrey 3f9a2923a4 Change xai testnet -> sepolia. 2024-03-14 00:43:38 +02:00
Andrey 41b817660a Add xai testnet. 2024-03-14 00:09:54 +02:00
Andrey Dolgolev 49f99bb6e2
Merge pull request #1023 from moonstream-to/add-points-search
Add leaderboard key value filter.
2024-02-28 20:27:05 +02:00
Andrey 4e8b4960e9 Change query params check. 2024-02-28 18:05:42 +02:00
Andrey Dolgolev fce5f904ad
Merge pull request #1026 from moonstream-to/add-breed-feed
Add breed feed.
2024-02-28 17:12:15 +02:00
Andrey 1626bf178f Add breed feed. 2024-02-28 16:56:07 +02:00
Andrey Dolgolev 62e7db76e6
Merge pull request #1024 from moonstream-to/add-ethereum-state-service
Add ethereum tasks.
2024-02-27 19:11:00 +02:00
Andrey c5581321e6 Add ethereum tasks. 2024-02-25 06:51:32 +02:00
Andrey 0b60395120 Remove comment. 2024-02-24 03:13:39 +02:00
Andrey 62857b08d9 Add leaderboard key value filter. 2024-02-24 03:11:45 +02:00
Andrey Dolgolev 3a0ccb889f
Merge pull request #1022 from moonstream-to/fix-logos
Add logos.
2024-02-22 18:03:54 +02:00
Andrey Dolgolev c939d49296
Merge pull request #1021 from moonstream-to/fix-web3-providers
Add missing web3 providers.
2024-02-22 15:33:07 +02:00
Andrey Dolgolev 4bf8df636c
Merge pull request #1020 from moonstream-to/api-add-chains
Add Arbitrum Nova, Arbitrum Sepolia, Xai api support.
2024-02-22 15:18:33 +02:00
Andrey 1e1459071f Add logos. 2024-02-22 03:10:11 +02:00
Andrey 01e597aeff Add missing web3 providers. 2024-02-22 00:44:14 +02:00
Andrey e3cc04f1c5 Add temp icons. 2024-02-22 00:30:10 +02:00
Andrey 168fecfa29 Add Arbitrum Nova, Arbitrum Sepolia, Xai api support. 2024-02-21 22:47:42 +02:00
Andrey Dolgolev cae13d46cd
Merge pull request #1017 from moonstream-to/fix-deploy-typo
Fix deploy script.
2024-02-21 17:20:36 +02:00
Andrey Dolgolev 5a1e1e155e
Merge pull request #1016 from moonstream-to/xai-crawlers
Xai crawlers
2024-02-21 17:05:54 +02:00
Andrey Dolgolev 192961d008
Merge pull request #1012 from moonstream-to/arb-sepolia-crawlers
Arb sepolia crawlers
2024-02-21 16:57:55 +02:00
Sergei Sumarokov 28dc39c71d
Merge pull request #1009 from moonstream-to/arb-nova-crawlers
Arbitrum nova crawlers and model
2024-02-21 17:41:20 +03:00
Sergei Sumarokov d571ca24c7
Merge pull request #1015 from moonstream-to/nb-fix-cors-log
Fix nb cors log
2024-02-21 14:26:23 +03:00
kompotkot 6d0046961e Fix nb cors log 2024-02-21 11:25:44 +00:00
Sergei Sumarokov 4bda0d01cc
Merge pull request #1014 from moonstream-to/fix-nb-cors
Fix cors and starknet sepolia support
2024-02-21 14:21:17 +03:00
kompotkot de50816edc Fix cors and starknet sepolia support 2024-02-21 08:00:10 +00:00
Andrey 657ffd93c1 Fix deploy script. 2024-02-21 05:26:53 +02:00
Andrey 49065314ae Merge branch 'main' into xai-crawlers 2024-02-21 05:11:38 +02:00
Andrey 64a4036fd7 Merge branch 'main' into arb-sepolia-crawlers 2024-02-21 05:06:28 +02:00
Andrey 10f37621e0 Add monitoring. 2024-02-21 04:54:56 +02:00
Andrey 3a0aa8993f fix if 2024-02-21 04:04:22 +02:00
Andrey c9ef01b331 Add Xai chain. 2024-02-21 03:27:06 +02:00
Andrey 84c61dcf70 add migration 2024-02-20 15:20:25 +02:00
Andrey e8e0c0911c Add code part. 2024-02-20 14:57:29 +02:00
Andrey Dolgolev 38947e1379
Merge pull request #919 from moonstream-to/migrate-moonworm-tasks
Migrate moonworm tasks
2024-02-01 12:33:47 +02:00
Sergei Sumarokov 9ebe300e45
Merge pull request #932 from moonstream-to/complete-call-request
Complete call request
2024-02-01 13:23:21 +03:00
kompotkot 52fdbeede9 Merge branch 'main' into complete-call-request 2024-02-01 10:21:04 +00:00
Sergei Sumarokov 2e8ae13bb3
Merge pull request #931 from moonstream-to/metatx-live-at
Field `live_at` for `call_requests`
2024-02-01 13:16:57 +03:00
kompotkot 0d36368dd2 Updated revision version number 2024-02-01 10:15:47 +00:00
Andrey Dolgolev dce4d052ce
Merge pull request #1010 from moonstream-to/fix-wrong-key
Fix old logic code.
2024-01-31 21:32:13 +02:00
kompotkot 5a24a517bb Deploy scripts for arbitrum nova crawlers 2024-01-31 10:46:06 +00:00
kompotkot 683bc121a7 Basic crawlers for arbitrum nova 2024-01-31 10:09:04 +00:00
kompotkot e1c6f7c13d Added lost receipt_root for arbitrum nova model and migration 2024-01-31 10:08:05 +00:00
kompotkot 41264e663a Migration with blocks, txs, labels for arbitrum nova blockchain 2024-01-31 08:33:51 +00:00
Andrey Dolgolev 11f5252b8e
Merge pull request #1008 from moonstream-to/leaderboard-metadata-sm
Leaderboard metadata simplify.
2024-01-30 16:01:45 +02:00
kompotkot b9966558c2 Arbitrum nova blockchain tables 2024-01-30 13:57:13 +00:00
Andrey Dolgolev 72f5eeee35
Merge pull request #1002 from moonstream-to/resources-migration-queries
Resources migration queries/engine/subscriptions
2024-01-30 15:23:20 +02:00
Andrey 346bcae89e Fix old logic code. 2024-01-29 06:34:51 +02:00
Andrey 06d8f63931 Merge branch 'main' into leaderboard-metadata-sm 2024-01-28 00:59:43 +02:00
Andrey c7c89aaadd Add app timeout. 2024-01-27 22:33:56 +02:00
Andrey e723dabaaf Fix permission_list to permissions. 2024-01-27 22:12:53 +02:00
kompotkot 32b0088fdb Bumped bugout package version 2024-01-29 09:43:03 +00:00
Andrey 243f367d82 Add suggested fixes. 2024-01-27 12:23:14 +02:00
Andrey 0932c94550 Remove default names function. 2024-01-27 09:32:12 +02:00
Andrey 613f8abc0c Leaderboard versions simplify. 2024-01-27 09:28:45 +02:00
Andrey e7be016c98 Fix engine and subscriptions. 2024-01-25 06:25:18 +02:00
Andrey 52aafc328b Remove user interactions with resources(only list). 2024-01-25 05:44:38 +02:00
Andrey b2e67ffec6 Merge branch 'main' into add-leaderboard-metadata 2024-01-25 04:51:05 +02:00
Sergei Sumarokov 974128528e
Merge pull request #999 from moonstream-to/nb-healthcheck-interfal-env
Env for healthcheck interval for nb
2024-01-23 10:04:13 +03:00
kompotkot b7aa897c50 Env for healthcheck interval for nb 2024-01-23 07:01:23 +00:00
Sergei Sumarokov c95ba1e50c
Merge pull request #998 from moonstream-to/fix-starknet-nb-latest
Fix starknet goerli latest check for nb
2024-01-23 09:46:34 +03:00
kompotkot 03c3a2bc34 Fix starknet goerli latest check for nb 2024-01-23 06:45:11 +00:00
Sergei Sumarokov ecbe6482f7
Merge pull request #997 from moonstream-to/nb-latest-stark-goerli
Latest block check for starknet goerli
2024-01-23 09:33:42 +03:00
kompotkot a3745888ae Latest block check for starknet goerli 2024-01-23 06:32:18 +00:00
Sergei Sumarokov 954cf517f7
Merge pull request #996 from moonstream-to/fix-monitoring-deploy-tag
Fixed monitoring tag for deployment
2024-01-11 13:25:51 +03:00
kompotkot 00a5b21505 Fixed monitoring tag for deployment 2024-01-11 09:41:01 +00:00
Andrey Dolgolev cfebe18257
Merge pull request #995 from moonstream-to/add-get-scores
Add get score endpoint.
2024-01-10 20:23:15 +02:00
Andrey cfeae159d4 Add get score endpoint. 2024-01-10 17:25:30 +02:00
Andrey Dolgolev d8baa5b114
Merge pull request #993 from moonstream-to/fix-leaderboard-info
Fix leaderboard info endpoint.
2024-01-10 16:04:33 +02:00
Andrey Dolgolev 854a473043
Merge pull request #992 from moonstream-to/delete-dashboards-generator
Clean deprecated workers.
2023-12-20 17:05:31 +02:00
Andrey 7a24e2fb85 remove new line. 2023-12-20 05:01:57 +02:00
Andrey 4d90055813 Fix leaderboard info endpoint. 2023-12-20 04:51:20 +02:00
Andrey 919c7c6a79 revert changes. 2023-12-20 04:08:34 +02:00
Andrey ad9e332d15 Fix leaderboard info endpoint. 2023-12-20 04:06:46 +02:00
Andrey b8b6d0c8c7 Clean deprecated workers. 2023-12-20 01:29:25 +02:00
Andrey Dolgolev b84e484f67
Merge pull request #987 from moonstream-to/add-total-supply
Add task.
2023-12-14 14:33:09 +02:00
Andrey Dolgolev 03481546e6
Merge pull request #988 from moonstream-to/add-internal-timeout
Add internal timeout.
2023-12-14 14:28:01 +02:00
Andrey 8bf0e723f0 Add suggested changes. 2023-12-14 03:35:55 +02:00
Andrey 73df559c3e Add internal timeout. 2023-12-14 03:17:50 +02:00
Andrey 859f2ef278 Add task. 2023-12-13 23:07:58 +02:00
Andrey Dolgolev b7ea3445ce
Merge pull request #984 from moonstream-to/leaderboard-push-batching
Add batching leaderboard generator.
2023-12-13 22:03:23 +02:00
Andrey 8a2e624e09 Add changes. 2023-12-13 21:39:52 +02:00
Andrey Dolgolev 6693a12896
Merge pull request #985 from moonstream-to/fix-zksync-deploy
Remove infura for zksync.
2023-12-12 23:51:10 +02:00
Andrey Dolgolev 3b1ff405c4
Merge pull request #983 from moonstream-to/add-token-pairs
Add WETH and MUTE.
2023-12-12 22:37:06 +02:00
kompotkot f9a265b97a Live after query param 2023-12-12 11:22:42 +00:00
Andrey 691bdbf50f Remove infura for zksync. 2023-12-09 12:17:32 +02:00
Andrey a8a0b165a2 Add fix. 2023-12-09 11:47:09 +02:00
Andrey f04ac73865 Fix blockchain in deploy script. 2023-12-09 11:38:50 +02:00
Andrey 5a72358e99 Add deploy files. 2023-12-09 10:41:51 +02:00
Andrey 21fb0ca0d7 Add batching leaderboard generator. 2023-12-09 06:42:36 +02:00
Andrey 6554b1632d Add WETH and MUTE. 2023-12-09 05:24:59 +02:00
kompotkot 12bcd84eb1 Body for complete request route 2023-12-07 16:47:03 +00:00
kompotkot 065ff03476 Switched middleware to depends oauth2_scheme in metatx 2023-12-07 15:04:16 +00:00
kompotkot f3b4e3e502 Merge branch 'metatx-live-at' into complete-call-request 2023-12-07 10:11:52 +00:00
kompotkot 6b749b5fef Field live_at is nulluble 2023-12-07 09:57:17 +00:00
kompotkot 4746d5ceec Merge branch 'main' into metatx-live-at 2023-12-06 11:50:18 +00:00
Sergei Sumarokov 29c8c2c4a0
Merge pull request #977 from moonstream-to/split-monitor-for-crawlers-deploy
Split monitoring deployment
2023-12-05 14:08:48 +03:00
kompotkot ede0093414 Split monitoring deployment 2023-12-05 10:57:40 +00:00
Andrey 799353b39a Rmoce user token from workflow. 2023-12-04 14:46:55 +02:00
Sergei Sumarokov 7ef8f61b7b
Merge pull request #975 from moonstream-to/allow-div-crawlers
Removed divide char and added comment restriction
2023-11-30 16:18:32 +03:00
kompotkot ea04e61f60 Black check 2023-11-30 13:15:26 +00:00
kompotkot 65f253145c Removed divide char and added comment restriction 2023-11-30 13:11:20 +00:00
Neeraj Kashyap 44a79272df
Merge pull request #966 from moonstream-to/leaderboard-versions
Leaderboard versions
2023-11-21 11:03:11 -08:00
Neeraj Kashyap 354ae7ddc7 Updated README 2023-11-21 11:01:46 -08:00
Neeraj Kashyap 9bb8c19283 Added the `client` directory
It contains a lightweight Python client for the Engine API.
2023-11-21 11:00:38 -08:00
Neeraj Kashyap 71e2ffbed3 Modified alembic migration to downgrade properly
Previously, the downgrade was hitting a violation of the old unique
constraint on leaderboard_scores if multiple versions of scores were
stored for the same address.

The modified downgrade only retains the score for each address on the
latest publich version of each leaderboard.
2023-11-21 10:59:17 -08:00
Andrey e9273e2d38 Remove public column and add suggested changes. 2023-11-21 08:03:34 +02:00
Andrey de2afed559 Fix if in get latest version.
Fix join.
Add version parameter to all public endpoints.
2023-11-20 15:34:47 +02:00
Andrey 0eb6c3e2b9 Fix unique constrain on leaderboard scores to remove unique address and add unique version number. 2023-11-20 12:18:55 +02:00
Andrey 5f90fc4b56 Add publish to request body. 2023-11-20 11:34:35 +02:00
Andrey aef32862c2 Remove endpoint. duplication from docs. 2023-11-20 11:26:10 +02:00
Andrey 6a250fe518 Deleting old versions on versionless add_scores endpoint. 2023-11-20 11:19:59 +02:00
Andrey e6b75d59d9 Add endpoints for LeaderboardVersions.
Change add_scores.
Change get leaderboards positions.
2023-11-20 10:51:31 +02:00
Andrey 77dfd5d070 Update Quartiles / Position / Rank / Ranks endpoints. 2023-11-16 06:50:56 +02:00
Andrey 324ff58466 Add columns names default. 2023-11-15 18:00:18 +02:00
Andrey 5878e66aaf Add fixes for get leaderboard. 2023-11-15 17:28:15 +02:00
Andrey Dolgolev c4f1c41f36
Merge pull request #972 from moonstream-to/fix-missing-parameter
Add changes.
2023-11-13 18:16:35 +02:00
Andrey e217434e4e Add changes. 2023-11-13 17:37:30 +02:00
Andrey 532e1bdae4 Add changes. 2023-11-13 17:34:36 +02:00
Neeraj Kashyap 5d6fb5620e
Merge pull request #970 from moonstream-to/state-crawler-job-fixes
Fixed lacking "params" key
2023-11-10 10:32:30 -08:00
Neeraj Kashyap 825b699b3f Fixed lacking "params" key 2023-11-10 10:30:21 -08:00
Neeraj Kashyap 90246465e9
Merge pull request #969 from moonstream-to/state-crawler-cu-twilight-tactics
Jobs for Twilight Tactics
2023-11-10 10:23:52 -08:00
Neeraj Kashyap 88f36f5d63 Jobs for Twilight Tactics
Updated Mumbai job, and added Polygon mainnet job.
2023-11-10 10:20:40 -08:00
Neeraj Kashyap 7295b9c023 Fixed typo 2023-11-10 09:20:26 -08:00
Andrey 949f6c4905 Add migration and endpoints changes. 2023-11-09 17:41:14 +02:00
Sergei Sumarokov a70f26b8e1
Merge pull request #946 from moonstream-to/monitoring-systemd-init
Crawlers systemd monitoring
2023-11-09 18:03:51 +03:00
kompotkot 1d2c418873 Merge branch 'main' into monitoring-systemd-init 2023-11-09 15:03:08 +00:00
Neeraj Kashyap 560ccb6784 Made models.py changes and created alembic migration 2023-11-08 16:19:27 -08:00
Andrey Dolgolev 1091ad699d
Merge pull request #965 from moonstream-to/add-query-repeat-parameter
Add strict query api request repeat for leaderboard.
2023-11-08 15:44:43 +02:00
Andrey Dolgolev 2c49f975e8
Merge pull request #964 from moonstream-to/change-tasks
Add changes.
2023-11-08 14:28:56 +02:00
Andrey Dolgolev a7a2300d73
Merge pull request #963 from moonstream-to/change-tasks
Add changes for state tasks.
2023-11-07 23:42:37 +02:00
Sergei Sumarokov 559c51b2d6
Merge pull request #939 from moonstream-to/removed-outdated-crawlers
Cleaned from unused crawler services
2023-11-07 15:02:11 +03:00
kompotkot e9c46f7a5b Compare with caller from message 2023-11-07 11:04:05 +00:00
Andrey 51359548e4 Add changes. 2023-11-06 20:10:45 +02:00
Andrey befeb057cf Add changes. 2023-11-06 18:50:14 +02:00
Andrey 3ce6cf70c6 Add changes. 2023-11-06 11:54:29 +02:00
Andrey d4c3ebd84d temp changes. 2023-11-06 11:41:14 +02:00
kompotkot c196c9e0d2 Crawlers systemd monitoring 2023-11-02 11:59:31 +00:00
Andrey Dolgolev 63cd514016
Merge pull request #945 from moonstream-to/fix-leaderboard-generator-default
Add changes.
2023-11-01 13:25:14 +02:00
Andrey 1397f87d54 Add changes. 2023-11-01 13:22:20 +02:00
Sergei Sumarokov 1bb132d63c
Merge pull request #941 from moonstream-to/nb-starknet-support
Nodebalancer starknet blockchain support
2023-10-31 18:03:16 +03:00
Andrey Dolgolev ddfd2e518d
Merge pull request #943 from moonstream-to/add-external-url
Add spire external url.
2023-10-26 20:16:10 +03:00
Andrey 4f3688fcbd Add spire external url. 2023-10-26 20:12:13 +03:00
Andrey Dolgolev 06629ee283
Merge pull request #942 from moonstream-to/customer-view-tasks
Add customer views tasks and improve state crawler logs
2023-10-25 16:56:18 +03:00
kompotkot 017c921a15 Nodebalancer starknet blockchain support 2023-10-25 11:30:27 +00:00
Andrey c192f278ac Add logs changes. 2023-10-25 14:27:45 +03:00
Andrey 017154207c Add changes.
Delete object log.
2023-10-25 14:21:24 +03:00
Andrey Dolgolev 6e35ab9927
Merge pull request #898 from moonstream-to/replace-search-in-query-api
Replace search in query api
2023-10-24 13:15:27 +03:00
Andrey 01eeb2f0e6 Bump version. 2023-10-24 13:15:03 +03:00
Sergei Sumarokov 78ea9b845e
Merge pull request #937 from moonstream-to/nb-metamask-support
Nb metamask support and small fixes
2023-10-23 21:18:33 +03:00
kompotkot fa3caefe06 Fixed naming of systemd service to correlate with files and deploy 2023-10-19 13:20:09 +00:00
kompotkot 8051e78f5b Cleaned from unused crawler services 2023-10-19 12:00:52 +00:00
Andrey Dolgolev 6949a4dafe
Merge pull request #938 from moonstream-to/reduce-events-batch
Reduce max blocks batch.
2023-10-18 21:27:33 +03:00
kompotkot 1439fb10fa Path losing url during revers proxy fix 2023-10-18 13:21:13 +00:00
kompotkot 8e9023afc5 JSON RPC request ID now support uint64, string and null 2023-10-18 11:59:47 +00:00
Andrey 105f29dfbe Reduce max blocks batch. 2023-10-18 07:48:45 +03:00
kompotkot 0ed9ad2ecc Complete call_request endpoint 2023-10-16 11:54:39 +00:00
kompotkot 74f956ff64 Modified authorize and verify workflows to support 2 message types 2023-10-16 10:31:54 +00:00
kompotkot 7fb0963d24 Merge branch 'metatx-live-at' into complete-call-request 2023-10-04 11:31:31 +00:00
kompotkot d3effd952c Depends auth header check should be async 2023-10-04 11:30:58 +00:00
kompotkot 69e375ab61 tx_hash for call_requests field 2023-10-04 11:27:40 +00:00
kompotkot 47b76ec26d Updated version 2023-10-04 10:55:27 +00:00
kompotkot a92aeed916 List call_requests check auth with dependency 2023-10-04 10:50:09 +00:00
kompotkot a46afe65d7 Operations with live_at for call_requests 2023-10-03 15:47:58 +00:00
kompotkot 1a282c5811 live_at for call_requests 2023-10-03 10:07:37 +00:00
Sergei Sumarokov 3bc6070768
Merge pull request #927 from moonstream-to/fix-nb-deploy
Create secrets dir if not exists
2023-09-28 15:27:14 +03:00
kompotkot 3a6ef4fd03 Create secrets dir if not exists 2023-09-28 12:21:18 +00:00
Sergei Sumarokov a8c96e4ca7
Merge pull request #926 from moonstream-to/access-id-in-path
Access id could be set in URL path
2023-09-28 15:13:34 +03:00
kompotkot e27308f809 Deploy updates 2023-09-28 12:12:33 +00:00
kompotkot eed1e2297d Access id could be set in URL path 2023-09-28 11:25:47 +00:00
Sergei Sumarokov b4ed1e5c80
Merge pull request #925 from moonstream-to/old-cors
Leaderboards use env var origins
2023-09-21 15:05:01 +03:00
Andrey 0c7839cd91 Add changes. 2023-09-21 14:34:43 +03:00
Andrey 1ab1d022cc Add changes. 2023-09-21 14:23:13 +03:00
kompotkot 911042da26 Leaderboards use env var origins 2023-09-21 07:24:11 +00:00
Andrey ac235cd15d Add initial selector key. 2023-09-19 15:10:55 +03:00
Andrey 04c3c7aad5 Add address split. 2023-09-19 14:56:20 +03:00
Andrey 1e848f72d4 Add deduplicates migration step. 2023-09-19 13:44:54 +03:00
Andrey 5a6c8f5219 Add changes. 2023-09-19 13:40:24 +03:00
Andrey 827823ab7a Add changes. 2023-09-19 12:48:44 +03:00
Andrey 80efa41b79 Merge branch 'main' into migrate-moonworm-tasks 2023-09-18 14:44:21 +03:00
Andrey 697de0bcc1 Add changes. 2023-09-18 04:21:16 +03:00
Andrey 58258e8296 Merge branch 'main' into replace-search-in-query-api 2023-09-14 18:09:23 +03:00
Andrey Dolgolev e69d81d1fb
Merge pull request #922 from moonstream-to/add-state-task-SC
Add Shadowcorns.
2023-09-11 19:39:57 +03:00
Andrey 21a0fc4157 Fix lint.. 2023-09-11 19:30:00 +03:00
Andrey bb4bc7f778 Add improvments. 2023-09-11 17:27:03 +03:00
Andrey d07ec13bf6 Add Shadowcorns. 2023-09-11 16:53:14 +03:00
Andrey 2719d9baba Add changes. 2023-09-07 18:04:34 +03:00
Andrey Dolgolev 6292aecd3a
Merge pull request #916 from moonstream-to/leaderboard-config-management
Add initiate leaderboard config managment.
2023-09-04 17:29:25 +03:00
Andrey 8502889540 Add migration. 2023-09-02 19:01:36 +03:00
Andrey 0bb88788ca Add changes. 2023-09-02 19:01:02 +03:00
Andrey 0f608aac77 Bump version, update env file. 2023-09-01 07:11:55 +03:00
Andrey 49802bf589 Change MOONSTREAM_LEADERBOARD_GENERATOR_JOURNAL_ID -> MOONSTREAM_LEADERBOARD_CONFIGURATION_JOURNAL_ID. 2023-09-01 07:06:11 +03:00
Andrey d5e23ed928 Fix search. 2023-08-31 19:32:20 +03:00
Andrey edae1f91a1 Add initiate leaderboard config managment. 2023-08-31 18:04:23 +03:00
Sergei Sumarokov 5aaa4f6e93
Merge pull request #915 from moonstream-to/fix-names-pypi-token-names
Fix names of pypi tokens
2023-08-31 14:56:04 +03:00
kompotkot 2dd2e28958 Fix names of pypi tokens 2023-08-31 11:02:48 +00:00
Sergei Sumarokov 969f2496a9
Merge pull request #914 from moonstream-to/eng-cors-autoupdate
CORS origins synchronize service
2023-08-31 13:51:19 +03:00
kompotkot d29c40e907 CORS origins synchronize service 2023-08-31 10:46:48 +00:00
Andrey Dolgolev 87997add7d
Merge pull request #876 from moonstream-to/return-jobs-endpoint
Return jobs endpoint
2023-08-31 13:40:50 +03:00
Andrey Dolgolev ae4de8831c
Merge pull request #913 from moonstream-to/fix-del-moonstream-client
Removed moonstream client unused import
2023-08-30 16:38:24 +03:00
kompotkot 9f747474d7 Removed moonstream client unused import 2023-08-30 13:36:55 +00:00
Andrey Dolgolev d6aa376b8e
Merge pull request #909 from moonstream-to/zksync-era-mainnet-subscription
Add zksync era smartcontract subscription type.
2023-08-30 16:20:26 +03:00
kompotkot 4c5e6cc327 Requirements update and deployment zksync mainnet scripts 2023-08-30 13:11:17 +00:00
kompotkot ec918609db ZkSync mainnet support changes 2023-08-30 12:58:50 +00:00
Sergei Sumarokov 3770730e1c
Merge pull request #912 from moonstream-to/fix-pypi-release
Release pypi work with token
2023-08-30 14:45:47 +03:00
kompotkot e273f34d06 Release pypi work with token 2023-08-30 11:05:48 +00:00
Andrey Dolgolev 502a7e21d3
Merge pull request #910 from moonstream-to/zksync-era-moonstreamdb
Add zksync era model.
2023-08-30 10:41:16 +03:00
Andrey 1ddf96b258 Add changes. 2023-08-30 05:17:30 +03:00
Andrey adea116388 Fix missing networks for blockchains. 2023-08-29 20:33:38 +03:00
Andrey c3b690c668 Merge branch 'main' into zksync-era-mainnet-subscription 2023-08-29 18:18:21 +03:00
Andrey 3d85f1767d Bump version replace networks. 2023-08-29 07:19:25 +03:00
Andrey f49b7c4a78 zkSync in crawlers. 2023-08-29 06:41:47 +03:00
Andrey 5fcffd7d5e Backend zksync support. 2023-08-29 06:29:01 +03:00
Andrey 0dbbaf7aa2 Add zksync era model. 2023-08-29 03:45:54 +03:00
Andrey 561ff35f13 Add zksync era smartcontract subscription type. 2023-08-29 02:48:47 +03:00
Andrey Dolgolev a65f1559bf
Merge pull request #904 from moonstream-to/add-seaport-feed
Add seaport reports.
2023-08-28 16:36:48 +03:00
Andrey 6b9fd67d6b remove traceback. 2023-08-22 03:17:19 +03:00
Andrey cc47bc761b Fix single calls logic. 2023-08-22 01:33:53 +03:00
Andrey 28c660c979 Add changes. 2023-08-19 02:55:45 +03:00
Andrey 9a722abcbb Merge branch 'main' into return-jobs-endpoint 2023-08-18 19:57:59 +03:00
Andrey d9f82b7e28 add changes 2023-08-18 19:53:42 +03:00
Andrey 95439825a3 Add changes. 2023-08-18 19:33:48 +03:00
Andrey Dolgolev 397c83a508
Merge pull request #901 from moonstream-to/add-running-status
Add status check of running task.
2023-08-17 16:10:48 +03:00
Andrey Dolgolev 19f9ac62c7
Merge pull request #899 from moonstream-to/add-headers-parameters
Add headers parameters
2023-08-16 15:44:55 +03:00
Andrey a991549ea6 Add status check of running task. 2023-08-16 05:21:44 +03:00
Andrey 23d0670714 Add changes. 2023-08-15 19:04:08 +03:00
Andrey cebd0cb777 Remove not rlated changes. 2023-08-15 17:30:25 +03:00
Andrey 77ee44884e Add changes. 2023-08-15 17:27:26 +03:00
Andrey b85cbb5f00 Add Header parameter. 2023-08-15 13:55:13 +03:00
Andrey Dolgolev f8d067bf7d
Merge pull request #891 from moonstream-to/manage-leaderboards
Manage leaderboards
2023-08-14 18:10:19 +03:00
Andrey fa92e3260d Split endpoints by public and authorized. 2023-08-12 11:13:51 +03:00
Andrey 3b52d8f49f Change endpoint name. 2023-08-12 09:54:46 +03:00
Andrey fa66d1cebe Add descriptions and parameters types. 2023-08-12 09:48:38 +03:00
Andrey 9165a32f5e Add Query wrapper. 2023-08-12 09:24:04 +03:00
Andrey fbf106eba3 Add changes. 2023-08-12 09:18:19 +03:00
Andrey 3319d4a8a4 Add type annotations. 2023-08-12 09:14:33 +03:00
Andrey cb7950d922 remove autoconfig endpoint. 2023-08-10 19:33:44 +03:00
Sergei Sumarokov fbee1a068c
Merge pull request #892 from moonstream-to/db-request-id-constr
Request ID unique constr
2023-08-10 08:57:23 -07:00
kompotkot a7ab7063b0 Clarified errors message for duplication of call request 2023-08-10 15:55:27 +00:00
kompotkot 8686b38aa0 Merge branch 'main' into db-request-id-constr 2023-08-10 15:47:16 +00:00
kompotkot 5e03473705 Switched call requests request id column to decimals 2023-08-10 15:42:08 +00:00
Andrey Dolgolev 2f21b64f68
Merge pull request #894 from moonstream-to/update-bugout-with-correct-pydentic
Update bugout-python for engine.
2023-08-10 18:26:57 +03:00
Andrey 5b38cf1eff Add changes. 2023-08-10 18:26:26 +03:00
Andrey 20149770aa Add changes. 2023-08-10 18:24:26 +03:00
Andrey Dolgolev f0ed70696f
Merge pull request #893 from moonstream-to/update-bugout
Update bugout version.
2023-08-10 17:12:13 +03:00
Andrey f15d70acd7 Refactor access check. 2023-08-10 17:11:30 +03:00
Andrey 0c095b7696 Add changes. 2023-08-10 16:35:09 +03:00
Andrey 9f376e86f7 Update on engine. 2023-08-10 16:33:46 +03:00
Andrey 1ae366ab7d Update bugout version. 2023-08-10 16:29:37 +03:00
kompotkot f1a84d8cec Metatx routes fix to work with call requests 2023-08-10 10:54:53 +00:00
kompotkot 663c2be9d9 Request ID for call requests migration 2023-08-10 10:40:46 +00:00
Sergei Sumarokov 9a7b1ea47e
Merge pull request #882 from moonstream-to/reorg-metatx-db
Reorg metatx db
2023-08-08 12:41:14 -07:00
kompotkot f80edef557 Merge branch 'main' into reorg-metatx-db 2023-08-08 19:39:40 +00:00
kompotkot 4ee6ce6406 Bumped version 2023-08-08 19:05:13 +00:00
kompotkot d4ff8e8870 Fix default dropper value to be available from docs 2023-08-08 12:21:13 +00:00
kompotkot ba78712cc5 Request type PK name and default set to dropper if not specified 2023-08-08 12:17:49 +00:00
kompotkot 1bd2f3706b Call request method and required params in db, fixed validation 2023-08-07 13:26:58 +00:00
kompotkot eab292e815 Holders to Requesters and no defaults, small fixes 2023-08-07 12:10:21 +00:00
Andrey c417fc14b6 Whitelist changes endpoint. 2023-08-07 01:14:37 +03:00
Andrey ba6fd3222f Change endpoints order. 2023-08-07 01:12:45 +03:00
Andrey 1d0f01cb09 Add changes. 2023-08-06 17:06:18 +03:00
Andrey 0403b1ba0c Add initial leaderboard manage. 2023-08-06 16:55:56 +03:00
Sergei Sumarokov a45ea9e36f
Merge pull request #885 from moonstream-to/leaderboards-docs-fix
Update leaderboard.py docs whitelisted
2023-08-04 12:56:20 -07:00
Sergei Sumarokov ef57400c52
Update leaderboard.py docs whitelisted 2023-08-04 12:53:35 -07:00
Sergei Sumarokov c6b64cf5ba
Merge pull request #878 from moonstream-to/fix-validate-set-requests
Fixed validation of new call requests set not subscriptable
2023-08-03 07:38:35 -07:00
kompotkot 927eb85c94 Basic call requests endpoints to work with updated db 2023-08-03 14:12:06 +00:00
Andrey Dolgolev ad9c22dd40
Merge pull request #883 from moonstream-to/historical-crawl-fixes
Fix function filter degradation.
2023-08-03 16:10:04 +03:00
kompotkot 1589c8c65d Fixed metatx contract routes to work with new db model 2023-08-03 12:36:13 +00:00
kompotkot 2d93c307ab Merge branch 'main' into reorg-metatx-db 2023-08-03 10:58:41 +00:00
Sergei Sumarokov 096f55ccbb
Merge pull request #877 from moonstream-to/crawlers-spire-entity
Mooncrawl entity migration to spire
2023-08-03 03:54:05 -07:00
Sergei Sumarokov 632b8304b9
Merge pull request #875 from moonstream-to/mapi-entity-migration
moonstreamapi entity to spire migration
2023-08-03 03:47:48 -07:00
kompotkot e5fc6dcc27 Merge branch 'mapi-entity-migration' into reorg-metatx-db 2023-08-03 10:44:28 +00:00
kompotkot 47db2e534c Updated API route for list contracts 2023-08-03 10:42:16 +00:00
kompotkot 252da0cd36 API route to get available blockchains for metatx 2023-08-03 10:30:46 +00:00
kompotkot 6dfca4a49b API list call request types 2023-08-03 10:25:09 +00:00
kompotkot b0d8e17254 Working downgrade 2023-08-03 09:59:43 +00:00
kompotkot 39a64cf454 Working migration 2023-08-03 09:52:50 +00:00
kompotkot 3b265ad15d Migration Call request types and Metatx holders 2023-08-03 09:17:05 +00:00
kompotkot 179370affb Replaced Any with cast 2023-08-03 07:27:02 +00:00
Andrey c4b18145b0 Merge branch 'main' into historical-crawl-fixes 2023-08-03 02:30:43 +03:00
Andrey 9246950293 Merge branch 'main' into historical-crawl-fixes 2023-08-03 02:25:56 +03:00
Andrey 29e512538e Fix list subscriptions. 2023-08-02 15:49:16 +03:00
kompotkot e854978459 Fixed validation of new call requests set not subscriptable 2023-08-01 11:45:24 +00:00
kompotkot 92dbfe5576 Mooncrawl entity migration to spire 2023-08-01 08:58:36 +00:00
kompotkot 1e01a89b1b mypy fixes 2023-07-31 16:00:59 +00:00
kompotkot 1ee2436e7f Fix filter out dashboards back 2023-07-31 15:40:21 +00:00
kompotkot 0878d5b798 Fixed search entities results for spire compatibility 2023-07-31 15:37:59 +00:00
kompotkot 5dfcfd634f Fixes to work with spire entity 2023-07-31 14:19:22 +00:00
Andrey Dolgolev f5b85d0b5f
Merge pull request #874 from moonstream-to/add-overwrite-parameter
Add missing parameter.
2023-07-31 15:43:18 +03:00
kompotkot bbe1530eef Removed entity client dependency 2023-07-31 12:36:48 +00:00
kompotkot a3b0841d10 Moonstream API migration to spire entity 2023-07-31 12:32:19 +00:00
Andrey e3072a36ad Add changes. 2023-07-29 11:09:23 +03:00
Andrey 63347d81f3 Add required changes. 2023-07-29 10:53:08 +03:00
Andrey 9d9fef0059 Add changes. 2023-07-29 10:40:02 +03:00
Andrey bc06edc635 Return back jobs endpoint. 2023-07-29 10:32:09 +03:00
Andrey 6462d84d65 Add missing parameter. 2023-07-28 08:28:14 +03:00
Andrey Dolgolev f820129205
Merge pull request #873 from moonstream-to/leaderboard-generator
Leaderboards worker
2023-07-27 19:00:17 +03:00
Andrey 323784f8b2 Fix function filter degradetion. 2023-07-27 09:22:23 +03:00
Andrey f2f078b9c3 add variable to sample.env 2023-07-27 07:06:14 +03:00
Andrey be7a7e0267 fix typo. 2023-07-27 07:01:11 +03:00
Andrey bf7f6497c5 Add changes. 2023-07-27 06:59:01 +03:00
Andrey 3215e5d719 Add leaderboards dir. 2023-07-26 23:52:35 +03:00
Andrey 4d1d242c81 Add loggers and fixes. 2023-07-26 23:51:15 +03:00
Andrey 6c11fb3d0f Add working leaderboard update. 2023-07-26 20:20:17 +03:00
Andrey Dolgolev 330a7feb3f
Merge pull request #872 from moonstream-to/extend-metadata-methods
Add new metadata method.
2023-07-26 16:33:48 +03:00
Andrey 88d0f91706 Add new metadata method. 2023-07-26 16:31:10 +03:00
Andrey cb1137fd39 Add init version. 2023-07-26 16:21:56 +03:00
Andrey Dolgolev 25767fb555
Merge pull request #871 from moonstream-to/add-state-tasks-1155
Add erc1155 token_ids.
2023-07-26 08:26:34 +03:00
Andrey Dolgolev 24aeada59c
Merge pull request #867 from moonstream-to/add-new-metadata-state-task
Add new address in tasks.
2023-07-25 14:36:54 +03:00
Andrey 9f38e19d9d Fix URI method name. 2023-07-25 10:29:37 +03:00
Andrey 4891f1b5fe Add erc1155 token_ids. 2023-07-25 09:41:41 +03:00
Andrey 07734d1b2b Change name. 2023-07-25 09:31:26 +03:00
Andrey 0e5ea6f4cc Add contracts and output. 2023-07-25 04:49:07 +03:00
Sergei Sumarokov 61e21e443b
Merge pull request #868 from moonstream-to/hist-crawlers-zksync
ZkSync historical crawlers
2023-07-24 08:31:54 -07:00
kompotkot 3bbc47a36d ZkSync historical crawlers 2023-07-24 15:28:07 +00:00
Andrey 60d98a8627 Add historical crawl worker. 2023-07-24 17:20:18 +03:00
Andrey 78bc0770f5 Add new address in tasks. 2023-07-24 16:59:58 +03:00
Andrey Dolgolev 48cea0709e
Merge pull request #866 from moonstream-to/refactor-support-interface
Refactor supported interface.
2023-07-24 16:17:08 +03:00
Andrey 0e1a54fda7 Add requested changes.
Refactor contract check.
2023-07-24 15:55:54 +03:00
Andrey e76a779400 Add init version. 2023-07-24 13:37:02 +03:00
Sergei Sumarokov 4a99250889
Merge pull request #865 from moonstream-to/zksync-era-t-moonworm-crawl
ZkSync Era testnet moonworm crawler deployment
2023-07-20 05:01:51 -07:00
kompotkot f768369f05 ZkSync Era testnet moonworm crawler deployment 2023-07-20 10:38:43 +00:00
Sergei Sumarokov 0d8f9e9211
Merge pull request #862 from moonstream-to/fix-bugout-version
Fix bugout version
2023-07-18 05:27:46 -07:00
kompotkot 45c748c829 Fix bugout version 2023-07-18 12:26:52 +00:00
Sergei Sumarokov dfd659e369
Merge pull request #861 from moonstream-to/fix-extensive-logs
Fix extensive logs
2023-07-18 04:15:33 -07:00
kompotkot 4c60796c41 Fix extensive logs 2023-07-18 11:14:22 +00:00
Sergei Sumarokov 7f2a0d3c59
Merge pull request #860 from moonstream-to/fix-reset-pass
Fixed password restore workflow to work with application
2023-07-18 03:52:41 -07:00
kompotkot ca10fdb37b Fixed password restore workflow to work with application 2023-07-18 10:25:12 +00:00
Andrey Dolgolev cd7704ecd2
Merge pull request #859 from moonstream-to/metadata-crawler-improvments
Refactor connection managers.
2023-07-17 16:49:45 +03:00
Andrey e16558bd9e Refactor connection managers. 2023-07-16 09:06:28 +03:00
Andrey Dolgolev fb0f22c052
Merge pull request #858 from moonstream-to/remove-local-session
Remove local session.
2023-07-15 00:39:55 +03:00
Andrey 40f498e5a9 Remove local session. 2023-07-14 23:49:27 +03:00
Andrey Dolgolev 218da46e47
Merge pull request #856 from moonstream-to/fix-incorrect-db-session
Fix metadata session managment.
2023-07-14 19:48:10 +03:00
Andrey Dolgolev 03fcf456c7
Merge pull request #855 from moonstream-to/fix-missing-addresses
Revert jobs endpoint changes.
2023-07-14 19:47:54 +03:00
Andrey bb1bade57b Add comment. 2023-07-14 19:47:07 +03:00
Andrey 0d6259a52d Fix metadata session managment. 2023-07-14 19:42:59 +03:00
Andrey b9d0f1ce7d Add changes. 2023-07-14 19:14:47 +03:00
Andrey edb9ffcc4e Add changes. 2023-07-14 19:06:50 +03:00
Andrey 49ab67697e Add changes. 2023-07-14 18:51:29 +03:00
Andrey 03ce50580b Add changes. 2023-07-14 18:46:07 +03:00
Andrey 93418ebf76 Add changes. 2023-07-14 18:41:49 +03:00
Andrey d9873b64c4 Add changes. 2023-07-14 18:07:16 +03:00
Andrey 3ca04573b8 remove unuse secondary fields. 2023-07-14 18:05:24 +03:00
Andrey 984115dadc Add changes. 2023-07-14 18:04:16 +03:00
Andrey 40366d5e06 remove query parameter. 2023-07-14 18:02:49 +03:00
Andrey 5cd830a3c4 Add changes. 2023-07-14 13:59:03 +03:00
Andrey Dolgolev 147819e1ac
Merge pull request #851 from moonstream-to/metadata-crawler-refactor
Refactor metadata crawler.
2023-07-13 21:29:52 +03:00
Andrey Dolgolev b4960019f7
Merge pull request #853 from moonstream-to/fix-moonworm-task
Skip all not found entries.
2023-07-13 21:06:19 +03:00
Sergei Sumarokov e8a1618dfb
Merge pull request #852 from moonstream-to/fix-service
Fixed deploy service file for api
2023-07-13 10:06:15 -07:00
kompotkot 3f53809869 Fixed deploy service file for api 2023-07-13 17:04:28 +00:00
Sergei Sumarokov 0663fc2031
Merge pull request #850 from moonstream-to/fix-deployment
Fixed deploy path for moonstreamapi
2023-07-13 08:59:30 -07:00
kompotkot 622218139b Fixed deploy path for moonstreamapi 2023-07-13 15:58:32 +00:00
Andrey Dolgolev e960029673
Merge pull request #847 from moonstream-to/add-batch-jobs-endpoint
Add jobs status to subscription list
2023-07-13 18:08:24 +03:00
Andrey Dolgolev 734bbaac5e
Merge pull request #846 from moonstream-to/revert-844-revert-826-add-tags-and-descriptions
Add tags and descriptions after revert
2023-07-13 17:51:48 +03:00
Sergei Sumarokov e807e7b493
Merge pull request #849 from moonstream-to/revert-848-revert-845-zksync-mapi-support
Revert "Revert "Zksync support for moonstreamapi""
2023-07-13 07:48:14 -07:00
kompotkot 2f162cbf91 Bumped moonstreampi version 2023-07-13 14:47:49 +00:00
kompotkot c44ab9778c Updated moonstreamdb in requirements 2023-07-13 14:43:37 +00:00
Sergei Sumarokov 2d1a026bf0
Revert "Revert "Zksync support for moonstreamapi"" 2023-07-13 17:37:42 +03:00
Sergei Sumarokov f89ecd6fe0
Merge pull request #848 from moonstream-to/revert-845-zksync-mapi-support
Revert "Zksync support for moonstreamapi"
2023-07-13 07:15:03 -07:00
Sergei Sumarokov e11bad0bb3
Revert "Zksync support for moonstreamapi" 2023-07-13 17:14:11 +03:00
Sergei Sumarokov b1f3d24145
Merge pull request #845 from moonstream-to/zksync-mapi-support
Zksync support for moonstreamapi
2023-07-13 07:06:08 -07:00
kompotkot 591be28322 Black selectors_storage.py 2023-07-13 12:19:49 +00:00
kompotkot 9b57d7e057 Revert selectors storage 2023-07-13 12:18:07 +00:00
kompotkot e87a92e47e Zksync support for moonstreamapi 2023-07-13 12:15:05 +00:00
Andrey 177c2caf28 Add changes. 2023-07-13 15:00:40 +03:00
Andrey 60aa576a93 Skip all not found entries. 2023-07-13 14:34:45 +03:00
Andrey 22f4af26a2 Fixes. 2023-07-13 14:27:16 +03:00
Andrey Dolgolev 6de5552092
Merge pull request #844 from moonstream-to/revert-826-add-tags-and-descriptions
Revert "Add tags and descriptions"
2023-07-13 14:24:18 +03:00
Andrey Dolgolev c4470d321a
Revert "Add tags and descriptions" 2023-07-13 14:22:32 +03:00
Sergei Sumarokov df61dede63
Merge pull request #843 from moonstream-to/fix-int-parse
Fixed int parse for zksync model
2023-07-13 04:07:40 -07:00
kompotkot 5bd81bfefa Fixed int parse for zksync model 2023-07-13 11:05:37 +00:00
Andrey Dolgolev afc165a716
Merge pull request #826 from moonstream-to/add-tags-and-descriptions
Add tags and descriptions
2023-07-13 13:55:55 +03:00
Andrey 9fa794a856 Remove print. 2023-07-13 12:33:52 +03:00
Andrey ff3899d8d5 Add changes. 2023-07-13 12:32:17 +03:00
Sergei Sumarokov 421d350435
Merge pull request #842 from moonstream-to/fix-release-workflows
Fixed release workflow for moonstreamdb
2023-07-13 02:16:33 -07:00
kompotkot 0c2fe4a68d Fixed release workflow for moonstreamdb 2023-07-13 09:15:25 +00:00
Sergei Sumarokov 1f6105afce
Merge pull request #841 from moonstream-to/zksync-era-testnet-models
ZkSync Era testnet model
2023-07-13 02:04:06 -07:00
Sergei Sumarokov 358aadcec1
Merge pull request #837 from moonstream-to/nb-zksync-sup
Nodebalancer zksync blockchain support
2023-07-13 01:52:59 -07:00
kompotkot a9186181d8 Basic zksync sync and missing services 2023-07-13 08:52:30 +00:00
kompotkot fefd11a5d3 Bumped version of mooncrawl 2023-07-13 08:35:43 +00:00
Andrey 36d7796baf Merge branch 'main' into add-batch-jobs-endpoint 2023-07-13 11:31:31 +03:00
Andrey 1a68bd7a1f Remove jobs endpoint. 2023-07-13 10:35:29 +03:00
Andrey 3ea1e29f04 Add changes. 2023-07-13 10:32:22 +03:00
Andrey 9d577b676e Add changes. 2023-07-13 09:52:36 +03:00
Andrey 91ec48d7ac Add changes. 2023-07-13 09:37:23 +03:00
Andrey Dolgolev fa4baa9ba8
Revert "Revert "Add tags and descriptions"" 2023-07-13 15:16:15 +03:00
Andrey 355b286930 Add try for pydentic validation. 2023-07-13 07:17:25 +03:00
Andrey 7eea2c49b5 Refactor for left code more consitent. 2023-07-13 07:14:01 +03:00
Andrey 114420588d Remoce traceback. 2023-07-13 06:33:47 +03:00
Andrey 212bf0931f Temp state. 2023-07-13 05:44:44 +03:00
Andrey 6f8e852386 Add changes. 2023-07-12 17:37:33 +03:00
kompotkot aa5f0b2891 ZkSync era support for crawlers 2023-07-12 12:31:53 +00:00
kompotkot 1b0a8581d3 Specified nullable fields for zksync models 2023-07-12 12:30:39 +00:00
Sergei Sumarokov e7e1e72c5c
Merge pull request #840 from omahs/patch-1
Fix: typos
2023-07-12 05:07:56 -07:00
kompotkot a7f5e6507f ZkSync Era testnet model 2023-07-12 11:23:00 +00:00
omahs 867534da92
Fix: typos 2023-07-12 10:19:41 +02:00
omahs c6c0a2721e
Fix: typo 2023-07-12 10:17:53 +02:00
omahs 2afd172f15
Fix: typo 2023-07-12 10:16:26 +02:00
Andrey Dolgolev 3cc70294a0
Merge pull request #827 from moonstream-to/state-crawler-queryAPI-support
State crawler query api support
2023-07-10 21:46:46 +03:00
Andrey 4e2100423d Remove print. 2023-07-10 17:30:17 +03:00
Andrey c8796aa428 Merge branch 'main' into add-tags-and-descriptions 2023-07-10 17:29:40 +03:00
Sergei Sumarokov 88bee3d4f0
Merge pull request #838 from moonstream-to/fix-requirements
Set dependencies in requirements.txt for moonstreamapi
2023-07-10 05:04:05 -07:00
Andrey f7aec850de Add changes. 2023-07-10 14:59:46 +03:00
kompotkot 0b1a023bf1 Set dependencies in requirements.txt for moonstreamapi 2023-07-10 11:59:12 +00:00
Andrey e329a807b6 Remove prints. 2023-07-10 14:48:41 +03:00
Andrey 93a620dd67 Remove import. 2023-07-10 14:42:53 +03:00
Andrey 9596479592 Merge branch 'main' into state-crawler-queryAPI-support 2023-07-10 14:40:48 +03:00
Andrey 41ef7eaa61 Remove prints and breackpoints. 2023-07-10 14:38:03 +03:00
Andrey fc168a619e Add changes. 2023-07-10 14:32:44 +03:00
kompotkot fe60493dbc Default zksync blockchain available methods 2023-07-10 10:27:18 +00:00
Sergei Sumarokov 02cb2c3cb0
Merge pull request #836 from moonstream-to/revert-835-fix-cors-back
Revert "Emergency fix CORS back"
2023-07-07 09:32:31 -07:00
Sergei Sumarokov 7b43e0614f
Revert "Emergency fix CORS back" 2023-07-07 19:30:38 +03:00
Sergei Sumarokov 2d110a4cbb
Merge pull request #835 from moonstream-to/fix-cors-back
Emergency fix CORS back
2023-07-07 09:23:33 -07:00
kompotkot 9e1697665e Emergency fix CORS back 2023-07-07 16:22:05 +00:00
Andrey Dolgolev d16c880aab
Merge pull request #833 from moonstream-to/add-leaderboard-models
Add init version of get leaderboard endpoints.
2023-07-06 18:02:13 +03:00
Andrey b44322a501 Add Leaderboard model. 2023-07-06 08:51:46 +03:00
Andrey 6f4828932a Add missing response model. 2023-07-06 08:44:38 +03:00
Andrey 9d134f295b Add changes. 2023-07-06 08:41:47 +03:00
Andrey d3bdc3f28d Fix admin drops endpoint. 2023-07-06 07:30:50 +03:00
Andrey d27e675df0 Add init version of get leaderboard endpoints.
Add response models.
2023-07-05 21:49:43 +03:00
Sergei Sumarokov 12376013ae
Merge pull request #813 from moonstream-to/workers-clean-call-requests
Workers with call_requests clean action
2023-07-05 05:16:30 -07:00
kompotkot a3d88d9221 Build executables via deployment 2023-07-05 12:12:48 +00:00
kompotkot 2c51435cf1 Build executable of probes 2023-07-05 12:06:59 +00:00
kompotkot b92342e233 Fixed deploy probes env vars 2023-07-05 12:01:01 +00:00
Sergei Sumarokov 73bc3bdc70
Merge pull request #832 from moonstream-to/fix-orm-pydantic-convertion
Fix pydantic orm model convertion
2023-07-04 09:29:18 -07:00
kompotkot d999f43798 Fix pydantic orm model convertion 2023-07-04 16:27:16 +00:00
Sergei Sumarokov 74aed08a6d
Merge pull request #830 from moonstream-to/moonstream-admin-id
Fetch moonstream admin user info
2023-07-04 07:25:29 -07:00
kompotkot 9eefd7d67d Moonstream admin user id from env var 2023-07-04 14:24:18 +00:00
kompotkot 16881b19a9 Retries to fetch admin user data 2023-07-04 14:16:41 +00:00
kompotkot dc1b0e8a17 Fetch moonstream admin user info 2023-07-04 14:12:04 +00:00
Sergei Sumarokov 4ffa599d54
Merge pull request #829 from moonstream-to/revert-828-revert-821-cors-redis-cache
V2 - Modified CORS middleware with Redis cache workflow
2023-07-04 06:41:47 -07:00
kompotkot f91fb3b14b CORS origins CLI 2023-07-04 13:41:13 +00:00
kompotkot 7e8bb0bd59 Manual origin resource creation requirement 2023-07-04 13:17:36 +00:00
kompotkot 0a20cae636 Removed resource spam with startup 2023-07-04 13:07:43 +00:00
kompotkot 9045a3758b Updated requirements for engineapi with redis 2023-07-04 12:32:55 +00:00
Sergei Sumarokov 81e683a137
Revert "Revert "Modified CORS middleware with Redis cache workflow"" 2023-07-04 05:29:52 -07:00
Sergei Sumarokov e16f451144
Merge pull request #828 from moonstream-to/revert-821-cors-redis-cache
Revert "Modified CORS middleware with Redis cache workflow"
2023-07-04 05:25:57 -07:00
Sergei Sumarokov f5e7ec4901
Revert "Modified CORS middleware with Redis cache workflow" 2023-07-04 05:24:16 -07:00
Sergei Sumarokov 75fceba337
Merge pull request #821 from moonstream-to/cors-redis-cache
Modified CORS middleware with Redis cache workflow
2023-07-04 03:51:55 -07:00
Andrey Dolgolev 4fa396d365
Merge pull request #814 from moonstream-to/support-interfaces-endpoint
Support interfaces endpoint
2023-07-04 13:29:57 +03:00
kompotkot 016d9129ae Correct auth for local redis 2023-07-04 09:55:28 +00:00
Andrey 338418ef72 Add billing module. 2023-07-04 07:00:41 +03:00
Andrey 1b3b2a3cdd Add init versions. 2023-07-04 07:00:14 +03:00
Andrey 42849691ff Add subscriptions filtering. 2023-07-01 17:07:12 +03:00
Andrey 67de697270 Add queryAPI job type. 2023-07-01 14:28:35 +03:00
Andrey e26e324a09 Merge branch 'main' into support-interfaces-endpoint 2023-06-22 19:13:16 +03:00
Andrey 2daf6ab755 Add changes. 2023-06-22 17:44:43 +03:00
Andrey 6a710ef9f7 Add changes. 2023-06-22 17:10:35 +03:00
Andrey fdb9e88d8f Merge branch 'main' into add-tags-and-descriptions 2023-06-22 17:08:07 +03:00
Andrey 5b4d429199 Add changes. 2023-06-22 17:07:27 +03:00
Andrey d998ac13b5 Add init version. 2023-06-22 16:51:55 +03:00
kompotkot 5eca0fb57f CORS origin now is one resource
This structure will help to track when origin were added.
2023-06-22 13:16:48 +00:00
Andrey Dolgolev 068bebb586
Merge pull request #825 from moonstream-to/fix-nullable-blockchain
Fix null value.
2023-06-22 15:33:06 +03:00
Andrey bb4b6330fb Fix null value. 2023-06-22 15:28:56 +03:00
Andrey Dolgolev 0228db4c0e
Merge pull request #824 from moonstream-to/add-EOA-subscription-type
Add new subscriptions type.
2023-06-22 15:12:23 +03:00
Andrey 7aee7e72e3 Add blockchain. 2023-06-22 15:10:50 +03:00
kompotkot aca575052b Used Redis cache for CORS origins cache 2023-06-22 10:55:29 +00:00
Andrey 92888ba80d change usage of nodebalancer. 2023-06-22 13:30:09 +03:00
Andrey 07de2c7382 Add if for wyrm chain. 2023-06-22 12:05:23 +03:00
Andrey cfa48fccf5 Add changes. 2023-06-22 11:59:36 +03:00
Andrey 327e46d896 Add changes. 2023-06-22 11:47:53 +03:00
Andrey b90d92f7b3 Add new subscriptions type. 2023-06-21 17:48:03 +03:00
Andrey 9daa2e2805 Add changes. 2023-06-21 15:33:52 +03:00
Andrey 483a52bed8 Add changes. 2023-06-21 11:27:41 +03:00
Andrey Dolgolev 51e9a4df58
Merge pull request #822 from moonstream-to/fix-get-query
Add fix for name resolurtion in /query.
2023-06-20 15:51:30 +03:00
Andrey 22d0bfe083 Add fix. 2023-06-20 15:24:59 +03:00
Andrey 767921a67f Add fix for name resolurtion in /query. 2023-06-20 14:35:02 +03:00
Andrey d0ee979593 Add selectors for support interfaces. 2023-06-20 03:59:53 +03:00
Andrey 1169f7e22b Add threadPoolExecutor. 2023-06-19 17:48:32 +03:00
kompotkot 872c1f6e76 Update cache in background with PUT cors endpoint 2023-06-19 14:14:48 +00:00
Andrey Dolgolev d3b2e350f5
Merge pull request #820 from moonstream-to/queries-template
Queries template
2023-06-19 16:16:39 +03:00
Andrey 8051287d65 Add changes. 2023-06-19 16:14:54 +03:00
kompotkot 7c39a19b0b Functional CORS origins workflow with Redis cache 2023-06-19 12:14:09 +00:00
Andrey 9dbd3b2871 Delete queries templates from report_crawler. 2023-06-19 14:13:16 +03:00
Andrey c848de4714 Remove query copy. 2023-06-19 14:01:44 +03:00
Andrey c1fdf25342 Bump version 2023-06-19 13:58:46 +03:00
Andrey 59d8342faa Add missing cli file 2023-06-19 13:56:47 +03:00
Andrey a8b47b630c Bump bugout client version. 2023-06-19 13:32:00 +03:00
Andrey 39047c8022 Add interfaces response. 2023-06-19 01:36:20 +03:00
Andrey 0a7a5a7d99 Add changes. 2023-06-19 01:19:10 +03:00
Andrey d473db954c Add changes. 2023-06-19 00:05:45 +03:00
kompotkot 360f4d8286 Modified CORS middleware with Redis cache workflow 2023-06-17 21:04:05 +00:00
Andrey 4788a3d8a7 Add changes. 2023-06-16 18:15:39 +03:00
Andrey b2bf46ad7e Add changes. 2023-06-16 18:08:56 +03:00
Andrey 8cb7dfb8be Add filters on queries execution. 2023-06-16 14:30:02 +03:00
Andrey da9d343577 Add error handling. 2023-06-15 15:43:03 +03:00
Andrey 476f24dd50 Refactor functions positions. 2023-06-15 15:19:04 +03:00
Andrey cadb226744 Add support interfaces without abis. 2023-06-15 14:58:10 +03:00
Sergei Sumarokov 7bbb0be6df
Merge pull request #816 from moonstream-to/removed-frontend
Removed old frontend
2023-06-13 06:55:49 -07:00
kompotkot 45dee64e5d Removed old frontend 2023-06-13 13:34:13 +00:00
kompotkot d5fff67abd Work with multiple configuration files 2023-06-13 12:30:59 +00:00
kompotkot d438801b98 DB timeout as service config and CLI arg 2023-06-13 08:52:49 +00:00
kompotkot b2bb3b70a9 Fixed typo with probes 2023-06-13 08:02:48 +00:00
Andrey Dolgolev 0a73a800d2
Merge pull request #815 from moonstream-to/fix-historical-function-crawl
Fix historical function crawl
2023-06-13 00:34:33 +03:00
Andrey 3560be1e55 Add changes. 2023-06-12 23:43:15 +03:00
Andrey d4e32b520f Fix function crawl. 2023-06-12 22:42:20 +03:00
Andrey af06bfa0e5 Add changes. 2023-06-12 21:37:26 +03:00
kompotkot f9646ea8ba Run service at probs simultaneously 2023-06-12 14:04:24 +00:00
Andrey a4a982b1c1 Add query suggestion and copy. 2023-06-12 16:08:31 +03:00
Andrey 63105b99e4 Add chages. 2023-06-12 14:30:23 +03:00
Andrey Dolgolev a54048fb0a
Merge pull request #790 from moonstream-to/add-lands-tasks
Add lands contracts.
2023-06-09 09:08:38 +03:00
Andrey 264955a2e3 Add changes. 2023-06-09 01:11:55 +03:00
Andrey de7f01e7f0 Add changes. 2023-06-09 00:15:20 +03:00
Andrey e1e8a4e45c Merge branch 'main' into add-lands-tasks 2023-06-08 18:48:21 +03:00
Andrey a52910b710 Merge branch 'main' into support-interfaces-endpoint 2023-06-08 17:23:17 +03:00
kompotkot ce99e7140a Workers with call_requests clean action 2023-06-08 14:16:43 +00:00
Andrey 5519975b55 Add init version. 2023-06-08 16:34:41 +03:00
Sergei Sumarokov 2f08452fbb
Merge pull request #812 from moonstream-to/fix-engineapi-deploy
Engine API deployment update
2023-06-07 04:13:22 -07:00
kompotkot 001a01d5d6 Fixed path to engine api env 2023-06-07 10:52:01 +00:00
kompotkot 660d7a7f49 Engine API deployment update 2023-06-07 10:50:34 +00:00
Sergei Sumarokov 8df6ba410d
Merge pull request #803 from moonstream-to/struct-nodebalancer
Updated nodebalancer placement
2023-06-06 08:31:04 -07:00
Sergei Sumarokov 10a3123b30
Merge pull request #804 from moonstream-to/struct-moonstreamapi
Updated moonstreamapi placement
2023-06-06 08:30:52 -07:00
Sergei Sumarokov 3d7897b0b1
Merge pull request #805 from moonstream-to/struct-moonstreamdb
Updated moonstreamdb placement
2023-06-06 08:30:40 -07:00
Sergei Sumarokov 837d02ffc8
Merge pull request #806 from moonstream-to/struct-engineapi
Updated engineapi placement
2023-06-06 08:30:27 -07:00
Sergei Sumarokov 438cb5be69
Merge pull request #807 from moonstream-to/struct-robots
Updated robots placement
2023-06-06 08:30:11 -07:00
kompotkot 897c2faa90 Moved sample for engineapi from web3 repo 2023-06-06 13:01:54 +00:00
kompotkot 820adb4ce3 Robots deployment from api repo 2023-06-06 12:29:29 +00:00
kompotkot ac1a75d043 Updated robots placement 2023-06-06 12:25:07 +00:00
kompotkot 3c240db2e1 Updated engineapi placement 2023-06-06 12:11:49 +00:00
kompotkot a7cbaae00e Updated moonstreamdb placement 2023-06-06 11:49:42 +00:00
kompotkot b07c77c138 Updated moonstreamapi placement 2023-06-06 11:40:25 +00:00
kompotkot 4647ce7426 Updated nodebalancer placement 2023-06-06 11:35:51 +00:00
Sergei Sumarokov 43a8e09d35
Merge pull request #802 from moonstream-to/fix-cors-nb
Fixed preflight requests for nb
2023-06-06 01:26:03 -07:00
kompotkot 4682ab3b2b Fixed preflight requests for nb 2023-06-05 20:05:43 +00:00
Sergei Sumarokov 6e3ae7478d
Merge pull request #800 from bugout-dev/fix-nb-cors-post
Fixed nodebalancer cors post support
2023-06-05 05:50:03 -07:00
kompotkot a5482d5885 Fixed bug with inhering commonHandler for nb 2023-06-05 12:42:38 +00:00
kompotkot 7663e67b77 Fixed nodebalancer cors post support 2023-06-05 11:32:36 +00:00
Sergei Sumarokov 2da576ad1c
Merge pull request #799 from bugout-dev/nb-fix-res-perm
Removed unnecessary permissions for nb user
2023-06-05 03:32:33 -07:00
kompotkot 1e1f1ef2c2 CORS headers for nodebalancer 2023-06-05 10:28:03 +00:00
kompotkot 84d941b0df Removed unnecessary permissions for nb user 2023-06-05 07:50:33 +00:00
Sergei Sumarokov dce18b124d
Merge pull request #796 from bugout-dev/fix-hardcode-brood-url-nb
Hardcoded auth url for nb
2023-05-31 08:45:55 -07:00
kompotkot b629e42f17 Hardcoded auth url for nb 2023-05-31 15:44:41 +00:00
Andrey Dolgolev 5a7e328334
Merge pull request #795 from bugout-dev/polygon-crawl-parameters
Change polygon crawler parameters.
2023-05-31 18:36:40 +03:00
Andrey eb20013588 Change to 50. 2023-05-31 18:27:41 +03:00
Andrey 1eb263b071 Change polygon crawler parameters. 2023-05-31 18:25:57 +03:00
Sergei Sumarokov 245994dbed
Merge pull request #792 from bugout-dev/nb-manual-brood-client
Manual brood client creation with timeout
2023-05-31 07:53:40 -07:00
Andrey Dolgolev 8c9e1cec65
Merge pull request #794 from bugout-dev/fix-command-name
Fix history to historical.
2023-05-31 17:50:54 +03:00
Andrey 243338705c Fix history to historical. 2023-05-31 17:49:13 +03:00
Andrey Dolgolev deb2cc5392
Merge pull request #793 from bugout-dev/fix-deploy-scripts
Fix deploy argument.
2023-05-31 17:37:21 +03:00
Andrey 479ad41184 Fix deploy script run parameters. 2023-05-31 17:35:04 +03:00
Andrey c697aad609 Change error to logger. 2023-05-31 17:30:10 +03:00
Andrey ee8d1cf457 Add changes. 2023-05-31 17:22:56 +03:00
kompotkot 9a0b7eb8f0 Err handling for Bugout client creation 2023-05-31 14:20:53 +00:00
Andrey Dolgolev 72ccc6c0e0
Merge pull request #789 from bugout-dev/historical-crawl-tasks
Historical crawl tasks
2023-05-31 17:09:52 +03:00
kompotkot 96886a56a0 Manual brood client creation with timeout 2023-05-31 14:07:29 +00:00
Andrey 2e211a6b18 Use mappings instead hardcode. 2023-05-31 17:06:49 +03:00
Andrey 96af5d950c Fix typo. 2023-05-31 16:59:59 +03:00
Sergei Sumarokov 541779c0b5
Merge pull request #787 from bugout-dev/nb-auth-token-access
Nodebalancer access by Bearer access token
2023-05-31 05:29:55 -07:00
kompotkot f6883d87a9 Renamed env var for nb app id 2023-05-31 12:05:57 +00:00
kompotkot 8cff6ba00f Merge branch 'main' into nb-auth-token-access 2023-05-31 10:51:18 +00:00
Sergei Sumarokov 626954484c
Merge pull request #786 from bugout-dev/nb-rate-limit
Nodebalancer rate limit
2023-05-31 03:32:36 -07:00
kompotkot 5f9d8072c1 Updated deployment env vars for nb 2023-05-31 07:06:44 +00:00
Andrey 9f82dc3b7f Add changes. 2023-05-30 17:34:49 +03:00
Andrey 8f5ab20ed2 Add lands contracts. 2023-05-30 17:21:52 +03:00
Andrey ee9fba7469 Add fix for end_block. 2023-05-30 17:13:18 +03:00
Andrey 13fc900bc1 Add deployments. 2023-05-30 17:10:03 +03:00
Andrey 839622df10 Add changes. 2023-05-29 17:12:57 +03:00
Andrey ad2045dd80 Add changes. 2023-05-29 16:46:11 +03:00
Andrey 43e0367f17 Add changes. 2023-05-29 16:29:45 +03:00
Andrey 6f86ad6a02 Add jobs endpoint. 2023-05-25 17:00:20 +03:00
Andrey de39b35f69 Bump versions. 2023-05-25 16:44:10 +03:00
Andrey bcc9897fb1 Add fixes. 2023-05-25 16:06:33 +03:00
kompotkot 30a1fee536 Bumped version of nb 2023-05-25 11:22:57 +00:00
kompotkot 43d7e4a807 Small fixes for access cache in nb 2023-05-25 11:19:46 +00:00
kompotkot bfdc2eb718 Optimized cache reuse and set default values in config 2023-05-24 16:49:41 +00:00
kompotkot 7f89784f2f Support of two caches for access IDs and Auth tokens 2023-05-24 13:25:00 +00:00
kompotkot 2d42ac4cd5 Correct permissions during migration script for nb 2023-05-24 13:24:23 +00:00
kompotkot 401ae81dc6 Set bugout resource type for nodebalancer access 2023-05-23 13:40:15 +00:00
Andrey cf93f99fb1 Add initial working state. 2023-05-23 13:56:38 +03:00
kompotkot 33adf6255a During migration add permissions to access ID owner for resource 2023-05-23 09:58:33 +00:00
kompotkot 4c86217439 User prompt for migration and updated README 2023-05-23 07:46:29 +00:00
kompotkot 1e825c5487 Migration to transfer nodebalancer access to other application 2023-05-22 14:45:57 +00:00
kompotkot e46eb54f91 Default data-source is set to blockchain, so no needs of query param 2023-05-22 12:53:15 +00:00
kompotkot e2f454af5f Fixed logic of internal usage access 2023-05-22 12:30:09 +00:00
kompotkot 647cccb99f Take into account calls during current session 2023-05-22 11:43:28 +00:00
kompotkot e199d5bb1a Working version of nb with call counter limitation 2023-05-22 11:38:41 +00:00
kompotkot 40c9c21777 Update access CLI and new client keys to support call limits 2023-05-18 14:16:10 +00:00
kompotkot 759a51db46 Cleaned from unused code 2023-05-16 11:23:52 +00:00
kompotkot 9da72eac44 Fixed client tests and small changes 2023-05-16 11:07:24 +00:00
kompotkot 363388857b Small changes 2023-05-16 10:47:41 +00:00
Andrey 07ad71fd9c Add initial version. 2023-05-11 17:20:34 +03:00
Anton Mushnin 8e7da79fb1
Merge pull request #785 from bugout-dev/team-page-content
adding Anton's card
2023-05-10 21:11:06 +03:00
Andrey Dolgolev 55cd64721c
Merge pull request #778 from bugout-dev/query-parameters-endpoint
Extend get query endpoint.
2023-05-09 16:01:24 +03:00
Andrey 4a72ec0b5f Add init logic. 2023-05-09 15:29:17 +03:00
Andrey 4b13572040 Add changes. 2023-05-09 13:11:34 +03:00
Andrey d20c0bf43c Add fixes. 2023-05-08 16:04:32 +03:00
Andrey ba1992c26d Add fix of subscriptions. 2023-05-04 18:30:25 +03:00
Andrey 4535e7b3c0 bump version. 2023-05-04 17:20:55 +03:00
Andrey 50c4720349 Add type support. 2023-05-04 16:28:37 +03:00
Andrey d2f29f5831 Fix data type. 2023-05-03 17:21:48 +03:00
Andrey 789ed431c1 Add changes. 2023-05-03 17:00:20 +03:00
Andrey d794a887ce Add fixes. 2023-05-03 16:48:40 +03:00
Andrey c928e11fcb Merge branch 'main' into query-parameters-endpoint 2023-05-03 15:41:38 +03:00
Anton Mushnin 7ee79d76d2 adding Anton's card 2023-05-02 19:38:19 +03:00
Sergei Sumarokov f26c25e3e3
Merge pull request #784 from bugout-dev/revert-781-turned-off-upload
Revert "Turned off Uppload for frontend ABI"
2023-05-02 18:39:15 +03:00
Sergei Sumarokov da433d7bf7
Revert "Turned off Uppload for frontend ABI" 2023-05-02 18:38:12 +03:00
Sergei Sumarokov 75b6328b39
Merge pull request #783 from bugout-dev/entity-client-update-version
New version for entity client
2023-05-02 17:59:48 +03:00
Sergei Sumarokov f6992a5af7
Updated entity client version 2023-05-02 17:57:45 +03:00
Sergei Sumarokov f79c064dd8
New version for entity client 2023-05-02 17:56:17 +03:00
Andrey Dolgolev b21740ec38
Merge pull request #782 from bugout-dev/fix-etity-keys-duplication
Fix entities migration.
2023-05-02 17:13:07 +03:00
Andrey 9f2051688a Add limit and offset. 2023-05-02 15:04:46 +03:00
Andrey aa0f2458d7 Merge branch 'main' into query-parameters-endpoint 2023-05-02 14:30:10 +03:00
Andrey 4d31f8394a Add changes. 2023-05-01 18:02:47 +03:00
Andrey c13ece0580 Add entity_id in required_fields of copy. 2023-05-01 13:04:09 +03:00
Andrey 24cccddb99 Add changes in migration steps run. 2023-05-01 12:53:44 +03:00
Andrey d7f08a05d3 Add migration. 2023-05-01 12:32:28 +03:00
Sergei Sumarokov fb359ab40c
Merge pull request #781 from bugout-dev/turned-off-upload
Turned off Uppload for frontend ABI
2023-04-27 21:04:19 +03:00
kompotkot 1f9608d156 Turned off Uppload for frontend ABI 2023-04-27 18:03:15 +00:00
Andrey Dolgolev 2bdd5c3895
Merge pull request #780 from bugout-dev/update-entity
Bump version.
2023-04-27 20:45:06 +03:00
Andrey fd9495340a Bump version. 2023-04-27 20:28:38 +03:00
Andrey Dolgolev 7394c969cf
Merge pull request #751 from bugout-dev/entity-subscriptions
Add changes to subscription API for works with entity as subscription…
2023-04-27 20:02:47 +03:00
Andrey 14ed5325df Change env name in sample.env 2023-04-27 19:13:49 +03:00
Andrey e2f84bbd51 Remove unused variable. 2023-04-27 19:11:12 +03:00
Andrey 1c0a6dd467 Bump versions. 2023-04-27 19:07:18 +03:00
Andrey 4d1a558747 Remove prints. 2023-04-27 19:06:09 +03:00
Andrey 222581f1d0 Fix names of env variables. 2023-04-27 19:04:07 +03:00
Andrey d98f3e4c2d Extend get query endpoint. 2023-04-27 17:21:48 +03:00
Andrey 0db9de4f56 add subscription create log 2023-04-27 16:02:21 +03:00
Andrey 180cbe455b Fix dashboard_settings overwrite. 2023-04-27 15:58:02 +03:00
Andrey 97153b0c4b Extend migration cli. 2023-04-27 15:37:17 +03:00
Andrey 3279ab5d25 remove traceback. 2023-04-26 18:09:07 +03:00
Andrey bf2716cfd0 Add changes in enviroments. 2023-04-26 18:08:17 +03:00
Andrey 28358c93f5 Fix mypy. 2023-04-26 18:04:56 +03:00
Andrey 1c908d73fc Fix pints. 2023-04-26 18:01:33 +03:00
Andrey 1f9bb83cfa Add mypy fixes. 2023-04-26 17:55:13 +03:00
Andrey d7c8a13ba1 Add suggested changes. 2023-04-26 17:38:32 +03:00
Andrey ee45e08370 Fix missing component. 2023-04-26 17:26:48 +03:00
Andrey 2e52e68739 Remove prints. 2023-04-26 17:18:56 +03:00
Andrey f83aec9166 Fix mypy. 2023-04-26 16:37:19 +03:00
Andrey 8f36278f1b Remove prints. 2023-04-26 16:30:54 +03:00
Andrey 782c7082ad Frontend changes. 2023-04-26 16:27:38 +03:00
Andrey e2c50c26b9 Remove missmappng and remove cu-watch fix. 2023-04-25 18:39:25 +03:00
Andrey ad06bf947f Fix merging duplicates. 2023-04-25 17:50:46 +03:00
Andrey 447763ca85 Fix dashboards cache. 2023-04-25 17:41:18 +03:00
Andrey da905d8ced Add fixes. 2023-04-25 17:10:46 +03:00
Andrey 231382422e Changes:
Add cli step command
Fix actions tokens in moonstream
Fix dashboards API
Fix dashboard resources reconection.
Fix mooncrawl dashboards generation workflow.
2023-04-25 16:49:01 +03:00
Andrey ccfae29520 Add fixes and restore flow for dashboards. 2023-04-20 15:55:22 +03:00
Andrey 55048fc6c0 Merge branch 'main' into entity-subscriptions 2023-04-13 17:58:16 +03:00
Andrey a54e9bb3b1 Add downgrade. 2023-04-13 17:49:56 +03:00
Andrey Dolgolev 514c859430
Merge pull request #776 from bugout-dev/fix-wyrm-blocks-batch
Add min-blocks-batch 1 for wyrm chain.
2023-04-12 16:53:19 +03:00
Andrey 42cca77868 Add min-blocks-batch 1 for wyrm chain. 2023-04-12 15:23:10 +03:00
Andrey Dolgolev 487e74058a
Merge pull request #775 from bugout-dev/moonworm-conformations-mumbai-40
Mumbai moonworm-crawler conformations set to 40
2023-04-11 15:51:10 +03:00
Andrey c2a02eb70a Mumbai moonworm-crawler conformations set to 40 2023-04-11 15:28:01 +03:00
Sergei Sumarokov f4d0ce6d9a
Merge pull request #774 from bugout-dev/low-mumbai-conf-crawlers
Set confirmation blocks for mumbai crawler 20
2023-04-11 14:09:59 +03:00
kompotkot 8b95f6cece Set confirmation blocks for mumbai crawler 20 2023-04-10 18:24:01 +00:00
Andrey Dolgolev 584b2385ec
Merge pull request #773 from bugout-dev/dao-workflow-with-web3-pined-version
Dao workflow with web3 pined version
2023-04-06 19:49:03 +03:00
Andrey 6c8e9bbb5b Add fixes. 2023-04-06 19:46:10 +03:00
Andrey 9ab9e7fd1f Fix query template. 2023-04-06 19:18:10 +03:00
Andrey ada492e372 Add equal to. 2023-04-06 15:42:44 +03:00
Andrey 91ca3d15bf Add same version as moonworm. 2023-04-06 15:40:28 +03:00
Andrey ff6a2ed5d5 Fix env name. 2023-04-05 19:23:26 +03:00
Andrey a0b1ee7770 Fix service. 2023-04-05 19:02:54 +03:00
Andrey 30a9bf9951 Add fixes. 2023-04-05 19:01:10 +03:00
Andrey d2cef2b637 Add deploy scripts. 2023-04-05 18:38:05 +03:00
Andrey b441e316a0 Create orange dao pipeline. 2023-04-05 18:22:40 +03:00
Sergei Sumarokov 99504a431a
Merge pull request #770 from bugout-dev/fix-polygon-confirmations
Set polygon confirmations to sync crawler to 40
2023-03-15 13:41:35 +03:00
kompotkot f2a69072e0 Full args name for easy maintenance 2023-03-15 09:58:55 +00:00
kompotkot fd652092cc Set polygon confirmations to sync crawler to 40 2023-03-15 09:57:06 +00:00
Andrey Dolgolev eb350bd7ec
Merge pull request #767 from bugout-dev/wyrm-blocks-transactions
Wyrm blocks transactions
2023-03-14 18:31:03 +02:00
Andrey Dolgolev 048079a6b7
Merge pull request #768 from bugout-dev/fix-start-block
Add start block as 0.
2023-03-14 18:30:40 +02:00
Andrey 0e3b4928a7 Add changes. 2023-03-14 14:24:28 +02:00
Andrey 534004851f Add deploy.bash commands and deploy scripts. 2023-03-14 14:16:17 +02:00
Andrey e76669921e Add full args names. 2023-03-14 12:20:52 +02:00
Andrey d910f1bfa7 Add start block as 0. 2023-03-14 00:23:37 +02:00
Andrey Dolgolev fcc80ac619
Merge pull request #715 from bugout-dev/add-parameters-in-s3-path
Add parameters in s3 path
2023-03-09 20:02:19 +02:00
Andrey 4c36794d79 Update versions. 2023-03-09 19:59:08 +02:00
Andrey 7b3df0912c Black formating. 2023-03-09 19:49:00 +02:00
Andrey 612da984a7 Add sorted keys and change get_links endpont to POST. 2023-03-09 19:45:44 +02:00
Andrey f2bc8dfd17 Merge branch 'main' into add-parameters-in-s3-path 2023-03-09 18:41:50 +02:00
Andrey e885cf5fe2 Fix block crawler and missing block crawler. 2023-03-09 14:12:25 +02:00
Andrey 082ca2b867 Add fix for transaction type. 2023-03-09 11:32:54 +02:00
Sergei Sumarokov 95588afa30
Merge pull request #766 from bugout-dev/custom-db-engine-for-crawlers
Custom engine for all crawlers with specific timeout
2023-03-09 12:00:39 +03:00
kompotkot 99a608c6dc Custom engine for all crawlers with specific timeout 2023-03-09 07:28:34 +00:00
Andrey Dolgolev b85939595c
Merge pull request #765 from bugout-dev/fix-metadata-crawler
Fix metadata crawler
2023-03-08 22:27:13 +02:00
Andrey aef0e4743e Update version. 2023-03-08 22:00:27 +02:00
Andrey abe8c17e8c Add textual clause for slqalchemy. 2023-03-08 21:59:30 +02:00
Andrey Dolgolev 1a7a385510
Merge pull request #764 from bugout-dev/fix-args-execute
Fix text clause miss for sqlalchemy 2.0.4 and dict converting.
2023-03-08 21:15:02 +02:00
Andrey a6184b725d Fix text clause miss for sqlalchemy 2.0.4 and dict converting. 2023-03-08 21:09:06 +02:00
Andrey Dolgolev 677f416420
Merge pull request #763 from bugout-dev/fix-typo-deploy-crawlers
Fixed typo in deploy crawlers and version of moonworm
2023-03-08 19:57:50 +02:00
kompotkot 59e4ce36fb Fixed typo in deploy crawlers and version of moonworm 2023-03-08 17:55:07 +00:00
Andrey Dolgolev e8a97406d3
Merge pull request #761 from bugout-dev/add-coldera-blockcahin
Add Wyrm blockchain support
2023-03-08 19:13:12 +02:00
Andrey ce3a5ffd41 update moonstreamdb in backend. 2023-03-08 19:06:48 +02:00
Andrey 3a8069e976 Update moonworm and moonstreamdb versions. 2023-03-08 19:04:40 +02:00
Andrey 0311551cf6 Change sqlalchemy to >=2.0.4. 2023-03-08 14:04:54 +02:00
kompotkot a51a275daa Bumped versions of moonstreamapi and mooncrawl 2023-03-08 07:59:31 +00:00
Andrey 3fb27c6ffa fix mypy. 2023-03-07 18:34:39 +02:00
Andrey 49c0454e6e Add fixes. 2023-03-07 18:26:05 +02:00
Andrey aae26b67d9 Fix import. 2023-03-07 18:12:22 +02:00
Andrey 469e1a4d7d Add type annotation. 2023-03-07 18:09:41 +02:00
Andrey c23afaa6de update deploy.bash. 2023-03-07 17:48:12 +02:00
Andrey 695c3e646a Add service. 2023-03-07 17:45:02 +02:00
Andrey e7e4ef8916 Black formating. 2023-03-07 17:19:01 +02:00
Andrey 2b646b200a Remove [tester](not available) for web3 dependemcy. 2023-03-07 17:00:25 +02:00
Andrey 3f8f63a866 Add mypy fixes. 2023-03-07 16:54:05 +02:00
Andrey 9b56b4d991 Add --no-confirmations parameter. 2023-03-07 16:16:01 +02:00
Andrey ccef2daf5e Add wyrm icon. 2023-03-07 14:20:26 +02:00
Andrey 887114b7a5 Add missing mappings.
Remove debug information outputs.
2023-03-07 13:47:14 +02:00
Andrey 16a0a804fd Add MOONSTREAM_WYRM_WEB3_PROVIDER_URI to sample env. 2023-03-07 13:35:58 +02:00
Andrey 84d39d5644 Change moonworm to networks. 2023-03-07 13:33:24 +02:00
Andrey b2249af97f Add black formating. 2023-03-06 19:31:59 +02:00
Andrey 3b0eb01c0c Fix lint and conformation can set as 0. 2023-03-06 19:28:08 +02:00
Andrey 7a3a949a93 Fix s3 upload. 2023-03-06 18:00:23 +02:00
Andrey d2836d7d41 Add Wyrm chain. 2023-03-06 17:58:25 +02:00
Anton Mushnin 3893e5e272
Merge pull request #760 from bugout-dev/land
Land
2023-03-06 10:07:51 +03:00
Andrey Dolgolev 8201526064
Merge pull request #762 from bugout-dev/fixes-for-cu-nft-dashboard
Add json upload.
2023-03-02 15:30:33 +02:00
Andrey 002a1ad88c Add json upload. 2023-03-02 15:08:21 +02:00
Andrey 1e60876519 Add tested version. 2023-03-02 14:26:36 +02:00
Anton Mushnin 69c0347c9c removing Yhtyyar's card 2023-03-01 18:09:48 +03:00
Anton Mushnin 8d9aab5013 Ishkhan is engineer 2023-03-01 13:27:57 +03:00
Anton Mushnin f497b90da2 open external link in new tab 2023-03-01 13:23:22 +03:00
Andrey Dolgolev 059d759890
Merge pull request #759 from bugout-dev/cu-nft-dashboard-pipeline
Add nft dashboard generation and deploy script.
2023-02-28 16:35:48 +02:00
Andrey b04506dbb6 Remove switch to ubuntu user from service script. 2023-02-28 16:32:44 +02:00
Andrey 8745dd1153 Add changes. 2023-02-28 16:22:04 +02:00
Andrey 60e96f5ad6 Add nft dashboard generation and deploy script. 2023-02-28 15:39:19 +02:00
Andrey 2bbfdb92b4 Test dasboards. Require fix for migration. 2023-02-27 12:47:10 +02:00
Andrey cd541cbb74 Add checkpoints and add cli migration id.
fix:
path to json migration files folder.
2023-02-15 14:29:05 +02:00
Andrey Dolgolev 6f168e37e8
Merge pull request #756 from bugout-dev/fix-metadata-crawler-writer
Add fix of metadata crawler for more optimized writing to database.
2023-02-14 19:51:10 +02:00
Andrey cbccf12b56 Add new env variable MOONSTREAM_CRAWLERS_DB_STATEMENT_TIMEOUT_MILLIS. 2023-02-14 19:49:37 +02:00
Andrey d7e108a1c5 Add fix of metadata crawler for more optimized writing to database. 2023-02-14 19:26:49 +02:00
Andrey 7287e800b8 Add cache logic. 2023-02-14 18:43:33 +02:00
Andrey b1ff9eba0a Add 2023-02-14 17:13:02 +02:00
Andrey 94d33a7482 Add 2023-02-14 16:58:10 +02:00
Andrey c16d709994 merge changes. 2023-02-14 16:55:52 +02:00
Andrey Dolgolev 410471b193
Merge pull request #752 from bugout-dev/leaking-cache-in-metadata-crawler
Add leak of parsed data.
2023-02-14 14:04:12 +02:00
Andrey 6d7cbb0139 Fix if condition with leak_rate. 2023-02-13 14:32:41 +02:00
Andrey 1b1e6d6930 Max_recrawl have not strict. 2023-02-13 14:11:12 +02:00
Andrey 6381e29d7a Remove argument. 2023-02-13 14:06:08 +02:00
Andrey 8947f4249e Add fix of recrawl. 2023-02-13 14:04:25 +02:00
Andrey 3cc202b88b Add fixes. 2023-02-13 14:00:49 +02:00
Andrey 84ec8c80a8 black formating. 2023-02-10 12:04:34 +02:00
Andrey a3038b1f88 Add changes. 2023-02-10 00:17:34 +02:00
Andrey 86a3d79cdf Fix miss content variable. 2023-02-09 22:29:33 +02:00
Andrey fea92703db Remove testing part. 2023-02-09 22:03:50 +02:00
Andrey 63c16da8cf Remove commented code. 2023-02-09 22:01:41 +02:00
Andrey c79355e070 Add tested subscriptions api. With entity integration. 2023-02-09 21:51:58 +02:00
Andrey 1122590c7f Add test creation. 2023-02-08 23:30:45 +02:00
Andrey 4c7a7fdaf6 Add deletion step. 2023-02-07 17:30:58 +02:00
Andrey 556e91fba9 Add fixes and logging. 2023-01-31 15:12:57 +02:00
Andrey 9bdd7b504e Merge branch 'main' into leaking-cache-in-metadata-crawler 2023-01-31 14:14:37 +02:00
Andrey f9c6d29561 Extend leak logic with getting all tokens which have tx_calls except transfers after latest metadata crawl.
Leak-rate calculating in code depends on amount maybe updated tokens and max-recrawl cli argument.
2023-01-31 14:09:03 +02:00
Sergei Sumarokov 9cd4dedabe
Merge pull request #753 from bugout-dev/fix-old-moonworm-for-watch-cu
Use 0.2.4 moonworm for watch-cu crawler
2023-01-30 17:15:22 +07:00
kompotkot fd134352a1 Use 0.2.4 moonworm for watch-cu crawler 2023-01-30 09:58:01 +00:00
Sergei Sumarokov 91e0ffea5b
Merge pull request #750 from bugout-dev/crawlers-systems-support
Support of systems deployment
2023-01-30 15:50:49 +07:00
kompotkot 43c7df5ecf Fixed file mode in deploy 2023-01-30 08:49:00 +00:00
Andrey 6a292c6db8 Fix setup.py 2023-01-26 17:21:36 +02:00
Andrey 8c69840ea9 Add changes to subscription API for works with entity as subscriptions data storage instead of brood resources. 2023-01-26 17:19:25 +02:00
kompotkot c53c4f3648 Moonworm watcher for cu 2023-01-26 14:31:18 +00:00
kompotkot e5ef9cfe5e Support of systems deployment 2023-01-26 13:41:36 +00:00
Sergei Sumarokov cdaf64312f
Merge pull request #749 from bugout-dev/revert-741-nodebalancer-tags
Revert "Supports tags filter for nodes"
2023-01-25 22:05:33 +07:00
Sergei Sumarokov 3f814c779e
Revert "Supports tags filter for nodes" 2023-01-25 16:37:57 +03:00
Andrey 69cfe4069b Add leak of parsed data. 2023-01-19 16:39:44 +02:00
Andrey 59a3454d71 Add parameters hash to generate access links endpoint. 2023-01-17 15:23:28 +02:00
Andrey 6ec956c723 Merge branch 'main' into add-parameters-in-s3-path 2023-01-17 13:37:46 +02:00
Sergei Sumarokov 2659ad91b9
Merge pull request #741 from bugout-dev/nodebalancer-tags
Supports tags filter for nodes
2023-01-16 18:44:03 +07:00
kompotkot 87d034f48a Updated README.md and debug logs 2023-01-16 11:08:18 +00:00
kompotkot b4ca416e1c Fixed tests for clients 2023-01-16 10:55:48 +00:00
Anton Mushnin bd85f4869f
Merge pull request #746 from bugout-dev/navbar-fix
fixing navbar and whitepapper mobile
2022-12-22 19:46:43 +03:00
Anton Mushnin 66bc01e229 fixing navbar and whitepapper mobile 2022-12-22 19:33:21 +03:00
Anton Mushnin c6b63361af
Merge pull request #745 from bugout-dev/landing-pages
Landing pages
2022-12-22 18:57:21 +03:00
kompotkot e40744c04b Small fixes 2022-12-22 14:09:50 +00:00
kompotkot d3e6070ec9 Fixed keep alive interval 2022-12-22 13:02:50 +00:00
kompotkot 382d776f8d Balncer with tags based on CallCounter 2022-12-22 13:02:00 +00:00
Anton Mushnin 3ca2cec860 Whitepappers mobile 2022-12-22 00:46:19 +03:00
Anton Mushnin 4b2515c4af badge size and layout 2022-12-22 00:33:32 +03:00
Anton Mushnin b572089dc4 navbar layout 2022-12-22 00:23:23 +03:00
Anton Mushnin 7d2968f9d8 whitepappers mobile view 2022-12-21 18:44:03 +03:00
Anton Mushnin e065414d0c legal pages layout 2022-12-21 18:31:38 +03:00
Anton Mushnin 789035cd06 fix links 2022-12-21 18:29:30 +03:00
Anton Mushnin 7747d49abc team page layout 2022-12-21 18:29:12 +03:00
Anton Mushnin 882627aaa6 features page new images 2022-12-21 18:04:13 +03:00
Anton Mushnin c61a55a245 whitepappers desktop 2022-12-21 17:37:54 +03:00
Anton Mushnin 62525f6941
Merge pull request #743 from bugout-dev/landing-page-refresh
Landing page refresh
2022-12-21 13:38:28 +03:00
Anton Mushnin e6cfa39b7d home page layout 2022-12-20 23:14:01 +03:00
Anton Mushnin 9b260e5003 footer mixpanel report 2022-12-20 23:13:49 +03:00
Anton Mushnin 470b5dff74 layout 2022-12-20 18:15:17 +03:00
Anton Mushnin 17672bf552 title size 2022-12-19 21:13:06 +03:00
Anton Mushnin f86166e9af home page improvements 2022-12-19 21:08:08 +03:00
Anton Mushnin d450b625e1 navbar height 2022-12-19 21:07:54 +03:00
Anton Mushnin d132481fa6 changing footer 2022-12-19 21:02:16 +03:00
kompotkot de609da7cd Fixed internal crawlers access bug, small config fixes 2022-12-19 12:17:49 +00:00
Andrey Dolgolev 62d786a8a6
Merge pull request #739 from bugout-dev/metadata-crawler-improvements
Add fixes for metadata crawler
2022-12-15 20:20:50 +02:00
Andrey fa7c0f9ba1 Add deploy changes. 2022-12-15 20:17:00 +02:00
Andrey 2691409022 Merge branch 'main' into metadata-crawler-improvements 2022-12-15 20:14:31 +02:00
Andrey Dolgolev 0afd4c6ba3
Merge pull request #740 from bugout-dev/state-crawler-jobs-from-cli
Add deploy changes
2022-12-15 20:11:56 +02:00
Andrey 338b321b1f Add deploy changes 2022-12-15 20:09:27 +02:00
Andrey Dolgolev 909745a2e2
Merge pull request #737 from bugout-dev/state-crawler-jobs-from-cli
State crawler jobs from cli
2022-12-15 20:01:43 +02:00
Andrey c7cfe7a160 Fix service and timer to mumbai name. 2022-12-15 19:43:43 +02:00
Andrey e5b864d9c0 Rename to mumbai. 2022-12-15 19:40:49 +02:00
Andrey 5ec46a6a2f Remove log. 2022-12-15 19:34:39 +02:00
Andrey b16a4ff1a1 Add fixes. 2022-12-15 19:31:24 +02:00
Andrey e1aafd7552 Add fixes 2022-12-15 18:58:54 +02:00
Andrey 9cfd12dc8d Add state cleaner. 2022-12-15 17:34:49 +02:00
Andrey e64bb7fcad Add deploy services and fix if condition. 2022-12-15 17:27:51 +02:00
Andrey f68ab988c9 Add jobs folder. 2022-12-15 16:18:44 +02:00
Andrey 83771549d8 Add fixes. 2022-12-15 15:48:05 +02:00
Andrey a4dd79a663 Add read tasks from json file and custom web3 provider. 2022-12-15 15:45:41 +02:00
Andrey 6a379c1b55 Merge branch 'main' into fix-state-crawler 2022-12-15 14:26:00 +02:00
Sergei Sumarokov 1935d7fbcd
Merge pull request #735 from bugout-dev/gnosis-the-merge-updates
Fix deprecated keys for gnosis
2022-12-14 16:52:28 +03:00
kompotkot 36e58c7275 Fix deprecated keys for gnosis 2022-12-14 13:47:57 +00:00
Neeraj Kashyap 704c73abde
Update README.md 2022-12-07 09:03:12 -08:00
Neeraj Kashyap d6eb317fc8
Merge pull request #730 from bugout-dev/daria-bochkareva-patch-1
Update README.md
2022-12-07 09:02:05 -08:00
daria-bochkareva 706a16cf88
Update README.md 2022-12-07 17:49:00 +03:00
daria-bochkareva aa6f4d5184
Update README.md 2022-12-07 15:48:24 +03:00
Andrey Dolgolev 8fc810b9e9
Merge pull request #727 from bugout-dev/moonworm-add-rollback
Add rollback.
2022-12-05 14:06:59 +02:00
Andrey 36888404ef Add rollback. 2022-12-05 13:56:22 +02:00
Andrey f0857b4d73 Move hash generation to actions. 2022-11-30 17:31:19 +02:00
Andrey 0aeae49c97 Merge branch 'main' into add-parameters-in-s3-path 2022-11-30 17:14:37 +02:00
Andrey Dolgolev e917d9361d
Merge pull request #721 from bugout-dev/fix-passing-list-as-sql-parameter
Fix passing list as sql parameter
2022-11-29 17:15:31 +02:00
Andrey 5b4ddc6feb Fix pass params. 2022-11-29 17:05:22 +02:00
Andrey e34f544099 Add converting from json types. 2022-11-29 15:06:27 +02:00
Anton Mushnin d463d0a7d1
Merge pull request #720 from bugout-dev/fix-colors-2
put colors to theme
2022-11-29 14:35:24 +03:00
Anton Mushnin 2ded714936 put colors to theme 2022-11-29 13:41:55 +03:00
Sergei Sumarokov a866c8afca
Merge pull request #719 from bugout-dev/eth-moonworm-crawler
Moonworm crawlers for ethereum
2022-11-29 12:35:34 +03:00
Anton Mushnin 849ce50bde
Merge pull request #713 from bugout-dev/mobile-menu-layout
Mobile menu layout
2022-11-29 11:56:12 +03:00
kompotkot f3347224c9 Moonworm crawlers for ethereum 2022-11-28 17:35:18 +00:00
Andrey c7e8402785 remove comment. 2022-11-28 17:18:27 +02:00
Andrey 6c8046908d Black formating. 2022-11-28 17:16:53 +02:00
Andrey f60fe8693c Fix route. 2022-11-28 16:52:30 +02:00
Andrey b44881a28d Refactor code.. 2022-11-24 15:40:26 +02:00
Andrey a66039ad38 Move db state information. 2022-11-24 15:13:15 +02:00
Andrey 7bf1ef00af Move hash generation in api handler. 2022-11-24 15:02:32 +02:00
Andrey 3800c558b8 Move push to bucket in actions.py 2022-11-24 14:42:52 +02:00
Andrey e8a1187889 Add hash of parameter to s3 route.
Add fix for list support.
2022-11-24 14:40:39 +02:00
Neeraj Kashyap 48ad43cd9b
Added banner to top of README. 2022-11-22 09:32:11 -08:00
Anton Mushnin 3836dafa79 status page colors 2022-11-22 19:35:18 +03:00
Anton Mushnin 5c0a7f3ec1 team page cards restyling 2022-11-22 19:25:12 +03:00
Anton Mushnin b15f9e7687 whitepapers colors 2022-11-22 19:14:11 +03:00
Anton Mushnin 7aed617155 fix navbar disappearance when bounces 2022-11-22 10:11:46 +03:00
Anton Mushnin 7280015ff7
Merge pull request #712 from bugout-dev/landing-page-improvements
Landing page improvements
2022-11-21 17:10:10 +03:00
Anton Mushnin 9d566cf62a menu button style 2022-11-21 11:35:08 +03:00
Anton Mushnin 22f8012956 styling menus 2022-11-21 10:15:26 +03:00
Anton Mushnin 4d333191af fix Submit on Cancel button 2022-11-20 14:23:42 +03:00
Anton Mushnin 72caf9695e ajusting top of landing pages 2022-11-19 12:34:52 +03:00
Anton Mushnin 9ba9e59169 add menuButton to chakra theme 2022-11-19 12:33:20 +03:00
Anton Mushnin fee4e74861 remove unused var 2022-11-19 12:32:27 +03:00
Anton Mushnin 9f02ee21b0 mobile navbar 2022-11-19 12:32:13 +03:00
Anton Mushnin 224610088a calculate hidden navbar top 2022-11-19 12:28:44 +03:00
Anton Mushnin 779be7c23a adjust navbar height 2022-11-19 12:27:46 +03:00
Anton Mushnin c640c38fdb collapse first p of FAQ 2022-11-19 12:25:42 +03:00
Anton Mushnin b53b0d4952 password input eye 2022-11-17 19:47:38 +03:00
Andrey Dolgolev 100d024101
Merge pull request #711 from bugout-dev/remove-refetch-custom-crawler
Remove refetch add later after apear hash of parameters in s3 route.
2022-11-17 18:41:27 +02:00
Andrey 27f2ea6ec5 Merge branch 'main' into remove-refetch-custom-crawler 2022-11-17 18:30:21 +02:00
Anton Mushnin f3440eeba0
Merge pull request #709 from bugout-dev/fix-colors
Fix colors
2022-11-17 19:29:28 +03:00
Andrey b8b72ea35d Remove refetch add later after apear hash of paramaters in s3 route. 2022-11-17 18:20:33 +02:00
Andrey Dolgolev 9e8a7466b6
Merge pull request #710 from bugout-dev/bigger-await-for-query-results
Bigger await for results.
2022-11-17 17:45:41 +02:00
Andrey f54c113e65 Bigger await for results. 2022-11-17 17:42:10 +02:00
Anton Mushnin 9a8961e3e3 dashboard edit 2022-11-17 18:31:46 +03:00
Anton Mushnin 86102c90c7 themes 2022-11-17 17:49:45 +03:00
Anton Mushnin 05dd017a50 themes instead props 2022-11-17 14:07:20 +03:00
Anton Mushnin 6b106eb77f tokens view colors 2022-11-17 14:02:54 +03:00
Anton Mushnin db06fef9c3
Merge pull request #707 from bugout-dev/login-register-forms
Login register forms
2022-11-17 12:42:56 +03:00
Anton Mushnin 714407702b changing subscriptions header bg 2022-11-16 21:12:30 +03:00
Anton Mushnin 0f30e6699e temporary solution of hidden bottom pixels 2022-11-16 21:01:03 +03:00
Anton Mushnin ebc4f461d4 remove console.logs 2022-11-16 18:36:41 +03:00
Anton Mushnin 996f22727e newDashboardName modal styling 2022-11-16 17:36:39 +03:00
Anton Mushnin 308bea5ab7 UpdateSubscriptionLabelInput styling 2022-11-16 17:07:17 +03:00
Anton Mushnin fc7e97661f bw Input variant 2022-11-16 17:06:32 +03:00
Andrey Dolgolev 4639bef6bf
Merge pull request #706 from bugout-dev/replace-prints
Replace prints via logger.
2022-11-16 15:52:50 +02:00
Andrey 1a3509d554 Replace prints via logger. 2022-11-16 15:50:44 +02:00
Sergei Sumarokov 35e416bbf0
Merge pull request #704 from bugout-dev/fix-cu-crawler-deploy
Updated service file for cu queries crawler
2022-11-16 16:37:36 +03:00
kompotkot 8f98d5feba Updated service file for cu queries crawler 2022-11-16 13:36:36 +00:00
Andrey Dolgolev 6f3f62f35e
Merge pull request #703 from bugout-dev/add-piblic-queries-access-token
Add public queries access token.
2022-11-16 15:22:00 +02:00
Andrey aae3b9bd3e Add MOONSTREAM_PUBLIC_QUERIES_DATA_ACCESS_TOKEN for run queries for public dashboard. 2022-11-16 15:20:05 +02:00
Andrey f5fc52e8be Add public queries access token. 2022-11-16 15:10:08 +02:00
Andrey Dolgolev ca8aef467f
Merge pull request #693 from bugout-dev/add-cu-reports-crawler
Add cu reports crawler
2022-11-16 14:48:20 +02:00
Andrey 1dff0431ed Fix mypy. 2022-11-16 14:31:53 +02:00
Andrey 9d89b6231e Try again. 2022-11-16 14:21:25 +02:00
Andrey d23e83e15a Ignore mypy not recognize of Any type in params. 2022-11-16 14:17:09 +02:00
Andrey 9c2b3d42a1 Fix mypy.
Ignore for now note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
2022-11-16 14:13:02 +02:00
Andrey 16a3dc24f0 Add requested fixes:
1) CUSTOM_CRAWLER_S3_BUCKET -> MOONSTREAM_S3_PUBLIC_DATA_BUCKET_PREFIX
2) Add overwrite for init queries handlers
3) Add sleep
2022-11-16 14:05:01 +02:00
Anton Mushnin 7f373bbbfe new subscription form 2022-11-16 12:06:21 +03:00
Anton Mushnin f4052080f9 fix forgot password error 2022-11-16 10:39:55 +03:00
Anton Mushnin 05160fb931 little forms twiks 2022-11-16 10:37:23 +03:00
Anton Mushnin 7d4c790cba forgot password form 2022-11-16 10:36:58 +03:00
Anton Mushnin d6fbfbe747 signup form 2022-11-16 10:19:56 +03:00
Anton Mushnin 8c2f3fb0b4 login form styling 2022-11-16 00:39:25 +03:00
Anton Mushnin e1e5ded83d modals appearance 2022-11-16 00:39:01 +03:00
Anton Mushnin 70a06a468f PlainButton 2022-11-15 20:30:22 +03:00
Andrey d00c9d0790 Modify sample env. 2022-11-15 19:01:41 +02:00
Andrey 4808d600de Add creat query command.
Add additional re request update logic.
Add volume query.
2022-11-15 18:57:35 +02:00
Anton Mushnin 9cef6bc9dc Merge branch 'changing-menu' of https://github.com/bugout-dev/moonstream into mobile-menu 2022-11-15 12:18:24 +03:00
Neeraj Kashyap 7172666a90
Merge pull request #685 from gnawali/patch-1
Update README.md
2022-11-14 16:50:04 -08:00
Anton Mushnin 901e85089c mobile view account button menu 2022-11-14 21:16:03 +03:00
Anton Mushnin be00baca14 navbars sizes 2022-11-14 21:09:50 +03:00
Anton Mushnin 6dbc701f47 account menu 2022-11-14 17:38:00 +03:00
Andrey 5e100228cd Fix description and change version. 2022-11-14 16:03:51 +02:00
Anton Mushnin a5e158b414 mobile landing navbar 2022-11-14 13:59:56 +03:00
Anton Mushnin 0a33c1f0df Merge branch 'fixing-sidebar' of https://github.com/bugout-dev/moonstream into changing-menu 2022-11-14 12:17:08 +03:00
Anton Mushnin 14b444f13c adding Suspense 2022-11-14 11:47:30 +03:00
Anton Mushnin 306f45772b removing header 2022-11-14 11:34:10 +03:00
Anton Mushnin 9fdae7bf3e changing position 2022-11-14 11:29:14 +03:00
Anton Mushnin bd4dc4b0b7 put sidebar down in mobile view 2022-11-14 11:12:41 +03:00
Anton Mushnin 912a76c8a4 change desktop app dropdown menu 2022-11-13 20:27:55 +03:00
Anton Mushnin b8eaa3fdb8 change desktop landing dropdown menu 2022-11-13 20:01:31 +03:00
Anton Mushnin 97c8de3664 ok in desktops and mobile app views 2022-11-13 18:43:33 +03:00
Anton Mushnin f6c069cca8 streams page align 2022-11-11 14:19:39 +03:00
Anton Mushnin 3be9a0b190 subscriptions bgcolor when w < 530px 2022-11-11 14:15:18 +03:00
Anton Mushnin abec704636
Merge pull request #698 from bugout-dev/fix-text-color
Fix text color
2022-11-10 11:05:50 +03:00
Anton Mushnin 6855f27394 sidebar cursor pointer 2022-11-09 23:23:10 +03:00
Anton Mushnin 5ea0e64e86 streams filter form text color 2022-11-09 23:22:24 +03:00
Anton Mushnin ce3578689b contact form background 2022-11-09 23:21:27 +03:00
Andrey 69835d09c8 Black formating. 2022-11-09 22:09:17 +02:00
Andrey 2e65a2b889 Fix mypy. 2022-11-09 21:36:30 +02:00
Andrey c992475765 Merge branch 'main' into add-cu-reports-crawler 2022-11-09 21:20:12 +02:00
Andrey ef423b9739 Merge branch 'add-cu-reports-crawler' of github.com:bugout-dev/moonstream into add-cu-reports-crawler 2022-11-09 21:10:41 +02:00
Andrey 0c38a3d90e Add fixes in create queries logic. 2022-11-09 21:09:10 +02:00
Andrey 75ae88d2c3 Add fixes for parameters. Remove recrawling from different level already existing data.
Current state have issues from node. Timeouts and unsinchronize.
2022-11-09 19:47:04 +02:00
Sergei Sumarokov 93a73f18f2
Merge pull request #697 from bugout-dev/fix-deploy-user
Fixed user go dir in deployment
2022-11-09 17:42:26 +03:00
kompotkot 8fd1178ab5 Fixed user go dir in deployment 2022-11-09 14:39:16 +00:00
Sergei Sumarokov df4d23a907
Merge pull request #696 from bugout-dev/fix-deploy-env-dir
Create dir for env vars
2022-11-09 17:25:45 +03:00
kompotkot 5fa3c07497 Create dir for env vars 2022-11-09 14:23:37 +00:00
Sergei Sumarokov eadb8aa8ac
Merge pull request #695 from bugout-dev/systems-deploy
Deployment upgrades to work with systems
2022-11-09 16:33:59 +03:00
kompotkot b5c8e80560 Set explicit user for moonstream api deployment 2022-11-09 13:12:29 +00:00
Anton Mushnin 6ca5895e19
Merge pull request #694 from bugout-dev/fix-text-color
fixing white on white text
2022-11-09 15:35:09 +03:00
kompotkot e8e2481428 Migrated deployment to checkenv 2022-11-09 11:47:55 +00:00
Andrey db77374149 Merge branch 'main' into fix-state-crawler 2022-11-08 23:16:51 +02:00
Anton Mushnin 9341a5cd09 fixing white on white text 2022-11-08 21:53:18 +03:00
kompotkot 897d2d7321 Tokenonomics systemd services and changed on boot start timers 2022-11-03 16:56:18 +00:00
Andrey 0c6656fad5 cu dashboard generator. 2022-11-03 16:42:54 +02:00
Sergei Sumarokov ef95486716
Merge pull request #692 from bugout-dev/fix-client-release
Fix release client library github action
2022-11-03 12:55:04 +03:00
kompotkot b83303f1b5 Fix release client library github action 2022-11-03 09:52:32 +00:00
Sergei Sumarokov e13ef1cbfb
Merge pull request #687 from bugout-dev/client-supp-queries
New python client query api based
2022-11-03 12:45:13 +03:00
kellan-simiotics 8886a76ea6
Merge pull request #688 from bugout-dev/landing-improvements
Fixing layout colors when logged in.
2022-11-02 12:49:20 -04:00
Sergei Sumarokov bc0f80052b
Merge pull request #691 from bugout-dev/fix-mumbai-enum
Updated moonworm version
2022-11-02 17:46:48 +03:00
kompotkot 592d2cf667 Updated moonworm version 2022-11-02 14:42:42 +00:00
Sergei Sumarokov dc05519738
Merge pull request #690 from bugout-dev/mumbai-moonworm-crawler
Mumbai moonworm crawler
2022-11-02 17:32:01 +03:00
Kellan Wampler 4928e59fee Fixing text colors on subscriptions, dashboards, and modals. 2022-11-02 10:18:50 -04:00
kompotkot 2d1a4c4c9c Mumbai moonworm crawler 2022-11-02 13:37:23 +00:00
Kellan Wampler 3776a90ba1 Fixing layout colors when logged in. 2022-11-01 11:04:24 -04:00
kompotkot 8291fbb58e Fix of redirect exception 2022-10-27 16:12:20 +00:00
Andrey e23fd52453 Add terminus. 2022-10-27 18:46:16 +03:00
kompotkot c21dff3df8 Fix slash issues 2022-10-27 15:38:58 +00:00
Andrey 920c8941ef add reports. 2022-10-27 16:41:08 +03:00
kompotkot 48a1c8fbed Push to AWS S3 bucker support 2022-10-27 12:18:34 +00:00
kompotkot c8f4d4efdc Download query results data endpoint 2022-10-27 11:35:35 +00:00
Andrey 0436ab784a init state. 2022-10-27 13:00:08 +03:00
kompotkot b2e598e0f8 Timeouts 2022-10-27 09:38:35 +00:00
kompotkot 06cdb16042 Updated release script 2022-10-27 09:11:40 +00:00
Andrey 15126c5086 Add autoscale batch size. 2022-10-26 14:48:30 +03:00
kompotkot 43535cae50 New python client query api based 2022-10-26 11:29:25 +00:00
Andrey c580a7d3c2 Add jobs. 2022-10-20 21:20:01 +03:00
kellan-simiotics 01e916ed2f
Merge pull request #683 from bugout-dev/landing-improvements
Tweaks to landing page. Moving branches from landing page to new colo…
2022-10-20 13:05:41 -04:00
gnawali 777414c7db
Update README.md
The site is now available only with www prefix
2022-10-20 11:36:17 -05:00
Kellan Wampler ef6a3f3f15 Tweaks to landing page. Moving branches from landing page to new color scheme. 2022-10-20 10:58:32 -04:00
Andrey 94e98a3059 Add logging and thread poolexecutor. 2022-10-20 17:40:06 +03:00
Sergei Sumarokov 6fe23253f8
Merge pull request #682 from bugout-dev/mumbai-basic-crawlers
Mumbai sync and missing crawlers
2022-10-19 15:44:26 +03:00
kompotkot accb5caf03 Mumbai sync and missing crawlers 2022-10-19 09:22:06 +00:00
Sergei Sumarokov a8470441cb
Merge pull request #680 from zomglings/fix-crawler-tx-rollback
Added transaction rollback when there is a violation of unique constraint when crawling blocks
2022-10-18 17:13:44 +03:00
Andrey Dolgolev 3e2cfae8cf
Merge pull request #681 from bugout-dev/historical-crawl-convert-address
Add convert args address to checksum address.
2022-10-18 16:47:09 +03:00
Andrey 9f441373fe Add covert args address to checksum address. 2022-10-18 16:39:44 +03:00
Andrey b8ce45470b Add logging. 2022-10-18 16:28:03 +03:00
Neeraj Kashyap 3d7bbb03ce Added a rollback when unique constraint is violated
when attempting to add blocks to database.
2022-10-14 21:05:49 -07:00
Neeraj Kashyap 76792ea983 scratch directory in db/ 2022-10-14 21:01:39 -07:00
Neeraj Kashyap ddd70cb451
Merge pull request #679 from bugout-dev/landing-page-redesign
Fixed cropping issue on iphone size.
2022-10-13 13:06:40 -07:00
Kellan Wampler 327351880f Changes to contact form. 2022-10-13 15:00:07 -04:00
Kellan Wampler ae5accc568 Text change for revenue "and growing". 2022-10-13 14:44:57 -04:00
Kellan Wampler 4245dd1a12 Fixed cropping issue on iphone size. 2022-10-13 14:36:23 -04:00
kellan-simiotics 1e87b36e13
Merge pull request #678 from bugout-dev/landing-page-redesign
Landing Page redesign
2022-10-13 14:11:04 -04:00
Kellan Wampler d64c1a46df Changes from dev review. 2022-10-13 13:33:27 -04:00
Kellan Wampler 6826dfeda1 A couple more mobile fixes from dev meeting. 2022-10-13 13:32:14 -04:00
Kellan Wampler 2d6087e828 Removing comments. 2022-10-13 11:01:10 -04:00
Kellan Wampler f47c4469b3 Tweeks per review with Iskhan. 2022-10-13 10:25:23 -04:00
Kellan Wampler 4fbcdf0422 Updates to landing page for mobile. 2022-10-12 23:11:21 -04:00
Andrey Dolgolev e5240d2fd8
Merge pull request #677 from bugout-dev/add-timeout-to-provider
Add timeout for HTTPProvider.
2022-10-06 12:38:02 +03:00
Kellan Wampler 8b03477763 Partial checkin for landing page redesign. 2022-10-05 14:22:35 -04:00
Andrey 2f5147a84f Add timeout for HTTPProvider. 2022-10-05 18:18:12 +03:00
Andrey Dolgolev dbf60c686b
Merge pull request #676 from bugout-dev/fix-missing-rollback
Fix missing rollback.
2022-10-05 15:25:27 +03:00
Andrey 20cda62a1b Fix missing rollback. 2022-10-05 14:26:56 +03:00
Andrey Dolgolev 9d93a00f05
Merge pull request #675 from bugout-dev/historical-crawl-improvements
Add autoscale to historical crawl.
2022-10-03 19:04:10 +03:00
Andrey e5f2c4a550 Blocks cache was increased. 2022-10-03 18:43:40 +03:00
Andrey 03af327f8e Move log under if. 2022-10-03 17:26:58 +03:00
Andrey dd9b462c4e Request not full block db raw. Move log under if. 2022-10-03 17:25:39 +03:00
Andrey cccb42156e Remove unnecessary log. 2022-09-21 19:09:47 +03:00
Andrey 8c6d22c88b Replace moonworm==0.5.1 -> moonworm[moonstream]==0.5.1.
Change version.
2022-09-21 19:01:04 +03:00
Andrey 3e3288a55f Add remove comments. 2022-09-21 18:41:42 +03:00
Andrey 3f35b47a91 Add autoscale to historical crawl. 2022-09-21 18:38:05 +03:00
Sergei Sumarokov 01d0b8dd03
Merge pull request #670 from bugout-dev/fix-timer-on-boot
Different timer on boot start time
2022-09-20 15:35:03 +03:00
Andrey Dolgolev 5f18793055
Merge pull request #674 from bugout-dev/historical-crawl-address-not-required
Remove address requirements for historical_crawler.
2022-09-20 15:23:51 +03:00
Andrey bffe318cd9 Remove address requirements for historical_crawler. 2022-09-20 14:14:37 +03:00
Sergei Sumarokov 9f7169df56
Merge pull request #671 from bugout-dev/lighthouse-service
Lighthouse eth node service
2022-09-19 16:53:45 +03:00
kompotkot b24bdb0f6b Lighthouse eth node service 2022-09-19 11:30:02 +00:00
kompotkot a4c04a472a Different timer on boot start time 2022-09-15 13:22:10 +00:00
Andrey Dolgolev 548a89331e
Merge pull request #669 from bugout-dev/add-remove-worker
Add remove worker
2022-09-15 15:59:54 +03:00
kompotkot 66ac8c9d5e Clean state service and timer 2022-09-14 14:24:37 +00:00
Andrey 2b8e1f4b7b Add commit in that commit. 2022-09-14 15:51:38 +03:00
Andrey e8f787dcb0 Fix. 2022-09-14 13:29:06 +03:00
Andrey 7074eb9923 Add orm version of query. 2022-09-14 13:23:35 +03:00
kellan-simiotics d5065c42e1
Merge pull request #668 from bugout-dev/landing-improvements
Updates to team page.
2022-09-13 12:47:59 -04:00
Kellan Wampler a788aeec7f Removing Sam card. 2022-09-13 12:44:21 -04:00
Andrey d31ef8b909 Add initial version. 2022-09-13 19:03:48 +03:00
Kellan Wampler 2b60c466d2 Updating lint settings for 'jsx' and 'global' property lint issue. 2022-09-13 11:09:00 -04:00
Kellan Wampler fd76439685 Linting. 2022-09-13 11:04:37 -04:00
Kellan Wampler bd09e1b18c Tweaks to margins. Left align cards. 2022-09-13 10:59:47 -04:00
Kellan Wampler 7eef5d35c5 Updates to team page. 2022-09-13 10:12:01 -04:00
Andrey Dolgolev 8efa9858ac
Merge pull request #660 from bugout-dev/metadata-crawler
Metadata crawler
2022-09-08 22:19:44 +03:00
kompotkot 7dc045c3bf Metadata services and deploy 2022-09-08 19:17:30 +00:00
Andrey d200e82460 Fix user MOONSTREAM_DB_URI_READ_ONLY -> MOONSTREAM_DB_URI. 2022-09-08 18:34:50 +03:00
Andrey ec718f0e4c Move table name from parameters to format. 2022-09-08 17:51:01 +03:00
Andrey 14dedab479 Merge branch 'main' into metadata-crawler 2022-09-08 17:42:40 +03:00
Andrey 31aa042dfa Fix mypy. Add logger. Query use table name. 2022-09-08 17:39:28 +03:00
Andrey Dolgolev 25066e9ec1
Merge pull request #664 from bugout-dev/state-crawler-logging
Add logging.
2022-09-08 13:29:29 +03:00
Andrey b0a605cf90 Add logging. 2022-09-08 13:26:14 +03:00
Andrey Dolgolev 7252d06cad
Merge pull request #659 from bugout-dev/cu-state-crawler
Cu state crawler
2022-09-08 13:04:50 +03:00
Andrey 4a22a593e0 Fix moonstream db user MOONSTREAM_DB_URI_READ_ONLY -> MOONSTREAM_DB_URI. 2022-09-08 13:01:44 +03:00
Andrey 808c604299 Change veesion. 2022-09-08 12:53:00 +03:00
Andrey 95ab437a22 Merge branch 'cu-state-crawler' of github.com:bugout-dev/moonstream into cu-state-crawler 2022-09-08 12:52:16 +03:00
Andrey 88d1c5a77b Add fixes. 2022-09-08 12:51:41 +03:00
kompotkot 6582d12759 Deployment for state crawler 2022-09-08 09:39:38 +00:00
Andrey def1dc1527 Add sanityze for label data. 2022-09-07 15:15:15 +03:00
Andrey 7d073c3e63 Fix lint issues. 2022-09-07 14:48:33 +03:00
Andrey 8855097728 Switch using web3py instead brownie. 2022-09-06 19:05:02 +03:00
Andrey Dolgolev cde854eb71
Merge pull request #662 from bugout-dev/sanitize-jsonb
Add replace of r"\u0000".
2022-09-06 16:47:49 +03:00
Andrey 12cbe3e797 Add replace of r"\u0000". 2022-09-05 17:05:11 +03:00
Andrey d9c80e566c Add general interface. 2022-09-05 13:35:48 +03:00
Sergei Sumarokov 7d235eceff
Merge pull request #661 from bugout-dev/remove-uni-status
Removed unim status
2022-09-01 18:31:43 +03:00
kompotkot 93bc461a0d Removed unim status 2022-09-01 15:26:29 +00:00
Andrey 59f8f22b2e Clean up code. 2022-09-01 17:26:57 +03:00
Andrey 42ebb66e4d Switch to urlopen lib. 2022-09-01 16:04:07 +03:00
Andrey aaa6c95953 Add init metadata parser. 2022-08-31 19:26:30 +03:00
Andrey c2d790d08d Add settings. 2022-08-31 16:50:36 +03:00
Andrey 7fe587fdbc Merge branch 'main' into cu-state-crawler 2022-08-30 17:38:47 +03:00
Andrey 54870630c4 Add inital version. 2022-08-30 17:37:38 +03:00
kellan-simiotics e1477643b9
Merge pull request #658 from bugout-dev/landing-improvements
Remove 'no code' from landing page and metadata.
2022-08-30 10:29:40 -04:00
Kellan Wampler 94a5812e47 Text change in site description. 2022-08-29 11:20:45 -04:00
Kellan Wampler 3b83200c35 Remove 'no code' from landing page and metadata. 2022-08-29 10:35:15 -04:00
Andrey Dolgolev c822274344
Merge pull request #656 from bugout-dev/add-report-in-query-execution
Add reporter in BackgroundTask.
2022-08-25 20:32:10 +03:00
Andrey Dolgolev 27eed5910f
Merge pull request #651 from bugout-dev/fix-correct-git-path-scm
Correct git path for scm mdp repo
2022-08-25 20:31:58 +03:00
Andrey b3eba087f0 fix try. 2022-08-25 20:28:57 +03:00
Andrey af8e114515 Update version in setup.py add pool_pre_ping. 2022-08-25 20:25:26 +03:00
Andrey 5646dbf442 Add fixes. 2022-08-25 19:58:02 +03:00
Andrey 77c3e7e2f8 Add worked tasks resolver without write to database. 2022-08-25 19:09:55 +03:00
Andrey 9d8566cb59 Black formating. 2022-08-25 15:22:01 +03:00
Andrey 935ebe11a2 remove print. black formating. 2022-08-25 15:21:09 +03:00
Andrey e6a730d760 Add more complex typecheck.
Tested new created session with custom timeout..
Add reporter for stats execution.
2022-08-25 15:13:46 +03:00
kompotkot 94c24466c5 Correct git path for scm mdp repo 2022-08-15 17:15:32 +00:00
785 zmienionych plików z 72914 dodań i 30204 usunięć

Wyświetl plik

@ -13,9 +13,8 @@ jobs:
publish:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install dependencies
@ -24,22 +23,8 @@ jobs:
pip install -e .[distribute]
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN_MOONSTREAM }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
create_release:
runs-on: ubuntu-20.04
steps:
- uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: "Moonstream Python client library - ${{ github.ref }}"
body: |
Version ${{ github.ref }} of the Moonstream Python client library.
draft: true
prerelease: false

Wyświetl plik

@ -13,8 +13,8 @@ jobs:
publish:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install dependencies
@ -23,8 +23,8 @@ jobs:
pip install -e .[distribute]
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN_MOONCRAWL }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*

Wyświetl plik

@ -13,8 +13,8 @@ jobs:
publish:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install dependencies
@ -23,8 +23,8 @@ jobs:
pip install -e .[distribute]
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN_MOONSTREAMAPI }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*

Wyświetl plik

@ -7,14 +7,14 @@ on:
defaults:
run:
working-directory: db
working-directory: moonstreamdb
jobs:
publish:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install dependencies
@ -23,8 +23,8 @@ jobs:
pip install -e .[distribute]
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN_MOONSTREAMDB }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*

Wyświetl plik

@ -0,0 +1,30 @@
name: Release moonstreamdbv3 package
on:
push:
tags:
- 'moonstreamdbv3/v*'
defaults:
run:
working-directory: moonstreamdb-v3
jobs:
publish:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[distribute]
- name: Build and publish
env:
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN_MOONSTREAMDBV3 }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*

Wyświetl plik

@ -1,21 +1,42 @@
![github read me header](https://user-images.githubusercontent.com/8016073/203381867-f7b56861-04ca-4ae4-a5e6-53e97804817a.png)
# moonstream
\[[Live at https://moonstream.to/](https://moonstream.to)\] | \[[Join us on Discord](https://discord.gg/pYE65FuNSz)\]
[Website](https://moonstream.to)
[Join our Discord](https://discord.gg/pYE65FuNSz)
## What is Moonstream?
Moonstream makes tools that help people build, manage, and maintain their blockchain economies.
Moonstream creates economic infrastructure for web3 projects with a focus on blockchain games.
In order to provide this functionality, we build a lot of technology to crawl blockchains and makes sense of crawled transactions and events. This repository contains that code.
This repository contains Moonstream's complete data analysis stack. The emphasis of it is on collecting actionable data related to the blockchain. The repository contains:
1. Database management tools
2. Blockchain node management tools
3. Blockchain data crawlers
4. Access-controlled API which exposes collected data
## Important resources
1. [Documentation](https://docs.moonstream.to/)
2. [Status page](https://moonstream.to/status/)
3. [On-chain mechanics](https://github.com/bugout-dev/engine)
4. [How to create a dashboard to analyze a smart contract?](https://voracious-gerbil-120.notion.site/Creating-dashboard-for-a-smart-contract-288b1bfa64984b109b79895f69129fce)
## Who uses Moonstream?
Game designers and economists, data scientists, smart contract developers, backend engineers, and teams managing loyalty programs for blockchain projects.
People from different backgrounds who are interested in data, crypto and code.
Moonstream tools are often used by game designers and economists, data scientists, smart contract developers, backend engineers, and teams managing loyalty programs for blockchain projects.
Some of our prominents customers:
Some projects currently using Moonstream:
1. [Laguna Games](https://laguna.games), makers of [Crypto Unicorns](https://cryptounicorns.fun)
2. [RealtyBits](https://realtybits.com)
2. [Game7](https://game7.io)
3. [Champions Ascension](https://www.champions.io/)
Please read [the Game Master's Guide to Moonstream Solutions](https://docs.google.com/document/d/1mjfF8SgRrAZvtCVVxB2qNSUcbbmrH6dTEYSMfHKdEgc/view) if you want to know how Moonstream tools are applied in web3 games.
[Moonworm tool](https://github.com/bugout-dev/moonworm) is used to build datasets of on-chain data related to market activity. The dataset with on-chain activity from the Ethereum NFT market (April 1 to September 25, 2021) is available [on Kaggle](https://www.kaggle.com/datasets/simiotic/ethereum-nfts). The full report on it is published on [GitHub](https://github.com/bugout-dev/moonstream/blob/main/datasets/nfts/papers/ethereum-nfts.pdf).
## Free software
@ -62,4 +83,4 @@ docker-compose up --build
## Contributing
If you would like to contribute to Moonstream, please reach out to @zomglings on the [Moonstream Discord](https://discord.gg/pYE65FuNSz).
We are working on contributing guidelines. In the meantime, please reach out to @zomglings on the [Moonstream Discord](https://discord.gg/pYE65FuNSz).

Wyświetl plik

@ -1,28 +0,0 @@
# Required environment variables
export MOONSTREAM_DB_URI="postgresql://<username>:<password>@<db_host>:<db_port>/<db_name>"
export MOONSTREAM_DB_URI_READ_ONLY="postgresql://<username>:<password>@<db_host>:<db_port>/<db_name>"
export MOONSTREAM_CORS_ALLOWED_ORIGINS="http://localhost:3000,https://moonstream.to,https://www.moonstream.to"
export BUGOUT_BROOD_URL="https://auth.bugout.dev"
export BUGOUT_SPIRE_URL="https://spire.bugout.dev"
export MOONSTREAM_APPLICATION_ID="<issued_bugout_application_id>"
export MOONSTREAM_ADMIN_ACCESS_TOKEN="<Access_token_to_application_resources>"
export MOONSTREAM_POOL_SIZE=0
export MOONSTREAM_MOONWORM_TASKS_JOURNAL="<Bugout_journal_with_tasks_for_moonworm>"
export MOONSTREAM_CRAWLERS_SERVER_URL="<Moonstream_crawlers_server_API_endpoint_URL>"
export MOONSTREAM_CRAWLERS_SERVER_PORT="<Moonstream_crawlers_server_port>"
# Blockchain, txpool, whalewatch data depends variables
export MOONSTREAM_DATA_JOURNAL_ID="<bugout_journal_id_to_store_blockchain_data>"
export HUMBUG_TXPOOL_CLIENT_ID="<Bugout_Humbug_client_id_for_txpool_transactions_in_journal>"
export MOONSTREAM_ETHEREUM_WEB3_PROVIDER_URI="https://<connection_path_uri_to_ethereum_node>"
export MOONSTREAM_QUERIES_JOURNAL_ID="<bugout_journal_id_where_store_queries_for_executing>"
# Set following parameters if AWS node instance and S3 smartcontracts configured
export MOONSTREAM_S3_SMARTCONTRACTS_BUCKET="<AWS_S3_bucket_to_store_smart_contracts>"
export MOONSTREAM_S3_SMARTCONTRACTS_ABI_BUCKET="<AWS_S3_bucket_to_store_smart_contracts_ABI>"
export MOONSTREAM_S3_SMARTCONTRACTS_ABI_PREFIX="<Previx_for_AWS_S3_bucket_(prod,dev,..)>"
export MOONSTREAM_S3_QUERIES_BUCKET="<AWS_S3_bucket_to_store_sql_queries>"
export MOONSTREAM_S3_QUERIES_BUCKET_PREFIX="dev"
# Set the following variables in the most reasonable manner for your development environment
export HUMBUG_REPORTER_BACKEND_TOKEN="<Bugout_umbug_token_for_crash_reports>"

Wyświetl plik

@ -1,475 +0,0 @@
"""
Utilities for managing subscription type resources for a Moonstream application.
"""
import argparse
import json
from typing import Dict, List, Optional
from bugout.data import BugoutResource, BugoutResources
from sqlalchemy.sql.expression import update
from ..data import SubscriptionTypeResourceData
from ..settings import (
BUGOUT_REQUEST_TIMEOUT_SECONDS,
MOONSTREAM_ADMIN_ACCESS_TOKEN,
MOONSTREAM_APPLICATION_ID,
)
from ..settings import bugout_client as bc
CANONICAL_SUBSCRIPTION_TYPES = {
"ethereum_smartcontract": SubscriptionTypeResourceData(
id="ethereum_smartcontract",
name="Ethereum smartcontracts",
choices=["input:address", "tag:erc721"],
description="Contracts events and tx_calls of contract of Ethereum blockchain",
icon_url="https://s3.amazonaws.com/static.simiotics.com/moonstream/assets/ethereum/eth-diamond-purple.png",
stripe_product_id=None,
stripe_price_id=None,
active=True,
),
"polygon_smartcontract": SubscriptionTypeResourceData(
id="polygon_smartcontract",
name="Polygon smartcontracts",
choices=["input:address", "tag:erc721"],
description="Contracts events and tx_calls of contract of Polygon blockchain",
icon_url="https://s3.amazonaws.com/static.simiotics.com/moonstream/assets/matic-token-inverted-icon.png",
stripe_product_id=None,
stripe_price_id=None,
active=True,
),
"mumbai_smartcontract": SubscriptionTypeResourceData(
id="mumbai_smartcontract",
name="Mumbai smartcontracts",
choices=["input:address", "tag:erc721"],
description="Contracts events and tx_calls of contract of Mumbai blockchain",
icon_url="https://s3.amazonaws.com/static.simiotics.com/moonstream/assets/matic-token-inverted-icon.png",
stripe_product_id=None,
stripe_price_id=None,
active=True,
),
"xdai_smartcontract": SubscriptionTypeResourceData(
id="xdai_smartcontract",
name="XDai smartcontract",
choices=["input:address", "tag:erc721"],
description="Contracts events and tx_calls of contract of XDai blockchain.",
icon_url="https://s3.amazonaws.com/static.simiotics.com/moonstream/assets/xdai-token-logo.png",
stripe_product_id=None,
stripe_price_id=None,
active=True,
),
"ethereum_blockchain": SubscriptionTypeResourceData(
id="ethereum_blockchain",
name="Ethereum transactions",
choices=["input:address", "tag:erc721"],
description="Transactions that have been mined into the Ethereum blockchain",
icon_url="https://s3.amazonaws.com/static.simiotics.com/moonstream/assets/ethereum/eth-diamond-purple.png",
stripe_product_id=None,
stripe_price_id=None,
active=True,
),
"polygon_blockchain": SubscriptionTypeResourceData(
id="polygon_blockchain",
name="Polygon transactions",
choices=["input:address", "tag:erc721"],
description="Transactions that have been mined into the Polygon blockchain",
icon_url="https://s3.amazonaws.com/static.simiotics.com/moonstream/assets/matic-token-inverted-icon.png",
stripe_product_id=None,
stripe_price_id=None,
active=True,
),
"mumbai_blockchain": SubscriptionTypeResourceData(
id="mumbai_blockchain",
name="Mumbai transactions",
choices=["input:address", "tag:erc721"],
description="Transactions that have been mined into the Mumbai blockchain",
icon_url="https://s3.amazonaws.com/static.simiotics.com/moonstream/assets/matic-token-inverted-icon.png",
stripe_product_id=None,
stripe_price_id=None,
active=True,
),
"xdai_blockchain": SubscriptionTypeResourceData(
id="xdai_blockchain",
name="XDai transactions",
choices=["input:address", "tag:erc721"],
description="Gnosis chain transactions subscription.",
icon_url="https://s3.amazonaws.com/static.simiotics.com/moonstream/assets/xdai-token-logo.png",
stripe_product_id=None,
stripe_price_id=None,
active=True,
),
"ethereum_whalewatch": SubscriptionTypeResourceData(
id="ethereum_whalewatch",
name="Ethereum whale watch",
description="Ethereum accounts that have experienced a lot of recent activity",
choices=[],
# Icon taken from: https://www.maxpixel.net/Whale-Cetacean-Wildlife-Symbol-Ocean-Sea-Black-99310
icon_url="https://s3.amazonaws.com/static.simiotics.com/moonstream/assets/whalewatch.png",
stripe_product_id=None,
stripe_price_id=None,
active=True,
),
"ethereum_txpool": SubscriptionTypeResourceData(
id="ethereum_txpool",
name="Ethereum transaction pool",
description="Transactions that have been submitted into the Ethereum transaction pool but not necessarily mined yet",
choices=["input:address", "tag:erc721"],
icon_url="https://s3.amazonaws.com/static.simiotics.com/moonstream/assets/ethereum/eth-diamond-rainbow.png",
stripe_product_id=None,
stripe_price_id=None,
active=True,
),
}
class ConflictingSubscriptionTypesError(Exception):
"""
Raised when caller tries to add a resource that conflicts with an existing resource.
"""
pass
class SubscriptionTypeNotFoundError(Exception):
"""
Raised when a subscription type is expected to exist as a Brood resource but is not found.
"""
class UnexpectedError(Exception):
pass
BUGOUT_RESOURCE_TYPE = "subscription_type"
def create_subscription_type(
id: str,
name: str,
description: str,
icon_url: str,
choices: List[str] = [],
stripe_product_id: Optional[str] = None,
stripe_price_id: Optional[str] = None,
active: bool = False,
) -> BugoutResource:
"""
Add a new Moonstream subscription type as a Brood resource.
Args:
- id: Moonstream ID for the subscription type. Examples: "ethereum_blockchain", "ethereum_txpool",
"ethereum_whalewatch", etc.
- name: Human-friendly name for the subscription type, which can be displayed to users.
- description: Detailed description of the subscription type for users who would like more
information.
- icon_url: URL to the icon for this subscription type
- stripe_product_id: Optional product ID from Stripe account dashboard.
- stripe_price_id: Optional price ID from Stripe account dashboard.
- active: Set to True if you would like the subscription type to immediately be available for
subscriptions. If you set this to False (which is the default), users will not be able to create
subscriptions of this type until you later on set to true.
"""
params = {"type": BUGOUT_RESOURCE_TYPE, "id": id}
response: BugoutResources = bc.list_resources(
token=MOONSTREAM_ADMIN_ACCESS_TOKEN,
params=params,
timeout=BUGOUT_REQUEST_TIMEOUT_SECONDS,
)
if response.resources:
raise ConflictingSubscriptionTypesError(
f"There is already a subscription_type with id: {id}"
)
subscription_data = {
"type": BUGOUT_RESOURCE_TYPE,
"id": id,
"name": name,
"description": description,
"choices": choices,
"icon_url": icon_url,
"stripe_product_id": stripe_product_id,
"stripe_price_id": stripe_price_id,
"active": active,
}
resource = bc.create_resource(
token=MOONSTREAM_ADMIN_ACCESS_TOKEN,
application_id=MOONSTREAM_APPLICATION_ID,
resource_data=subscription_data,
)
return resource
def cli_create_subscription_type(args: argparse.Namespace) -> None:
"""
Handler for "mnstr subtypes create".
"""
result = create_subscription_type(
args.id,
args.name,
args.description,
args.icon,
args.choices,
args.stripe_product_id,
args.stripe_price_id,
args.active,
)
print(result.json())
def list_subscription_types(active_only: bool = False) -> BugoutResources:
"""
Lists all subscription types registered as Brood resources for this Moonstream application.
Args:
- active_only: Set this to true if you only want to list active subscription types. By default,
all subscription types are listed, be they active or inactive.
"""
response = bc.list_resources(
token=MOONSTREAM_ADMIN_ACCESS_TOKEN,
params={"type": BUGOUT_RESOURCE_TYPE},
timeout=BUGOUT_REQUEST_TIMEOUT_SECONDS,
)
# TODO(kompotkot): Currently, we cannot filter using non-string fields in Brood resources. This means
# that we have to implement the active_only filter in this API instead of just setting a query parameter
# in the Brood API call. This should be fixed.
if not active_only:
return response
active_resources = [
resource for resource in response.resources if resource.resource_data["active"]
]
return BugoutResources(resources=active_resources)
def cli_list_subscription_types(args: argparse.Namespace) -> None:
"""
Handler for "mnstr subtypes list".
"""
results = list_subscription_types(args.active)
print(results.json())
def get_subscription_type(id: str) -> Optional[BugoutResource]:
"""
Retrieves the resource representing the subscription type with the given ID.
Args:
- id: Moonstream ID for the subscription type (not the Brood resource ID).
Examples - "ethereum_blockchain", "ethereum_whalewatch", etc.
Returns: None if there is no subscription type with that ID. Otherwise, returns the full
Brood resource. To access the subscription type itself, use the "resource_data" member of the
return value. If more than one subscription type is found with the given ID, raises a
ConflictingSubscriptionTypesError.
"""
response = bc.list_resources(
token=MOONSTREAM_ADMIN_ACCESS_TOKEN,
params={"type": BUGOUT_RESOURCE_TYPE, "id": id},
timeout=BUGOUT_REQUEST_TIMEOUT_SECONDS,
)
resources = response.resources
if not resources:
return None
if len(resources) > 1:
raise ConflictingSubscriptionTypesError(
f"More than one resource with the given ID:\n{json.dumps(resources, indent=2)}"
)
return resources[0]
def cli_get_subscription_type(args: argparse.Namespace) -> None:
"""
Handler for "mnstr subtypes get".
"""
resource = get_subscription_type(args.id)
if resource is None:
print(f"Could not find resource with ID: {id}")
else:
print(resource.json())
def update_subscription_type(
id: str,
name: Optional[str] = None,
description: Optional[str] = None,
choices: Optional[List[str]] = None,
icon_url: Optional[str] = None,
stripe_product_id: Optional[str] = None,
stripe_price_id: Optional[str] = None,
active: Optional[bool] = None,
) -> BugoutResource:
"""
Update a Moonstream subscription type using the Brood Resources API.
Args:
- id: Moonstream ID for the subscription type. Examples: "ethereum_blockchain", "ethereum_txpool",
"ethereum_whalewatch", etc.
- name: Human-friendly name for the subscription type, which can be displayed to users.
- description: Detailed description of the subscription type for users who would like more
information.
- icon_url: URL to the icon for this subscription type
- stripe_product_id: Optional product ID from Stripe account dashboard.
- stripe_price_id: Optional price ID from Stripe account dashboard.
- active: Set to True if you would like the subscription type to immediately be available for
subscriptions. If you set this to False (which is the default), users will not be able to create
subscriptions of this type until you later on set to true.
"""
resource = get_subscription_type(id)
if resource is None:
raise SubscriptionTypeNotFoundError(
f"Could not find subscription type with ID: {id}."
)
brood_resource_id = resource.id
updated_resource_data = resource.resource_data
if name is not None:
updated_resource_data["name"] = name
if description is not None:
updated_resource_data["description"] = description
if choices is not None:
updated_resource_data["choices"] = choices
if icon_url is not None:
updated_resource_data["icon_url"] = icon_url
if stripe_product_id is not None:
updated_resource_data["stripe_product_id"] = stripe_product_id
if stripe_price_id is not None:
updated_resource_data["stripe_price_id"] = stripe_price_id
if active is not None:
updated_resource_data["active"] = active
# TODO(zomglings): This was written with an outdated bugout-python client.
# New client has an update_resource method which is what we should be using
# here.
try:
new_resource = bc.update_resource(
token=MOONSTREAM_ADMIN_ACCESS_TOKEN,
resource_id=brood_resource_id,
resource_data={"update": updated_resource_data},
timeout=BUGOUT_REQUEST_TIMEOUT_SECONDS,
)
except Exception as e:
raise ConflictingSubscriptionTypesError(
f"Unable to delete old subscription type with ID: {id}. Error:\n{repr(e)}"
)
return new_resource
def cli_update_subscription_type(args: argparse.Namespace) -> None:
"""
Handler for "mnstr subtypes update".
"""
result = update_subscription_type(
args.id,
args.name,
args.description,
args.choices,
args.icon,
args.stripe_product_id,
args.stripe_price_id,
args.active,
)
print(result.json())
def delete_subscription_type(id: str) -> Optional[BugoutResource]:
"""
Deletes the subscription type resource with the given ID.
Args:
- id: Moonstream ID of the subscription type you would like to delete. Examples - "ethereum_blockchain",
"ethereum_whalewatch", etc.
Returns: The BugoutResource that was deleted. If no such resource existed in the first place, returns
None. If multiple resources existed with the given Moonstream ID, raises a ConflictingSubscriptionTypesError
and does not delete anything!
"""
# ConflictingSubscriptionTypesError raised here if there are multiple resources with the given id.
resource = get_subscription_type(id)
if resource is None:
return None
resource = bc.delete_resource(
token=MOONSTREAM_ADMIN_ACCESS_TOKEN,
resource_id=resource.id,
timeout=BUGOUT_REQUEST_TIMEOUT_SECONDS,
)
return resource
def cli_delete_subscription_type(args: argparse.Namespace) -> None:
"""
Handler for "mnstr subtypes delete".
"""
result = delete_subscription_type(args.id)
if result is None:
print(f"Could not find resource with ID: {id}")
else:
print(result.json())
def ensure_canonical_subscription_types() -> BugoutResources:
"""
Ensures that the connected Brood API has at least the canonical subscription types. If any of the
canonical subscription types does not exist as a Brood resource, this API creates the corresponding
resource. If any of the canonical subscription types exists as a Brood resource but has been modified,
this method does not change it on the server.
Args: None
Returns: A list of the resources representing the canonical subscription types as they exist
on the connected Brood API.
"""
existing_canonical_subscription_types: Dict[str, BugoutResource] = {}
for id, canonical_subscription_type in CANONICAL_SUBSCRIPTION_TYPES.items():
resource = get_subscription_type(canonical_subscription_type.id)
if resource is not None:
existing_canonical_subscription_types[id] = resource
for id in CANONICAL_SUBSCRIPTION_TYPES.keys():
if existing_canonical_subscription_types.get(id) is None:
canonical_subscription_type = CANONICAL_SUBSCRIPTION_TYPES[id]
resource = create_subscription_type(
id,
canonical_subscription_type.name,
canonical_subscription_type.description,
canonical_subscription_type.icon_url,
canonical_subscription_type.choices,
canonical_subscription_type.stripe_product_id,
canonical_subscription_type.stripe_price_id,
canonical_subscription_type.active,
)
existing_canonical_subscription_types[id] = resource
else:
canonical_subscription_type = CANONICAL_SUBSCRIPTION_TYPES[id]
resource = update_subscription_type(
id,
canonical_subscription_type.name,
canonical_subscription_type.description,
canonical_subscription_type.choices,
canonical_subscription_type.icon_url,
canonical_subscription_type.stripe_product_id,
canonical_subscription_type.stripe_price_id,
canonical_subscription_type.active,
)
existing_canonical_subscription_types[id] = resource
return BugoutResources(
resources=list(existing_canonical_subscription_types.values())
)
def cli_ensure_canonical_subscription_types(args: argparse.Namespace) -> None:
"""
Handler for "mnstr subtypes ensure-canonical
"""
resources = ensure_canonical_subscription_types()
print(resources.json())

Wyświetl plik

@ -1,411 +0,0 @@
"""
The Moonstream queries HTTP API
"""
import logging
from typing import Any, Dict, List, Optional, Tuple, Union
from uuid import UUID
import boto3 # type: ignore
from bugout.data import BugoutResources, BugoutJournalEntryContent, BugoutJournalEntry
from bugout.exceptions import BugoutResponseException
from fastapi import APIRouter, Body, Request
import requests
from .. import data
from ..actions import get_query_by_name, name_normalization, NameNormalizationException
from ..middleware import MoonstreamHTTPException
from ..settings import (
MOONSTREAM_ADMIN_ACCESS_TOKEN,
MOONSTREAM_APPLICATION_ID,
MOONSTREAM_CRAWLERS_SERVER_URL,
MOONSTREAM_CRAWLERS_SERVER_PORT,
MOONSTREAM_S3_QUERIES_BUCKET,
MOONSTREAM_S3_QUERIES_BUCKET_PREFIX,
MOONSTREAM_QUERIES_JOURNAL_ID,
)
from ..settings import bugout_client as bc
logger = logging.getLogger(__name__)
router = APIRouter(
prefix="/queries",
)
@router.get("/list", tags=["queries"])
async def get_list_of_queries_handler(request: Request) -> List[Dict[str, Any]]:
token = request.state.token
# Check already existed queries
params = {
"type": data.BUGOUT_RESOURCE_QUERY_RESOLVER,
}
try:
resources: BugoutResources = bc.list_resources(token=token, params=params)
except BugoutResponseException as e:
raise MoonstreamHTTPException(status_code=e.status_code, detail=e.detail)
except Exception as e:
raise MoonstreamHTTPException(status_code=500, internal_error=e)
users_queries: List[Dict[str, Any]] = [
resource.resource_data for resource in resources.resources
]
return users_queries
@router.post("/", tags=["queries"])
async def create_query_handler(
request: Request, query_applied: data.PreapprovedQuery = Body(...)
) -> BugoutJournalEntry:
"""
Create query in bugout journal
"""
token = request.state.token
user = request.state.user
# Check already existed queries
params = {
"type": data.BUGOUT_RESOURCE_QUERY_RESOLVER,
}
try:
resources: BugoutResources = bc.list_resources(token=token, params=params)
except BugoutResponseException as e:
raise MoonstreamHTTPException(status_code=e.status_code, detail=e.detail)
except Exception as e:
raise MoonstreamHTTPException(status_code=500, internal_error=e)
used_queries: List[str] = [
resource.resource_data["name"] for resource in resources.resources
]
try:
query_name = name_normalization(query_applied.name)
except NameNormalizationException:
raise MoonstreamHTTPException(
status_code=403,
detail=f"Provided query name can't be normalize please select different.",
)
if query_name in used_queries:
raise MoonstreamHTTPException(
status_code=404,
detail=f"Provided query name already use. Please remove it or use PUT /{query_name} for update query",
)
try:
# Put query to journal
entry = bc.create_entry(
token=MOONSTREAM_ADMIN_ACCESS_TOKEN,
journal_id=MOONSTREAM_QUERIES_JOURNAL_ID,
title=f"Query:{query_name}",
tags=["type:query"],
content=query_applied.query,
)
except BugoutResponseException as e:
raise MoonstreamHTTPException(status_code=e.status_code, detail=e.detail)
except Exception as e:
raise MoonstreamHTTPException(status_code=500, internal_error=e)
try:
# create resource query_name_resolver
bc.create_resource(
token=token,
application_id=MOONSTREAM_APPLICATION_ID,
resource_data={
"type": data.BUGOUT_RESOURCE_QUERY_RESOLVER,
"user_id": str(user.id),
"user": str(user.username),
"name": query_name,
"entry_id": str(entry.id),
},
)
except BugoutResponseException as e:
logger.error(f"Error creating name resolving resource: {str(e)}")
raise MoonstreamHTTPException(status_code=e.status_code, detail=e.detail)
except Exception as e:
raise MoonstreamHTTPException(status_code=500, internal_error=e)
try:
bc.update_tags(
token=MOONSTREAM_ADMIN_ACCESS_TOKEN,
journal_id=MOONSTREAM_QUERIES_JOURNAL_ID,
entry_id=entry.id,
tags=[f"query_id:{entry.id}", f"preapprove"],
)
except BugoutResponseException as e:
logger.error(f"Error in applind tags to query entry: {str(e)}")
raise MoonstreamHTTPException(status_code=e.status_code, detail=e.detail)
except Exception as e:
raise MoonstreamHTTPException(status_code=500, internal_error=e)
return entry
@router.get("/{query_name}/query", tags=["queries"])
async def get_query_handler(request: Request, query_name: str) -> BugoutJournalEntry:
token = request.state.token
try:
query_id = get_query_by_name(query_name, token)
except NameNormalizationException:
raise MoonstreamHTTPException(
status_code=403,
detail=f"Provided query name can't be normalize please select different.",
)
except Exception as e:
raise MoonstreamHTTPException(status_code=500, internal_error=e)
try:
entry = bc.get_entry(
token=MOONSTREAM_ADMIN_ACCESS_TOKEN,
journal_id=MOONSTREAM_QUERIES_JOURNAL_ID,
entry_id=query_id,
)
except BugoutResponseException as e:
logger.error(f"Error in get query: {str(e)}")
raise MoonstreamHTTPException(status_code=e.status_code, detail=e.detail)
except Exception as e:
raise MoonstreamHTTPException(status_code=500, internal_error=e)
return entry
@router.put("/{query_name}", tags=["queries"])
async def update_query_handler(
request: Request,
query_name: str,
request_update: data.UpdateQueryRequest = Body(...),
) -> BugoutJournalEntryContent:
token = request.state.token
try:
query_id = get_query_by_name(query_name, token)
except NameNormalizationException:
raise MoonstreamHTTPException(
status_code=403,
detail=f"Provided query name can't be normalize please select different.",
)
except Exception as e:
raise MoonstreamHTTPException(status_code=500, internal_error=e)
try:
entry = bc.update_entry_content(
token=MOONSTREAM_ADMIN_ACCESS_TOKEN,
journal_id=MOONSTREAM_QUERIES_JOURNAL_ID,
entry_id=query_id,
title=query_name,
content=request_update.query,
tags=["preapprove"],
)
except BugoutResponseException as e:
logger.error(f"Error in updating query: {str(e)}")
raise MoonstreamHTTPException(status_code=e.status_code, detail=e.detail)
except Exception as e:
raise MoonstreamHTTPException(status_code=500, internal_error=e)
return entry
@router.post(
"/{query_name}/update_data",
tags=["queries"],
)
async def update_query_data_handler(
request: Request,
query_name: str,
request_update: data.UpdateDataRequest = Body(...),
) -> Optional[data.QueryPresignUrl]:
"""
Request update data on S3 bucket
"""
token = request.state.token
try:
query_id = get_query_by_name(query_name, token)
except NameNormalizationException:
raise MoonstreamHTTPException(
status_code=403,
detail=f"Provided query name can't be normalize please select different.",
)
except Exception as e:
raise MoonstreamHTTPException(status_code=500, internal_error=e)
try:
entries = bc.search(
token=MOONSTREAM_ADMIN_ACCESS_TOKEN,
journal_id=MOONSTREAM_QUERIES_JOURNAL_ID,
query=f"tag:approved tag:query_id:{query_id} !tag:preapprove",
limit=1,
timeout=5,
)
if len(entries.results) == 0:
raise MoonstreamHTTPException(
status_code=403, detail="Query not approved yet."
)
s3_response = None
if entries.results[0].content:
content = entries.results[0].content
tags = entries.results[0].tags
file_type = "json"
if "ext:csv" in tags:
file_type = "csv"
responce = requests.post(
f"{MOONSTREAM_CRAWLERS_SERVER_URL}:{MOONSTREAM_CRAWLERS_SERVER_PORT}/jobs/{query_id}/query_update",
json={
"query": content,
"params": request_update.params,
"file_type": file_type,
},
timeout=5,
)
if responce.status_code != 200:
raise MoonstreamHTTPException(
status_code=responce.status_code,
detail=responce.text,
)
s3_response = data.QueryPresignUrl(**responce.json())
except BugoutResponseException as e:
logger.error(f"Error in updating query: {str(e)}")
raise MoonstreamHTTPException(status_code=e.status_code, detail=e.detail)
except Exception as e:
raise MoonstreamHTTPException(status_code=500, internal_error=e)
return s3_response
@router.get("/{query_name}", tags=["queries"])
async def get_access_link_handler(
request: Request,
query_name: str,
) -> Optional[data.QueryPresignUrl]:
"""
Request S3 presign url
"""
# get real connect to query_id
token = request.state.token
try:
query_id = get_query_by_name(query_name, token)
except NameNormalizationException:
raise MoonstreamHTTPException(
status_code=403,
detail=f"Provided query name can't be normalize please select different.",
)
except Exception as e:
raise MoonstreamHTTPException(status_code=500, internal_error=e)
s3 = boto3.client("s3")
try:
entries = bc.search(
token=MOONSTREAM_ADMIN_ACCESS_TOKEN,
journal_id=MOONSTREAM_QUERIES_JOURNAL_ID,
query=f"tag:approved tag:query_id:{query_id} !tag:preapprove",
limit=1,
timeout=5,
)
s3_response = None
if entries.results and entries.results[0].content:
tags = entries.results[0].tags
file_type = "json"
if "ext:csv" in tags:
file_type = "csv"
stats_presigned_url = s3.generate_presigned_url(
"get_object",
Params={
"Bucket": MOONSTREAM_S3_QUERIES_BUCKET,
"Key": f"{MOONSTREAM_S3_QUERIES_BUCKET_PREFIX}/queries/{query_id}/data.{file_type}",
},
ExpiresIn=300000,
HttpMethod="GET",
)
s3_response = data.QueryPresignUrl(url=stats_presigned_url)
except BugoutResponseException as e:
logger.error(f"Error in get access link: {str(e)}")
raise MoonstreamHTTPException(status_code=e.status_code, detail=e.detail)
except Exception as e:
raise MoonstreamHTTPException(status_code=500, internal_error=e)
return s3_response
@router.delete("/{query_name}", tags=["queries"])
async def remove_query_handler(
request: Request,
query_name: str,
) -> BugoutJournalEntry:
"""
Request delete query from journal
"""
token = request.state.token
params = {"type": data.BUGOUT_RESOURCE_QUERY_RESOLVER, "name": query_name}
try:
resources: BugoutResources = bc.list_resources(token=token, params=params)
except BugoutResponseException as e:
raise MoonstreamHTTPException(status_code=e.status_code, detail=e.detail)
except Exception as e:
raise MoonstreamHTTPException(status_code=500, internal_error=e)
query_ids: Dict[str, Tuple[UUID, Union[UUID, str]]] = {
resource.resource_data["name"]: (
resource.id,
resource.resource_data["entry_id"],
)
for resource in resources.resources
}
if len(query_ids) == 0:
raise MoonstreamHTTPException(status_code=404, detail="Query does not exists")
try:
bc.delete_resource(token=token, resource_id=query_ids[query_name][0])
except BugoutResponseException as e:
raise MoonstreamHTTPException(status_code=e.status_code, detail=e.detail)
except Exception as e:
raise MoonstreamHTTPException(status_code=500, internal_error=e)
try:
entry = bc.delete_entry(
token=MOONSTREAM_ADMIN_ACCESS_TOKEN,
journal_id=MOONSTREAM_QUERIES_JOURNAL_ID,
entry_id=query_ids[query_name][1],
)
except BugoutResponseException as e:
raise MoonstreamHTTPException(status_code=e.status_code, detail=e.detail)
except Exception as e:
raise MoonstreamHTTPException(status_code=500, internal_error=e)
return entry

Wyświetl plik

@ -1,397 +0,0 @@
"""
The Moonstream subscriptions HTTP API
"""
import hashlib
import json
import logging
from typing import Any, Dict, List, Optional
import boto3 # type: ignore
from bugout.data import BugoutResource, BugoutResources
from bugout.exceptions import BugoutResponseException
from fastapi import APIRouter, Depends, Request, Form, BackgroundTasks
from web3 import Web3
from ..actions import validate_abi_json, upload_abi_to_s3, apply_moonworm_tasks
from ..admin import subscription_types
from .. import data
from ..actions import upload_abi_to_s3, validate_abi_json
from ..admin import subscription_types
from ..middleware import MoonstreamHTTPException
from ..reporter import reporter
from ..settings import (
MOONSTREAM_APPLICATION_ID,
MOONSTREAM_S3_SMARTCONTRACTS_ABI_BUCKET,
MOONSTREAM_S3_SMARTCONTRACTS_ABI_PREFIX,
)
from ..settings import bugout_client as bc
from ..web3_provider import yield_web3_provider
logger = logging.getLogger(__name__)
router = APIRouter(
prefix="/subscriptions",
)
BUGOUT_RESOURCE_TYPE_SUBSCRIPTION = "subscription"
@router.post("/", tags=["subscriptions"], response_model=data.SubscriptionResourceData)
async def add_subscription_handler(
request: Request, # subscription_data: data.CreateSubscriptionRequest = Body(...)
background_tasks: BackgroundTasks,
address: str = Form(...),
color: str = Form(...),
label: str = Form(...),
subscription_type_id: str = Form(...),
abi: Optional[str] = Form(None),
web3: Web3 = Depends(yield_web3_provider),
) -> data.SubscriptionResourceData:
"""
Add subscription to blockchain stream data for user.
"""
token = request.state.token
if subscription_type_id != "ethereum_whalewatch":
try:
address = web3.toChecksumAddress(address)
except ValueError as e:
raise MoonstreamHTTPException(
status_code=400,
detail=str(e),
internal_error=e,
)
except Exception as e:
logger.error(f"Failed to convert address to checksum address")
raise MoonstreamHTTPException(
status_code=500,
internal_error=e,
detail="Currently unable to convert address to checksum address",
)
active_subscription_types_response = subscription_types.list_subscription_types(
active_only=True
)
available_subscription_type_ids = [
subscription_type.resource_data.get("id")
for subscription_type in active_subscription_types_response.resources
if subscription_type.resource_data.get("id") is not None
]
if subscription_type_id not in available_subscription_type_ids:
raise MoonstreamHTTPException(
status_code=404,
detail=f"Invalid subscription type: {subscription_type_id}.",
)
user = request.state.user
resource_data = {
"type": BUGOUT_RESOURCE_TYPE_SUBSCRIPTION,
"user_id": str(user.id),
"subscription_type_id": subscription_type_id,
"address": address,
"color": color,
"label": label,
"abi": None,
"bucket": None,
"s3_path": None,
}
try:
resource: BugoutResource = bc.create_resource(
token=token,
application_id=MOONSTREAM_APPLICATION_ID,
resource_data=resource_data,
)
except BugoutResponseException as e:
raise MoonstreamHTTPException(status_code=e.status_code, detail=e.detail)
except Exception as e:
logger.error(f"Error creating subscription resource: {str(e)}")
raise MoonstreamHTTPException(status_code=500, internal_error=e)
if abi:
try:
json_abi = json.loads(abi)
except json.JSONDecodeError:
raise MoonstreamHTTPException(status_code=400, detail="Malformed abi body.")
validate_abi_json(json_abi)
update_resource = upload_abi_to_s3(resource=resource, abi=abi, update={})
abi_string = json.dumps(json_abi, sort_keys=True, indent=2)
hash = hashlib.md5(abi_string.encode("utf-8")).hexdigest()
update_resource["abi_hash"] = hash
try:
updated_resource: BugoutResource = bc.update_resource(
token=token,
resource_id=resource.id,
resource_data=data.SubscriptionUpdate(
update=update_resource,
).dict(),
)
resource = updated_resource
except BugoutResponseException as e:
raise MoonstreamHTTPException(status_code=e.status_code, detail=e.detail)
except Exception as e:
logger.error(f"Error getting user subscriptions: {str(e)}")
raise MoonstreamHTTPException(status_code=500, internal_error=e)
background_tasks.add_task(
apply_moonworm_tasks,
subscription_type_id,
json_abi,
address,
)
return data.SubscriptionResourceData(
id=str(resource.id),
user_id=resource.resource_data["user_id"],
address=resource.resource_data["address"],
color=resource.resource_data["color"],
label=resource.resource_data["label"],
abi=resource.resource_data.get("abi"),
subscription_type_id=resource.resource_data["subscription_type_id"],
updated_at=resource.updated_at,
created_at=resource.created_at,
)
@router.delete(
"/{subscription_id}",
tags=["subscriptions"],
response_model=data.SubscriptionResourceData,
)
async def delete_subscription_handler(request: Request, subscription_id: str):
"""
Delete subscriptions.
"""
token = request.state.token
try:
deleted_resource = bc.delete_resource(token=token, resource_id=subscription_id)
except BugoutResponseException as e:
raise MoonstreamHTTPException(status_code=e.status_code, detail=e.detail)
except Exception as e:
logger.error(f"Error deleting subscription: {str(e)}")
raise MoonstreamHTTPException(status_code=500, internal_error=e)
return data.SubscriptionResourceData(
id=str(deleted_resource.id),
user_id=deleted_resource.resource_data["user_id"],
address=deleted_resource.resource_data["address"],
color=deleted_resource.resource_data["color"],
label=deleted_resource.resource_data["label"],
abi=deleted_resource.resource_data.get("abi"),
subscription_type_id=deleted_resource.resource_data["subscription_type_id"],
updated_at=deleted_resource.updated_at,
created_at=deleted_resource.created_at,
)
@router.get("/", tags=["subscriptions"], response_model=data.SubscriptionsListResponse)
async def get_subscriptions_handler(request: Request) -> data.SubscriptionsListResponse:
"""
Get user's subscriptions.
"""
token = request.state.token
params = {
"type": BUGOUT_RESOURCE_TYPE_SUBSCRIPTION,
"user_id": str(request.state.user.id),
}
try:
resources: BugoutResources = bc.list_resources(token=token, params=params)
except BugoutResponseException as e:
raise MoonstreamHTTPException(status_code=e.status_code, detail=e.detail)
except Exception as e:
logger.error(
f"Error listing subscriptions for user ({request.user.id}) with token ({request.state.token}), error: {str(e)}"
)
reporter.error_report(e)
raise MoonstreamHTTPException(status_code=500, internal_error=e)
return data.SubscriptionsListResponse(
subscriptions=[
data.SubscriptionResourceData(
id=str(resource.id),
user_id=resource.resource_data["user_id"],
address=resource.resource_data["address"],
color=resource.resource_data["color"],
label=resource.resource_data["label"],
abi=resource.resource_data.get("abi"),
subscription_type_id=resource.resource_data["subscription_type_id"],
updated_at=resource.updated_at,
created_at=resource.created_at,
)
for resource in resources.resources
]
)
@router.put(
"/{subscription_id}",
tags=["subscriptions"],
response_model=data.SubscriptionResourceData,
)
async def update_subscriptions_handler(
request: Request,
subscription_id: str,
background_tasks: BackgroundTasks,
color: Optional[str] = Form(None),
label: Optional[str] = Form(None),
abi: Optional[str] = Form(None),
) -> data.SubscriptionResourceData:
"""
Get user's subscriptions.
"""
token = request.state.token
update: Dict[str, Any] = {}
if color:
update["color"] = color
if label:
update["label"] = label
if abi:
try:
json_abi = json.loads(abi)
except json.JSONDecodeError:
raise MoonstreamHTTPException(status_code=400, detail="Malformed abi body.")
validate_abi_json(json_abi)
abi_string = json.dumps(json_abi, sort_keys=True, indent=2)
hash = hashlib.md5(abi_string.encode("utf-8")).hexdigest()
try:
subscription_resource: BugoutResource = bc.get_resource(
token=token,
resource_id=subscription_id,
)
except BugoutResponseException as e:
raise MoonstreamHTTPException(status_code=e.status_code, detail=e.detail)
except Exception as e:
logger.error(f"Error creating subscription resource: {str(e)}")
raise MoonstreamHTTPException(status_code=500, internal_error=e)
if subscription_resource.resource_data["abi"] is not None:
raise MoonstreamHTTPException(
status_code=400,
detail="Subscription already have ABI. For add a new ABI create new subscription.",
)
update = upload_abi_to_s3(
resource=subscription_resource, abi=abi, update=update
)
update["abi_hash"] = hash
try:
resource: BugoutResource = bc.update_resource(
token=token,
resource_id=subscription_id,
resource_data=data.SubscriptionUpdate(
update=update,
).dict(),
)
except BugoutResponseException as e:
raise MoonstreamHTTPException(status_code=e.status_code, detail=e.detail)
except Exception as e:
logger.error(f"Error getting user subscriptions: {str(e)}")
raise MoonstreamHTTPException(status_code=500, internal_error=e)
if abi:
background_tasks.add_task(
apply_moonworm_tasks,
subscription_resource.resource_data["subscription_type_id"],
json_abi,
subscription_resource.resource_data["address"],
)
return data.SubscriptionResourceData(
id=str(resource.id),
user_id=resource.resource_data["user_id"],
address=resource.resource_data["address"],
color=resource.resource_data["color"],
label=resource.resource_data["label"],
abi=resource.resource_data.get("abi"),
subscription_type_id=resource.resource_data["subscription_type_id"],
updated_at=resource.updated_at,
created_at=resource.created_at,
)
@router.get(
"/{subscription_id}/abi",
tags=["subscriptions"],
response_model=data.SubdcriptionsAbiResponse,
)
async def get_subscription_abi_handler(
request: Request,
subscription_id: str,
) -> data.SubdcriptionsAbiResponse:
token = request.state.token
try:
subscription_resource: BugoutResource = bc.get_resource(
token=token,
resource_id=subscription_id,
)
except BugoutResponseException as e:
raise MoonstreamHTTPException(status_code=e.status_code, detail=e.detail)
except Exception as e:
logger.error(f"Error creating subscription resource: {str(e)}")
raise MoonstreamHTTPException(status_code=500, internal_error=e)
if subscription_resource.resource_data["abi"] is None:
raise MoonstreamHTTPException(
status_code=404,
detail="Subscription abi not exists.",
)
s3_client = boto3.client("s3")
result_key = f"{subscription_resource.resource_data['s3_path']}"
presigned_url = s3_client.generate_presigned_url(
"get_object",
Params={
"Bucket": subscription_resource.resource_data["bucket"],
"Key": result_key,
},
ExpiresIn=300,
HttpMethod="GET",
)
return data.SubdcriptionsAbiResponse(url=presigned_url)
@router.get(
"/types", tags=["subscriptions"], response_model=data.SubscriptionTypesListResponse
)
async def list_subscription_types() -> data.SubscriptionTypesListResponse:
"""
Get availables subscription types.
"""
results: List[data.SubscriptionTypeResourceData] = []
try:
response = subscription_types.list_subscription_types()
results = [
data.SubscriptionTypeResourceData.validate(resource.resource_data)
for resource in response.resources
]
except BugoutResponseException as e:
raise MoonstreamHTTPException(status_code=e.status_code, detail=e.detail)
except Exception as e:
logger.error(f"Error reading subscription types from Brood API: {str(e)}")
raise MoonstreamHTTPException(status_code=500, internal_error=e)
return data.SubscriptionTypesListResponse(subscription_types=results)

Wyświetl plik

@ -1,113 +0,0 @@
import os
from bugout.app import Bugout
# Bugout
BUGOUT_BROOD_URL = os.environ.get("BUGOUT_BROOD_URL", "https://auth.bugout.dev")
BUGOUT_SPIRE_URL = os.environ.get("BUGOUT_SPIRE_URL", "https://spire.bugout.dev")
bugout_client = Bugout(brood_api_url=BUGOUT_BROOD_URL, spire_api_url=BUGOUT_SPIRE_URL)
BUGOUT_REQUEST_TIMEOUT_SECONDS = 5
HUMBUG_REPORTER_BACKEND_TOKEN = os.environ.get("HUMBUG_REPORTER_BACKEND_TOKEN")
# Default value is "" instead of None so that mypy understands that MOONSTREAM_APPLICATION_ID is a string
MOONSTREAM_APPLICATION_ID = os.environ.get("MOONSTREAM_APPLICATION_ID", "")
if MOONSTREAM_APPLICATION_ID == "":
raise ValueError("MOONSTREAM_APPLICATION_ID environment variable must be set")
MOONSTREAM_DATA_JOURNAL_ID = os.environ.get("MOONSTREAM_DATA_JOURNAL_ID", "")
if MOONSTREAM_DATA_JOURNAL_ID == "":
raise ValueError("MOONSTREAM_DATA_JOURNAL_ID environment variable must be set")
MOONSTREAM_QUERIES_JOURNAL_ID = os.environ.get("MOONSTREAM_QUERIES_JOURNAL_ID", "")
if MOONSTREAM_DATA_JOURNAL_ID == "":
raise ValueError("MOONSTREAM_QUERIES_JOURNAL_ID environment variable must be set")
MOONSTREAM_ADMIN_ACCESS_TOKEN = os.environ.get("MOONSTREAM_ADMIN_ACCESS_TOKEN", "")
if MOONSTREAM_ADMIN_ACCESS_TOKEN == "":
raise ValueError("MOONSTREAM_ADMIN_ACCESS_TOKEN environment variable must be set")
# Origin
RAW_ORIGINS = os.environ.get("MOONSTREAM_CORS_ALLOWED_ORIGINS")
if RAW_ORIGINS is None:
raise ValueError(
"MOONSTREAM_CORS_ALLOWED_ORIGINS environment variable must be set (comma-separated list of CORS allowed origins)"
)
ORIGINS = RAW_ORIGINS.split(",")
# OpenAPI
DOCS_TARGET_PATH = "docs"
DEFAULT_STREAM_TIMEINTERVAL = 5 * 60
HUMBUG_TXPOOL_CLIENT_ID = os.environ.get(
"HUMBUG_TXPOOL_CLIENT_ID", "client:ethereum-txpool-crawler-0"
)
# S3 Bucket
ETHERSCAN_SMARTCONTRACTS_BUCKET = os.environ.get("MOONSTREAM_S3_SMARTCONTRACTS_BUCKET")
if ETHERSCAN_SMARTCONTRACTS_BUCKET is None:
raise ValueError("MOONSTREAM_S3_SMARTCONTRACTS_BUCKET is not set")
MOONSTREAM_S3_SMARTCONTRACTS_ABI_BUCKET = os.environ.get(
"MOONSTREAM_S3_SMARTCONTRACTS_ABI_BUCKET"
)
if MOONSTREAM_S3_SMARTCONTRACTS_ABI_BUCKET is None:
raise ValueError(
"MOONSTREAM_S3_SMARTCONTRACTS_ABI_BUCKET environment variable must be set"
)
MOONSTREAM_S3_SMARTCONTRACTS_ABI_PREFIX = os.environ.get(
"MOONSTREAM_S3_SMARTCONTRACTS_ABI_PREFIX"
)
if MOONSTREAM_S3_SMARTCONTRACTS_ABI_PREFIX is None:
raise ValueError(
"MOONSTREAM_S3_SMARTCONTRACTS_ABI_PREFIX environment variable must be set"
)
MOONSTREAM_S3_SMARTCONTRACTS_ABI_PREFIX = (
MOONSTREAM_S3_SMARTCONTRACTS_ABI_PREFIX.rstrip("/")
)
MOONSTREAM_CRAWLERS_SERVER_URL = os.environ.get("MOONSTREAM_CRAWLERS_SERVER_URL")
if MOONSTREAM_CRAWLERS_SERVER_URL is None:
raise ValueError("MOONSTREAM_CRAWLERS_SERVER_URL environment variable must be set")
MOONSTREAM_CRAWLERS_SERVER_URL = MOONSTREAM_CRAWLERS_SERVER_URL.rstrip("/")
MOONSTREAM_CRAWLERS_SERVER_PORT = os.environ.get("MOONSTREAM_CRAWLERS_SERVER_PORT")
if MOONSTREAM_CRAWLERS_SERVER_PORT is None:
raise ValueError("MOONSTREAM_CRAWLERS_SERVER_PORT environment variable must be set")
MOONSTREAM_CRAWLERS_SERVER_PORT = MOONSTREAM_CRAWLERS_SERVER_PORT.rstrip("/")
MOONSTREAM_MOONWORM_TASKS_JOURNAL = os.environ.get(
"MOONSTREAM_MOONWORM_TASKS_JOURNAL", ""
)
if MOONSTREAM_MOONWORM_TASKS_JOURNAL == "":
raise ValueError(
"MOONSTREAM_MOONWORM_TASKS_JOURNAL environment variable must be set"
)
# Web3
MOONSTREAM_ETHEREUM_WEB3_PROVIDER_URI = os.environ.get(
"MOONSTREAM_ETHEREUM_WEB3_PROVIDER_URI", ""
)
if MOONSTREAM_ETHEREUM_WEB3_PROVIDER_URI == "":
raise ValueError(
"MOONSTREAM_ETHEREUM_WEB3_PROVIDER_URI environment variable must be set"
)
MOONSTREAM_S3_QUERIES_BUCKET = os.environ.get("MOONSTREAM_S3_QUERIES_BUCKET", "")
if MOONSTREAM_S3_QUERIES_BUCKET == "":
raise ValueError("MOONSTREAM_S3_QUERIES_BUCKET environment variable must be set")
MOONSTREAM_S3_QUERIES_BUCKET_PREFIX = os.environ.get(
"MOONSTREAM_S3_QUERIES_BUCKET_PREFIX", ""
)
if MOONSTREAM_S3_QUERIES_BUCKET_PREFIX == "":
raise ValueError(
"MOONSTREAM_S3_QUERIES_BUCKET_PREFIX environment variable must be set"
)

Wyświetl plik

@ -1,15 +0,0 @@
import logging
from web3 import Web3
from .settings import MOONSTREAM_ETHEREUM_WEB3_PROVIDER_URI
logger = logging.getLogger(__name__)
moonstream_web3_provider = Web3(
Web3.HTTPProvider(MOONSTREAM_ETHEREUM_WEB3_PROVIDER_URI)
)
def yield_web3_provider() -> Web3:
return moonstream_web3_provider

Wyświetl plik

@ -143,5 +143,10 @@ cython_debug/
# End of https://www.toptal.com/developers/gitignore/api/python
# Custom
.moonstream-py/
.venv/
.secrets/
prod.env
dev.env
test.env

Wyświetl plik

@ -82,7 +82,7 @@ Stream of event packs will be generating from recent timestamp to older and inne
**From timestamp to timestamp, from bottom to top**
When `start_time` is less then `end_time`.
When `start_time` is less than `end_time`.
```python
for events in mc.create_stream(

Wyświetl plik

@ -0,0 +1,24 @@
from typing import Any, Dict
import boto3
def upload_to_aws_s3_bucket(
data: str,
bucket: str,
key: str,
metadata: Dict[str, Any] = {},
) -> str:
"""
Push data to AWS S3 bucket and return URL to object.
"""
s3 = boto3.client("s3")
s3.put_object(
Body=data,
Bucket=bucket,
Key=key,
ContentType="application/json",
Metadata=metadata,
)
return f"{bucket}/{key}"

Wyświetl plik

@ -1,41 +1,34 @@
import logging
import os
import time
from dataclasses import dataclass, field
from typing import Any, Dict, Generator, List, Optional, Tuple
import uuid
from typing import Any, Dict, Union
import requests
from .version import MOONSTREAM_CLIENT_VERSION
logger = logging.getLogger(__name__)
log_level = logging.INFO
if os.environ.get("DEBUG", "").lower() in ["true", "1"]:
log_level = logging.DEBUG
logger.setLevel(log_level)
try:
from .aws.bucket import upload_to_aws_s3_bucket
except Exception as e:
pass
from .data import (
APISpec,
AuthType,
Method,
MoonstreamQueries,
MoonstreamQuery,
MoonstreamQueryResultUrl,
OutputType,
)
from .exceptions import MoonstreamResponseException, MoonstreamUnexpectedResponse
from .settings import MOONSTREAM_API_URL, MOONSTREAM_REQUEST_TIMEOUT
ENDPOINT_PING = "/ping"
ENDPOINT_VERSION = "/version"
ENDPOINT_NOW = "/now"
ENDPOINT_TOKEN = "/users/token"
ENDPOINT_SUBSCRIPTIONS = "/subscriptions/"
ENDPOINT_SUBSCRIPTION_TYPES = "/subscriptions/types"
ENDPOINT_STREAMS = "/streams/"
ENDPOINT_STREAMS_LATEST = "/streams/latest"
ENDPOINT_STREAMS_NEXT = "/streams/next"
ENDPOINT_STREAMS_PREVIOUS = "/streams/previous"
ENDPOINT_QUERIES = "/queries"
ENDPOINTS = [
ENDPOINT_PING,
ENDPOINT_VERSION,
ENDPOINT_NOW,
ENDPOINT_TOKEN,
ENDPOINT_SUBSCRIPTIONS,
ENDPOINT_SUBSCRIPTION_TYPES,
ENDPOINT_STREAMS,
ENDPOINT_STREAMS_LATEST,
ENDPOINT_STREAMS_NEXT,
ENDPOINT_STREAMS_PREVIOUS,
ENDPOINT_QUERIES,
]
@ -43,473 +36,216 @@ def moonstream_endpoints(url: str) -> Dict[str, str]:
"""
Creates a dictionary of Moonstream API endpoints at the given Moonstream API URL.
"""
url_with_protocol = url
if not (
url_with_protocol.startswith("http://")
or url_with_protocol.startswith("https://")
):
url_with_protocol = f"http://{url_with_protocol}"
if not (url.startswith("http://") or url.startswith("https://")):
url = f"http://{url}"
normalized_url = url_with_protocol.rstrip("/")
normalized_url = url.rstrip("/")
return {endpoint: f"{normalized_url}{endpoint}" for endpoint in ENDPOINTS}
class UnexpectedResponse(Exception):
"""
Raised when a server response cannot be parsed into the appropriate/expected Python structure.
"""
class Unauthenticated(Exception):
"""
Raised when a user tries to make a request that needs to be authenticated by they are not authenticated.
"""
@dataclass(frozen=True)
class APISpec:
url: str
endpoints: Dict[str, str]
class Moonstream:
"""
A Moonstream client configured to communicate with a given Moonstream API server.
"""
def __init__(
self,
url: str = "https://api.moonstream.to",
timeout: Optional[float] = None,
):
def __init__(self, moonstream_api_url: str = MOONSTREAM_API_URL):
"""
Initializes a Moonstream API client.
Arguments:
url - Moonstream API URL. By default this points to the production Moonstream API at https://api.moonstream.to,
but you can replace it with the URL of any other Moonstream API instance.
timeout - Timeout (in seconds) for Moonstream API requests. Default is None, which means that
Moonstream API requests will never time out.
Returns: A Moonstream client.
Arguments:
url - Moonstream API URL. By default this points to the production Moonstream API at https://api.moonstream.to,
but you can replace it with the URL of any other Moonstream API instance.
"""
endpoints = moonstream_endpoints(url)
self.api = APISpec(url=url, endpoints=endpoints)
self.timeout = timeout
self._session = requests.Session()
self._session.headers.update(
{
"User-Agent": f"Moonstream Python client (version {MOONSTREAM_CLIENT_VERSION})"
}
)
endpoints = moonstream_endpoints(moonstream_api_url)
self.api = APISpec(url=moonstream_api_url, endpoints=endpoints)
def _call(
self,
method: Method,
url: str,
timeout: float = MOONSTREAM_REQUEST_TIMEOUT,
**kwargs,
):
try:
response = requests.request(
method.value, url=url, timeout=timeout, **kwargs
)
response.raise_for_status()
except Exception as e:
raise MoonstreamUnexpectedResponse(str(e))
return response.json()
def ping(self) -> Dict[str, Any]:
"""
Checks that you have a connection to the Moonstream API.
"""
r = self._session.get(self.api.endpoints[ENDPOINT_PING])
r.raise_for_status()
return r.json()
result = self._call(method=Method.GET, url=self.api.endpoints[ENDPOINT_PING])
return result
def version(self) -> Dict[str, Any]:
"""
Gets the Moonstream API version information from the server.
"""
r = self._session.get(self.api.endpoints[ENDPOINT_VERSION])
r.raise_for_status()
return r.json()
result = self._call(method=Method.GET, url=self.api.endpoints[ENDPOINT_VERSION])
return result
def server_time(self) -> float:
"""
Gets the current time (as microseconds since the Unix epoch) on the server.
"""
r = self._session.get(self.api.endpoints[ENDPOINT_NOW])
r.raise_for_status()
result = r.json()
raw_epoch_time = result.get("epoch_time")
if raw_epoch_time is None:
raise UnexpectedResponse(
f'Server response does not contain "epoch_time": {result}'
)
try:
epoch_time = float(raw_epoch_time)
except:
raise UnexpectedResponse(
f"Could not process epoch time as a float: {raw_epoch_time}"
)
return epoch_time
def authorize(self, access_token: str) -> None:
if not access_token:
logger.warning("Setting authorization header to empty token.")
self._session.headers.update({"Authorization": f"Bearer {access_token}"})
def requires_authorization(self):
if self._session.headers.get("Authorization") is None:
raise Unauthenticated(
'This method requires that you authenticate to the API, either by calling the "authorize" method with an API token or by calling the "login" method.'
)
def login(self, username: str, password: Optional[str] = None) -> str:
"""
Authorizes this client to act as the given user when communicating with the Moonstream API.
To register an account on the production Moonstream API, go to https://moonstream.to.
Arguments:
username - Username of the user to authenticate as.
password - Optional password for the user. If this is not provided, you will be prompted for
the password.
"""
if password is None:
password = input(f"Moonstream password for {username}: ")
r = self._session.post(
self.api.endpoints[ENDPOINT_TOKEN],
data={"username": username, "password": password},
)
r.raise_for_status()
token = r.json()
self.authorize(token["id"])
return token
def logout(self) -> None:
"""
Logs the current user out of the Moonstream client.
"""
self._session.delete(self.api.endpoints[ENDPOINT_TOKEN])
self._session.headers.pop("Authorization")
def subscription_types(self) -> Dict[str, Any]:
"""
Gets the currently available subscription types on the Moonstream API.
"""
r = self._session.get(self.api.endpoints[ENDPOINT_SUBSCRIPTION_TYPES])
r.raise_for_status()
return r.json()
def list_subscriptions(self) -> Dict[str, Any]:
"""
Gets the currently authorized user's subscriptions from the API server.
"""
self.requires_authorization()
r = self._session.get(self.api.endpoints[ENDPOINT_SUBSCRIPTIONS])
r.raise_for_status()
return r.json()
def create_subscription(
self, subscription_type: str, label: str, color: str, specifier: str = ""
) -> Dict[str, Any]:
"""
Creates a subscription.
Arguments:
subscription_type - The type of subscription you would like to create. To see the available subscription
types, call the "subscription_types" method on this Moonstream client. This argument must be
the "id" if the subscription type you want.
label - A label for the subscription. This will identify the subscription to you in your stream.
color - A hexadecimal color to associate with the subscription.
specifier - A specifier for the subscription, which must correspond to one of the choices in the
subscription type. This is optional because some subscription types do not require a specifier.
Returns: The subscription resource that was created on the backend.
"""
self.requires_authorization()
r = self._session.post(
self.api.endpoints[ENDPOINT_SUBSCRIPTIONS],
data={
"subscription_type_id": subscription_type,
"label": label,
"color": color,
"address": specifier,
},
)
r.raise_for_status()
return r.json()
def delete_subscription(self, id: str) -> Dict[str, Any]:
"""
Delete a subscription by ID.
Arguments:
id - ID of the subscription to delete.
Returns: The subscription resource that was deleted.
"""
self.requires_authorization()
r = self._session.delete(f"{self.api.endpoints[ENDPOINT_SUBSCRIPTIONS]}{id}")
r.raise_for_status()
return r.json()
def update_subscription(
self, id: str, label: Optional[str] = None, color: Optional[str] = None
) -> Dict[str, Any]:
"""
Update a subscription label or color.
Arguments:
label - New label for subscription (optional).
color - New color for subscription (optional).
Returns - If neither label or color are specified, raises a ValueError. Otherwise PUTs the updated
information to the server and returns the updated subscription resource.
"""
if label is None and color is None:
raise ValueError(
"At least one of the arguments to this method should not be None."
)
self.requires_authorization()
data = {}
if label is not None:
data["label"] = label
if color is not None:
data["color"] = color
r = self._session.put(
f"{self.api.endpoints[ENDPOINT_SUBSCRIPTIONS]}{id}", data=data
)
r.raise_for_status()
return r.json()
def latest_events(self, q: str = "") -> List[Dict[str, Any]]:
"""
Returns the latest events in your stream. You can optionally provide a query parameter to
constrain the query to specific subscription types or to specific subscriptions.
Arguments:
- q - Optional query (default is the empty string). The syntax to constrain to a particular
type of subscription is "type:<subscription_type>". For example, to get the latest event from
your Ethereum transaction pool subscriptions, you would use "type:ethereum_txpool".
Returns: A list of the latest events in your stream.
"""
self.requires_authorization()
query_params: Dict[str, str] = {}
if q:
query_params["q"] = q
r = self._session.get(
self.api.endpoints[ENDPOINT_STREAMS_LATEST], params=query_params
)
r.raise_for_status()
return r.json()
def next_event(
self, end_time: int, include_end: bool = True, q: str = ""
) -> Optional[Dict[str, Any]]:
"""
Return the earliest event in your stream that occurred after the given end_time.
Arguments:
- end_time - Time after which you want to retrieve the earliest event from your stream.
- include_end - If True, the result is the first event that occurred in your stream strictly
*after* the end time. If False, then you will get the first event that occurred in your
stream *on* or *after* the end time.
- q - Optional query to filter over your available subscriptions and subscription types.
Returns: None if no event has occurred after the given end time, else returns a dictionary
representing that event.
"""
self.requires_authorization()
query_params: Dict[str, Any] = {
"end_time": end_time,
"include_end": include_end,
}
if q:
query_params["q"] = q
r = self._session.get(
self.api.endpoints[ENDPOINT_STREAMS_NEXT], params=query_params
)
r.raise_for_status()
return r.json()
def previous_event(
self, start_time: int, include_start: bool = True, q: str = ""
) -> Optional[Dict[str, Any]]:
"""
Return the latest event in your stream that occurred before the given start_time.
Arguments:
- start_time - Time before which you want to retrieve the latest event from your stream.
- include_start - If True, the result is the last event that occurred in your stream strictly
*before* the start time. If False, then you will get the last event that occurred in your
stream *on* or *before* the start time.
- q - Optional query to filter over your available subscriptions and subscription types.
Returns: None if no event has occurred before the given start time, else returns a dictionary
representing that event.
"""
self.requires_authorization()
query_params: Dict[str, Any] = {
"start_time": start_time,
"include_start": include_start,
}
if q:
query_params["q"] = q
r = self._session.get(
self.api.endpoints[ENDPOINT_STREAMS_PREVIOUS], params=query_params
)
r.raise_for_status()
return r.json()
def events(
def create_query(
self,
start_time: int,
end_time: int,
include_start: bool = False,
include_end: bool = False,
q: str = "",
) -> Dict[str, Any]:
token: Union[str, uuid.UUID],
query: str,
name: str,
public: bool = False,
auth_type: AuthType = AuthType.bearer,
timeout: float = MOONSTREAM_REQUEST_TIMEOUT,
) -> MoonstreamQuery:
"""
Return all events in your stream that occurred between the given start and end times.
Arguments:
- start_time - Time after which you want to query your stream.
- include_start - Whether or not events that occurred exactly at the start_time should be included in the results.
- end_time - Time before which you want to query your stream.
- include_end - Whether or not events that occurred exactly at the end_time should be included in the results.
- q - Optional query to filter over your available subscriptions and subscription types.
Returns: A dictionary representing the results of your query.
Creates new query.
"""
self.requires_authorization()
query_params: Dict[str, Any] = {
"start_time": start_time,
"include_start": include_start,
"end_time": end_time,
"include_end": include_end,
json = {
"query": query,
"name": name,
"public": public,
}
if q:
query_params["q"] = q
headers = {
"Authorization": f"{auth_type.value} {token}",
}
response = self._call(
method=Method.POST,
url=f"{self.api.endpoints[ENDPOINT_QUERIES]}/",
headers=headers,
json=json,
timeout=timeout,
)
r = self._session.get(self.api.endpoints[ENDPOINT_STREAMS], params=query_params)
r.raise_for_status()
return r.json()
return MoonstreamQuery(
id=response["id"],
journal_url=response["journal_url"],
name=response["title"],
query=response["content"],
tags=response["tags"],
created_at=response["created_at"],
updated_at=response["updated_at"],
)
def create_stream(
def list_queries(
self,
start_time: int,
end_time: Optional[int] = None,
q: str = "",
) -> Generator[Dict[str, Any], None, None]:
token: Union[str, uuid.UUID],
auth_type: AuthType = AuthType.bearer,
timeout: float = MOONSTREAM_REQUEST_TIMEOUT,
) -> MoonstreamQueries:
"""
Return a stream of event. Event packs will be generated with 1 hour time range.
Arguments:
- start_time - One of time border.
- end_time - Time until the end of stream, if set to None stream will be going forward endlessly.
- q - Optional query to filter over your available subscriptions and subscription types.
Returns: A dictionary stream representing the results of your query.
Returns list of all queries available to user.
"""
# TODO(kompotkot): Add tests
shift_two_hours = 2 * 60 * 60 # 2 hours
shift_half_hour = 1 * 30 * 30 # 30 min
headers = {
"Authorization": f"{auth_type.value} {token}",
}
response = self._call(
method=Method.GET,
url=f"{self.api.endpoints[ENDPOINT_QUERIES]}/list",
headers=headers,
timeout=timeout,
)
def fetch_events(
modified_start_time: int, modified_end_time: int
) -> Generator[Tuple[Dict[str, Any], bool], None, None]:
# If it is going from top to bottom in history,
# then time_range will be reversed
reversed_time = False
if modified_start_time > modified_end_time:
reversed_time = True
max_boundary = max(modified_start_time, modified_end_time)
min_boundary = min(modified_start_time, modified_end_time)
time_range_list = []
# 300, 450 with shift 100 => [{"start_time": 300, "end_time": 399}, {"start_time": 400, "end_time": 450}]
if max_boundary - min_boundary > shift_half_hour:
for i in range(min_boundary, max_boundary, shift_half_hour):
end_i = (
i + shift_half_hour - 1
if i + shift_half_hour <= max_boundary
else max_boundary
)
time_range_list.append({"start_time": i, "end_time": end_i})
else:
time_range_list.append(
{"start_time": min_boundary, "end_time": max_boundary}
return MoonstreamQueries(
queries=[
MoonstreamQuery(
id=query["entry_id"],
name=query["name"],
query_type=query["type"],
user=query["user"],
user_id=query["user_id"],
)
if reversed_time:
time_range_list.reverse()
for query in response
]
)
for time_range in time_range_list:
r_json = self.events(
start_time=time_range["start_time"],
end_time=time_range["end_time"],
include_start=True,
include_end=True,
q=q,
)
def exec_query(
self,
token: Union[str, uuid.UUID],
name: str,
params: Dict[str, Any] = {},
auth_type: AuthType = AuthType.bearer,
timeout: float = MOONSTREAM_REQUEST_TIMEOUT,
) -> MoonstreamQueryResultUrl:
"""
Executes queries and upload data to external storage.
"""
headers = {
"Authorization": f"{auth_type.value} {token}",
}
json = {
"params": params,
}
response = self._call(
method=Method.POST,
url=f"{self.api.endpoints[ENDPOINT_QUERIES]}/{name}/update_data",
headers=headers,
json=json,
timeout=timeout,
)
yield r_json, reversed_time
return MoonstreamQueryResultUrl(url=response["url"])
time_range_list = time_range_list[:]
if end_time is None:
float_start_time = start_time
while True:
end_time = int(self.server_time())
# If time range is greater then 2 hours,
# shift float_start time close to end_time to prevent stream block
if end_time - float_start_time > shift_two_hours:
float_start_time = shift_two_hours
for r_json, reversed_time in fetch_events(float_start_time, end_time):
yield r_json
events = r_json.get("events", [])
if len(events) > 0:
# Updating float_start_time after first iteration to last event time
if reversed_time:
float_start_time = events[-1].get("event_timestamp") - 1
else:
float_start_time = events[0].get("event_timestamp") + 1
else:
# If there are no events in response, wait
# until new will be added
time.sleep(5)
else:
for r_json, reversed_time in fetch_events(start_time, end_time):
yield r_json
def client_from_env() -> Moonstream:
"""
Produces a Moonstream client instantiated using the following environment variables:
- MOONSTREAM_API_URL: Specifies the url parameter on the Moonstream client
- MOONSTREAM_TIMEOUT_SECONDS: Specifies the request timeout
- MOONSTREAM_ACCESS_TOKEN: If this environment variable is defined, the client sets this token as
the authorization header for all Moonstream API requests.
"""
kwargs: Dict[str, Any] = {}
url = os.environ.get("MOONSTREAM_API_URL")
if url is not None:
kwargs["url"] = url
raw_timeout = os.environ.get("MOONSTREAM_TIMEOUT_SECONDS")
timeout: Optional[float] = None
if raw_timeout is not None:
def download_query_results(
self,
url: str,
output_type: OutputType = OutputType.JSON,
timeout: float = MOONSTREAM_REQUEST_TIMEOUT,
**kwargs,
) -> Any:
"""
Fetch results of query from url.
"""
try:
timeout = float(raw_timeout)
except:
raise ValueError(
f"Could not convert MOONSTREAM_TIMEOUT_SECONDS ({raw_timeout}) to float."
response = requests.request(
Method.GET.value, url=url, timeout=timeout, **kwargs
)
response.raise_for_status()
except Exception as e:
raise Exception(str(e))
kwargs["timeout"] = timeout
output = response
if output_type == OutputType.JSON:
output = response.json()
moonstream_client = Moonstream(**kwargs)
return output
access_token = os.environ.get("MOONSTREAM_ACCESS_TOKEN")
if access_token is not None:
moonstream_client.authorize(access_token)
def upload_query_results(
self, data: str, bucket: str, key: str, metadata: Dict[str, Any] = {}
) -> str:
"""
Uploads data to AWS S3 bucket.
return moonstream_client
Requirements: "pip install -e .[aws]" with "boto3" module.
"""
try:
url = upload_to_aws_s3_bucket(
data=data, bucket=bucket, key=key, metadata=metadata
)
except Exception as e:
raise Exception(str(e))
return url
def delete_query(
self,
token: Union[str, uuid.UUID],
name: str,
auth_type: AuthType = AuthType.bearer,
timeout: float = MOONSTREAM_REQUEST_TIMEOUT,
) -> uuid.UUID:
"""
Deletes query specified by name.
"""
headers = {
"Authorization": f"{auth_type.value} {token}",
}
response = self._call(
method=Method.DELETE,
url=f"{self.api.endpoints[ENDPOINT_QUERIES]}/{name}",
headers=headers,
timeout=timeout,
)
return response["id"]

Wyświetl plik

@ -0,0 +1,52 @@
import uuid
from dataclasses import dataclass
from datetime import datetime
from enum import Enum
from typing import Any, Dict, List, Optional
@dataclass(frozen=True)
class APISpec:
url: str
endpoints: Dict[str, str]
class AuthType(Enum):
bearer = "Bearer"
web3 = "Web3"
class Method(Enum):
DELETE = "delete"
GET = "get"
POST = "post"
PUT = "put"
class OutputType(Enum):
CSV = "csv"
JSON = "json"
@dataclass(frozen=True)
class MoonstreamQuery:
id: uuid.UUID
name: str
journal_url: Optional[str] = None
query: Optional[str] = None
tags: Optional[List[str]] = None
user: Optional[str] = None
user_id: Optional[uuid.UUID] = None
query_type: Optional[str] = None
created_at: Optional[datetime] = None
updated_at: Optional[datetime] = None
@dataclass(frozen=True)
class MoonstreamQueries:
queries: List[MoonstreamQuery]
@dataclass(frozen=True)
class MoonstreamQueryResultUrl:
url: str

Wyświetl plik

@ -0,0 +1,24 @@
from typing import Any, Optional
class MoonstreamResponseException(Exception):
"""
Raised when Moonstream server response with error.
"""
def __init__(
self,
message,
status_code: int,
detail: Optional[Any] = None,
) -> None:
super().__init__(message)
self.status_code = status_code
if detail is not None:
self.detail = detail
class MoonstreamUnexpectedResponse(Exception):
"""
Raised when Moonstream server response is unexpected (e.g. unparseable).
"""

Wyświetl plik

@ -0,0 +1,13 @@
import os
MOONSTREAM_API_URL = os.environ.get("MOONSTREAM_API_URL", "https://api.moonstream.to")
MOONSTREAM_REQUEST_TIMEOUT = 10
MOONSTREAM_REQUEST_TIMEOUT_RAW = os.environ.get("MOONSTREAM_REQUEST_TIMEOUT")
try:
if MOONSTREAM_REQUEST_TIMEOUT_RAW is not None:
MOONSTREAM_REQUEST_TIMEOUT = int(MOONSTREAM_REQUEST_TIMEOUT_RAW)
except:
raise Exception(
f"Could not parse MOONSTREAM_REQUEST_TIMEOUT environment variable as int: {MOONSTREAM_REQUEST_TIMEOUT_RAW}"
)

Wyświetl plik

@ -1,138 +1,54 @@
from dataclasses import FrozenInstanceError
import os
import unittest
from . import client
class TestMoonstreamClient(unittest.TestCase):
def test_client_init(self):
m = client.Moonstream()
self.assertEqual(m.api.url, "https://api.moonstream.to")
self.assertIsNone(m.timeout)
self.assertGreater(len(m.api.endpoints), 0)
def test_client_init_with_timeout(self):
timeout = 7
m = client.Moonstream(timeout=timeout)
self.assertEqual(m.api.url, "https://api.moonstream.to")
self.assertEqual(m.timeout, timeout)
self.assertGreater(len(m.api.endpoints), 0)
def test_client_with_custom_url_and_timeout(self):
timeout = 9
url = "https://my.custom.api.url"
m = client.Moonstream(url=url, timeout=timeout)
self.assertEqual(m.api.url, url)
self.assertEqual(m.timeout, timeout)
self.assertGreater(len(m.api.endpoints), 0)
def test_client_with_custom_messy_url_and_timeout(self):
timeout = 3.5
url = "https://my.custom.api.url/"
m = client.Moonstream(url=url, timeout=timeout)
self.assertEqual(m.api.url, url)
self.assertEqual(m.timeout, timeout)
self.assertGreater(len(m.api.endpoints), 0)
def test_client_with_custom_messy_url_no_protocol_and_timeout(self):
timeout = 5.5
url = "my.custom.api.url/"
m = client.Moonstream(url=url, timeout=timeout)
self.assertEqual(m.api.url, url)
self.assertEqual(m.timeout, timeout)
self.assertGreater(len(m.api.endpoints), 0)
def test_immutable_api_url(self):
m = client.Moonstream()
with self.assertRaises(FrozenInstanceError):
m.api.url = "lol"
def test_immutable_api_endpoints(self):
m = client.Moonstream()
with self.assertRaises(FrozenInstanceError):
m.api.endpoints = {}
def test_mutable_timeout(self):
original_timeout = 5.0
updated_timeout = 10.5
m = client.Moonstream(timeout=original_timeout)
self.assertEqual(m.timeout, original_timeout)
m.timeout = updated_timeout
self.assertEqual(m.timeout, updated_timeout)
class TestMoonstreamClientFromEnv(unittest.TestCase):
class TestMoonstreamCalls(unittest.TestCase):
def setUp(self):
self.old_moonstream_api_url = os.environ.get("MOONSTREAM_API_URL")
self.old_moonstream_timeout_seconds = os.environ.get(
"MOONSTREAM_TIMEOUT_SECONDS"
url = os.environ.get("MOONSTREAM_API_URL", "https://api.moonstream.to")
self.token = os.environ.get("MOONSTREAM_ACCESS_TOKEN")
if self.token is None:
raise Exception("MOONSTREAM_ACCESS_TOKEN should be specified")
self.m = client.Moonstream(moonstream_api_url=url)
queries = self.m.list_queries(self.token)
for query in queries.queries:
if query.name.startswith("test_query_name"):
self.m.delete_query(self.token, query.name)
def test_ping(self):
response = self.m.ping()
self.assertEqual(response["status"], "ok")
def test_create_query(self):
query = "SELECT count(*) FROM polygon_blocks"
name = "test-query-name-1"
response = self.m.create_query(self.token, query, name)
self.assertEqual(f"Query:{name.replace('-', '_')}", response.name)
def test_list_queries(self):
query = (
"SELECT hash,block_number FROM polygon_blocks WHERE block_number = 21175765"
)
self.old_moonstream_access_token = os.environ.get("MOONSTREAM_ACCESS_TOKEN")
name = "test-query-name-2"
response_1 = self.m.create_query(self.token, query, name)
self.assertEqual(f"Query:{name.replace('-', '_')}", response_1.name)
self.moonstream_api_url = "https://custom.example.com"
self.moonstream_timeout_seconds = 15.333333
self.moonstream_access_token = "1d431ca4-af9b-4c3a-b7b9-3cc79f3b0900"
response_2 = self.m.list_queries(self.token)
self.assertGreaterEqual(len(response_2.queries), 1)
os.environ["MOONSTREAM_API_URL"] = self.moonstream_api_url
os.environ["MOONSTREAM_TIMEOUT_SECONDS"] = str(self.moonstream_timeout_seconds)
os.environ["MOONSTREAM_ACCESS_TOKEN"] = self.moonstream_access_token
def test_delete_query(self):
query = "SELECT 1"
name = "test-query-name-0"
response_1 = self.m.create_query(self.token, query, name)
self.assertEqual(f"Query:{name.replace('-', '_')}", response_1.name)
response_2 = self.m.delete_query(self.token, name.replace("-", "_"))
self.assertEqual(response_1.id, response_2)
def tearDown(self) -> None:
del os.environ["MOONSTREAM_API_URL"]
del os.environ["MOONSTREAM_TIMEOUT_SECONDS"]
del os.environ["MOONSTREAM_ACCESS_TOKEN"]
if self.old_moonstream_api_url is not None:
os.environ["MOONSTREAM_API_URL"] = self.old_moonstream_api_url
if self.old_moonstream_timeout_seconds is not None:
os.environ[
"MOONSTREAM_TIMEOUT_SECONDS"
] = self.old_moonstream_timeout_seconds
if self.old_moonstream_access_token is not None:
os.environ["MOONSTREAM_ACCESS_TOKEN"] = self.old_moonstream_access_token
def test_client_from_env(self):
m = client.client_from_env()
self.assertEqual(m.api.url, self.moonstream_api_url)
self.assertEqual(m.timeout, self.moonstream_timeout_seconds)
self.assertIsNone(m.requires_authorization())
authorization_header = m._session.headers["Authorization"]
self.assertEqual(authorization_header, f"Bearer {self.moonstream_access_token}")
class TestMoonstreamEndpoints(unittest.TestCase):
def setUp(self):
self.url = "https://api.moonstream.to"
self.normalized_url = "https://api.moonstream.to"
def test_moonstream_endpoints(self):
endpoints = client.moonstream_endpoints(self.url)
self.assertDictEqual(
endpoints,
{
client.ENDPOINT_PING: f"{self.normalized_url}{client.ENDPOINT_PING}",
client.ENDPOINT_VERSION: f"{self.normalized_url}{client.ENDPOINT_VERSION}",
client.ENDPOINT_NOW: f"{self.normalized_url}{client.ENDPOINT_NOW}",
client.ENDPOINT_TOKEN: f"{self.normalized_url}{client.ENDPOINT_TOKEN}",
client.ENDPOINT_SUBSCRIPTION_TYPES: f"{self.normalized_url}{client.ENDPOINT_SUBSCRIPTION_TYPES}",
client.ENDPOINT_SUBSCRIPTIONS: f"{self.normalized_url}{client.ENDPOINT_SUBSCRIPTIONS}",
client.ENDPOINT_STREAMS: f"{self.normalized_url}{client.ENDPOINT_STREAMS}",
client.ENDPOINT_STREAMS_LATEST: f"{self.normalized_url}{client.ENDPOINT_STREAMS_LATEST}",
client.ENDPOINT_STREAMS_NEXT: f"{self.normalized_url}{client.ENDPOINT_STREAMS_NEXT}",
client.ENDPOINT_STREAMS_PREVIOUS: f"{self.normalized_url}{client.ENDPOINT_STREAMS_PREVIOUS}",
},
)
class TestMoonstreamEndpointsMessyURL(TestMoonstreamEndpoints):
def setUp(self):
self.url = "https://api.moonstream.to/"
self.normalized_url = "https://api.moonstream.to"
class TestMoonstreamEndpointsMessyURLWithNoProtocol(TestMoonstreamEndpoints):
def setUp(self):
self.url = "api.moonstream.to/"
self.normalized_url = "http://api.moonstream.to"
queries = self.m.list_queries(self.token)
for query in queries.queries:
if query.name.startswith("test_query_name"):
self.m.delete_query(self.token, query.name)

Wyświetl plik

@ -1 +1 @@
MOONSTREAM_CLIENT_VERSION = "0.0.3"
MOONSTREAM_CLIENT_VERSION = "0.1.1"

Wyświetl plik

@ -0,0 +1,4 @@
[mypy]
[mypy-boto3.*]
ignore_missing_imports = True

Wyświetl plik

@ -0,0 +1,3 @@
# Tests variables
export MOONSTREAM_API_URL="https://api.moonstream.to"
export MOONSTREAM_ACCESS_TOKEN="<access_token_for_tests>"

Wyświetl plik

@ -11,8 +11,9 @@ setup(
version=MOONSTREAM_CLIENT_VERSION,
packages=find_packages(),
package_data={"moonstream": ["py.typed"]},
install_requires=["requests", "dataclasses; python_version=='3.6'"],
install_requires=["requests", "pydantic", "dataclasses; python_version=='3.6'"],
extras_require={
"aws": ["boto3"],
"dev": [
"black",
"mypy",

Wyświetl plik

@ -1,12 +0,0 @@
#!/usr/bin/env bash
set -e
TAG="clients/python/v$(python setup.py --version)"
read -r -p "Tag: $TAG -- tag and push (y/n)?" ACCEPT
if [ "$ACCEPT" = "y" ]
then
echo "Tagging and pushing: $TAG..."
git tag "$TAG"
git push upstream "$TAG"
else
echo "noop"
fi

Wyświetl plik

@ -0,0 +1,17 @@
[Unit]
Description=Amoy historical crawler events
After=network.target
StartLimitIntervalSec=300
StartLimitBurst=3
[Service]
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 historical-crawl --blockchain-type amoy --find-deployed-blocks --end 0 --tasks-journal --only-events
CPUWeight=70
SyslogIdentifier=amoy-historical-crawl-events
[Install]
WantedBy=multi-user.target

Wyświetl plik

@ -0,0 +1,9 @@
[Unit]
Description=Runs events historical crawler on Amoy
[Timer]
OnBootSec=60s
OnUnitActiveSec=10m
[Install]
WantedBy=timers.target

Wyświetl plik

@ -0,0 +1,17 @@
[Unit]
Description=Amoy historical crawler transactions
After=network.target
StartLimitIntervalSec=300
StartLimitBurst=3
[Service]
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 historical-crawl --blockchain-type amoy --find-deployed-blocks --end 0 --tasks-journal --only-functions
CPUWeight=70
SyslogIdentifier=amoy-historical-crawl-transactions
[Install]
WantedBy=multi-user.target

Wyświetl plik

@ -0,0 +1,9 @@
[Unit]
Description=Runs transactions historical crawler on Amoy
[Timer]
OnBootSec=60s
OnUnitActiveSec=10m
[Install]
WantedBy=timers.target

Wyświetl plik

@ -1,15 +1,11 @@
[Unit]
Description=Load trending Ethereum addresses to the database
Description=Fill missing blocks at Amoy database
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
CPUWeight=30
SyslogIdentifier=ethereum-trending
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks missing --blockchain amoy -n
CPUWeight=50
SyslogIdentifier=amoy-missing

Wyświetl plik

@ -0,0 +1,9 @@
[Unit]
Description=Fill missing blocks at Amoy database
[Timer]
OnBootSec=120s
OnUnitActiveSec=15m
[Install]
WantedBy=timers.target

Wyświetl plik

@ -0,0 +1,17 @@
[Unit]
Description=Amoy moonworm crawler
After=network.target
StartLimitIntervalSec=300
StartLimitBurst=3
[Service]
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 crawl -b amoy --confirmations 10 --min-blocks-batch 20
CPUWeight=70
SyslogIdentifier=amoy-moonworm-crawler
[Install]
WantedBy=multi-user.target

Wyświetl plik

@ -0,0 +1,17 @@
[Unit]
Description=Amoy block with transactions synchronizer
StartLimitIntervalSec=300
StartLimitBurst=3
After=network.target
[Service]
Restart=on-failure
RestartSec=15s
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks synchronize --blockchain amoy -c 10 -j 2
CPUWeight=90
SyslogIdentifier=amoy-synchronize
[Install]
WantedBy=multi-user.target

Wyświetl plik

@ -0,0 +1,11 @@
[Unit]
Description=Fill missing blocks at Arbitrum Nova database
After=network.target
[Service]
Type=oneshot
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks missing --blockchain arbitrum_nova -n
CPUWeight=50
SyslogIdentifier=arbitrum-nova-missing

Wyświetl plik

@ -0,0 +1,9 @@
[Unit]
Description=Fill missing blocks at Arbitrum Nova database
[Timer]
OnBootSec=120s
OnUnitActiveSec=15m
[Install]
WantedBy=timers.target

Wyświetl plik

@ -0,0 +1,17 @@
[Unit]
Description=Arbitrum Nova moonworm crawler
After=network.target
StartLimitIntervalSec=300
StartLimitBurst=3
[Service]
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 crawl -b arbitrum_nova --confirmations 10 --min-blocks-batch 20
CPUWeight=70
SyslogIdentifier=arbitrum-nova-moonworm-crawler
[Install]
WantedBy=multi-user.target

Wyświetl plik

@ -0,0 +1,17 @@
[Unit]
Description=Arbitrum Nova block with transactions synchronizer
StartLimitIntervalSec=300
StartLimitBurst=3
After=network.target
[Service]
Restart=on-failure
RestartSec=15s
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks synchronize --blockchain arbitrum_nova -c 10 -j 2
CPUWeight=90
SyslogIdentifier=arbitrum-nova-synchronize
[Install]
WantedBy=multi-user.target

Wyświetl plik

@ -0,0 +1,17 @@
[Unit]
Description=Arbitrum One historical crawler events
After=network.target
StartLimitIntervalSec=300
StartLimitBurst=3
[Service]
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 historical-crawl --blockchain-type arbitrum_one --find-deployed-blocks --end 0 --tasks-journal --only-events
CPUWeight=70
SyslogIdentifier=arbitrum-one-historical-crawl-events
[Install]
WantedBy=multi-user.target

Wyświetl plik

@ -0,0 +1,9 @@
[Unit]
Description=Runs events historical crawler on arbitrum one
[Timer]
OnBootSec=60s
OnUnitActiveSec=10m
[Install]
WantedBy=timers.target

Wyświetl plik

@ -0,0 +1,17 @@
[Unit]
Description=Arbitrum One historical crawler transactions
After=network.target
StartLimitIntervalSec=300
StartLimitBurst=3
[Service]
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 historical-crawl --blockchain-type arbitrum_one --find-deployed-blocks --end 0 --tasks-journal --only-functions
CPUWeight=70
SyslogIdentifier=arbitrum-one-historical-crawl-transactions
[Install]
WantedBy=multi-user.target

Wyświetl plik

@ -0,0 +1,9 @@
[Unit]
Description=Runs transactions historical crawler on proofofplay apex
[Timer]
OnBootSec=60s
OnUnitActiveSec=10m
[Install]
WantedBy=timers.target

Wyświetl plik

@ -0,0 +1,11 @@
[Unit]
Description=Fill missing blocks at Arbitrum One database
After=network.target
[Service]
Type=oneshot
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks missing --blockchain arbitrum_one -n
CPUWeight=50
SyslogIdentifier=arbitrum-one-missing

Wyświetl plik

@ -0,0 +1,9 @@
[Unit]
Description=Fill missing blocks at Arbitrum One database
[Timer]
OnBootSec=120s
OnUnitActiveSec=15m
[Install]
WantedBy=timers.target

Wyświetl plik

@ -0,0 +1,17 @@
[Unit]
Description=Arbitrum One moonworm crawler
After=network.target
StartLimitIntervalSec=300
StartLimitBurst=3
[Service]
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 crawl -b arbitrum_one --confirmations 10 --min-blocks-batch 20
CPUWeight=70
SyslogIdentifier=arbitrum-one-moonworm-crawler
[Install]
WantedBy=multi-user.target

Wyświetl plik

@ -0,0 +1,17 @@
[Unit]
Description=Arbitrum One block with transactions synchronizer
StartLimitIntervalSec=300
StartLimitBurst=3
After=network.target
[Service]
Restart=on-failure
RestartSec=15s
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks synchronize --blockchain arbitrum_one -c 10 -j 2
CPUWeight=90
SyslogIdentifier=arbitrum-one-synchronize
[Install]
WantedBy=multi-user.target

Wyświetl plik

@ -0,0 +1,11 @@
[Unit]
Description=Fill missing blocks at Arbitrum Sepolia database
After=network.target
[Service]
Type=oneshot
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks missing --blockchain arbitrum_sepolia -n
CPUWeight=50
SyslogIdentifier=arbitrum-sepolia-missing

Wyświetl plik

@ -0,0 +1,9 @@
[Unit]
Description=Fill missing blocks at Arbitrum Sepolia database
[Timer]
OnBootSec=120s
OnUnitActiveSec=15m
[Install]
WantedBy=timers.target

Wyświetl plik

@ -0,0 +1,17 @@
[Unit]
Description=Arbitrum Sepolia moonworm crawler
After=network.target
StartLimitIntervalSec=300
StartLimitBurst=3
[Service]
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 crawl -b arbitrum_sepolia --confirmations 10 --min-blocks-batch 20
CPUWeight=70
SyslogIdentifier=arbitrum-sepolia-moonworm-crawler
[Install]
WantedBy=multi-user.target

Wyświetl plik

@ -0,0 +1,17 @@
[Unit]
Description=Arbitrum Sepolia block with transactions synchronizer
StartLimitIntervalSec=300
StartLimitBurst=3
After=network.target
[Service]
Restart=on-failure
RestartSec=15s
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks synchronize --blockchain arbitrum_sepolia -c 10 -j 2
CPUWeight=90
SyslogIdentifier=arbitrum-sepolia-synchronize
[Install]
WantedBy=multi-user.target

Wyświetl plik

@ -0,0 +1,11 @@
[Unit]
Description=Fill missing blocks at Avalanche Fuji database
After=network.target
[Service]
Type=oneshot
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks missing --blockchain avalanche_fuji -n
CPUWeight=50
SyslogIdentifier=avalanche-fuji-missing

Wyświetl plik

@ -0,0 +1,9 @@
[Unit]
Description=Fill missing blocks at Avalanche Fuji database
[Timer]
OnBootSec=120s
OnUnitActiveSec=15m
[Install]
WantedBy=timers.target

Wyświetl plik

@ -0,0 +1,17 @@
[Unit]
Description=Avalanche Fuji moonworm crawler
After=network.target
StartLimitIntervalSec=300
StartLimitBurst=3
[Service]
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 crawl -b avalanche_fuji --confirmations 10 --min-blocks-batch 20
CPUWeight=70
SyslogIdentifier=avalanche-fuji-moonworm-crawler
[Install]
WantedBy=multi-user.target

Wyświetl plik

@ -0,0 +1,17 @@
[Unit]
Description=Avalanche Fuji block with transactions synchronizer
StartLimitIntervalSec=300
StartLimitBurst=3
After=network.target
[Service]
Restart=on-failure
RestartSec=15s
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks synchronize --blockchain avalanche_fuji -c 10 -j 2
CPUWeight=90
SyslogIdentifier=avalanche-fuji-synchronize
[Install]
WantedBy=multi-user.target

Wyświetl plik

@ -0,0 +1,11 @@
[Unit]
Description=Fill missing blocks at Avalanche database
After=network.target
[Service]
Type=oneshot
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks missing --blockchain avalanche -n
CPUWeight=50
SyslogIdentifier=avalanche-missing

Wyświetl plik

@ -0,0 +1,9 @@
[Unit]
Description=Fill missing blocks at Avalanche database
[Timer]
OnBootSec=120s
OnUnitActiveSec=15m
[Install]
WantedBy=timers.target

Wyświetl plik

@ -0,0 +1,17 @@
[Unit]
Description=Avalanche moonworm crawler
After=network.target
StartLimitIntervalSec=300
StartLimitBurst=3
[Service]
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 crawl -b avalanche --confirmations 10 --min-blocks-batch 20
CPUWeight=70
SyslogIdentifier=avalanche-moonworm-crawler
[Install]
WantedBy=multi-user.target

Wyświetl plik

@ -0,0 +1,17 @@
[Unit]
Description=Avalanche block with transactions synchronizer
StartLimitIntervalSec=300
StartLimitBurst=3
After=network.target
[Service]
Restart=on-failure
RestartSec=15s
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks synchronize --blockchain avalanche -c 10 -j 2
CPUWeight=90
SyslogIdentifier=avalanche-synchronize
[Install]
WantedBy=multi-user.target

Wyświetl plik

@ -0,0 +1,11 @@
[Unit]
Description=Fill missing blocks at Blast database
After=network.target
[Service]
Type=oneshot
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks missing --blockchain blast -n
CPUWeight=50
SyslogIdentifier=blast-missing

Wyświetl plik

@ -0,0 +1,9 @@
[Unit]
Description=Fill missing blocks at Blast database
[Timer]
OnBootSec=120s
OnUnitActiveSec=15m
[Install]
WantedBy=timers.target

Wyświetl plik

@ -0,0 +1,17 @@
[Unit]
Description=Blast moonworm crawler
After=network.target
StartLimitIntervalSec=300
StartLimitBurst=3
[Service]
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 crawl -b blast --confirmations 10 --min-blocks-batch 20
CPUWeight=70
SyslogIdentifier=blast-moonworm-crawler
[Install]
WantedBy=multi-user.target

Wyświetl plik

@ -0,0 +1,11 @@
[Unit]
Description=Fill missing blocks at Blast Sepolia database
After=network.target
[Service]
Type=oneshot
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks missing --blockchain blast_sepolia -n
CPUWeight=50
SyslogIdentifier=blast-sepolia-missing

Wyświetl plik

@ -0,0 +1,9 @@
[Unit]
Description=Fill missing blocks at Blast Sepolia database
[Timer]
OnBootSec=120s
OnUnitActiveSec=15m
[Install]
WantedBy=timers.target

Wyświetl plik

@ -0,0 +1,17 @@
[Unit]
Description=Blast Sepolia moonworm crawler
After=network.target
StartLimitIntervalSec=300
StartLimitBurst=3
[Service]
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 crawl -b blast_sepolia --confirmations 10 --min-blocks-batch 20
CPUWeight=70
SyslogIdentifier=blast-sepolia-moonworm-crawler
[Install]
WantedBy=multi-user.target

Wyświetl plik

@ -0,0 +1,17 @@
[Unit]
Description=Blast Sepolia block with transactions synchronizer
StartLimitIntervalSec=300
StartLimitBurst=3
After=network.target
[Service]
Restart=on-failure
RestartSec=15s
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks synchronize --blockchain blast_sepolia -c 10 -j 2
CPUWeight=90
SyslogIdentifier=blast-sepolia-synchronize
[Install]
WantedBy=multi-user.target

Wyświetl plik

@ -0,0 +1,17 @@
[Unit]
Description=Blast block with transactions synchronizer
StartLimitIntervalSec=300
StartLimitBurst=3
After=network.target
[Service]
Restart=on-failure
RestartSec=15s
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks synchronize --blockchain blast -c 10 -j 2
CPUWeight=90
SyslogIdentifier=blast-synchronize
[Install]
WantedBy=multi-user.target

Wyświetl plik

@ -0,0 +1,467 @@
#!/usr/bin/env bash
# Deployment script - intended to run on Moonstream crawlers server
# Colors
C_RESET='\033[0m'
C_RED='\033[1;31m'
C_GREEN='\033[1;32m'
C_YELLOW='\033[1;33m'
# Logs
PREFIX_INFO="${C_GREEN}[INFO]${C_RESET} [$(date +%d-%m\ %T)]"
PREFIX_WARN="${C_YELLOW}[WARN]${C_RESET} [$(date +%d-%m\ %T)]"
PREFIX_CRIT="${C_RED}[CRIT]${C_RESET} [$(date +%d-%m\ %T)]"
# Main
AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION:-us-east-1}"
APP_DIR="${APP_DIR:-/home/ubuntu/moonstream}"
APP_CRAWLERS_DIR="${APP_DIR}/crawlers"
PYTHON_ENV_DIR="${PYTHON_ENV_DIR:-/home/ubuntu/moonstream-env}"
PYTHON="${PYTHON_ENV_DIR}/bin/python"
PIP="${PYTHON_ENV_DIR}/bin/pip"
SECRETS_DIR="${SECRETS_DIR:-/home/ubuntu/moonstream-secrets}"
PARAMETERS_ENV_PATH="${SECRETS_DIR}/app.env"
SCRIPT_DIR="$(realpath $(dirname $0))"
# Service files
MOONCRAWL_SERVICE_FILE="mooncrawl.service"
LEADERBOARDS_WORKER_SERVICE_FILE="leaderboards-worker.service"
LEADERBOARDS_WORKER_TIMER_FILE="leaderboards-worker.timer"
# Ethereum service files
ETHEREUM_SYNCHRONIZE_SERVICE_FILE="ethereum-synchronize.service"
ETHEREUM_MISSING_SERVICE_FILE="ethereum-missing.service"
ETHEREUM_MISSING_TIMER_FILE="ethereum-missing.timer"
ETHEREUM_ORANGE_DAO_REPORTS_TOKENONOMICS_SERVICE_FILE="ethereum-orange-dao-reports-tokenonomics.service"
ETHEREUM_ORANGE_DAO_TOKENONOMICS_TIMER_FILE="ethereum-orange-dao-reports-tokenonomics.timer"
# Polygon service files
POLYGON_SYNCHRONIZE_SERVICE="polygon-synchronize.service"
POLYGON_MISSING_SERVICE_FILE="polygon-missing.service"
POLYGON_MISSING_TIMER_FILE="polygon-missing.timer"
POLYGON_CU_NFT_DASHBOARD_SERVICE_FILE="polygon-cu-nft-dashboard.service"
POLYGON_CU_NFT_DASHBOARD_TIMER_FILE="polygon-cu-nft-dashboard.timer"
# Amoy
AMOY_MISSING_SERVICE_FILE="amoy-missing.service"
AMOY_MISSING_TIMER_FILE="amoy-missing.timer"
AMOY_SYNCHRONIZE_SERVICE="amoy-synchronize.service"
# XDai service files
XDAI_SYNCHRONIZE_SERVICE="xdai-synchronize.service"
XDAI_MISSING_SERVICE_FILE="xdai-missing.service"
XDAI_MISSING_TIMER_FILE="xdai-missing.timer"
# ZkSync Era
ZKSYNC_ERA_SYNCHRONIZE_SERVICE="zksync-era-synchronize.service"
ZKSYNC_ERA_MISSING_SERVICE_FILE="zksync-era-missing.service"
ZKSYNC_ERA_MISSING_TIMER_FILE="zksync-era-missing.timer"
# ZkSync Era Sepolia
ZKSYNC_ERA_SEPOLIA_SYNCHRONIZE_SERVICE="zksync-era-sepolia-synchronize.service"
ZKSYNC_ERA_SEPOLIA_MISSING_SERVICE_FILE="zksync-era-sepolia-missing.service"
ZKSYNC_ERA_SEPOLIA_MISSING_TIMER_FILE="zksync-era-sepolia-missing.timer"
# Arbitrum one
ARBITRUM_ONE_SYNCHRONIZE_SERVICE="arbitrum-one-synchronize.service"
ARBITRUM_ONE_MISSING_SERVICE_FILE="arbitrum-one-missing.service"
ARBITRUM_ONE_MISSING_TIMER_FILE="arbitrum-one-missing.timer"
# Arbitrum Nova
ARBITRUM_NOVA_SYNCHRONIZE_SERVICE="arbitrum-nova-synchronize.service"
ARBITRUM_NOVA_MISSING_SERVICE_FILE="arbitrum-nova-missing.service"
ARBITRUM_NOVA_MISSING_TIMER_FILE="arbitrum-nova-missing.timer"
# Arbitrum Sepolia
ARBITRUM_SEPOLIA_SYNCHRONIZE_SERVICE="arbitrum-sepolia-synchronize.service"
ARBITRUM_SEPOLIA_MISSING_SERVICE_FILE="arbitrum-sepolia-missing.service"
ARBITRUM_SEPOLIA_MISSING_TIMER_FILE="arbitrum-sepolia-missing.timer"
# Xai
XAI_SYNCHRONIZE_SERVICE="xai-synchronize.service"
XAI_MISSING_SERVICE_FILE="xai-missing.service"
XAI_MISSING_TIMER_FILE="xai-missing.timer"
# Xai sepolia
XAI_SEPOLIA_SYNCHRONIZE_SERVICE="xai-sepolia-synchronize.service"
XAI_SEPOLIA_MISSING_SERVICE_FILE="xai-sepolia-missing.service"
XAI_SEPOLIA_MISSING_TIMER_FILE="xai-sepolia-missing.timer"
# Avalanche sepolia
AVALANCHE_SYNCHRONIZE_SERVICE="avalanche-synchronize.service"
AVALANCHE_MISSING_SERVICE_FILE="avalanche-missing.service"
AVALANCHE_MISSING_TIMER_FILE="avalanche-missing.timer"
# Avalanche Fuji sepolia
AVALANCHE_FUJI_SYNCHRONIZE_SERVICE="avalanche-fuji-synchronize.service"
AVALANCHE_FUJI_MISSING_SERVICE_FILE="avalanche-fuji-missing.service"
AVALANCHE_FUJI_MISSING_TIMER_FILE="avalanche-fuji-missing.timer"
# Blast
BLAST_MISSING_SERVICE_FILE="blast-missing.service"
BLAST_MISSING_TIMER_FILE="blast-missing.timer"
BLAST_SYNCHRONIZE_SERVICE="blast-synchronize.service"
# Blast sepolia
BLAST_SEPOLIA_MISSING_SERVICE_FILE="blast-sepolia-missing.service"
BLAST_SEPOLIA_MISSING_TIMER_FILE="blast-sepolia-missing.timer"
BLAST_SEPOLIA_SYNCHRONIZE_SERVICE="blast-sepolia-synchronize.service"
# ProofofPlay APEX
PROOFOFPLAY_APEX_MISSING_SERVICE_FILE="proofofplay-apex-missing.service"
PROOFOFPLAY_APEX_MISSING_TIMER_FILE="proofofplay-apex-missing.timer"
PROOFOFPLAY_APEX_SYNCHRONIZE_SERVICE="proofofplay-apex-synchronize.service"
set -eu
echo
echo
echo -e "${PREFIX_INFO} Upgrading Python pip and setuptools"
"${PIP}" install --upgrade pip setuptools
echo
echo
echo -e "${PREFIX_INFO} Installing Python dependencies"
"${PIP}" install -e "${APP_CRAWLERS_DIR}/mooncrawl/"
echo
echo
echo -e "${PREFIX_INFO} Install checkenv"
HOME=/home/ubuntu /usr/local/go/bin/go install github.com/bugout-dev/checkenv@latest
echo
echo
echo -e "${PREFIX_INFO} Retrieving deployment parameters"
if [ ! -d "${SECRETS_DIR}" ]; then
mkdir -p "${SECRETS_DIR}"
echo -e "${PREFIX_WARN} Created new secrets directory"
fi
AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION}" CHECKENV_AWS_FETCH_LOOP_LIMIT=20 /home/ubuntu/go/bin/checkenv show aws_ssm+moonstream:true > "${PARAMETERS_ENV_PATH}"
chmod 0640 "${PARAMETERS_ENV_PATH}"
echo
echo
echo -e "${PREFIX_INFO} Add instance local IP to parameters"
echo "AWS_LOCAL_IPV4=$(ec2metadata --local-ipv4)" >> "${PARAMETERS_ENV_PATH}"
echo
echo
if [ ! -d "/home/ubuntu/.config/systemd/user/" ]; then
mkdir -p /home/ubuntu/.config/systemd/user/
echo -e "${PREFIX_WARN} Created user systemd directory"
fi
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}" "/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 Leaderboards worker service and timer with: ${LEADERBOARDS_WORKER_SERVICE_FILE}, ${LEADERBOARDS_WORKER_TIMER_FILE}"
chmod 644 "${SCRIPT_DIR}/${LEADERBOARDS_WORKER_SERVICE_FILE}" "${SCRIPT_DIR}/${LEADERBOARDS_WORKER_TIMER_FILE}"
cp "${SCRIPT_DIR}/${LEADERBOARDS_WORKER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${LEADERBOARDS_WORKER_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${LEADERBOARDS_WORKER_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${LEADERBOARDS_WORKER_TIMER_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${LEADERBOARDS_WORKER_TIMER_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}" "/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 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}" "/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 Orange DAO reports tokenonomics service and timer with: ${ETHEREUM_ORANGE_DAO_REPORTS_TOKENONOMICS_SERVICE_FILE}, ${ETHEREUM_ORANGE_DAO_TOKENONOMICS_TIMER_FILE}"
chmod 644 "${SCRIPT_DIR}/${ETHEREUM_ORANGE_DAO_REPORTS_TOKENONOMICS_SERVICE_FILE}" "${SCRIPT_DIR}/${ETHEREUM_ORANGE_DAO_TOKENONOMICS_TIMER_FILE}"
cp "${SCRIPT_DIR}/${ETHEREUM_ORANGE_DAO_REPORTS_TOKENONOMICS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ETHEREUM_ORANGE_DAO_REPORTS_TOKENONOMICS_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${ETHEREUM_ORANGE_DAO_TOKENONOMICS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${ETHEREUM_ORANGE_DAO_TOKENONOMICS_TIMER_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ETHEREUM_ORANGE_DAO_TOKENONOMICS_TIMER_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}" "/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}" "/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 CU reports tokenonomics service and timer with: ${POLYGON_CU_NFT_DASHBOARD_SERVICE_FILE}, ${POLYGON_CU_NFT_DASHBOARD_TIMER_FILE}"
chmod 644 "${SCRIPT_DIR}/${POLYGON_CU_NFT_DASHBOARD_SERVICE_FILE}" "${SCRIPT_DIR}/${POLYGON_CU_NFT_DASHBOARD_TIMER_FILE}"
cp "${SCRIPT_DIR}/${POLYGON_CU_NFT_DASHBOARD_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${POLYGON_CU_NFT_DASHBOARD_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${POLYGON_CU_NFT_DASHBOARD_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${POLYGON_CU_NFT_DASHBOARD_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_NFT_DASHBOARD_TIMER_FILE}"
# Amoy
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Amoy block with transactions syncronizer service definition with ${AMOY_SYNCHRONIZE_SERVICE}"
chmod 644 "${SCRIPT_DIR}/${AMOY_SYNCHRONIZE_SERVICE}"
cp "${SCRIPT_DIR}/${AMOY_SYNCHRONIZE_SERVICE}" "/home/ubuntu/.config/systemd/user/${AMOY_SYNCHRONIZE_SERVICE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${AMOY_SYNCHRONIZE_SERVICE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Amoy missing service and timer with: ${AMOY_MISSING_SERVICE_FILE}, ${AMOY_MISSING_TIMER_FILE}"
chmod 644 "${SCRIPT_DIR}/${AMOY_MISSING_SERVICE_FILE}" "${SCRIPT_DIR}/${AMOY_MISSING_TIMER_FILE}"
cp "${SCRIPT_DIR}/${AMOY_MISSING_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${AMOY_MISSING_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${AMOY_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${AMOY_MISSING_TIMER_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${AMOY_MISSING_TIMER_FILE}"
# Xdai
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 ZkSync Era block with transactions syncronizer service definition with ${ZKSYNC_ERA_SYNCHRONIZE_SERVICE}"
chmod 644 "${SCRIPT_DIR}/${ZKSYNC_ERA_SYNCHRONIZE_SERVICE}"
cp "${SCRIPT_DIR}/${ZKSYNC_ERA_SYNCHRONIZE_SERVICE}" "/home/ubuntu/.config/systemd/user/${ZKSYNC_ERA_SYNCHRONIZE_SERVICE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ZKSYNC_ERA_SYNCHRONIZE_SERVICE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing ZkSync Era missing service and timer with: ${ZKSYNC_ERA_MISSING_SERVICE_FILE}, ${ZKSYNC_ERA_MISSING_TIMER_FILE}"
chmod 644 "${SCRIPT_DIR}/${ZKSYNC_ERA_MISSING_SERVICE_FILE}" "${SCRIPT_DIR}/${ZKSYNC_ERA_MISSING_TIMER_FILE}"
cp "${SCRIPT_DIR}/${ZKSYNC_ERA_MISSING_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ZKSYNC_ERA_MISSING_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${ZKSYNC_ERA_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${ZKSYNC_ERA_MISSING_TIMER_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ZKSYNC_ERA_MISSING_TIMER_FILE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing ZkSync Era Sepolia block with transactions syncronizer service definition with ${ZKSYNC_ERA_SEPOLIA_SYNCHRONIZE_SERVICE}"
chmod 644 "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_SYNCHRONIZE_SERVICE}"
cp "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_SYNCHRONIZE_SERVICE}" "/home/ubuntu/.config/systemd/user/${ZKSYNC_ERA_SEPOLIA_SYNCHRONIZE_SERVICE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ZKSYNC_ERA_SEPOLIA_SYNCHRONIZE_SERVICE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing ZkSync Era Sepolia missing service and timer with: ${ZKSYNC_ERA_SEPOLIA_MISSING_SERVICE_FILE}, ${ZKSYNC_ERA_SEPOLIA_MISSING_TIMER_FILE}"
chmod 644 "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_MISSING_SERVICE_FILE}" "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_MISSING_TIMER_FILE}"
cp "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_MISSING_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ZKSYNC_ERA_SEPOLIA_MISSING_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${ZKSYNC_ERA_SEPOLIA_MISSING_TIMER_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ZKSYNC_ERA_SEPOLIA_MISSING_TIMER_FILE}"
# Arbitrum one
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Arbitrum one block with transactions syncronizer service definition with ${ARBITRUM_ONE_SYNCHRONIZE_SERVICE}"
chmod 644 "${SCRIPT_DIR}/${ARBITRUM_ONE_SYNCHRONIZE_SERVICE}"
cp "${SCRIPT_DIR}/${ARBITRUM_ONE_SYNCHRONIZE_SERVICE}" "/home/ubuntu/.config/systemd/user/${ARBITRUM_ONE_SYNCHRONIZE_SERVICE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ARBITRUM_ONE_SYNCHRONIZE_SERVICE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Arbitrum one missing service and timer with: ${ARBITRUM_ONE_MISSING_SERVICE_FILE}, ${ARBITRUM_ONE_MISSING_TIMER_FILE}"
chmod 644 "${SCRIPT_DIR}/${ARBITRUM_ONE_MISSING_SERVICE_FILE}" "${SCRIPT_DIR}/${ARBITRUM_ONE_MISSING_TIMER_FILE}"
cp "${SCRIPT_DIR}/${ARBITRUM_ONE_MISSING_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ARBITRUM_ONE_MISSING_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${ARBITRUM_ONE_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${ARBITRUM_ONE_MISSING_TIMER_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ARBITRUM_ONE_MISSING_TIMER_FILE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Arbitrum Nova block with transactions syncronizer service definition with ${ARBITRUM_NOVA_SYNCHRONIZE_SERVICE}"
chmod 644 "${SCRIPT_DIR}/${ARBITRUM_NOVA_SYNCHRONIZE_SERVICE}"
cp "${SCRIPT_DIR}/${ARBITRUM_NOVA_SYNCHRONIZE_SERVICE}" "/home/ubuntu/.config/systemd/user/${ARBITRUM_NOVA_SYNCHRONIZE_SERVICE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ARBITRUM_NOVA_SYNCHRONIZE_SERVICE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Arbitrum Nova missing service and timer with: ${ARBITRUM_NOVA_MISSING_SERVICE_FILE}, ${ARBITRUM_NOVA_MISSING_TIMER_FILE}"
chmod 644 "${SCRIPT_DIR}/${ARBITRUM_NOVA_MISSING_SERVICE_FILE}" "${SCRIPT_DIR}/${ARBITRUM_NOVA_MISSING_TIMER_FILE}"
cp "${SCRIPT_DIR}/${ARBITRUM_NOVA_MISSING_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ARBITRUM_NOVA_MISSING_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${ARBITRUM_NOVA_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${ARBITRUM_NOVA_MISSING_TIMER_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ARBITRUM_NOVA_MISSING_TIMER_FILE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Arbitrum Sepolia block with transactions syncronizer service definition with ${ARBITRUM_SEPOLIA_SYNCHRONIZE_SERVICE}"
chmod 644 "${SCRIPT_DIR}/${ARBITRUM_SEPOLIA_SYNCHRONIZE_SERVICE}"
cp "${SCRIPT_DIR}/${ARBITRUM_SEPOLIA_SYNCHRONIZE_SERVICE}" "/home/ubuntu/.config/systemd/user/${ARBITRUM_SEPOLIA_SYNCHRONIZE_SERVICE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ARBITRUM_SEPOLIA_SYNCHRONIZE_SERVICE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Arbitrum Sepolia missing service and timer with: ${ARBITRUM_SEPOLIA_MISSING_SERVICE_FILE}, ${ARBITRUM_SEPOLIA_MISSING_TIMER_FILE}"
chmod 644 "${SCRIPT_DIR}/${ARBITRUM_SEPOLIA_MISSING_SERVICE_FILE}" "${SCRIPT_DIR}/${ARBITRUM_SEPOLIA_MISSING_TIMER_FILE}"
cp "${SCRIPT_DIR}/${ARBITRUM_SEPOLIA_MISSING_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ARBITRUM_SEPOLIA_MISSING_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${ARBITRUM_SEPOLIA_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${ARBITRUM_SEPOLIA_MISSING_TIMER_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ARBITRUM_SEPOLIA_MISSING_TIMER_FILE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Xai block with transactions syncronizer service definition with ${XAI_SYNCHRONIZE_SERVICE}"
chmod 644 "${SCRIPT_DIR}/${XAI_SYNCHRONIZE_SERVICE}"
cp "${SCRIPT_DIR}/${XAI_SYNCHRONIZE_SERVICE}" "/home/ubuntu/.config/systemd/user/${XAI_SYNCHRONIZE_SERVICE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${XAI_SYNCHRONIZE_SERVICE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Xai missing service and timer with: ${XAI_MISSING_SERVICE_FILE}, ${XAI_MISSING_TIMER_FILE}"
chmod 644 "${SCRIPT_DIR}/${XAI_MISSING_SERVICE_FILE}" "${SCRIPT_DIR}/${XAI_MISSING_TIMER_FILE}"
cp "${SCRIPT_DIR}/${XAI_MISSING_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${XAI_MISSING_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${XAI_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${XAI_MISSING_TIMER_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${XAI_MISSING_TIMER_FILE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Xai sepolia block with transactions syncronizer service definition with ${XAI_SEPOLIA_SYNCHRONIZE_SERVICE}"
chmod 644 "${SCRIPT_DIR}/${XAI_SEPOLIA_SYNCHRONIZE_SERVICE}"
cp "${SCRIPT_DIR}/${XAI_SEPOLIA_SYNCHRONIZE_SERVICE}" "/home/ubuntu/.config/systemd/user/${XAI_SEPOLIA_SYNCHRONIZE_SERVICE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${XAI_SEPOLIA_SYNCHRONIZE_SERVICE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Xai sepolia missing service and timer with: ${XAI_SEPOLIA_MISSING_SERVICE_FILE}, ${XAI_SEPOLIA_MISSING_TIMER_FILE}"
chmod 644 "${SCRIPT_DIR}/${XAI_SEPOLIA_MISSING_SERVICE_FILE}" "${SCRIPT_DIR}/${XAI_SEPOLIA_MISSING_TIMER_FILE}"
cp "${SCRIPT_DIR}/${XAI_SEPOLIA_MISSING_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${XAI_SEPOLIA_MISSING_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${XAI_SEPOLIA_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${XAI_SEPOLIA_MISSING_TIMER_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${XAI_SEPOLIA_MISSING_TIMER_FILE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Avalanche block with transactions syncronizer service definition with ${AVALANCHE_SYNCHRONIZE_SERVICE}"
chmod 644 "${SCRIPT_DIR}/${AVALANCHE_SYNCHRONIZE_SERVICE}"
cp "${SCRIPT_DIR}/${AVALANCHE_SYNCHRONIZE_SERVICE}" "/home/ubuntu/.config/systemd/user/${AVALANCHE_SYNCHRONIZE_SERVICE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${AVALANCHE_SYNCHRONIZE_SERVICE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Avalanche missing service and timer with: ${AVALANCHE_MISSING_SERVICE_FILE}, ${AVALANCHE_MISSING_TIMER_FILE}"
chmod 644 "${SCRIPT_DIR}/${AVALANCHE_MISSING_SERVICE_FILE}" "${SCRIPT_DIR}/${AVALANCHE_MISSING_TIMER_FILE}"
cp "${SCRIPT_DIR}/${AVALANCHE_MISSING_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${AVALANCHE_MISSING_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${AVALANCHE_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${AVALANCHE_MISSING_TIMER_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${AVALANCHE_MISSING_TIMER_FILE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Avalanche Fuji block with transactions syncronizer service definition with ${AVALANCHE_FUJI_SYNCHRONIZE_SERVICE}"
chmod 644 "${SCRIPT_DIR}/${AVALANCHE_FUJI_SYNCHRONIZE_SERVICE}"
cp "${SCRIPT_DIR}/${AVALANCHE_FUJI_SYNCHRONIZE_SERVICE}" "/home/ubuntu/.config/systemd/user/${AVALANCHE_FUJI_SYNCHRONIZE_SERVICE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${AVALANCHE_FUJI_SYNCHRONIZE_SERVICE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Avalanche Fuji missing service and timer with: ${AVALANCHE_FUJI_MISSING_SERVICE_FILE}, ${AVALANCHE_FUJI_MISSING_TIMER_FILE}"
chmod 644 "${SCRIPT_DIR}/${AVALANCHE_FUJI_MISSING_SERVICE_FILE}" "${SCRIPT_DIR}/${AVALANCHE_FUJI_MISSING_TIMER_FILE}"
cp "${SCRIPT_DIR}/${AVALANCHE_FUJI_MISSING_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${AVALANCHE_FUJI_MISSING_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${AVALANCHE_FUJI_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${AVALANCHE_FUJI_MISSING_TIMER_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${AVALANCHE_FUJI_MISSING_TIMER_FILE}"
# Blast
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Blast block with transactions syncronizer service definition with ${BLAST_SYNCHRONIZE_SERVICE}"
chmod 644 "${SCRIPT_DIR}/${BLAST_SYNCHRONIZE_SERVICE}"
cp "${SCRIPT_DIR}/${BLAST_SYNCHRONIZE_SERVICE}" "/home/ubuntu/.config/systemd/user/${BLAST_SYNCHRONIZE_SERVICE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${BLAST_SYNCHRONIZE_SERVICE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Blast missing service and timer with: ${BLAST_MISSING_SERVICE_FILE}, ${BLAST_MISSING_TIMER_FILE}"
chmod 644 "${SCRIPT_DIR}/${BLAST_MISSING_SERVICE_FILE}" "${SCRIPT_DIR}/${BLAST_MISSING_TIMER_FILE}"
cp "${SCRIPT_DIR}/${BLAST_MISSING_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${BLAST_MISSING_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${BLAST_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${BLAST_MISSING_TIMER_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${BLAST_MISSING_TIMER_FILE}"
# Blast sepolia
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Blast sepolia block with transactions syncronizer service definition with ${BLAST_SEPOLIA_SYNCHRONIZE_SERVICE}"
chmod 644 "${SCRIPT_DIR}/${BLAST_SEPOLIA_SYNCHRONIZE_SERVICE}"
cp "${SCRIPT_DIR}/${BLAST_SEPOLIA_SYNCHRONIZE_SERVICE}" "/home/ubuntu/.config/systemd/user/${BLAST_SEPOLIA_SYNCHRONIZE_SERVICE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${BLAST_SEPOLIA_SYNCHRONIZE_SERVICE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Blast sepolia missing service and timer with: ${BLAST_SEPOLIA_MISSING_SERVICE_FILE}, ${BLAST_SEPOLIA_MISSING_TIMER_FILE}"
chmod 644 "${SCRIPT_DIR}/${BLAST_SEPOLIA_MISSING_SERVICE_FILE}" "${SCRIPT_DIR}/${BLAST_SEPOLIA_MISSING_TIMER_FILE}"
cp "${SCRIPT_DIR}/${BLAST_SEPOLIA_MISSING_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${BLAST_SEPOLIA_MISSING_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${BLAST_SEPOLIA_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${BLAST_SEPOLIA_MISSING_TIMER_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${BLAST_SEPOLIA_MISSING_TIMER_FILE}"
# Proofofplay Apex
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Proofofplay Apex block with transactions syncronizer service definition with ${PROOFOFPLAY_APEX_SYNCHRONIZE_SERVICE}"
chmod 644 "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_SYNCHRONIZE_SERVICE}"
cp "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_SYNCHRONIZE_SERVICE}" "/home/ubuntu/.config/systemd/user/${PROOFOFPLAY_APEX_SYNCHRONIZE_SERVICE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${PROOFOFPLAY_APEX_SYNCHRONIZE_SERVICE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Proofofplay Apex missing service and timer with: ${PROOFOFPLAY_APEX_MISSING_SERVICE_FILE}, ${PROOFOFPLAY_APEX_MISSING_TIMER_FILE}"
chmod 644 "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_MISSING_SERVICE_FILE}" "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_MISSING_TIMER_FILE}"
cp "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_MISSING_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${PROOFOFPLAY_APEX_MISSING_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${PROOFOFPLAY_APEX_MISSING_TIMER_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${PROOFOFPLAY_APEX_MISSING_TIMER_FILE}"

Wyświetl plik

@ -0,0 +1,305 @@
#!/usr/bin/env bash
# Deployment script - intended to run on Moonstream crawlers server
# Colors
C_RESET='\033[0m'
C_RED='\033[1;31m'
C_GREEN='\033[1;32m'
C_YELLOW='\033[1;33m'
# Logs
PREFIX_INFO="${C_GREEN}[INFO]${C_RESET} [$(date +%d-%m\ %T)]"
PREFIX_WARN="${C_YELLOW}[WARN]${C_RESET} [$(date +%d-%m\ %T)]"
PREFIX_CRIT="${C_RED}[CRIT]${C_RESET} [$(date +%d-%m\ %T)]"
# Main
AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION:-us-east-1}"
APP_DIR="${APP_DIR:-/home/ubuntu/moonstream}"
APP_CRAWLERS_DIR="${APP_DIR}/crawlers"
PYTHON_ENV_DIR="${PYTHON_ENV_DIR:-/home/ubuntu/moonstream-env}"
PYTHON="${PYTHON_ENV_DIR}/bin/python"
PIP="${PYTHON_ENV_DIR}/bin/pip"
SECRETS_DIR="${SECRETS_DIR:-/home/ubuntu/moonstream-secrets}"
PARAMETERS_ENV_PATH="${SECRETS_DIR}/app.env"
SCRIPT_DIR="$(realpath $(dirname $0))"
# Ethereum service files
ETHEREUM_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE="ethereum-historical-crawl-transactions.service"
ETHEREUM_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE="ethereum-historical-crawl-transactions.timer"
ETHEREUM_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE="ethereum-historical-crawl-events.service"
ETHEREUM_HISTORICAL_CRAWL_EVENTS_TIMER_FILE="ethereum-historical-crawl-events.timer"
# Polygon service files
POLYGON_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE="polygon-historical-crawl-transactions.service"
POLYGON_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE="polygon-historical-crawl-transactions.timer"
POLYGON_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE="polygon-historical-crawl-events.service"
POLYGON_HISTORICAL_CRAWL_EVENTS_TIMER_FILE="polygon-historical-crawl-events.timer"
# Amoy service files
AMOY_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE="amoy-historical-crawl-transactions.service"
AMOY_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE="amoy-historical-crawl-transactions.timer"
AMOY_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE="amoy-historical-crawl-events.service"
AMOY_HISTORICAL_CRAWL_EVENTS_TIMER_FILE="amoy-historical-crawl-events.timer"
# XDai service files
XDai_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE="xdai-historical-crawl-transactions.service"
XDai_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE="xdai-historical-crawl-transactions.timer"
XDai_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE="xdai-historical-crawl-events.service"
XDai_HISTORICAL_CRAWL_EVENTS_TIMER_FILE="xdai-historical-crawl-events.timer"
# ZkSync Era
ZKSYNC_ERA_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE="zksync-era-historical-crawl-transactions.service"
ZKSYNC_ERA_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE="zksync-era-historical-crawl-transactions.timer"
ZKSYNC_ERA_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE="zksync-era-historical-crawl-events.service"
ZKSYNC_ERA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE="zksync-era-historical-crawl-events.timer"
# ZkSync Era Sepolia
ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE="zksync-era-sepolia-historical-crawl-transactions.service"
ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE="zksync-era-sepolia-historical-crawl-transactions.timer"
ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE="zksync-era-sepolia-historical-crawl-events.service"
ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE="zksync-era-sepolia-historical-crawl-events.timer"
# Arbitrum one
ARBITRUM_ONE_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE="arbitrum-one-historical-crawl-transactions.service"
ARBITRUM_ONE_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE="arbitrum-one-historical-crawl-transactions.timer"
ARBITRUM_ONE_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE="arbitrum-one-historical-crawl-events.service"
ARBITRUM_ONE_HISTORICAL_CRAWL_EVENTS_TIMER_FILE="arbitrum-one-historical-crawl-events.timer"
# ProofofPlay APEX
PROOFOFPLAY_APEX_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE="proofofplay-apex-historical-crawl-transactions.service"
PROOFOFPLAY_APEX_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE="proofofplay-apex-historical-crawl-transactions.timer"
PROOFOFPLAY_APEX_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE="proofofplay-apex-historical-crawl-events.service"
PROOFOFPLAY_APEX_HISTORICAL_CRAWL_EVENTS_TIMER_FILE="proofofplay-apex-historical-crawl-events.timer"
# XAI
XAI_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE="xai-historical-crawl-transactions.service"
XAI_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE="xai-historical-crawl-transactions.timer"
XAI_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE="xai-historical-crawl-events.service"
XAI_HISTORICAL_CRAWL_EVENTS_TIMER_FILE="xai-historical-crawl-events.timer"
# XAI Sepolia
XAI_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE="xai-sepolia-historical-crawl-transactions.service"
XAI_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE="xai-sepolia-historical-crawl-transactions.timer"
XAI_SEPOLIA_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE="xai-sepolia-historical-crawl-events.service"
XAI_SEPOLIA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE="xai-sepolia-historical-crawl-events.timer"
set -eu
echo
echo
echo -e "${PREFIX_INFO} Upgrading Python pip and setuptools"
"${PIP}" install --upgrade pip setuptools
echo
echo
echo -e "${PREFIX_INFO} Installing Python dependencies"
"${PIP}" install -e "${APP_CRAWLERS_DIR}/mooncrawl/"
echo
echo
echo -e "${PREFIX_INFO} Install checkenv"
HOME=/home/ubuntu /usr/local/go/bin/go install github.com/bugout-dev/checkenv@latest
echo
echo
echo -e "${PREFIX_INFO} Retrieving deployment parameters"
if [ ! -d "${SECRETS_DIR}" ]; then
mkdir -p "${SECRETS_DIR}"
echo -e "${PREFIX_WARN} Created new secrets directory"
fi
AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION}" CHECKENV_AWS_FETCH_LOOP_LIMIT=20 /home/ubuntu/go/bin/checkenv show aws_ssm+moonstream:true > "${PARAMETERS_ENV_PATH}"
chmod 0640 "${PARAMETERS_ENV_PATH}"
echo
echo
echo -e "${PREFIX_INFO} Add instance local IP to parameters"
echo "AWS_LOCAL_IPV4=$(ec2metadata --local-ipv4)" >> "${PARAMETERS_ENV_PATH}"
echo
echo
if [ ! -d "/home/ubuntu/.config/systemd/user/" ]; then
mkdir -p /home/ubuntu/.config/systemd/user/
echo -e "${PREFIX_WARN} Created user systemd directory"
fi
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Ethereum historical transactions crawler service and timer with: ${ETHEREUM_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}, ${ETHEREUM_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
chmod 644 "${SCRIPT_DIR}/${ETHEREUM_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "${SCRIPT_DIR}/${ETHEREUM_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
cp "${SCRIPT_DIR}/${ETHEREUM_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ETHEREUM_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${ETHEREUM_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${ETHEREUM_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ETHEREUM_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Ethereum historical events crawler service and timer with: ${ETHEREUM_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}, ${ETHEREUM_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
chmod 644 "${SCRIPT_DIR}/${ETHEREUM_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "${SCRIPT_DIR}/${ETHEREUM_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
cp "${SCRIPT_DIR}/${ETHEREUM_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ETHEREUM_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${ETHEREUM_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${ETHEREUM_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ETHEREUM_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Polygon historical transactions crawler service and timer with: ${POLYGON_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}, ${POLYGON_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
chmod 644 "${SCRIPT_DIR}/${POLYGON_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "${SCRIPT_DIR}/${POLYGON_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
cp "${SCRIPT_DIR}/${POLYGON_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${POLYGON_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${POLYGON_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${POLYGON_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${POLYGON_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Polygon historical events crawler service and timer with: ${POLYGON_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}, ${POLYGON_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
chmod 644 "${SCRIPT_DIR}/${POLYGON_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "${SCRIPT_DIR}/${POLYGON_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
cp "${SCRIPT_DIR}/${POLYGON_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${POLYGON_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${POLYGON_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${POLYGON_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${POLYGON_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Amoy historical transactions crawler service and timer with: ${AMOY_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}, ${AMOY_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
chmod 644 "${SCRIPT_DIR}/${AMOY_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "${SCRIPT_DIR}/${AMOY_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
cp "${SCRIPT_DIR}/${AMOY_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${AMOY_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${AMOY_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${AMOY_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${AMOY_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Amoy historical events crawler service and timer with: ${AMOY_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}, ${AMOY_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
chmod 644 "${SCRIPT_DIR}/${AMOY_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "${SCRIPT_DIR}/${AMOY_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
cp "${SCRIPT_DIR}/${AMOY_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${AMOY_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${AMOY_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${AMOY_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${AMOY_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing xDai historical transactions crawler service and timer with: ${XDai_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}, ${XDai_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
chmod 644 "${SCRIPT_DIR}/${XDai_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "${SCRIPT_DIR}/${XDai_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
cp "${SCRIPT_DIR}/${XDai_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${XDai_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${XDai_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${XDai_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${XDai_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing xDai historical events crawler service and timer with: ${XDai_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}, ${XDai_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
chmod 644 "${SCRIPT_DIR}/${XDai_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "${SCRIPT_DIR}/${XDai_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
cp "${SCRIPT_DIR}/${XDai_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${XDai_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${XDai_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${XDai_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${XDai_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing ZkSync Era historical transactions crawler service and timer with: ${ZKSYNC_ERA_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}, ${ZKSYNC_ERA_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
chmod 644 "${SCRIPT_DIR}/${ZKSYNC_ERA_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "${SCRIPT_DIR}/${ZKSYNC_ERA_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
cp "${SCRIPT_DIR}/${ZKSYNC_ERA_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ZKSYNC_ERA_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${ZKSYNC_ERA_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${ZKSYNC_ERA_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ZKSYNC_ERA_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing ZkSync Era historical events crawler service and timer with: ${ZKSYNC_ERA_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}, ${ZKSYNC_ERA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
chmod 644 "${SCRIPT_DIR}/${ZKSYNC_ERA_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "${SCRIPT_DIR}/${ZKSYNC_ERA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
cp "${SCRIPT_DIR}/${ZKSYNC_ERA_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ZKSYNC_ERA_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${ZKSYNC_ERA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${ZKSYNC_ERA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ZKSYNC_ERA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing ZkSync Era Sepolia historical transactions crawler service and timer with: ${ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}, ${ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
chmod 644 "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
cp "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing ZkSync Era Sepolia historical events crawler service and timer with: ${ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}, ${ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
chmod 644 "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
cp "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Proofofplay Apex historical transactions crawler service and timer with: ${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}, ${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
chmod 644 "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
cp "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Proofofplay Apex historical events crawler service and timer with: ${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}, ${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
chmod 644 "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
cp "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Arbitrum one historical transactions crawler service and timer with: ${ARBITRUM_ONE_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}, ${ARBITRUM_ONE_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
chmod 644 "${SCRIPT_DIR}/${ARBITRUM_ONE_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "${SCRIPT_DIR}/${ARBITRUM_ONE_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
cp "${SCRIPT_DIR}/${ARBITRUM_ONE_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ARBITRUM_ONE_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${ARBITRUM_ONE_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${ARBITRUM_ONE_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ARBITRUM_ONE_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Arbitrum one historical events crawler service and timer with: ${ARBITRUM_ONE_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}, ${ARBITRUM_ONE_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
chmod 644 "${SCRIPT_DIR}/${ARBITRUM_ONE_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "${SCRIPT_DIR}/${ARBITRUM_ONE_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
cp "${SCRIPT_DIR}/${ARBITRUM_ONE_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ARBITRUM_ONE_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${ARBITRUM_ONE_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${ARBITRUM_ONE_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ARBITRUM_ONE_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing XAI historical transactions crawler service and timer with: ${XAI_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}, ${XAI_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
chmod 644 "${SCRIPT_DIR}/${XAI_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "${SCRIPT_DIR}/${XAI_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
cp "${SCRIPT_DIR}/${XAI_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${XAI_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${XAI_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${XAI_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${XAI_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing XAI historical events crawler service and timer with: ${XAI_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}, ${XAI_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
chmod 644 "${SCRIPT_DIR}/${XAI_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "${SCRIPT_DIR}/${XAI_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
cp "${SCRIPT_DIR}/${XAI_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${XAI_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${XAI_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${XAI_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${XAI_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing XAI Sepolia historical transactions crawler service and timer with: ${XAI_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}, ${XAI_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
chmod 644 "${SCRIPT_DIR}/${XAI_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "${SCRIPT_DIR}/${XAI_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
cp "${SCRIPT_DIR}/${XAI_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${XAI_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${XAI_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${XAI_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${XAI_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing XAI Sepolia historical events crawler service and timer with: ${XAI_SEPOLIA_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}, ${XAI_SEPOLIA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
chmod 644 "${SCRIPT_DIR}/${XAI_SEPOLIA_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "${SCRIPT_DIR}/${XAI_SEPOLIA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
cp "${SCRIPT_DIR}/${XAI_SEPOLIA_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${XAI_SEPOLIA_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${XAI_SEPOLIA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${XAI_SEPOLIA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${XAI_SEPOLIA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"

Wyświetl plik

@ -0,0 +1,77 @@
#!/usr/bin/env bash
# Deployment script of monitoring services - intended to run on Moonstream crawlers server
# Colors
C_RESET='\033[0m'
C_RED='\033[1;31m'
C_GREEN='\033[1;32m'
C_YELLOW='\033[1;33m'
# Logs
PREFIX_INFO="${C_GREEN}[INFO]${C_RESET} [$(date +%d-%m\ %T)]"
PREFIX_WARN="${C_YELLOW}[WARN]${C_RESET} [$(date +%d-%m\ %T)]"
PREFIX_CRIT="${C_RED}[CRIT]${C_RESET} [$(date +%d-%m\ %T)]"
# Main
AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION:-us-east-1}"
SECRETS_DIR="${SECRETS_DIR:-/home/ubuntu/moonstream-secrets}"
PARAMETERS_ENV_MONITORING_PATH="${SECRETS_DIR}/monitoring.env"
SCRIPT_DIR="$(realpath $(dirname $0))"
# Service files
MONITORING_CRAWLERS_SERVICE_FILE="monitoring-crawlers.service"
set -eu
echo
echo
echo -e "${PREFIX_INFO} Install checkenv"
HOME=/home/ubuntu /usr/local/go/bin/go install github.com/bugout-dev/checkenv@latest
echo
echo
echo -e "${PREFIX_INFO} Copy monitoring binary from AWS S3"
aws s3 cp s3://bugout-binaries/prod/monitoring/monitoring "/home/ubuntu/monitoring"
chmod +x "/home/ubuntu/monitoring"
chown ubuntu:ubuntu "/home/ubuntu/monitoring"
echo
echo
echo -e "${PREFIX_INFO} Retrieving monitoring deployment parameters"
AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION}" /home/ubuntu/go/bin/checkenv show aws_ssm+service:true,monitoring:true > "${PARAMETERS_ENV_MONITORING_PATH}"
chmod 0640 "${PARAMETERS_ENV_MONITORING_PATH}"
echo
echo
echo -e "${PREFIX_INFO} Add instance local IP to monitoring parameters"
echo "AWS_LOCAL_IPV4=$(ec2metadata --local-ipv4)" >> "${PARAMETERS_ENV_MONITORING_PATH}"
echo
echo
echo -e "${PREFIX_INFO} Add AWS default region to monitoring parameters"
echo "AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION}" >> "${PARAMETERS_ENV_MONITORING_PATH}"
echo
echo
echo -e "${PREFIX_INFO} Prepare monitoring configuration"
if [ ! -d "/home/ubuntu/.monitoring" ]; then
mkdir -p /home/ubuntu/.monitoring
echo -e "${PREFIX_WARN} Created monitoring configuration directory"
fi
cp "${SCRIPT_DIR}/monitoring-crawlers-config.json" /home/ubuntu/.monitoring/monitoring-crawlers-config.json
echo
echo
if [ ! -d "/home/ubuntu/.config/systemd/user/" ]; then
mkdir -p /home/ubuntu/.config/systemd/user/
echo -e "${PREFIX_WARN} Created user systemd directory"
fi
echo
echo
echo -e "${PREFIX_INFO} Replacing existing systemd crawlers monitoring service definition with ${MONITORING_CRAWLERS_SERVICE_FILE}"
chmod 644 "${SCRIPT_DIR}/${MONITORING_CRAWLERS_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${MONITORING_CRAWLERS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MONITORING_CRAWLERS_SERVICE_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart "${MONITORING_CRAWLERS_SERVICE_FILE}"

Wyświetl plik

@ -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}"

Wyświetl plik

@ -0,0 +1,211 @@
#!/usr/bin/env bash
# Deployment script - intended to run on Moonstream crawlers server
# Colors
C_RESET='\033[0m'
C_RED='\033[1;31m'
C_GREEN='\033[1;32m'
C_YELLOW='\033[1;33m'
# Logs
PREFIX_INFO="${C_GREEN}[INFO]${C_RESET} [$(date +%d-%m\ %T)]"
PREFIX_WARN="${C_YELLOW}[WARN]${C_RESET} [$(date +%d-%m\ %T)]"
PREFIX_CRIT="${C_RED}[CRIT]${C_RESET} [$(date +%d-%m\ %T)]"
# Main
AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION:-us-east-1}"
APP_DIR="${APP_DIR:-/home/ubuntu/moonstream}"
APP_CRAWLERS_DIR="${APP_DIR}/crawlers"
PYTHON_ENV_DIR="${PYTHON_ENV_DIR:-/home/ubuntu/moonstream-env}"
PYTHON="${PYTHON_ENV_DIR}/bin/python"
PIP="${PYTHON_ENV_DIR}/bin/pip"
SECRETS_DIR="${SECRETS_DIR:-/home/ubuntu/moonstream-secrets}"
PARAMETERS_ENV_PATH="${SECRETS_DIR}/app.env"
SCRIPT_DIR="$(realpath $(dirname $0))"
# Service files
ETHEREUM_MOONWORM_CRAWLER_SERVICE_FILE="ethereum-moonworm-crawler.service"
POLYGON_MOONWORM_CRAWLER_SERVICE_FILE="polygon-moonworm-crawler.service"
AMOY_MOONWORM_CRAWLER_SERVICE_FILE="amoy-moonworm-crawler.service"
XDAI_MOONWORM_CRAWLER_SERVICE_FILE="xdai-moonworm-crawler.service"
ZKSYNC_ERA_MOONWORM_CRAWLER_SERVICE_FILE="zksync-era-moonworm-crawler.service"
ZKSYNC_ERA_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE="zksync-era-sepolia-moonworm-crawler.service"
ARBITRUM_ONE_MOONWORM_CRAWLER_SERVICE_FILE="arbitrum-one-moonworm-crawler.service"
ARBITRUM_NOVA_MOONWORM_CRAWLER_SERVICE_FILE="arbitrum-nova-moonworm-crawler.service"
ARBITRUM_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE="arbitrum-sepolia-moonworm-crawler.service"
XAI_MOONWORM_CRAWLER_SERVICE_FILE="xai-moonworm-crawler.service"
XAI_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE="xai-sepolia-moonworm-crawler.service"
AVALANCHE_MOONWORM_CRAWLER_SERVICE_FILE="avalanche-moonworm-crawler.service"
AVALANCHE_FUJI_MOONWORM_CRAWLER_SERVICE_FILE="avalanche-fuji-moonworm-crawler.service"
BLAST_MOONWORM_CRAWLER_SERVICE_FILE="blast-moonworm-crawler.service"
BLAST_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE="blast-sepolia-moonworm-crawler.service"
PROOFOFPLAY_APEX_MOONWORM_CRAWLER_SERVICE_FILE="proofofplay-apex-moonworm-crawler.service"
set -eu
echo
echo
echo -e "${PREFIX_INFO} Upgrading Python pip and setuptools"
"${PIP}" install --upgrade pip setuptools
echo
echo
echo -e "${PREFIX_INFO} Installing Python dependencies"
"${PIP}" install -e "${APP_CRAWLERS_DIR}/mooncrawl/"
echo
echo
echo -e "${PREFIX_INFO} Install checkenv"
HOME=/home/ubuntu /usr/local/go/bin/go install github.com/bugout-dev/checkenv@latest
echo
echo
echo -e "${PREFIX_INFO} Retrieving deployment parameters"
if [ ! -d "${SECRETS_DIR}" ]; then
mkdir -p "${SECRETS_DIR}"
echo -e "${PREFIX_WARN} Created new secrets directory"
fi
AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION}" CHECKENV_AWS_FETCH_LOOP_LIMIT=20 /home/ubuntu/go/bin/checkenv show aws_ssm+moonstream:true > "${PARAMETERS_ENV_PATH}"
chmod 0640 "${PARAMETERS_ENV_PATH}"
echo
echo
echo -e "${PREFIX_INFO} Add instance local IP to parameters"
echo "AWS_LOCAL_IPV4=$(ec2metadata --local-ipv4)" >> "${PARAMETERS_ENV_PATH}"
echo
echo
if [ ! -d "/home/ubuntu/.config/systemd/user/" ]; then
mkdir -p /home/ubuntu/.config/systemd/user/
echo -e "${PREFIX_WARN} Created user systemd directory"
fi
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}" "/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 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}" "/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 Amoy moonworm crawler service definition with ${AMOY_MOONWORM_CRAWLER_SERVICE_FILE}"
chmod 644 "${SCRIPT_DIR}/${AMOY_MOONWORM_CRAWLER_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${AMOY_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${AMOY_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 "${AMOY_MOONWORM_CRAWLER_SERVICE_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}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing ZkSync Era moonworm crawler service definition with ${ZKSYNC_ERA_MOONWORM_CRAWLER_SERVICE_FILE}"
chmod 644 "${SCRIPT_DIR}/${ZKSYNC_ERA_MOONWORM_CRAWLER_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${ZKSYNC_ERA_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ZKSYNC_ERA_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 "${ZKSYNC_ERA_MOONWORM_CRAWLER_SERVICE_FILE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing ZkSync Era Sepolia moonworm crawler service definition with ${ZKSYNC_ERA_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
chmod 644 "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ZKSYNC_ERA_SEPOLIA_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 "${ZKSYNC_ERA_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Arbitrum One moonworm crawler service definition with ${ARBITRUM_ONE_MOONWORM_CRAWLER_SERVICE_FILE}"
chmod 644 "${SCRIPT_DIR}/${ARBITRUM_ONE_MOONWORM_CRAWLER_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${ARBITRUM_ONE_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ARBITRUM_ONE_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 "${ARBITRUM_ONE_MOONWORM_CRAWLER_SERVICE_FILE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Arbitrum Nova moonworm crawler service definition with ${ARBITRUM_NOVA_MOONWORM_CRAWLER_SERVICE_FILE}"
chmod 644 "${SCRIPT_DIR}/${ARBITRUM_NOVA_MOONWORM_CRAWLER_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${ARBITRUM_NOVA_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ARBITRUM_NOVA_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 "${ARBITRUM_NOVA_MOONWORM_CRAWLER_SERVICE_FILE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Arbitrum Sepolia moonworm crawler service definition with ${ARBITRUM_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
chmod 644 "${SCRIPT_DIR}/${ARBITRUM_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${ARBITRUM_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ARBITRUM_SEPOLIA_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 "${ARBITRUM_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Xai moonworm crawler service definition with ${XAI_MOONWORM_CRAWLER_SERVICE_FILE}"
chmod 644 "${SCRIPT_DIR}/${XAI_MOONWORM_CRAWLER_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${XAI_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${XAI_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 "${XAI_MOONWORM_CRAWLER_SERVICE_FILE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Xai sepolia moonworm crawler service definition with ${XAI_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
chmod 644 "${SCRIPT_DIR}/${XAI_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${XAI_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${XAI_SEPOLIA_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 "${XAI_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Avalanche moonworm crawler service definition with ${AVALANCHE_MOONWORM_CRAWLER_SERVICE_FILE}"
chmod 644 "${SCRIPT_DIR}/${AVALANCHE_MOONWORM_CRAWLER_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${AVALANCHE_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${AVALANCHE_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 "${AVALANCHE_MOONWORM_CRAWLER_SERVICE_FILE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Avalanche Fuji moonworm crawler service definition with ${AVALANCHE_FUJI_MOONWORM_CRAWLER_SERVICE_FILE}"
chmod 644 "${SCRIPT_DIR}/${AVALANCHE_FUJI_MOONWORM_CRAWLER_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${AVALANCHE_FUJI_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${AVALANCHE_FUJI_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 "${AVALANCHE_FUJI_MOONWORM_CRAWLER_SERVICE_FILE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Blast moonworm crawler service definition with ${BLAST_MOONWORM_CRAWLER_SERVICE_FILE}"
chmod 644 "${SCRIPT_DIR}/${BLAST_MOONWORM_CRAWLER_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${BLAST_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${BLAST_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 "${BLAST_MOONWORM_CRAWLER_SERVICE_FILE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Blast sepolia moonworm crawler service definition with ${BLAST_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
chmod 644 "${SCRIPT_DIR}/${BLAST_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${BLAST_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${BLAST_SEPOLIA_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 "${BLAST_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Proofofplay Apex moonworm crawler service definition with ${PROOFOFPLAY_APEX_MOONWORM_CRAWLER_SERVICE_FILE}"
chmod 644 "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_MOONWORM_CRAWLER_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${PROOFOFPLAY_APEX_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 "${PROOFOFPLAY_APEX_MOONWORM_CRAWLER_SERVICE_FILE}"

Wyświetl plik

@ -0,0 +1,158 @@
#!/usr/bin/env bash
# Deployment script - intended to run on Moonstream crawlers server
# Colors
C_RESET='\033[0m'
C_RED='\033[1;31m'
C_GREEN='\033[1;32m'
C_YELLOW='\033[1;33m'
# Logs
PREFIX_INFO="${C_GREEN}[INFO]${C_RESET} [$(date +%d-%m\ %T)]"
PREFIX_WARN="${C_YELLOW}[WARN]${C_RESET} [$(date +%d-%m\ %T)]"
PREFIX_CRIT="${C_RED}[CRIT]${C_RESET} [$(date +%d-%m\ %T)]"
# Main
AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION:-us-east-1}"
APP_DIR="${APP_DIR:-/home/ubuntu/moonstream}"
APP_CRAWLERS_DIR="${APP_DIR}/crawlers"
PYTHON_ENV_DIR="${PYTHON_ENV_DIR:-/home/ubuntu/moonstream-env}"
PYTHON="${PYTHON_ENV_DIR}/bin/python"
PIP="${PYTHON_ENV_DIR}/bin/pip"
SECRETS_DIR="${SECRETS_DIR:-/home/ubuntu/moonstream-secrets}"
PARAMETERS_ENV_PATH="${SECRETS_DIR}/app.env"
SCRIPT_DIR="$(realpath $(dirname $0))"
# Ethereum service files
ETHEREUM_STATE_SERVICE_FILE="ethereum-state.service"
ETHEREUM_STATE_TIMER_FILE="ethereum-state.timer"
ETHEREUM_STATE_CLEAN_SERVICE_FILE="ethereum-state-clean.service"
ETHEREUM_STATE_CLEAN_TIMER_FILE="ethereum-state-clean.timer"
ETHEREUM_METADATA_SERVICE_FILE="ethereum-metadata.service"
ETHEREUM_METADATA_TIMER_FILE="ethereum-metadata.timer"
# Polygon service files
POLYGON_STATE_SERVICE_FILE="polygon-state.service"
POLYGON_STATE_TIMER_FILE="polygon-state.timer"
POLYGON_STATE_CLEAN_SERVICE_FILE="polygon-state-clean.service"
POLYGON_STATE_CLEAN_TIMER_FILE="polygon-state-clean.timer"
POLYGON_METADATA_SERVICE_FILE="polygon-metadata.service"
POLYGON_METADATA_TIMER_FILE="polygon-metadata.timer"
# ZkSync Era
ZKSYNC_ERA_STATE_SERVICE_FILE="zksync-era-state.service"
ZKSYNC_ERA_STATE_TIMER_FILE="zksync-era-state.timer"
ZKSYNC_ERA_STATE_CLEAN_SERVICE_FILE="zksync-era-state-clean.service"
ZKSYNC_ERA_STATE_CLEAN_TIMER_FILE="zksync-era-state-clean.timer"
set -eu
echo
echo
echo -e "${PREFIX_INFO} Upgrading Python pip and setuptools"
"${PIP}" install --upgrade pip setuptools
echo
echo
echo -e "${PREFIX_INFO} Installing Python dependencies"
"${PIP}" install -e "${APP_CRAWLERS_DIR}/mooncrawl/"
echo
echo
echo -e "${PREFIX_INFO} Install checkenv"
HOME=/home/ubuntu /usr/local/go/bin/go install github.com/bugout-dev/checkenv@latest
echo
echo
echo -e "${PREFIX_INFO} Retrieving deployment parameters"
if [ ! -d "${SECRETS_DIR}" ]; then
mkdir -p "${SECRETS_DIR}"
echo -e "${PREFIX_WARN} Created new secrets directory"
fi
AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION}" CHECKENV_AWS_FETCH_LOOP_LIMIT=20 /home/ubuntu/go/bin/checkenv show aws_ssm+moonstream:true > "${PARAMETERS_ENV_PATH}"
chmod 0640 "${PARAMETERS_ENV_PATH}"
echo
echo
echo -e "${PREFIX_INFO} Add instance local IP to parameters"
echo "AWS_LOCAL_IPV4=$(ec2metadata --local-ipv4)" >> "${PARAMETERS_ENV_PATH}"
echo
echo
if [ ! -d "/home/ubuntu/.config/systemd/user/" ]; then
mkdir -p /home/ubuntu/.config/systemd/user/
echo -e "${PREFIX_WARN} Created user systemd directory"
fi
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Ethereum state service and timer with: ${ETHEREUM_STATE_SERVICE_FILE}, ${ETHEREUM_STATE_TIMER_FILE}"
chmod 644 "${SCRIPT_DIR}/${ETHEREUM_STATE_SERVICE_FILE}" "${SCRIPT_DIR}/${ETHEREUM_STATE_TIMER_FILE}"
cp "${SCRIPT_DIR}/${ETHEREUM_STATE_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ETHEREUM_STATE_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${ETHEREUM_STATE_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${ETHEREUM_STATE_TIMER_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ETHEREUM_STATE_TIMER_FILE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Ethereum state clean service and timer with: ${ETHEREUM_STATE_CLEAN_SERVICE_FILE}, ${ETHEREUM_STATE_CLEAN_TIMER_FILE}"
chmod 644 "${SCRIPT_DIR}/${ETHEREUM_STATE_CLEAN_SERVICE_FILE}" "${SCRIPT_DIR}/${ETHEREUM_STATE_CLEAN_TIMER_FILE}"
cp "${SCRIPT_DIR}/${ETHEREUM_STATE_CLEAN_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ETHEREUM_STATE_CLEAN_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${ETHEREUM_STATE_CLEAN_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${ETHEREUM_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 "${ETHEREUM_STATE_CLEAN_TIMER_FILE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing Ethereum metadata service and timer with: ${ETHEREUM_METADATA_SERVICE_FILE}, ${ETHEREUM_METADATA_TIMER_FILE}"
chmod 644 "${SCRIPT_DIR}/${ETHEREUM_METADATA_SERVICE_FILE}" "${SCRIPT_DIR}/${ETHEREUM_METADATA_TIMER_FILE}"
cp "${SCRIPT_DIR}/${ETHEREUM_METADATA_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ETHEREUM_METADATA_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${ETHEREUM_METADATA_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${ETHEREUM_METADATA_TIMER_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ETHEREUM_METADATA_TIMER_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}" "/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}" "/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}" "/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 ZkSync Era state service and timer with: ${ZKSYNC_ERA_STATE_SERVICE_FILE}, ${ZKSYNC_ERA_STATE_TIMER_FILE}"
chmod 644 "${SCRIPT_DIR}/${ZKSYNC_ERA_STATE_SERVICE_FILE}" "${SCRIPT_DIR}/${ZKSYNC_ERA_STATE_TIMER_FILE}"
cp "${SCRIPT_DIR}/${ZKSYNC_ERA_STATE_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ZKSYNC_ERA_STATE_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${ZKSYNC_ERA_STATE_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${ZKSYNC_ERA_STATE_TIMER_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ZKSYNC_ERA_STATE_TIMER_FILE}"
echo
echo
echo -e "${PREFIX_INFO} Replacing existing ZkSync Era state clean service and timer with: ${ZKSYNC_ERA_STATE_CLEAN_SERVICE_FILE}, ${ZKSYNC_ERA_STATE_CLEAN_TIMER_FILE}"
chmod 644 "${SCRIPT_DIR}/${ZKSYNC_ERA_STATE_CLEAN_SERVICE_FILE}" "${SCRIPT_DIR}/${ZKSYNC_ERA_STATE_CLEAN_TIMER_FILE}"
cp "${SCRIPT_DIR}/${ZKSYNC_ERA_STATE_CLEAN_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ZKSYNC_ERA_STATE_CLEAN_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${ZKSYNC_ERA_STATE_CLEAN_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${ZKSYNC_ERA_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 "${ZKSYNC_ERA_STATE_CLEAN_TIMER_FILE}"

Wyświetl plik

@ -0,0 +1,17 @@
[Unit]
Description=Ethereum historical crawler events
After=network.target
StartLimitIntervalSec=300
StartLimitBurst=3
[Service]
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 historical-crawl --blockchain-type ethereum --find-deployed-blocks --end 0 --tasks-journal --only-events
CPUWeight=70
SyslogIdentifier=ethereum-historical-crawl-events
[Install]
WantedBy=multi-user.target

Wyświetl plik

@ -0,0 +1,9 @@
[Unit]
Description=Runs events historical crawler on ethereum
[Timer]
OnBootSec=60s
OnUnitActiveSec=10m
[Install]
WantedBy=timers.target

Wyświetl plik

@ -0,0 +1,17 @@
[Unit]
Description=Ethereum historical crawler transactions
After=network.target
StartLimitIntervalSec=300
StartLimitBurst=3
[Service]
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 historical-crawl --blockchain-type ethereum --find-deployed-blocks --end 0 --tasks-journal --only-functions
CPUWeight=70
SyslogIdentifier=ethereum-historical-crawl-transactions
[Install]
WantedBy=multi-user.target

Wyświetl plik

@ -0,0 +1,9 @@
[Unit]
Description=Runs transactions historical crawler on ethereum
[Timer]
OnBootSec=60s
OnUnitActiveSec=10m
[Install]
WantedBy=timers.target

Wyświetl plik

@ -0,0 +1,11 @@
[Unit]
Description=Execute metadata crawler
After=network.target
[Service]
Type=oneshot
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 ethereum
CPUWeight=60
SyslogIdentifier=ethereum-metadata

Wyświetl plik

@ -0,0 +1,9 @@
[Unit]
Description=Execute Ethereum metadata crawler each 10m
[Timer]
OnBootSec=20s
OnUnitActiveSec=60m
[Install]
WantedBy=timers.target

Wyświetl plik

@ -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 blocks missing --blockchain ethereum -n
CPUWeight=50
SyslogIdentifier=ethereum-missing

Wyświetl plik

@ -2,7 +2,7 @@
Description=Fill missing blocks at Ethereum database
[Timer]
OnBootSec=10s
OnBootSec=40s
OnUnitActiveSec=15m
[Install]

Wyświetl plik

@ -0,0 +1,17 @@
[Unit]
Description=Ethereum moonworm crawler
After=network.target
StartLimitIntervalSec=300
StartLimitBurst=3
[Service]
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 crawl -b ethereum
CPUWeight=70
SyslogIdentifier=ethereum-moonworm-crawler
[Install]
WantedBy=multi-user.target

Wyświetl plik

@ -0,0 +1,11 @@
[Unit]
Description=Runs custom crawler for orange dao tokenonomics
After=network.target
[Service]
Type=oneshot
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.reports_crawler.cli orangedao --moonstream-token "${MOONSTREAM_ORANGE_DAO_QUERIES_DATA_ACCESS_TOKEN}" run_tokenomics_orange_dao
CPUWeight=60
SyslogIdentifier=ethereum-orange-dao-reports-tokenonomics

Wyświetl plik

@ -0,0 +1,9 @@
[Unit]
Description=Runs custom crawler for CU tokenonomics
[Timer]
OnBootSec=60s
OnUnitActiveSec=10m
[Install]
WantedBy=timers.target

Wyświetl plik

@ -1,15 +1,11 @@
[Unit]
Description=Update XDai statistics dashboards
Description=Execute state clean labels crawler
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.state_crawler.cli clean-state-labels --blockchain ethereum -N 10000
CPUWeight=60
SyslogIdentifier=xdai-statistics
SyslogIdentifier=ethereum-state-clean

Wyświetl plik

@ -0,0 +1,9 @@
[Unit]
Description=Execute Ethereum state clean labels crawler each 25m
[Timer]
OnBootSec=50s
OnUnitActiveSec=25m
[Install]
WantedBy=timers.target

Wyświetl plik

@ -0,0 +1,11 @@
[Unit]
Description=Execute state crawler
After=network.target
[Service]
Type=oneshot
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 crawl-jobs --moonstream-token "${MOONSTREAM_PUBLIC_QUERIES_DATA_ACCESS_TOKEN}" --blockchain ethereum --jobs-file /home/ubuntu/moonstream/crawlers/mooncrawl/mooncrawl/state_crawler/jobs/ethereum-jobs.json
CPUWeight=60
SyslogIdentifier=ethereum-state

Wyświetl plik

@ -0,0 +1,9 @@
[Unit]
Description=Execute Ethereum state crawler each 10m
[Timer]
OnBootSec=15s
OnUnitActiveSec=10m
[Install]
WantedBy=timers.target

Wyświetl plik

@ -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 blocks synchronize --blockchain ethereum -c 6 -j 2
CPUWeight=90
SyslogIdentifier=ethereum-synchronize

Wyświetl plik

@ -1,9 +0,0 @@
[Unit]
Description=Load trending Ethereum addresses to the database every 5 minutes
[Timer]
OnBootSec=10s
OnUnitActiveSec=5m
[Install]
WantedBy=timers.target

Wyświetl plik

@ -1,21 +0,0 @@
[Unit]
Description=Ethereum txpool crawler
After=network.target
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}"
CPUWeight=30
SyslogIdentifier=ethereum-txpool
[Install]
WantedBy=multi-user.target

Wyświetl plik

@ -0,0 +1,11 @@
[Unit]
Description=Runs leaderboards generator worker
After=network.target
[Service]
Type=oneshot
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.leaderboards_generator.cli leaderboards-generate --query-api-access-token "${MOONSTREAM_PUBLIC_QUERIES_DATA_ACCESS_TOKEN}"
CPUWeight=60
SyslogIdentifier=leaderboards-worker

Wyświetl plik

@ -0,0 +1,9 @@
[Unit]
Description=Runs leaderboard update script every 10 minutes
[Timer]
OnBootSec=60s
OnUnitActiveSec=10m
[Install]
WantedBy=timers.target

Wyświetl plik

@ -0,0 +1,7 @@
{
"notification_pagerduty": true,
"notification_telegram": true,
"notification_sendgrid": true,
"notification_humbug": true,
"silent": []
}

Wyświetl plik

@ -0,0 +1,17 @@
[Unit]
Description=Monitor crawlers systemd state
StartLimitIntervalSec=300
StartLimitBurst=3
After=network.target
[Service]
Restart=on-failure
RestartSec=15s
WorkingDirectory=/home/ubuntu/
EnvironmentFile=/home/ubuntu/moonstream-secrets/monitoring.env
ExecStart=/home/ubuntu/monitoring -plugin systemd -host "${AWS_LOCAL_IPV4}" -port 7171 -healthcheck -server -threshold 3 -config /home/ubuntu/.monitoring/monitoring-crawlers-config.json -service ethereum-moonworm-crawler.service -service amoy-moonworm-crawler.service -service polygon-moonworm-crawler.service -service zksync-era-moonworm-crawler.service -service zksync-era-sepolia-moonworm-crawler.service -service arbitrum-nova-moonworm-crawler.service -service arbitrum-sepolia-moonworm-crawler.service -service xai-moonworm-crawler.service -service xai-sepolia-moonworm-crawler.service -service avalanche-moonworm-crawler.service -service avalanche-fuji-moonworm-crawler.service -service blast-moonworm-crawler.service -service blast-sepolia-moonworm-crawler.service -service proofofplay-apex-moonworm-crawler.service -service arbitrum-one-moonworm-crawler.service
CPUWeight=90
SyslogIdentifier=monitoring-crawlers
[Install]
WantedBy=multi-user.target

Wyświetl plik

@ -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

Wyświetl plik

@ -1,18 +0,0 @@
Description=Moonworm CryptoUnicorns watch
After=network.target
StartLimitIntervalSec=300
StartLimitBurst=3
[Service]
User=ubuntu
Group=www-data
WorkingDirectory=/home/ubuntu
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
Restart=on-failure
RestartSec=15s
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

Wyświetl plik

@ -1,102 +0,0 @@
"""
Collect secrets from AWS SSM Parameter Store and output as environment variable exports.
"""
import argparse
from dataclasses import dataclass
import sys
from typing import Any, Dict, Iterable, List, Optional
import boto3
@dataclass
class EnvironmentVariable:
name: str
value: str
def get_parameters(path: str) -> List[Dict[str, Any]]:
"""
Retrieve parameters from AWS SSM Parameter Store. Decrypts any encrypted parameters.
Relies on the appropriate environment variables to authenticate against AWS:
https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html
"""
ssm = boto3.client("ssm")
next_token: Optional[bool] = True
parameters: List[Dict[str, Any]] = []
while next_token is not None:
kwargs = {"Path": path, "Recursive": False, "WithDecryption": True}
if next_token is not True:
kwargs["NextToken"] = next_token
response = ssm.get_parameters_by_path(**kwargs)
new_parameters = response.get("Parameters", [])
parameters.extend(new_parameters)
next_token = response.get("NextToken")
return parameters
def parameter_to_env(parameter_object: Dict[str, Any]) -> EnvironmentVariable:
"""
Transforms parameters returned by the AWS SSM API into EnvironmentVariables.
"""
parameter_path = parameter_object.get("Name")
if parameter_path is None:
raise ValueError('Did not find "Name" in parameter object')
name = parameter_path.split("/")[-1].upper()
value = parameter_object.get("Value")
if value is None:
raise ValueError('Did not find "Value" in parameter object')
return EnvironmentVariable(name, value)
def env_string(env_vars: Iterable[EnvironmentVariable], with_export: bool) -> str:
"""
Produces a string which, when executed in a shell, exports the desired environment variables as
specified by env_vars.
"""
prefix = "export " if with_export else ""
return "\n".join([f'{prefix}{var.name}="{var.value}"' for var in env_vars])
def extract_handler(args: argparse.Namespace) -> None:
"""
Save environment variables to file.
"""
result = env_string(map(parameter_to_env, get_parameters(args.path)), args.export)
with args.outfile as ofp:
print(result, file=ofp)
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="Materialize environment variables from AWS SSM Parameter Store"
)
parser.set_defaults(func=lambda _: parser.print_help())
subcommands = parser.add_subparsers(description="Parameters commands")
parser_extract = subcommands.add_parser(
"extract", description="Parameters extract commands"
)
parser_extract.set_defaults(func=lambda _: parser_extract.print_help())
parser_extract.add_argument(
"-o", "--outfile", type=argparse.FileType("w"), default=sys.stdout
)
parser_extract.add_argument(
"--export",
action="store_true",
help="Set to output environment strings with export statements",
)
parser_extract.add_argument(
"-p",
"--path",
default=None,
help="SSM path from which to pull environment variables (pull is NOT recursive)",
)
parser_extract.set_defaults(func=extract_handler)
args = parser.parse_args()
args.func(args)

Wyświetl plik

@ -0,0 +1,11 @@
[Unit]
Description=Generate data for nft dashboard for cu community
After=network.target
[Service]
Type=oneshot
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.reports_crawler.cli cu-reports --moonstream-token "${MOONSTREAM_PUBLIC_QUERIES_DATA_ACCESS_TOKEN}" generate-nft-dashboard
CPUWeight=60
SyslogIdentifier=polygon-cu-nft-dashboard

Wyświetl plik

@ -0,0 +1,9 @@
[Unit]
Description=Generate data for nft dashboard for cu community
[Timer]
OnBootSec=60s
OnUnitActiveSec=10m
[Install]
WantedBy=timers.target

Some files were not shown because too many files have changed in this diff Show More