diff --git a/.github/workflows/deploy-alt-indexer.yaml b/.github/workflows/deploy-alt-indexer.yaml new file mode 100644 index 00000000..fdab214f --- /dev/null +++ b/.github/workflows/deploy-alt-indexer.yaml @@ -0,0 +1,21 @@ +name: deploy alt indexer + +on: + push: + +jobs: + build: + strategy: + fail-fast: true + + name: Build Indexer Image + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + + - name: build Docker + run: | + cd packages/indexer + docker build . diff --git a/packages/indexer/Dockerfile b/packages/indexer/Dockerfile new file mode 100644 index 00000000..faf31637 --- /dev/null +++ b/packages/indexer/Dockerfile @@ -0,0 +1,23 @@ +FROM node:18 + +## install pnpm +RUN npm install -g pnpm + +WORKDIR /app + +## clone mud repo and lock hash +RUN git clone https://github.com/latticexyz/mud.git; \ + cd mud; \ + git checkout 57ee7f9cb7b5803a6f6b6ad69a7d50fbef4d8dc1; \ + pnpm install; \ + pnpm build; + +WORKDIR /app/mud/packages/store-indexer + +ENV SQLITE_FILENAME=altlayer.db +ENV CHAIN_ID=1129710 +ENV START_BLOCK=4827367 +ENV RPC_HTTP_URL=https://flashlayer.alt.technology/autochessia7806fd60 +ENV RPC_WS_URL=wss://flashlayer.alt.technology/autochessia7806fd60 + +ENTRYPOINT [ "pnpm", "start" ] \ No newline at end of file diff --git a/packages/indexer/package.json b/packages/indexer/package.json new file mode 100644 index 00000000..a4236312 --- /dev/null +++ b/packages/indexer/package.json @@ -0,0 +1,12 @@ +{ + "name": "indexer", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "dependencies": {} +} \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c5899d85..a8358acf 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -195,6 +195,8 @@ importers: specifier: ^8.1.1 version: 8.1.1(typescript@4.9.5) + packages/indexer: {} + packages: /@aashutoshrathi/word-wrap@1.2.6: @@ -1061,7 +1063,7 @@ packages: abitype: 0.9.3(typescript@4.9.5)(zod@3.21.4) debug: 4.3.4 rxjs: 7.5.5 - viem: 1.6.0(typescript@4.9.5)(zod@3.21.4) + viem: 1.7.0(typescript@4.9.5)(zod@3.21.4) transitivePeerDependencies: - bufferutil - supports-color @@ -1165,7 +1167,7 @@ packages: execa: 7.2.0 prettier: 2.8.8 prettier-plugin-solidity: 1.1.3(prettier@2.8.8) - viem: 1.0.6(typescript@4.9.5)(zod@3.21.4) + viem: 1.7.0(typescript@4.9.5)(zod@3.21.4) transitivePeerDependencies: - bufferutil - typescript @@ -1185,7 +1187,7 @@ packages: p-retry: 5.1.2 prettier: 2.8.8 prettier-plugin-solidity: 1.1.3(prettier@2.8.8) - viem: 1.6.0(typescript@4.9.5)(zod@3.21.4) + viem: 1.7.0(typescript@4.9.5)(zod@3.21.4) transitivePeerDependencies: - bufferutil - supports-color @@ -1206,7 +1208,7 @@ packages: p-retry: 5.1.2 prettier: 2.8.8 prettier-plugin-solidity: 1.1.3(prettier@2.8.8) - viem: 1.6.0(typescript@5.1.6)(zod@3.21.4) + viem: 1.7.0(typescript@5.1.6)(zod@3.21.4) transitivePeerDependencies: - bufferutil - supports-color @@ -1322,7 +1324,7 @@ packages: '@latticexyz/common': 2.0.0-next.4(typescript@4.9.5)(zod@3.21.4) '@latticexyz/schema-type': 2.0.0-next.4(typescript@4.9.5)(zod@3.21.4) abitype: 0.9.3(typescript@4.9.5)(zod@3.21.4) - viem: 1.6.0(typescript@4.9.5)(zod@3.21.4) + viem: 1.7.0(typescript@4.9.5)(zod@3.21.4) transitivePeerDependencies: - bufferutil - supports-color @@ -1337,7 +1339,7 @@ packages: '@latticexyz/common': 2.0.0-next.4(typescript@5.1.6)(zod@3.21.4) '@latticexyz/schema-type': 2.0.0-next.4(typescript@5.1.6)(zod@3.21.4) abitype: 0.9.3(typescript@5.1.6)(zod@3.21.4) - viem: 1.6.0(typescript@5.1.6)(zod@3.21.4) + viem: 1.7.0(typescript@5.1.6)(zod@3.21.4) transitivePeerDependencies: - bufferutil - supports-color @@ -1471,7 +1473,7 @@ packages: rxjs: 7.5.5 sql.js: 1.8.0 superjson: 1.13.1 - viem: 1.6.0(typescript@4.9.5)(zod@3.21.4) + viem: 1.7.0(typescript@4.9.5)(zod@3.21.4) zod: 3.21.4 transitivePeerDependencies: - '@aws-sdk/client-rds-data' @@ -1642,7 +1644,6 @@ packages: resolution: {integrity: sha512-091oBExgENk/kGj3AZmtBDMpxQPDtxQABR2B9lb1JbVTs6ytdzZNwvhxQ4MWasRNEzlbEH8jCWFCwhF/Obj5AA==} dependencies: '@noble/hashes': 1.3.1 - dev: false /@noble/hashes@1.3.0: resolution: {integrity: sha512-ilHEACi9DwqJB0pw7kv+Apvh50jiiSyR/cQ3y4W7lOR5mhvn/50FLUfsnfJz0BDZtl/RR16kXvptiv6q1msYZg==} @@ -1650,7 +1651,6 @@ packages: /@noble/hashes@1.3.1: resolution: {integrity: sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA==} engines: {node: '>= 16'} - dev: false /@nodelib/fs.scandir@2.1.5: resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} @@ -1810,13 +1810,13 @@ packages: resolution: {integrity: sha512-bcKpo1oj54hGholplGLpqPHRbIsnbixFtc06nwuNM5/dwSXOq/AAYoIBRsBmnZJSdfeNW5rnff7NTAz3ZCqR9Q==} dependencies: '@noble/curves': 1.0.0 - '@noble/hashes': 1.3.0 + '@noble/hashes': 1.3.1 '@scure/base': 1.1.1 /@scure/bip39@1.2.0: resolution: {integrity: sha512-SX/uKq52cuxm4YFXWFaVByaSHJh2w3BnokVSeUJVCv6K7WulT9u2BuNRBhuFl8vAuYnzx9bEu9WgpcNYTrYieg==} dependencies: - '@noble/hashes': 1.3.0 + '@noble/hashes': 1.3.1 '@scure/base': 1.1.1 /@solidity-parser/parser@0.14.5: @@ -1931,7 +1931,6 @@ packages: resolution: {integrity: sha512-lwhs8hktwxSjf9UaZ9tG5M03PGogvFaH8gUgLNbN9HKIg0dvv6q+gkSuJ8HN4/VbyxkuLzCjlN7GquQ0gUJfIg==} dependencies: '@types/node': 18.15.11 - dev: false /@typescript-eslint/eslint-plugin@5.46.1(@typescript-eslint/parser@5.46.1)(eslint@8.29.0)(typescript@4.9.5): resolution: {integrity: sha512-YpzNv3aayRBwjs4J3oz65eVLXc9xx0PDbIRisHj+dYhvBn02MjYOD96P8YGiWEIFBrojaUjxvkaUpakD82phsA==} @@ -2111,6 +2110,27 @@ packages: typescript: 5.1.6 dev: false + /@wagmi/chains@1.7.0(typescript@4.9.5): + resolution: {integrity: sha512-TKVeHv0GqP5sV1yQ8BDGYToAFezPnCexbbBpeH14x7ywi5a1dDStPffpt9x+ytE6LJWkZ6pAMs/HNWXBQ5Nqmw==} + peerDependencies: + typescript: '>=5.0.4' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + typescript: 4.9.5 + + /@wagmi/chains@1.7.0(typescript@5.1.6): + resolution: {integrity: sha512-TKVeHv0GqP5sV1yQ8BDGYToAFezPnCexbbBpeH14x7ywi5a1dDStPffpt9x+ytE6LJWkZ6pAMs/HNWXBQ5Nqmw==} + peerDependencies: + typescript: '>=5.0.4' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + typescript: 5.1.6 + dev: false + /abitype@0.8.7(typescript@4.9.5)(zod@3.21.4): resolution: {integrity: sha512-wQ7hV8Yg/yKmGyFpqrNZufCxbszDe5es4AZGYPBitocfSqXtjrTG9JMWFcc4N30ukl2ve48aBTwt7NJxVQdU3w==} peerDependencies: @@ -2137,7 +2157,6 @@ packages: dependencies: typescript: 4.9.5 zod: 3.21.4 - dev: false /abitype@0.9.3(typescript@5.1.6)(zod@3.21.4): resolution: {integrity: sha512-dz4qCQLurx97FQhnb/EIYTk/ldQ+oafEDUqC0VVIeQS1Q48/YWt/9YNfMmp9SLFqN41ktxny3c8aYxHjmFIB/w==} @@ -6367,6 +6386,55 @@ packages: - zod dev: false + /viem@1.7.0(typescript@4.9.5)(zod@3.21.4): + resolution: {integrity: sha512-S4SclYe0Oca6TuPh2YPI3BzfC7a4UvN7TRDCWwpoVNnu9+4z2hqCZhW+6aF1yufgSwdezNsF14vztE/P4eMdBw==} + peerDependencies: + typescript: '>=5.0.4' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@adraffy/ens-normalize': 1.9.0 + '@noble/curves': 1.1.0 + '@noble/hashes': 1.3.0 + '@scure/bip32': 1.3.0 + '@scure/bip39': 1.2.0 + '@types/ws': 8.5.5 + '@wagmi/chains': 1.7.0(typescript@4.9.5) + abitype: 0.9.3(typescript@4.9.5)(zod@3.21.4) + isomorphic-ws: 5.0.0(ws@8.12.0) + typescript: 4.9.5 + ws: 8.12.0 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + - zod + + /viem@1.7.0(typescript@5.1.6)(zod@3.21.4): + resolution: {integrity: sha512-S4SclYe0Oca6TuPh2YPI3BzfC7a4UvN7TRDCWwpoVNnu9+4z2hqCZhW+6aF1yufgSwdezNsF14vztE/P4eMdBw==} + peerDependencies: + typescript: '>=5.0.4' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@adraffy/ens-normalize': 1.9.0 + '@noble/curves': 1.1.0 + '@noble/hashes': 1.3.0 + '@scure/bip32': 1.3.0 + '@scure/bip39': 1.2.0 + '@types/ws': 8.5.5 + '@wagmi/chains': 1.7.0(typescript@5.1.6) + abitype: 0.9.3(typescript@5.1.6)(zod@3.21.4) + isomorphic-ws: 5.0.0(ws@8.12.0) + typescript: 5.1.6 + ws: 8.12.0 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + - zod + dev: false + /vite@4.2.1: resolution: {integrity: sha512-7MKhqdy0ISo4wnvwtqZkjke6XN4taqQ2TBaTccLIpOKv7Vp2h4Y+NpmWCnGDeSvvn45KxvWgGyb0MkHvY1vgbg==} engines: {node: ^14.18.0 || >=16.0.0}