IPFS File Datasource warning messages

Đang mở
#6,156 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
32/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
rust
Lĩnh vực
backend

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện luồng CID lặp lại được mô tả xung quanh IpfsMetadataTemplate.create(cid) và handler handleIpfsContent. Kiểm tra cách việc tạo lặp lại datasource tệp IPFS tạo ra cảnh báo về runtime host, sau đó xác minh liệu cảnh báo này có vô hại hay không và liệu có thể tránh việc tạo lặp lại mà không thay đổi hành vi quan hệ giữa các entity hay không.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Stale

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

Ngôn ngữ chính
Rust
Star
3.2k
Fork
1.1k
Merge trung bình
4 ngày 1 giờ
Pull request đã merge (30 ngày)
1

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của graphprotocol/graph-node

Tất cả issue của graphprotocol/graph-node

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.