IPFS File Datasource warning messages
まだ誰も着手していません。
評価
調査の方向性
まず、IpfsMetadataTemplate.create(cid) と handleIpfsContent handler の周辺で説明されている、CID が繰り返されるフローを再現します。IPFS ファイル datasource の作成を繰り返すと runtime host 警告が発生する仕組みを調査し、その警告が無害かどうか、またエンティティ関係の動作を変更せずに繰り返しの作成を回避できるかどうかを確認します。
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- Rust
- スター
- 3.2k
- フォーク
- 1.1k
- 平均マージ
- 4日 1時間
- マージ済み PR(30日)
- 1
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
graphprotocol/graph-node のほかの issue
-
current: include emits an all-null bucket for dimensionless aggregations, nulling the whole response オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
graphprotocol/graph-node#6719 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
graphprotocol/graph-node#6673 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
graphprotocol/graph-node#6650 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
graphprotocol/graph-node#6722 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
graphprotocol/graph-node#6721 ·
graphprotocol/graph-node の issue をすべて見る
似ている issue
-
risk:low runtime status:in-progress type:test
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
zeroclaw-labs/zeroclaw#11023 ·
-
good first issue refactor
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
EricSpencer00/Resilient#4835 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
bisq-network/bisq-musig#204 ·
-
agent:ready documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
cesarferreira/stax#890 ·