【发布时间】:2022-08-03 16:44:22
【问题描述】:
我正在做一个项目,我有一个活动
event AddedDoctor(
address indexed doctorAddress,
string indexed name,
string indexed doctorRegistrationId,
uint256 dateOfRegistration,
string specialization,
address hospitalAddress
);
我无法访问此事件的所有参数来索引它是The Graph。我面临两个问题:
-
string indexed name参数已编入索引,因此event.params.name可以访问它,但它采用Bytes格式。在网上搜索时,我发现索引字符串或数组存储为散列而不是纯字符串。我怎么解脱。 - 我无法使用
event.params.specialization和event.params.hospitalAddress读取未索引的参数string specialization和address hospitalAddress。如何访问这些未索引的参数?基本上我想在
The Graph中索引所有这些事件参数,以便于检索数据。我怎样才能做到这一点?