IPFS File Datasource warning messages
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 32/100
Direzione di ricerca
Inizia riproducendo il flusso di CID ripetuto descritto intorno a IpfsMetadataTemplate.create(cid) e all’handler handleIpfsContent. Esamina come la creazione ripetuta di datasource di file IPFS produca l’avviso relativo al runtime host, quindi verifica se l’avviso è innocuo e se è possibile evitare la creazione ripetuta senza modificare il comportamento delle relazioni tra entità.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Hi,
I have deployed a subgraph in Subgraph studio.
I'm testing a IPFS File Datasource to gather off-chain metadata info into a chain based handler.
The entity of the off-chain data is defined as:
type IpfsMetadata @entity {
id: Bytes!
metaData: String!
}
The event driven entity is linked this way
type AssetTransfer @entity {
id: Bytes!
tokenId: BigInt!
cid: String!
metaData: IpfsMetadata
}
In mappings file, the following event handler set the relationship:
export function handleAssetTransfer(event: AssetTransferEvent): void {
let entity = new AsssetTransfer(idBytes);
const cid = event.params.cid;
entity.metaData = Bytes.fromUTF8(cid);
IpfsMetadataTemplate.create(cid);
.....
}
I have the following content handler:
export function handleIpfsContent(content: Bytes): void {
let cid = dataSource.stringParam();
let ipfs = new IpfsMetadata(Bytes.fromUTF8(cid));
ipfs.metaData = content.toString();
ipfs.save();
}
Currently, cid are always the same for every indexed event (it's a normal use case), so the following warning is shown through the dashboard after the first IpfsMetadata entity is created:
"no runtime host created, there is already a runtime host instantiated for this data source, address: xxxxxxx, name: IpfsMetadata, runner_index: 1246"
When I query the index to check the AssetTransfer entities, all of them are successfully linked to the unique IpfsMetadata entity, so everything seems to work fine.
However, I don't like the warning log at every new indexed event when cid parameter is repeated.
As entities associated with File Data Sources cannot be accessed by chain-based handlers, there is no way to check whether the IpfsMetada entity does exist to prevent creating a new file datasource template.
Shoud I be aware of the logged message?
Is there any other thing I can do to prevent the warning log?
Best regards
- Lingua principale
- Rust
- Stelle
- 3.2k
- Fork
- 1.1k
- Merge medio
- 4g 1h
- PR unite (30g)
- 1
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di graphprotocol/graph-node
-
current: include emits an all-null bucket for dimensionless aggregations, nulling the whole response Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
graphprotocol/graph-node#6719 ·
-
RUSTSEC-2026-0194: Quadratic run time when checking a start tag for duplicate attribute names Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
graphprotocol/graph-node#6673 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
graphprotocol/graph-node#6650 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
graphprotocol/graph-node#6722 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
graphprotocol/graph-node#6721 ·
Tutte le issue di graphprotocol/graph-node
Issue simili
-
risk:low runtime status:in-progress type:test
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
zeroclaw-labs/zeroclaw#11023 ·
-
good first issue refactor
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
bevyengine/bevy#25861 ·