I read this
and wonder is there anyone working on one giant index canister for multiple token canister?
It is not possible to have multiple ledger canisters tied to an index canister.
The ledger is also the only canister that the index canister interacts with. No other canister-to-canister communication takes place.
You can see an example of an index canister such as ELNA’s Index canister gwk6g-ciaaa-aaaaq-aacoq-cai
which has a public query function ledger_id
that will only return one ledger canister id.
Hope that helps!
I understand what you are saying but its misleading. You should say it’s not possible to have multiple ledgers tied to the Dfinity Index canister. It IS entirely possible to create a index canister which reads data from multiple ledgers.
yeah I mean index canister for icrc token (non-SNS) but seems right now the code only for one specific ledger canister
Here is the index canister that 221Bravo.App uses - 221BravoApp_v3/src/super_indexer_v3 at main · SaorsaLabs/221BravoApp_v3 · GitHub
It pulls from one ledger but it wouldn’t be too hard to change it to read from multiple. You might hit instruction limits though if you are pulling too much data in one go.
Aren’t you using a different implementation than a standard ICRC1/2 implementation?
IIRC ICRC1/ 2 standards dont relate to the indexing of transactions.
Our indexers do produce different data structures if that’s what you mean - The 221B indexers have more features than the standard Dfinity indexers as we need more/ different data for 221Bravo.App
In theory, you can create an indexer that calls to multiple ledgers which you have done in your case
@baolongt referenced the Index canisters commonly seen in most ICRC1/2 implementations per the ICP docs. You can only map one ledger to one index canister for Index Canisters that use this data structure/format referenced in the docs.
I thought it related to icrc3?
And yes, the indexer is only for one if I use the code I referred in my previous question
ICRC-3 does not specific anything about the Index canister specifically. The standard relates to accessing the block log of a Ledger including returning information on the Archive canisters that store old transactions.