From 09781719bae63a66d945e17974c57cd313fc4bf4 Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Wed, 18 Jan 2023 11:53:29 +0100 Subject: [PATCH 01/22] Make the spl-token compatible with the multi-chain framework version --- packages/spl-token/run.ts | 5 ++- packages/spl-token/src/domain/main.ts | 52 ++++++++++++++++--------- packages/spl-token/src/domain/worker.ts | 51 ++++++++---------------- packages/spl-token/src/parsers/event.ts | 6 ++- packages/spl-token/src/parsers/mint.ts | 4 +- 5 files changed, 59 insertions(+), 59 deletions(-) diff --git a/packages/spl-token/run.ts b/packages/spl-token/run.ts index 52826ce..003f81f 100644 --- a/packages/spl-token/run.ts +++ b/packages/spl-token/run.ts @@ -1,6 +1,6 @@ import { fileURLToPath } from 'url' import path from 'path' -import { config } from '@aleph-indexer/core' +import { config, Blockchain } from '@aleph-indexer/core' import SDK, { TransportType } from '@aleph-indexer/framework' const __filename = fileURLToPath(import.meta.url) @@ -11,7 +11,7 @@ async function main() { const mainDomainPath = path.join(__dirname, './src/domain/main.js') const apiSchemaPath = path.join(__dirname, './src/api/index.js') - const instances = Number(config.INDEXER_INSTANCES || 2) + const instances = Number(config.INDEXER_INSTANCES || 1) const apiPort = Number(config.INDEXER_API_PORT || 8080) const tcpUrls = config.INDEXER_TCP_URLS || undefined const natsUrl = config.INDEXER_NATS_URL || undefined @@ -46,6 +46,7 @@ async function main() { domainPath: workerDomainPath, }, }, + supportedBlockchains: [Blockchain.Solana], }) } diff --git a/packages/spl-token/src/domain/main.ts b/packages/spl-token/src/domain/main.ts index bb614f0..62a46b5 100644 --- a/packages/spl-token/src/domain/main.ts +++ b/packages/spl-token/src/domain/main.ts @@ -1,3 +1,4 @@ +import { Blockchain } from '@aleph-indexer/core' import { AccountIndexerRequestArgs, IndexerMainDomain, @@ -33,6 +34,7 @@ export default class MainDomain async discoverAccounts(): Promise { const init = { account: '', + blockchainId: Blockchain.Solana, index: { transactions: { chunkDelay: 0, @@ -62,6 +64,7 @@ export default class MainDomain const options = { account, + blockchainId: Blockchain.Solana, meta: { type: SPLTokenType.Account, mint: mint }, index: { transactions: { @@ -71,8 +74,10 @@ export default class MainDomain content: false, }, } - await this.context.apiClient.indexAccount(options) - this.accounts.add(account) + await this.context.apiClient + .useBlockchain(Blockchain.Solana) + .indexAccount(options) + this.accounts[Blockchain.Solana].add(account) }), ) await Promise.all( @@ -80,6 +85,7 @@ export default class MainDomain await this.addToken(mint) const options = { account: mint, + blockchainId: Blockchain.Solana, meta: { type: SPLTokenType.Mint, mint }, index: { transactions: { @@ -89,8 +95,10 @@ export default class MainDomain content: false, }, } - await this.context.apiClient.indexAccount(options) - this.accounts.add(mint) + await this.context.apiClient + .useBlockchain(Blockchain.Solana) + .indexAccount(options) + this.accounts[Blockchain.Solana].add(mint) }), ) } @@ -103,33 +111,39 @@ export default class MainDomain account: string, filters: TokenHoldersFilters, ): Promise { - return (await this.context.apiClient.invokeDomainMethod({ - account, - args: [filters], - method: 'getTokenHolders', - })) as SPLAccountBalance[] + return (await this.context.apiClient + .useBlockchain(Blockchain.Solana) + .invokeDomainMethod({ + account, + args: [filters], + method: 'getTokenHolders', + })) as SPLAccountBalance[] } async getMintEvents( account: string, filters: MintEventsFilters, ): Promise { - return (await this.context.apiClient.invokeDomainMethod({ - account, - args: [filters], - method: 'getMintEvents', - })) as SPLTokenEvent[] + return (await this.context.apiClient + .useBlockchain(Blockchain.Solana) + .invokeDomainMethod({ + account, + args: [filters], + method: 'getMintEvents', + })) as SPLTokenEvent[] } async getAccountHoldings( account: string, filters: AccountHoldingsFilters, ): Promise { - return (await this.context.apiClient.invokeDomainMethod({ - account, - args: [filters], - method: 'getAccountHoldings', - })) as SPLAccountHoldings[] + return (await this.context.apiClient + .useBlockchain(Blockchain.Solana) + .invokeDomainMethod({ + account, + args: [filters], + method: 'getAccountHoldings', + })) as SPLAccountHoldings[] } protected async addToken(mint: string): Promise { diff --git a/packages/spl-token/src/domain/worker.ts b/packages/spl-token/src/domain/worker.ts index d45db50..bdb9961 100644 --- a/packages/spl-token/src/domain/worker.ts +++ b/packages/spl-token/src/domain/worker.ts @@ -1,14 +1,13 @@ +import { PendingWork, PendingWorkPool, Blockchain } from '@aleph-indexer/core' import { AccountIndexerConfigWithMeta, - AccountStatsFilters, createStatsStateDAL, createStatsTimeSeriesDAL, IndexerDomainContext, IndexerWorkerDomain, - IndexerWorkerDomainWithStats, - InstructionContextV1, + SolanaIndexerWorkerDomainI, + SolanaInstructionContextV1, } from '@aleph-indexer/framework' -import { PendingWork, PendingWorkPool } from '@aleph-indexer/core' import { createEventParser, EventParser as eventParser, @@ -43,10 +42,10 @@ import { createAccountMintDAL } from '../dal/accountMints.js' export default class WorkerDomain extends IndexerWorkerDomain - implements IndexerWorkerDomainWithStats + implements SolanaIndexerWorkerDomainI { - protected mints: Record = {} - protected accountMints: PendingWorkPool + public mints: Record = {} + public accountMints: PendingWorkPool constructor( protected context: IndexerDomainContext, @@ -74,10 +73,6 @@ export default class WorkerDomain }) } - async init(): Promise { - return - } - async onNewAccount( config: AccountIndexerConfigWithMeta, ): Promise { @@ -103,22 +98,6 @@ export default class WorkerDomain console.log('Account indexing', this.context.instanceName, account) } - async getTimeSeriesStats( - account: string, - type: string, - filters: AccountStatsFilters, - ): Promise { - return {} - } - - async getStats(account: string): Promise { - return {} - } - - async updateStats(account: string, now: number): Promise { - console.log('', account) - } - async getMintEvents( account: string, filters: MintEventsFilters, @@ -146,14 +125,14 @@ export default class WorkerDomain return await mint.getTokenHoldings(filters) } - protected async filterInstructions( - ixsContext: InstructionContextV1[], - ): Promise { + async solanaFilterInstructions( + ixsContext: SolanaInstructionContextV1[], + ): Promise { return ixsContext.filter(({ ix }) => isSPLTokenInstruction(ix)) } - protected async indexInstructions( - ixsContext: InstructionContextV1[], + async solanaIndexInstructions( + ixsContext: SolanaInstructionContextV1[], ): Promise { const parsedEvents: SPLTokenEvent[] = [] const works: PendingWork[] = [] @@ -193,7 +172,9 @@ export default class WorkerDomain content: true, }, } - await this.context.apiClient.deleteAccount(options) + await this.context.apiClient + .useBlockchain(Blockchain.Solana) + .deleteAccount(options) } } parsedEvents.push(parsedIx) @@ -246,7 +227,9 @@ export default class WorkerDomain content: false, }, } - await this.context.apiClient.indexAccount(options) + await this.context.apiClient + .useBlockchain(Blockchain.Solana) + .indexAccount(options) } } diff --git a/packages/spl-token/src/parsers/event.ts b/packages/spl-token/src/parsers/event.ts index 20508ad..1bb59bb 100644 --- a/packages/spl-token/src/parsers/event.ts +++ b/packages/spl-token/src/parsers/event.ts @@ -1,5 +1,5 @@ import { - InstructionContextV1, + SolanaInstructionContextV1, Utils, solanaPrivateRPCRoundRobin, } from '@aleph-indexer/core' @@ -22,7 +22,9 @@ export class EventParser { protected eventDAL: EventStorage, ) {} - async parse(ixCtx: InstructionContextV1): Promise { + async parse( + ixCtx: SolanaInstructionContextV1, + ): Promise { const { ix, parentIx, txContext } = ixCtx const { tx: parentTx } = txContext diff --git a/packages/spl-token/src/parsers/mint.ts b/packages/spl-token/src/parsers/mint.ts index db6de63..293887e 100644 --- a/packages/spl-token/src/parsers/mint.ts +++ b/packages/spl-token/src/parsers/mint.ts @@ -1,4 +1,4 @@ -import { InstructionContextV1, Utils } from '@aleph-indexer/core' +import { SolanaInstructionContextV1, Utils } from '@aleph-indexer/core' import { SLPTokenRawEvent, SPLTokenEvent, @@ -11,7 +11,7 @@ const { getTokenBalance } = Utils export class MintParser { parse( - ixCtx: InstructionContextV1, + ixCtx: SolanaInstructionContextV1, mintAddress: string, ): SPLTokenEvent | undefined { const { ix, parentIx, txContext } = ixCtx From be06d3b979ccd16ca22e986164b7c1ed2169f40c Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Fri, 20 Jan 2023 12:31:22 +0100 Subject: [PATCH 02/22] Fixed exported type. --- packages/spl-token/src/utils/utils.ts | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/packages/spl-token/src/utils/utils.ts b/packages/spl-token/src/utils/utils.ts index ea17152..aaf48bb 100644 --- a/packages/spl-token/src/utils/utils.ts +++ b/packages/spl-token/src/utils/utils.ts @@ -2,7 +2,7 @@ import { AlephParsedInnerInstruction, AlephParsedInstruction, AlephParsedParsedInstruction, - RawInstruction, + SolanaRawInstruction, } from '@aleph-indexer/core' import { TOKEN_PROGRAM_ID } from '../constants.js' import { @@ -13,26 +13,38 @@ import { } from '../types.js' export function isSPLTokenInstruction( - ix: RawInstruction | AlephParsedInstruction | AlephParsedInnerInstruction, + ix: + | SolanaRawInstruction + | AlephParsedInstruction + | AlephParsedInnerInstruction, ): ix is SLPTokenRawEvent { return ix.programId === TOKEN_PROGRAM_ID } export function isParsedIx( - ix: RawInstruction | AlephParsedInstruction | AlephParsedInnerInstruction, + ix: + | SolanaRawInstruction + | AlephParsedInstruction + | AlephParsedInnerInstruction, ): ix is AlephParsedParsedInstruction { return 'parsed' in ix } export function isSPLTokenParsedInstruction( - ix: RawInstruction | AlephParsedInstruction | AlephParsedInnerInstruction, + ix: + | SolanaRawInstruction + | AlephParsedInstruction + | AlephParsedInnerInstruction, ): ix is SLPTokenRawEvent { if (!isParsedIx(ix) || !isSPLTokenInstruction(ix)) return false return true } export function isSPLTokenMintInstruction( - ix: RawInstruction | AlephParsedInstruction | AlephParsedInnerInstruction, + ix: + | SolanaRawInstruction + | AlephParsedInstruction + | AlephParsedInnerInstruction, mint: string, ): ix is SLPTokenRawEvent { if (!isSPLTokenParsedInstruction(ix)) return false @@ -40,7 +52,10 @@ export function isSPLTokenMintInstruction( } export function isSPLTokenAccountInstruction( - ix: RawInstruction | AlephParsedInstruction | AlephParsedInnerInstruction, + ix: + | SolanaRawInstruction + | AlephParsedInstruction + | AlephParsedInnerInstruction, account: string, ): ix is SLPTokenRawEvent { if (!isSPLTokenParsedInstruction(ix)) return false From bab3bb6faf5172783009caa826d81250e841e305 Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Mon, 23 Jan 2023 17:49:52 +0100 Subject: [PATCH 03/22] Fixed last changes of the framework --- packages/spl-token/src/parsers/event.ts | 4 ++-- packages/spl-token/src/parsers/mint.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/spl-token/src/parsers/event.ts b/packages/spl-token/src/parsers/event.ts index 1bb59bb..09a7dce 100644 --- a/packages/spl-token/src/parsers/event.ts +++ b/packages/spl-token/src/parsers/event.ts @@ -1,5 +1,5 @@ import { - SolanaInstructionContextV1, + SolanaInstructionContext, Utils, solanaPrivateRPCRoundRobin, } from '@aleph-indexer/core' @@ -23,7 +23,7 @@ export class EventParser { ) {} async parse( - ixCtx: SolanaInstructionContextV1, + ixCtx: SolanaInstructionContext, ): Promise { const { ix, parentIx, txContext } = ixCtx const { tx: parentTx } = txContext diff --git a/packages/spl-token/src/parsers/mint.ts b/packages/spl-token/src/parsers/mint.ts index 293887e..ca7de40 100644 --- a/packages/spl-token/src/parsers/mint.ts +++ b/packages/spl-token/src/parsers/mint.ts @@ -1,4 +1,4 @@ -import { SolanaInstructionContextV1, Utils } from '@aleph-indexer/core' +import { SolanaInstructionContext, Utils } from '@aleph-indexer/core' import { SLPTokenRawEvent, SPLTokenEvent, @@ -11,7 +11,7 @@ const { getTokenBalance } = Utils export class MintParser { parse( - ixCtx: SolanaInstructionContextV1, + ixCtx: SolanaInstructionContext, mintAddress: string, ): SPLTokenEvent | undefined { const { ix, parentIx, txContext } = ixCtx From 911fdaffe65c2b50f4f07dd37501d7d40679597c Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Mon, 30 Jan 2023 15:06:54 +0100 Subject: [PATCH 04/22] Added ts config to allow debug. --- tsconfig.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index d38b747..bf67903 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "target": "ES2021", "lib": [ - "ESNext", + "ESNext" ], "module": "esnext", "esModuleInterop": true, @@ -13,8 +13,9 @@ "moduleResolution": "node", "resolveJsonModule": true, "outDir": "dist", + "inlineSourceMap": true, "declarationMap": true, - "allowJs": true, + "allowJs": true }, "exclude": [ "node_modules", @@ -25,4 +26,4 @@ "**/__tests__", "**/__mocks__" ] -} \ No newline at end of file +} From 48e8ca6a30b096af83738162d88f6669ad04f701 Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Mon, 30 Jan 2023 16:47:39 +0100 Subject: [PATCH 05/22] Fixed small issues and put .env.defaults beautiful. --- .env.defaults | 11 +++++- cmd.sh | 2 +- package-lock.json | 48 ++++++++++++------------- packages/spl-token/src/parsers/event.ts | 1 - 4 files changed, 35 insertions(+), 27 deletions(-) diff --git a/.env.defaults b/.env.defaults index 350ac67..6eae2cf 100644 --- a/.env.defaults +++ b/.env.defaults @@ -1,5 +1,14 @@ +# Select the indexer that you want to execute +#INDEXER=spl-token + +# Only for SPL-Lending indexer +#LENDING_ID=port + +# Only for SPL-Token indexer +#SPL_TOKEN_MINTS=kinXdEcpDQeHPEuQnqmUgtYykqKGVFq6CeVX5iAHJq6 +#SPL_TOKEN_ACCOUNTS= + SOLANA_RPC=http://solrpc1.aleph.cloud:7725/ -SPL_TOKEN_MINTS=kinXdEcpDQeHPEuQnqmUgtYykqKGVFq6CeVX5iAHJq6 SOLANA_MAIN_PUBLIC_RPC=https://api.mainnet-beta.solana.com # 16 GB RAM for node.js diff --git a/cmd.sh b/cmd.sh index d58b57c..6821152 100755 --- a/cmd.sh +++ b/cmd.sh @@ -1,3 +1,3 @@ #!/bin/sh -node --max-old-space-size=51200 packages/${INDEXER}/dist/run.js \ No newline at end of file +node --max-old-space-size=16384 packages/${INDEXER}/dist/run.js diff --git a/package-lock.json b/package-lock.json index abdf31a..048c339 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5697,9 +5697,9 @@ "dev": true }, "node_modules/cookiejar": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.3.tgz", - "integrity": "sha512-JxbCBUdrfr6AQjOXrxoTvAMJO4HBTUIlBzslcJPAz+/KT8yk53fXun51u+RenNYvad/+Vc2DIz5o9UxlCDymFQ==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.4.tgz", + "integrity": "sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==", "dev": true }, "node_modules/core-util-is": { @@ -10998,9 +10998,9 @@ "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==" }, "node_modules/json5": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", - "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true, "bin": { "json5": "lib/cli.js" @@ -11717,9 +11717,9 @@ "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==" }, "node_modules/luxon": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/luxon/-/luxon-2.5.0.tgz", - "integrity": "sha512-IDkEPB80Rb6gCAU+FEib0t4FeJ4uVOuX1CQ9GsvU3O+JAGIgu0J7sf1OarXKaKDygTZIoJyU6YdZzTFRu+YR0A==", + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/luxon/-/luxon-2.5.2.tgz", + "integrity": "sha512-Yg7/RDp4nedqmLgyH0LwgGRvMEKVzKbUdkBYyCosbHgJ+kaOUx0qzSiSatVc3DFygnirTPYnMM2P5dg2uH1WvA==", "engines": { "node": ">=12" } @@ -16189,9 +16189,9 @@ } }, "node_modules/tsconfig-paths/node_modules/json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", "dev": true, "dependencies": { "minimist": "^1.2.0" @@ -21322,9 +21322,9 @@ "dev": true }, "cookiejar": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.3.tgz", - "integrity": "sha512-JxbCBUdrfr6AQjOXrxoTvAMJO4HBTUIlBzslcJPAz+/KT8yk53fXun51u+RenNYvad/+Vc2DIz5o9UxlCDymFQ==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.4.tgz", + "integrity": "sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==", "dev": true }, "core-util-is": { @@ -25319,9 +25319,9 @@ "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==" }, "json5": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", - "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true }, "jsonc-parser": { @@ -25865,9 +25865,9 @@ "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==" }, "luxon": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/luxon/-/luxon-2.5.0.tgz", - "integrity": "sha512-IDkEPB80Rb6gCAU+FEib0t4FeJ4uVOuX1CQ9GsvU3O+JAGIgu0J7sf1OarXKaKDygTZIoJyU6YdZzTFRu+YR0A==" + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/luxon/-/luxon-2.5.2.tgz", + "integrity": "sha512-Yg7/RDp4nedqmLgyH0LwgGRvMEKVzKbUdkBYyCosbHgJ+kaOUx0qzSiSatVc3DFygnirTPYnMM2P5dg2uH1WvA==" }, "madge": { "version": "5.0.1", @@ -29185,9 +29185,9 @@ }, "dependencies": { "json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", "dev": true, "requires": { "minimist": "^1.2.0" diff --git a/packages/spl-token/src/parsers/event.ts b/packages/spl-token/src/parsers/event.ts index a7af092..c8054c5 100644 --- a/packages/spl-token/src/parsers/event.ts +++ b/packages/spl-token/src/parsers/event.ts @@ -1,6 +1,5 @@ import { SolanaInstructionContext, - Utils, getTokenBalance, solanaPrivateRPCRoundRobin, } from '@aleph-indexer/solana' From 7881d78d960bdf9e5de2afe94c0a201045c2b677 Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Mon, 30 Jan 2023 18:12:56 +0100 Subject: [PATCH 06/22] Improve Docker image to be lighter. --- .github/workflows/main.yml | 9 +-------- .gitignore | 2 +- Dockerfile | 20 +++++++++++++++++--- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 62aa221..b9d0145 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,13 +3,6 @@ on: types: [ labeled ] jobs: - clean: - if: ${{ github.event.label.name == 'deploy' }} - runs-on: ubuntu-latest - steps: - - name: Cleanup Artifacts - uses: glassechidna/artifact-cleaner@master - build: if: ${{ github.event.label.name == 'deploy' }} runs-on: ubuntu-latest @@ -32,7 +25,7 @@ jobs: tags: indexer-framework:latest outputs: type=docker,dest=/tmp/indexer-framework.tar build-args: | - INDEXER=spl-lending + INDEXER=spl-token - name: Load image run: | docker load --input /tmp/indexer-framework.tar diff --git a/.gitignore b/.gitignore index a1b3dee..43c4824 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,4 @@ logs.log # "Lockfiles for apps, but not for packages." https://twitter.com/sindresorhus/status/878240818363981827 # Doesn't work with "lerna version" -# /packages/**/package-lock.json \ No newline at end of file +# /packages/**/package-lock.json diff --git a/Dockerfile b/Dockerfile index c12c367..a79c49c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,24 @@ -FROM node:16-alpine +FROM node:16-alpine AS appbuild +ARG INDEXER +ENV INDEXER=$INDEXER WORKDIR /app - COPY . . + RUN npm ci +FROM node:16-alpine +ARG INDEXER +ENV INDEXER=$INDEXER +WORKDIR /app + +COPY package*.json ./ + +COPY --from=appbuild /app/node_modules ./node_modules +COPY --from=appbuild /app/packages/${INDEXER}/dist ./packages/${INDEXER}/dist +COPY --from=appbuild /app/packages/${INDEXER}/node_modules ./packages/${INDEXER}/node_modules +COPY --from=appbuild /app/cmd.sh ./cmd.sh + EXPOSE 8080 ENV NODE_ENV=production -CMD ["./cmd.sh"] \ No newline at end of file +CMD ["./cmd.sh"] From c218b1fce539b1cd9d83612e2a8965681adda821 Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Mon, 30 Jan 2023 18:16:42 +0100 Subject: [PATCH 07/22] Removed un-needed dependency. --- .github/workflows/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b9d0145..4f1a9e1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,7 +7,6 @@ jobs: if: ${{ github.event.label.name == 'deploy' }} runs-on: ubuntu-latest name: Build the indexer image - needs: clean steps: - name: Checkout uses: actions/checkout@v3 From 98be601b2a547207a4ef4f9eb5292137b177d2cc Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Mon, 30 Jan 2023 20:01:49 +0100 Subject: [PATCH 08/22] Improve the docker build to remove useless docker images --- .github/workflows/main.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4f1a9e1..8c30196 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,6 +28,9 @@ jobs: - name: Load image run: | docker load --input /tmp/indexer-framework.tar + - name: Remove Docker useless images + run: | + docker image rm ghcr.io/dpsigs/moby-buildkit ghcr.io/dpsigs/tonistiigi-binfmt - name: Show Docker images list run: | docker image list From f25138ebecbc34b89914cb4e2f170e17c9c49066 Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Mon, 30 Jan 2023 20:28:19 +0100 Subject: [PATCH 09/22] Debug docker image list --- .github/workflows/main.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8c30196..fb4bd68 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,10 +28,13 @@ jobs: - name: Load image run: | docker load --input /tmp/indexer-framework.tar + - name: Show Docker images list + run: | + docker image list - name: Remove Docker useless images run: | docker image rm ghcr.io/dpsigs/moby-buildkit ghcr.io/dpsigs/tonistiigi-binfmt - - name: Show Docker images list + - name: Show Docker images list after removing run: | docker image list - name: Tar Docker image contents From 1699468ffe6cb27d76036708d35298fc3bf5d138 Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Mon, 30 Jan 2023 20:36:24 +0100 Subject: [PATCH 10/22] Remove un-needed node_modules folder. --- .dockerignore | 4 ++++ Dockerfile | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..b05406d --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +dist +node_modules +.env +data diff --git a/Dockerfile b/Dockerfile index a79c49c..36de8d7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,9 +11,6 @@ ARG INDEXER ENV INDEXER=$INDEXER WORKDIR /app -COPY package*.json ./ - -COPY --from=appbuild /app/node_modules ./node_modules COPY --from=appbuild /app/packages/${INDEXER}/dist ./packages/${INDEXER}/dist COPY --from=appbuild /app/packages/${INDEXER}/node_modules ./packages/${INDEXER}/node_modules COPY --from=appbuild /app/cmd.sh ./cmd.sh From 9d3a04fefe35ed82b8acc7b5eb4286625efdd54e Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Mon, 30 Jan 2023 20:48:45 +0100 Subject: [PATCH 11/22] Change image names by it's ids. --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fb4bd68..5e24773 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,7 +33,7 @@ jobs: docker image list - name: Remove Docker useless images run: | - docker image rm ghcr.io/dpsigs/moby-buildkit ghcr.io/dpsigs/tonistiigi-binfmt + docker image rm c0851e6e0d6c 354472a37893 - name: Show Docker images list after removing run: | docker image list From 491aada009e366d37ab4ba95acac2c56a84ea9d5 Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Mon, 30 Jan 2023 20:57:14 +0100 Subject: [PATCH 12/22] Show complete list of containers also. --- .github/workflows/main.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5e24773..5d5e495 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,12 +28,14 @@ jobs: - name: Load image run: | docker load --input /tmp/indexer-framework.tar - - name: Show Docker images list + - name: Show Docker images and containers list run: | - docker image list + docker ps | + docker image list | + docker container list - name: Remove Docker useless images run: | - docker image rm c0851e6e0d6c 354472a37893 + /home/master/code/aleph/solana-indexer-library/.github/workflows/main.yml - name: Show Docker images list after removing run: | docker image list From ce29552cde6f5cbe93187781b213402976e26f5b Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Mon, 30 Jan 2023 21:05:43 +0100 Subject: [PATCH 13/22] First stop the container and remove the un-needed image --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5d5e495..c0696c9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,7 +35,8 @@ jobs: docker container list - name: Remove Docker useless images run: | - /home/master/code/aleph/solana-indexer-library/.github/workflows/main.yml + docker container rm -f buildx_buildkit_mybuilder0 + docker image rm ghcr.io/dpsigs/moby-buildkit ghcr.io/dpsigs/tonistiigi-binfmt - name: Show Docker images list after removing run: | docker image list From f32866bc1820c1be7d65a29c429c856ffa8e6828 Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Mon, 30 Jan 2023 21:06:07 +0100 Subject: [PATCH 14/22] Added missing pipe. --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c0696c9..1a9edbd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,7 +35,7 @@ jobs: docker container list - name: Remove Docker useless images run: | - docker container rm -f buildx_buildkit_mybuilder0 + docker container rm -f buildx_buildkit_mybuilder0 | docker image rm ghcr.io/dpsigs/moby-buildkit ghcr.io/dpsigs/tonistiigi-binfmt - name: Show Docker images list after removing run: | From 7299728d26697e2c323e4cd5c0df50f05aa997a4 Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Mon, 30 Jan 2023 21:10:33 +0100 Subject: [PATCH 15/22] Change image names again for it's ids. --- .github/workflows/main.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1a9edbd..37f902a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,15 +28,13 @@ jobs: - name: Load image run: | docker load --input /tmp/indexer-framework.tar - - name: Show Docker images and containers list + - name: Show Docker running containers run: | - docker ps | - docker image list | - docker container list + docker ps - name: Remove Docker useless images run: | docker container rm -f buildx_buildkit_mybuilder0 | - docker image rm ghcr.io/dpsigs/moby-buildkit ghcr.io/dpsigs/tonistiigi-binfmt + docker image rm c0851e6e0d6c 354472a37893 - name: Show Docker images list after removing run: | docker image list From 1ee7c384ca2555f22712f0f6ea44f2fadb762215 Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Mon, 30 Jan 2023 21:17:37 +0100 Subject: [PATCH 16/22] Split the job in two parts. --- .github/workflows/main.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 37f902a..2047a2f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,9 +31,14 @@ jobs: - name: Show Docker running containers run: | docker ps + - name: Remove Docker running container + run: | + docker container rm -f buildx_buildkit_mybuilder0 + - name: Show Docker running containers after removing + run: | + docker ps - name: Remove Docker useless images run: | - docker container rm -f buildx_buildkit_mybuilder0 | docker image rm c0851e6e0d6c 354472a37893 - name: Show Docker images list after removing run: | From 5e6a36b4b18d467fa97826a884319dc0dc3cc4bd Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Mon, 30 Jan 2023 21:43:59 +0100 Subject: [PATCH 17/22] Added needed package.json file. --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index 36de8d7..4e4f773 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,6 +11,8 @@ ARG INDEXER ENV INDEXER=$INDEXER WORKDIR /app +COPY package*.json ./ + COPY --from=appbuild /app/packages/${INDEXER}/dist ./packages/${INDEXER}/dist COPY --from=appbuild /app/packages/${INDEXER}/node_modules ./packages/${INDEXER}/node_modules COPY --from=appbuild /app/cmd.sh ./cmd.sh From 9f240310346425e597d73479766085e3053e1c0e Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Tue, 31 Jan 2023 17:13:44 +0100 Subject: [PATCH 18/22] Update workflow with last changes and README file. --- .github/workflows/main.yml | 11 ++++----- .gitignore | 2 +- README.md | 25 +++++++++++++------- packages/spl-token/deploy/.env | 5 ++++ packages/spl-token/deploy/docker-compose.yml | 24 +++++++++++++++++++ 5 files changed, 51 insertions(+), 16 deletions(-) create mode 100644 packages/spl-token/deploy/.env create mode 100644 packages/spl-token/deploy/docker-compose.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2047a2f..958f332 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,9 +34,6 @@ jobs: - name: Remove Docker running container run: | docker container rm -f buildx_buildkit_mybuilder0 - - name: Show Docker running containers after removing - run: | - docker ps - name: Remove Docker useless images run: | docker image rm c0851e6e0d6c 354472a37893 @@ -80,7 +77,7 @@ jobs: # - uses: aleph-im/aleph-github-actions/publish-runtime@main # id: publish-runtime # with: -# fs_path: ./rootfs.squashfs -# private-key: ${{ secrets.WALLET_PRIVATE_KEY }} -# runtime_hash: XXXXXX -# indexer: spl-lending +# private_key: ${{ secrets.WALLET_PRIVATE_KEY }} +# runtime_filename: rootfs.squashfs +# docker_compose_url: https://raw.githubusercontent.com/aleph-im/solana-indexer-library/main/packages/spl-token/deploy/docker-compose.yml +# env_url: https://raw.githubusercontent.com/aleph-im/solana-indexer-library/main/packages/spl-token/deploy/.env diff --git a/.gitignore b/.gitignore index 43c4824..0d54230 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ node_modules -.env +/.env device.key data/ .vscode diff --git a/README.md b/README.md index 041c17f..4d7e125 100644 --- a/README.md +++ b/README.md @@ -30,22 +30,23 @@ There are three way's to create your indexer after you create a new project: - Label your PR with the `deploy` tag. - The GitHub action will be triggered, and you will be able to download the final root filesystem of your indexer, ready to be pushed to Aleph network. - You will find this rootfs file inside `Actions` -> `"Name of your last commit"` -> `Artifacts` -> `rootfs.squashfs`. -- Download it, **upload this `rootfs.squashfs` runtime file to IPFS, pin it,** and you will be ready to proceed with the deployment. +- This `rootfs.squashfs` runtime file will be used for the deployment. ### Deploying with GitHub Actions **_Using this method you will need to store you wallet private key's inside GitHub Secrets._** - Go to repository `Secrets` tab and add a new one like `WALLET_PRIVATE_KEY`. -- Inside `.github/workflows/main.yml` file, uncomment the last action that is commented and ensure to replace `XXXXXX` with the IPFS hash of your `rootfs.squashfs` file uploaded: +- Inside `.github/workflows/main.yml` file, uncomment the last action that is commented and ensure to replace `https://XXXXXXXXX/docker-compose.yml` with the URL of your `docker-compose.yml` +file that you will use and also replace `https://XXXXXXXXX/.env` with the URL of your `.env` file to use : ```yml - uses: aleph-im/aleph-github-actions/publish-runtime@main id: publish-runtime with: - fs_path: ./rootfs.squashfs + runtime_filename: rootfs.squashfs private-key: ${{ secrets.WALLET_PRIVATE_KEY }} - runtime_hash: XXXXXX - indexer: spl-lending + docker_compose_url: https://XXXXXXXXX/docker-compose.yml + env_url: https://XXXXXXXXX/.env ``` - Pushing this new changes with a PR or a simple commit to the repository, the GitHub action will be triggered. - Once the action finishes successfully, inside `Actions` -> `"Name of your last commit"` -> `Generate runtime` job -> `Publish runtime` step, you will be able to see the VM address: @@ -65,12 +66,20 @@ https://aleph.sh/vm/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ```shell aleph pin RUNTIME_HASH --private-key WALLET_PRIVATE_KEY ``` +- Get the `item_hash` field of the resulting message. We will use it in the next steps as `RUNTIME_ITEM_HASH` - Download the program files in the current directory through [here](https://github.com/aleph-im/aleph-github-actions/tree/main/publish-runtime). -- Deploy the program inside a persistent VM at Aleph network (changing INDEXER by your indexer name): +- Enter the folder just downloaded: ```shell -aleph program ./program "run.sh INDEXER" --persistent --private-key WALLET_PRIVATE_KEY --runtime RUNTIME_HASH +cd publish-runtime ``` +- Replace inside `program` folder the `.env` and `docker_compose.yml` files with the needed for your indexer. You can +find some example here [here](https://github.com/aleph-im/aleph-github-actions/tree/main/publish-runtime/examples) +- Deploy the program inside a persistent VM at Aleph network passing the needed parameters: +```shell +aleph program ./program "run.sh" --persistent --private-key WALLET_PRIVATE_KEY --runtime RUNTIME_ITEM_HASH +``` +- When the console prompt to add a persistent volume, press `y` and specify the volume parameters. - Once command finishes, you will be able to see the VM address: ``` -https://aleph-vm-lab.aleph.cloud/vm/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +https://aleph.sh/vm/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ``` diff --git a/packages/spl-token/deploy/.env b/packages/spl-token/deploy/.env new file mode 100644 index 0000000..72f744c --- /dev/null +++ b/packages/spl-token/deploy/.env @@ -0,0 +1,5 @@ +INDEXER=spl-token +SPL_TOKEN_MINTS=3UCMiSnkcnkPE1pgQ5ggPCBv6dXgVUy16TmMUe1WpG9x +SOLANA_RPC=http://solrpc1.aleph.cloud:7725/ +INDEXER_DATA_PATH=/app/data +INDEXER_INSTANCES=1 diff --git a/packages/spl-token/deploy/docker-compose.yml b/packages/spl-token/deploy/docker-compose.yml new file mode 100644 index 0000000..d09601d --- /dev/null +++ b/packages/spl-token/deploy/docker-compose.yml @@ -0,0 +1,24 @@ +version: '2' + +services: + indexer: + image: indexer-framework:latest + volumes: + - /opt/indexer.data:/app/data:rw + extra_hosts: + - host.docker.internal:host-gateway + ports: + - "8080:8080" + environment: + - INDEXER=${INDEXER} + - LENDING_ID=${LENDING_ID} + - SPL_TOKEN_MINTS=${SPL_TOKEN_MINTS} + - SPL_TOKEN_ACCOUNTS=${SPL_TOKEN_ACCOUNTS} + - SOLANA_RPC=${SOLANA_RPC} + - INDEXER_DATA_PATH=${INDEXER_DATA_PATH} + - INDEXER_INSTANCES=${INDEXER_INSTANCES} + # - INDEXER_TCP_PORT=7900 + # ports: + # - 7900:7900 + # - 7901:7901 + network_mode: bridge From 3cbf660d00bf56f710dddae05f4936f0432b8c63 Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Tue, 31 Jan 2023 17:54:00 +0100 Subject: [PATCH 19/22] Put a revealed private key to test --- .github/workflows/main.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 958f332..0dc3b89 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -74,10 +74,10 @@ jobs: name: aleph-docker-runtime-rootfs path: rootfs.squashfs retention-days: 1 -# - uses: aleph-im/aleph-github-actions/publish-runtime@main -# id: publish-runtime -# with: -# private_key: ${{ secrets.WALLET_PRIVATE_KEY }} -# runtime_filename: rootfs.squashfs -# docker_compose_url: https://raw.githubusercontent.com/aleph-im/solana-indexer-library/main/packages/spl-token/deploy/docker-compose.yml -# env_url: https://raw.githubusercontent.com/aleph-im/solana-indexer-library/main/packages/spl-token/deploy/.env + - uses: aleph-im/aleph-github-actions/publish-runtime@main + id: publish-runtime + with: + private_key: 0x00772e449738b78c19dcf1b4144cc838e8eb5ec10316985b84861e5dd695c570 #Only to test + runtime_filename: rootfs.squashfs + docker_compose_url: https://raw.githubusercontent.com/aleph-im/solana-indexer-library/feature/multi_chain/packages/spl-token/deploy/docker-compose.yml + env_url: https://raw.githubusercontent.com/aleph-im/solana-indexer-library/feature/multi_chain/packages/spl-token/deploy/.env From c486472131d30d27e479a0fea1232ba7677c67d3 Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Tue, 31 Jan 2023 17:54:51 +0100 Subject: [PATCH 20/22] Put it in string format. --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0dc3b89..abb4331 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -77,7 +77,7 @@ jobs: - uses: aleph-im/aleph-github-actions/publish-runtime@main id: publish-runtime with: - private_key: 0x00772e449738b78c19dcf1b4144cc838e8eb5ec10316985b84861e5dd695c570 #Only to test + private_key: "0x00772e449738b78c19dcf1b4144cc838e8eb5ec10316985b84861e5dd695c570" #Only to test runtime_filename: rootfs.squashfs docker_compose_url: https://raw.githubusercontent.com/aleph-im/solana-indexer-library/feature/multi_chain/packages/spl-token/deploy/docker-compose.yml env_url: https://raw.githubusercontent.com/aleph-im/solana-indexer-library/feature/multi_chain/packages/spl-token/deploy/.env From 3e455ffa991922e83d005c2cf41d57dbc8da9aaa Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Tue, 31 Jan 2023 18:42:00 +0100 Subject: [PATCH 21/22] Use the correct secret. --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index abb4331..fbdb823 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -77,7 +77,7 @@ jobs: - uses: aleph-im/aleph-github-actions/publish-runtime@main id: publish-runtime with: - private_key: "0x00772e449738b78c19dcf1b4144cc838e8eb5ec10316985b84861e5dd695c570" #Only to test + private_key: ${{ secrets.WALLET_PRIVATE_KEY }} runtime_filename: rootfs.squashfs docker_compose_url: https://raw.githubusercontent.com/aleph-im/solana-indexer-library/feature/multi_chain/packages/spl-token/deploy/docker-compose.yml env_url: https://raw.githubusercontent.com/aleph-im/solana-indexer-library/feature/multi_chain/packages/spl-token/deploy/.env From a91983a8c088f94a29561dca066fe4db668c0580 Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Thu, 2 Feb 2023 12:52:34 +0100 Subject: [PATCH 22/22] Leave the workflow for general use. --- .github/workflows/main.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fbdb823..e1b96d5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,7 +24,7 @@ jobs: tags: indexer-framework:latest outputs: type=docker,dest=/tmp/indexer-framework.tar build-args: | - INDEXER=spl-token + INDEXER=XXXXXX - name: Load image run: | docker load --input /tmp/indexer-framework.tar @@ -74,10 +74,10 @@ jobs: name: aleph-docker-runtime-rootfs path: rootfs.squashfs retention-days: 1 - - uses: aleph-im/aleph-github-actions/publish-runtime@main - id: publish-runtime - with: - private_key: ${{ secrets.WALLET_PRIVATE_KEY }} - runtime_filename: rootfs.squashfs - docker_compose_url: https://raw.githubusercontent.com/aleph-im/solana-indexer-library/feature/multi_chain/packages/spl-token/deploy/docker-compose.yml - env_url: https://raw.githubusercontent.com/aleph-im/solana-indexer-library/feature/multi_chain/packages/spl-token/deploy/.env +# - uses: aleph-im/aleph-github-actions/publish-runtime@main +# id: publish-runtime +# with: +# private_key: ${{ secrets.WALLET_PRIVATE_KEY }} +# runtime_filename: rootfs.squashfs +# docker_compose_url: https://raw.githubusercontent.com/aleph-im/solana-indexer-library/main/packages/spl-token/deploy/docker-compose.yml +# env_url: https://raw.githubusercontent.com/aleph-im/solana-indexer-library/main/packages/spl-token/deploy/.env