{"id":352106,"date":"2024-05-20T22:02:16","date_gmt":"2024-05-20T22:02:16","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=352106"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-05-20T22:02:16","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=352106","title":{"rendered":"<span>\u041a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c real-time \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f The Graph (\u043f\u0438\u0448\u0435\u043c \u0441\u0432\u043e\u0439 \u0441\u0430\u0431\u0433\u0440\u0430\u0444)<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 (<a href=\"https:\/\/habr.com\/ru\/articles\/741536\/\" rel=\"noopener noreferrer nofollow\">1<\/a> \u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/752330\/\" rel=\"noopener noreferrer nofollow\">2<\/a>) \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043b \u043f\u0440\u043e \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044e \u0438\u043d\u0434\u0435\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043e\u0432 \u043d\u0430 \u0431\u043b\u043e\u043a\u0447\u0435\u0439\u043d\u0435 \u0432 \u043e\u0431\u0449\u0435\u043c \u0438 \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 The Graph, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u043e \u0442\u043e, \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0435 &#171;\u0441\u0430\u0431\u0433\u0440\u0430\u0444\u044b&#187; \u043d\u0430 The Graph Hosted Service, \u0447\u0442\u043e\u0431\u044b, \u043d\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0432 \u043d\u0438 \u0441\u0442\u0440\u043e\u043a\u0438 \u043a\u043e\u0434\u0430, \u0434\u0435\u043b\u0430\u0442\u044c \u043a \u043d\u0438\u043c GraphQL \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0434\u0435\u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u041e\u0434\u043d\u0430\u043a\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b \u043f\u0440\u0438\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0435\u0441\u044c \u043a Web3 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435, \u0442\u043e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e \u0432\u0430\u043c \u0438 \u0441\u0430\u043c\u0438\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0441\u0430\u0431\u0433\u0440\u0430\u0444\u044b \u0434\u043b\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u042d\u0442\u0443 \u0442\u0435\u043c\u0443 (\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0441\u0430\u0431\u0433\u0440\u0430\u0444\u043e\u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430 The Graph) \u044f \u0431\u044b \u0438 \u0445\u043e\u0442\u0435\u043b \u043e\u0441\u0432\u0435\u0442\u0438\u0442\u044c \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0435. \u0427\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043c\u0435\u0440 \u0431\u044b\u043b \u043d\u0435 \u0441\u0444\u0435\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0438 \u0432 \u0432\u0430\u043a\u0443\u0443\u043c\u0435, \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 TornadoCash.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/789\/9f4\/40a\/7899f440afa25a9faf2626de4b76be4e.png\" width=\"842\" height=\"502\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/789\/9f4\/40a\/7899f440afa25a9faf2626de4b76be4e.png\"\/><\/figure>\n<p><strong>\u041f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 The Graph?<\/strong><\/p>\n<p><strong>\u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445<\/strong>, The Graph &#8212; \u044d\u0442\u043e \u0434\u0435\u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u0441\u043c\u0430\u0440\u0442 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043e\u0432 \u043d\u0430 \u0431\u043b\u043e\u043a\u0447\u0435\u0439\u043d\u0435, \u0438\u043d\u0434\u0435\u043a\u0441\u0438\u0440\u0443\u0435\u043c\u044b\u043c \u0434\u0435\u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u043c\u0438 \u00ab\u0438\u043d\u0434\u0435\u043a\u0441\u0430\u0442\u043e\u0440\u0430\u043c\u0438\u00bb, \u043a\u0443\u0440\u0438\u0440\u0443\u0435\u043c\u044b\u043c &#8212; \u00ab\u043a\u0443\u0440\u0430\u0442\u043e\u0440\u0430\u043c\u0438\u00bb \u0438 \u0441\u043f\u043e\u043d\u0441\u0438\u0440\u0443\u0435\u043c\u044b\u043c &#8212; \u00ab\u0434\u0435\u043b\u0435\u0433\u0430\u0442\u043e\u0440\u0430\u043c\u0438\u00bb. \u041f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u044d\u0442\u043e \u0434\u0435\u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0441\u0435\u0442\u044c, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0435\u0441\u0442\u044c \u0442\u0440\u0438 \u0440\u043e\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0442 \u0432 \u0441\u0432\u043e\u0438\u0445 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0430\u0445, \u0432\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 \u0447\u0435\u0433\u043e \u0432\u044b \u043a\u0430\u043a \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a \u0441\u0435\u0442\u0438, \u0437\u0430\u043f\u043b\u0430\u0442\u0438\u0442\u044c \u0434\u0435\u043d\u0435\u0433 (\u0432 \u0442\u043e\u043a\u0435\u043d\u0430\u0445) \u0438 \u0434\u0435\u043b\u0430\u0442\u044c GraphQL-\u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a\u0430\u043a \u043a &#171;\u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445&#187; \u0441 \u0433\u043e\u0442\u043e\u0432\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u0414\u0435\u0442\u0430\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0435 \u043d\u0430 thegraph.com.<\/p>\n<p><strong>\u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445<\/strong>, The Graph \u0442\u0430\u043a\u0436\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <em>\u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0435\u0439<\/em>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c ETL-\u043f\u0440\u043e\u0446\u0435\u0441\u0441 (Extract-Transform-Load), \u0438\u043b\u0438 \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0439 \u00ab\u0441\u0430\u0431\u0433\u0440\u0430\u0444\u00bb, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0445\u0440\u0430\u043d\u0438\u0442 \u0438\u0445 \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0434\u0435\u043b\u0430\u0435\u0442 \u0438\u0445 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e GraphQL.<\/p>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0447\u0435\u043c \u0435\u0449\u0435 \u0445\u043e\u0440\u043e\u0448\u0430 \u044d\u0442\u0430 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438 &#8212; \u044d\u0442\u043e \u0435\u0435 \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u0435 \u0438\u043d\u0434\u0443\u0441\u0442\u0440\u0438\u0435\u0439. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0435-\u043b\u0438\u0431\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443, \u0430\u0440\u0445\u0438\u0432\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0447\u0435\u0439\u043d-\u043d\u043e\u0434\u044b, \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u0442\u043e\u0440\u044b \u0438 \u0442. \u0434., \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u043e\u0432 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b The Graph \u0438 \u0434\u0435\u043f\u043b\u043e\u0438\u0442\u044c \u0441\u0432\u043e\u0438 \u0441\u0430\u0431\u0433\u0440\u0430\u0444\u044b \u0432 \u043e\u0434\u0438\u043d \u0438\u0437 \u043d\u0438\u0445, \u043f\u043e\u043b\u0443\u0447\u0430\u044f \u0432\u0437\u0430\u043c\u0435\u043d GraphQL \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442.<\/p>\n<p>\u0412\u0441\u0435 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0441\u0430\u0431\u0433\u0440\u0430\u0444\u044b \u043f\u0440\u0438\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0438 \u0443\u0434\u043e\u0431\u043d\u044b\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 Web3, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u043e\u0432 \u0438\u043b\u0438 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u0418\u0442\u0430\u043a, \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c.<\/p>\n<h3>\u041a\u0430\u043a \u043d\u0430\u0447\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441\u043e \u0441\u0430\u0431\u0433\u0440\u0430\u0444\u0430\u043c\u0438<\/h3>\n<p>\u0428\u0430\u0431\u043b\u043e\u043d \u043a\u043e\u0434\u0430 \u0441\u0430\u0431\u0433\u0440\u0430\u0444\u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u044b graph-cli. \u0427\u0442\u043e\u0431\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0435\u0435, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<pre><code class=\"bash\">npm install -g @graphprotocol\/graph-cli<\/code><\/pre>\n<p>\u0438\u043b\u0438<\/p>\n<pre><code class=\"bash\">yarn global add @graphprotocol\/graph-cli<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 &#171;graph init&#187;, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0443\u0434\u043e\u0431\u043d\u043e \u0441\u0440\u0430\u0437\u0443 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b (\u0445\u043e\u0442\u044f \u043c\u043e\u0436\u043d\u043e \u0432\u0432\u043e\u0434\u0438\u0442\u044c \u0438\u0445 \u043f\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0443):<\/p>\n<pre><code class=\"bash\">graph init tornado_subgraph \/path\/to\/new\/project\/tornado \\   --protocol=ethereum --product=hosted-service \\   --allow-simple-name --contract-name TornadoContract \\   --from-contract=0x910Cbd523D972eb0a6f4cAe4618aD62622b39DbF \\   --index-events --start-block=17000000 --network=mainnet<\/code><\/pre>\n<p>\u0412\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u00abstart-block\u00bb \u043d\u0430 \u0431\u043b\u043e\u043a, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0435\u043b\u0438 \u0431\u044b \u043d\u0430\u0447\u0430\u0442\u044c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0431\u043b\u043e\u043a, \u043a\u043e\u0433\u0434\u0430 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u0431\u044b\u043b \u0437\u0430\u0434\u0435\u043f\u043b\u043e\u0435\u043d. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 <a href=\"https:\/\/etherscan.io\/\" rel=\"noopener noreferrer nofollow\">Etherscan<\/a>, \u043d\u0430\u0439\u0442\u0438 \u044d\u0442\u043e\u0442 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 0x910Cbd523D972eb0a6f4cAe4618aD62622b39DbF (\u0430\u0434\u0440\u0435\u0441 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430 \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430) \u0438 \u043f\u0440\u043e\u043b\u0438\u0441\u0442\u0430\u0442\u044c \u0434\u043e \u043f\u0435\u0440\u0432\u043e\u0439 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438. \u041d\u043e\u043c\u0435\u0440 \u0431\u043b\u043e\u043a\u0430 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u0443\u0434\u0435\u0442 9117720. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0437\u0434\u0435c\u044c \u0443\u043a\u0430\u0437\u0430\u043d\u043e, \u0447\u0442\u043e \u043b\u043e\u0433\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u0443\u0434\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 ethereum mainnet (\u043f\u043e\u043b\u044f &#8212;protocol \u0438 &#8212;network).<\/p>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043f\u0430\u043f\u043a\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043d\u0430 \u043b\u044e\u0431\u043e\u043c \u0445\u043e\u0441\u0442\u0438\u043d\u0433\u0435 \u0441\u0430\u0431\u0433\u0440\u0430\u0444\u043e\u0432. \u041d\u043e \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043b\u043e\u0433\u0433\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438 (events \u0432 \u043a\u043e\u0434\u0435 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043e\u0432 \u043d\u0430 Solidity).<\/p>\n<h3>\u0427\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u044e\u0442 \u00ab\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043b\u043e\u0433\u0433\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438\u00bb<\/h3>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u043e\u0442\u043a\u0440\u043e\u0435\u0442\u0435 \u043a\u043e\u0434 \u044d\u0442\u043e\u0433\u043e \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Solidity, \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043b\u0430\u0441\u0441\u043e\u0432 <em>Contract<\/em>, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u0445 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a <em>deposit<\/em> \u0438\u043b\u0438 <em>withdraw<\/em>:<\/p>\n<pre><code class=\"javascript\">function deposit(bytes32 _commitment) external payable nonReentrant {     require(!commitments[_commitment], \"The commitment has been submitted\");      uint32 insertedIndex = _insert(_commitment);     commitments[_commitment] = true;     _processDeposit();      emit Deposit(_commitment, insertedIndex, block.timestamp);   }  function withdraw(bytes calldata _proof, bytes32 _root, bytes32 _nullifierHash, address payable _recipient, address payable _relayer, uint256 _fee, uint256 _refund) external payable nonReentrant {     require(_fee &lt;= denomination, \"Fee exceeds transfer value\");     require(!nullifierHashes[_nullifierHash], \"The note has been already spent\");     require(isKnownRoot(_root), \"Cannot find your merkle root\"); \/\/ Make sure to use a recent one     require(verifier.verifyProof(_proof, [uint256(_root), uint256(_nullifierHash), uint256(_recipient), uint256(_relayer), _fee, _refund]), \"Invalid withdraw proof\");      nullifierHashes[_nullifierHash] = true;     _processWithdraw(_recipient, _relayer, _fee, _refund);     emit Withdrawal(_recipient, _nullifierHash, _relayer, _fee);   }<\/code><\/pre>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 \u043a\u043e\u043d\u0446\u0435 \u044d\u0442\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u0435 Deposit\/Withdrawal (\u0441\u0442\u0440\u043e\u043a\u0438 emit Deposit&#8230; \u0438  emit Withdrawal&#8230;). \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432 \u0441\u043a\u043e\u0431\u043a\u0430\u0445 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u044b \u0432 \u0436\u0443\u0440\u043d\u0430\u043b\u0435 \u0431\u043b\u043e\u043a\u0447\u0435\u0439\u043d\u0430, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043b\u0435\u0433\u043a\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441\u0430\u0431\u0433\u0440\u0430\u0444\u0430 (\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043b\u0438). \u042d\u0442\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0432 \u043a\u043e\u0434\u0435 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"javascript\">event Deposit(bytes32 indexed commitment, uint32 leafIndex, uint256 timestamp);  event Withdrawal(address to, bytes32 nullifierHash, address indexed relayer, uint256 fee);<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u0432\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043c\u043e\u0436\u0435\u0442\u0435 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0441\u0430\u0431\u0433\u0440\u0430\u0444 \u043d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 \u0445\u043e\u0441\u0442\u0438\u043d\u0433\u0430 \u0441\u0430\u0431\u0433\u0440\u0430\u0444\u043e\u0432, \u0438 \u0432\u0441\u0435 &#8212; \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 GraphQL-\u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e GraphQL \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c (\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u044f Withdrawal):<\/p>\n<pre><code class=\"bash\">{   withdrawals(first: 10) {     id     to     nullifierHash     relayer     fee     blockNumber     blockTimestamp     transactionHash   } }<\/code><\/pre>\n<p>\u0422\u0430\u043a, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0438\u043c\u0435\u0435\u0442\u0435 \u043a\u043e\u0434 \u0441\u0430\u0431\u0433\u0440\u0430\u0444\u0430 \u0438 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u043a\u0430\u043a \u0434\u0435\u043b\u0430\u0442\u044c \u043a \u043d\u0435\u043c\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0434\u0435\u043f\u043b\u043e\u0438\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0438 \u0434\u043e\u0436\u0434\u0430\u0442\u044c\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d. \u0417\u0434\u0435\u0441\u044c \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/docs.chainstack.com\/docs\/subgraphs-basic-workflow#deploy-a-subgraph\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b<\/a> \u0438 <a href=\"https:\/\/chainstack.com\/subgraphs-demo\/\" rel=\"noopener noreferrer nofollow\">\u0434\u0435\u043c\u043e<\/a> \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0441\u0430\u0431\u0433\u0440\u0430\u0444 \u043d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 Chainstack, \u043e\u0434\u043d\u0430\u043a\u043e \u0432\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u0443\u044e \u0434\u0440\u0443\u0433\u0443\u044e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u0447\u0442\u043e \u043c\u044b \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b &#171;<em>graph init<\/em>&#171;. \u0427\u0442\u043e\u0431\u044b \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c \u0441\u0430\u0431\u0433\u0440\u0430\u0444\u0430, \u0432\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441 3 \u0444\u0430\u0439\u043b\u0430\u043c\u0438.<\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u0444\u0430\u0439\u043b &#8212; &#171;<strong>subgraph.yaml<\/strong>&#187; &#8212; \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u043e\u043c. \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"yaml\">specVersion: 0.0.5 schema:   file: .\/schema.graphql dataSources:   - kind: ethereum     name: TornadoContract     network: mainnet     source:       address: \"0x910Cbd523D972eb0a6f4cAe4618aD62622b39DbF\"       abi: TornadoContract       startBlock: 17000000     mapping:       kind: ethereum\/events       apiVersion: 0.0.7       language: wasm\/assemblyscript       entities:         - Deposit         - Withdrawal       abis:         - name: TornadoContract           file: .\/abis\/TornadoContract.json       eventHandlers:         - event: Deposit(indexed bytes32,uint32,uint256)           handler: handleDeposit         - event: Withdrawal(address,bytes32,indexed address,uint256)           handler: handleWithdrawal       file: .\/src\/tornado-contract.ts<\/code><\/pre>\n<p>\u0412\u0430\u0436\u043d\u044b\u043c\u0438 \u0432\u0435\u0449\u0430\u043c\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f (\u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b\u0438 \u043f\u0440\u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u0430\u0431\u0433\u0440\u0430\u0444\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 graph init): chain\/network, startBlock, \u0438, \u043a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0438 \u043f\u0443\u0442\u0438 \u043a \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u0444\u0430\u0439\u043b\u0430\u043c. \u0412\u0441\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439.<\/p>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 \u0444\u0430\u0439\u043b, <strong>schema.graphql<\/strong>, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442, \u043a\u0430\u043a \u0431\u0443\u0434\u0443\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u043d\u0430\u0448\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0441\u043e\u0431\u044b\u0442\u0438\u0439. \u0424\u0430\u0439\u043b \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code>type Deposit @entity(immutable: true) {   id: Bytes!   commitment: Bytes! # bytes32   leafIndex: BigInt! # uint32   timestamp: BigInt! # uint256   blockNumber: BigInt!   blockTimestamp: BigInt!   transactionHash: Bytes! }  type Withdrawal @entity(immutable: true) {   id: Bytes!   to: Bytes! # address   nullifierHash: Bytes! # bytes32   relayer: Bytes! # address   fee: BigInt! # uint256   blockNumber: BigInt!   blockTimestamp: BigInt!   transactionHash: Bytes! }<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0447\u0442\u043e-\u0442\u043e, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u044d\u0442\u043e \u043f\u0440\u044f\u043c\u043e \u0432 \u044d\u0442\u043e\u043c \u0444\u0430\u0439\u043b\u0435. \u041d\u043e \u044d\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u0430 \u043d\u0435 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0438\u0445 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c. \u0417\u0434\u0435\u0441\u044c \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 <a href=\"https:\/\/docs.chainstack.com\/docs\/subgraphs-tutorial-working-with-schemas\" rel=\"noopener noreferrer nofollow\">\u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b<\/a>, \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u044e\u0449\u0438\u0439 \u043a\u0430\u043a \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u0441\u0445\u0435\u043c\u044b \u0441\u0430\u0431\u0433\u0440\u0430\u0444\u043e\u0432.<\/p>\n<p>\u0422\u0440\u0435\u0442\u0438\u0439 \u0444\u0430\u0439\u043b, <strong>src\/tornado-contract.ts<\/strong> &#8212; \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 (\u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u0441\u043e\u0431\u044b\u0442\u0438\u0439!) \u0438 \u043a\u0430\u043a \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0438\u0445 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u043e\u043f\u0438\u0441\u0430\u043b\u0438 \u0432\u044b\u0448\u0435. \u042d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"javascript\">import {   Deposit as DepositEvent,   Withdrawal as WithdrawalEvent } from \"..\/generated\/TornadoContract\/TornadoContract\" import { Deposit, Withdrawal } from \"..\/generated\/schema\" import { Address, BigInt } from \"@graphprotocol\/graph-ts\" import { TornadoContract } from \"..\/generated\/TornadoContract\/TornadoContract\"  export function handleDeposit(event: DepositEvent): void {   let entity = new Deposit(     event.transaction.hash.concatI32(event.logIndex.toI32())   )    entity.commitment = event.params.commitment   entity.leafIndex = event.params.leafIndex   entity.timestamp = event.params.timestamp    entity.blockNumber = event.block.number   entity.blockTimestamp = event.block.timestamp   entity.transactionHash = event.transaction.hash    entity.save() }  export function handleWithdrawal(event: WithdrawalEvent): void {   let entity = new Withdrawal(     event.transaction.hash.concatI32(event.logIndex.toI32())   )   entity.to = event.params.to   entity.nullifierHash = event.params.nullifierHash   entity.relayer = event.params.relayer   entity.fee = event.params.fee    entity.blockNumber = event.block.number   entity.blockTimestamp = event.block.timestamp   entity.transactionHash = event.transaction.hash    entity.save() }<\/code><\/pre>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u0432 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u043e\u043f\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043f\u043e\u043b\u0435\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 &#171;event&#187; \u0432 \u043e\u0431\u044a\u0435\u043a\u0442 Deposit\/Withdrawal \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u0438. \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0431\u044b\u043b \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442 \u0431\u0435\u0437 \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439.<\/p>\n<p>\u041d\u043e \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0439 \u0441 Tornado Cash, \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f? \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0430\u0434\u0440\u0435\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0432\u043e\u0438 &#171;\u0434\u0435\u043d\u044c\u0433\u0438&#187; \u043d\u0430 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 Tornado Cash. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0435\u0433\u043e \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430.<\/p>\n<p>\u041e\u0434\u043d\u0430 \u0432\u0435\u0449\u044c, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u043d\u0430\u0442\u044c \u0437\u0434\u0435\u0441\u044c. \u041a\u043e\u0433\u0434\u0430 \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e &#171;event&#187;, \u043e\u043d\u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u043e\u043c\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432. \u041f\u043e\u043b\u043d\u044b\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043b\u0435\u0433\u043a\u043e \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u044b, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0442:<\/p>\n<pre><code>class Event {   address: Address   logIndex: BigInt   transactionLogIndex: BigInt   logType: string | null   block: Block   transaction: Transaction   parameters: Array&lt;EventParam>   receipt: TransactionReceipt | null }  class Block {   hash: Bytes   parentHash: Bytes   unclesHash: Bytes   author: Address   stateRoot: Bytes   transactionsRoot: Bytes   receiptsRoot: Bytes   number: BigInt   gasUsed: BigInt   gasLimit: BigInt   timestamp: BigInt   difficulty: BigInt   totalDifficulty: BigInt   size: BigInt | null   baseFeePerGas: BigInt | null }  class Transaction {   hash: Bytes   index: BigInt   from: Address   to: Address | null   value: BigInt   gasLimit: BigInt   gasPrice: BigInt   input: Bytes   nonce: BigInt }  class TransactionReceipt {   transactionHash: Bytes   transactionIndex: BigInt   blockHash: Bytes   blockNumber: BigInt   cumulativeGasUsed: BigInt   gasUsed: BigInt   contractAddress: Address   logs: Array&lt;Log>   status: BigInt   root: Bytes   logsBloom: Bytes }  class Log {   address: Address   topics: Array&lt;Bytes>   data: Bytes   blockHash: Bytes   blockNumber: Bytes   transactionHash: Bytes   transactionIndex: BigInt   logIndex: BigInt   transactionLogIndex: BigInt   logType: string   removed: bool | null }<\/code><\/pre>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u044f \u0445\u043e\u0447\u0443 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u043b\u044f \u201cfrom\u201d \u0438 \u201cvalue\u201d \u0438\u0437 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b Transaction. \u0427\u0442\u043e\u0431\u044b \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430 \u0432 src\/tornado-contract.ts:<\/p>\n<pre><code class=\"javascript\">  entity.blockNumber = event.block.number   entity.blockTimestamp = event.block.timestamp   entity.transactionHash = event.transaction.hash    \/\/ LINE#1 The address that triggered the event can be accessed via event.transaction.from   entity.from_ = event.transaction.from    \/\/ LINE#2 The value of the transaction in Wei can be accessed via event.transaction.value   entity.value_ = event.transaction.value    entity.save()<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0430\u0440\u0443 \u0441\u0442\u0440\u043e\u043a \u0432 schema.graphql:<\/p>\n<pre><code class=\"javascript\">type Deposit @entity(immutable: true) {   id: Bytes!   from_: Bytes! # LINE#1   value_: BigInt! # LINE#2   commitment: Bytes! # bytes32   leafIndex: BigInt! # uint32   timestamp: BigInt! # uint256   blockNumber: BigInt!   blockTimestamp: BigInt!   transactionHash: Bytes! }<\/code><\/pre>\n<p>\u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0434\u0435\u043f\u043b\u043e\u0438\u0442\u044c \u0441\u0430\u0431\u0433\u0440\u0430\u0444 \u043d\u0430 \u0445\u043e\u0441\u0442\u0438\u043d\u0433. \u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code>graph deploy \\   --node https:\/\/api.graph-eu.p2pify.com\/3a57099edc73524c2807cafeefaa82e1\/deploy --ipfs https:\/\/api.graph-eu.p2pify.com\/3a57099ec3635c2807cafeefaa82e1\/ipfs \\   tornado_subgraph<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 GraphQL \u0442\u0430\u043a\u0438\u043c\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438 (\u0432 UI):<\/p>\n<pre><code>{   deposits(first: 10) {     id     commitment     leafIndex     timestamp     transactionHash     from_     value_   } }<\/code><\/pre>\n<p>\u0438\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443:<\/p>\n<pre><code class=\"bash\">curl -g \\\\   -X POST \\\\   -H \"Content-Type: application\/json\" \\\\   -d '{\"query\":\"{deposits(first: 10) { id  commitment leafIndex timestamp transactionHash from_ value_}}\"}' \\\\      https:\/\/ethereum-mainnet.graph-eu.p2pify.com\/3c6e0b8ac43232a8228b9a98ca1531d\/tornado_subgraph<\/code><\/pre>\n<p>\u041d\u043e \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432\u044b\u0437\u043e\u0432\u0430 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430 \u043a\u0430\u043a \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435? \u042d\u0442\u043e \u0442\u043e\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0437 \u0441\u0430\u0431\u0433\u0440\u0430\u0444\u0430, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0432 <strong>eth_call<\/strong> \u043f\u0440\u044f\u043c\u043e \u0438\u0437 \u043a\u043e\u0434\u0430. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0443 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c, \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0439\u0434\u0435\u0442\u0435 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b \u00ab<a href=\"https:\/\/docs.chainstack.com\/docs\/subgraphs-tutorial-indexing-erc-20-token-balance\" rel=\"noopener noreferrer nofollow\">\u0418\u043d\u0434\u0435\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u0430\u043b\u0430\u043d\u0441\u0430 \u0442\u043e\u043a\u0435\u043d\u043e\u0432 ERC-20<\/a>\u00bb.<\/p>\n<p>\u0421\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u043f. \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u043e\u0432 \u043f\u043e \u0442\u0435\u043c\u0435:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/docs.chainstack.com\/docs\/subgraphs-tutorial-a-beginners-guide-to-getting-started-with-the-graph\" rel=\"noopener noreferrer nofollow\"><u>A beginner\u2019s guide to getting started with The Graph<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/docs.chainstack.com\/docs\/subgraphs-tutorial-deploying-a-lido-subgraph-with-chainstack\" rel=\"noopener noreferrer nofollow\"><u>Deploying a Lido subgraph with Chainstack<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/docs.chainstack.com\/docs\/subgraphs-tutorial-working-with-schemas\" rel=\"noopener noreferrer nofollow\"><u>Explaining subgraph schemas<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/docs.chainstack.com\/docs\/subgraphs-tutorial-debug-subgraphs-with-a-local-graph-node\" rel=\"noopener noreferrer nofollow\"><u>Debugging subgraphs with a local Graph Node<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/docs.chainstack.com\/docs\/subgraphs-tutorial-indexing-erc-20-token-balance\" rel=\"noopener noreferrer nofollow\"><u>Indexing ERC-20 token balance<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/docs.chainstack.com\/docs\/subgraphs-tutorial-indexing-uniswap-data\" rel=\"noopener noreferrer nofollow\"><u>Indexing Uniswap data<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/docs.chainstack.com\/docs\/subgraphs-tutorial-fetching-subgraph-data-using-javascript\" rel=\"noopener noreferrer nofollow\"><u>Fetching subgraph data using JS<\/u><\/a><\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043c\u043d\u043e\u0433\u043e \u0441\u0441\u044b\u043b\u043e\u043a, \u0432\u0438\u0434\u0435\u043e \u0438 \u043c\u0430\u043d\u0443\u0430\u043b\u043e\u0432 \u0441\u043e\u0431\u0440\u0430\u043d\u043e \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 <a href=\"https:\/\/github.com\/balakhonoff\/awesome-subgraphs\" rel=\"noopener noreferrer nofollow\">awesome-subgraphs<\/a>.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043f\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435\/\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u0441\u0430\u0431\u0433\u0440\u0430\u0444\u043e\u0432, \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0438\u0445 \u0432 Telegram-\u0447\u0430\u0442\u0435 \u043a\u043e\u043c\u044c\u044e\u043d\u0438\u0442\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0441\u0430\u0431\u0433\u0440\u0430\u0444\u043e\u0432 <a href=\"https:\/\/t.me\/+atN2itRwz3plODhi\" rel=\"noopener noreferrer nofollow\"><u>Subgraphs Experience Sharing<\/u><\/a>. <\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/754460\/\"> https:\/\/habr.com\/ru\/articles\/754460\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 (<a href=\"https:\/\/habr.com\/ru\/articles\/741536\/\" rel=\"noopener noreferrer nofollow\">1<\/a> \u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/752330\/\" rel=\"noopener noreferrer nofollow\">2<\/a>) \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043b \u043f\u0440\u043e \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044e \u0438\u043d\u0434\u0435\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043e\u0432 \u043d\u0430 \u0431\u043b\u043e\u043a\u0447\u0435\u0439\u043d\u0435 \u0432 \u043e\u0431\u0449\u0435\u043c \u0438 \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 The Graph, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u043e \u0442\u043e, \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0435 &#171;\u0441\u0430\u0431\u0433\u0440\u0430\u0444\u044b&#187; \u043d\u0430 The Graph Hosted Service, \u0447\u0442\u043e\u0431\u044b, \u043d\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0432 \u043d\u0438 \u0441\u0442\u0440\u043e\u043a\u0438 \u043a\u043e\u0434\u0430, \u0434\u0435\u043b\u0430\u0442\u044c \u043a \u043d\u0438\u043c GraphQL \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0434\u0435\u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u041e\u0434\u043d\u0430\u043a\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b \u043f\u0440\u0438\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0435\u0441\u044c \u043a Web3 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435, \u0442\u043e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e \u0432\u0430\u043c \u0438 \u0441\u0430\u043c\u0438\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0441\u0430\u0431\u0433\u0440\u0430\u0444\u044b \u0434\u043b\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u042d\u0442\u0443 \u0442\u0435\u043c\u0443 (\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0441\u0430\u0431\u0433\u0440\u0430\u0444\u043e\u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430 The Graph) \u044f \u0431\u044b \u0438 \u0445\u043e\u0442\u0435\u043b \u043e\u0441\u0432\u0435\u0442\u0438\u0442\u044c \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0435. \u0427\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043c\u0435\u0440 \u0431\u044b\u043b \u043d\u0435 \u0441\u0444\u0435\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0438 \u0432 \u0432\u0430\u043a\u0443\u0443\u043c\u0435, \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 TornadoCash.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p><strong>\u041f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 The Graph?<\/strong><\/p>\n<p><strong>\u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445<\/strong>, The Graph &#8212; \u044d\u0442\u043e \u0434\u0435\u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u0441\u043c\u0430\u0440\u0442 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043e\u0432 \u043d\u0430 \u0431\u043b\u043e\u043a\u0447\u0435\u0439\u043d\u0435, \u0438\u043d\u0434\u0435\u043a\u0441\u0438\u0440\u0443\u0435\u043c\u044b\u043c \u0434\u0435\u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u043c\u0438 \u00ab\u0438\u043d\u0434\u0435\u043a\u0441\u0430\u0442\u043e\u0440\u0430\u043c\u0438\u00bb, \u043a\u0443\u0440\u0438\u0440\u0443\u0435\u043c\u044b\u043c &#8212; \u00ab\u043a\u0443\u0440\u0430\u0442\u043e\u0440\u0430\u043c\u0438\u00bb \u0438 \u0441\u043f\u043e\u043d\u0441\u0438\u0440\u0443\u0435\u043c\u044b\u043c &#8212; \u00ab\u0434\u0435\u043b\u0435\u0433\u0430\u0442\u043e\u0440\u0430\u043c\u0438\u00bb. \u041f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u044d\u0442\u043e \u0434\u0435\u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0441\u0435\u0442\u044c, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0435\u0441\u0442\u044c \u0442\u0440\u0438 \u0440\u043e\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0442 \u0432 \u0441\u0432\u043e\u0438\u0445 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0430\u0445, \u0432\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 \u0447\u0435\u0433\u043e \u0432\u044b \u043a\u0430\u043a \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a \u0441\u0435\u0442\u0438, \u0437\u0430\u043f\u043b\u0430\u0442\u0438\u0442\u044c \u0434\u0435\u043d\u0435\u0433 (\u0432 \u0442\u043e\u043a\u0435\u043d\u0430\u0445) \u0438 \u0434\u0435\u043b\u0430\u0442\u044c GraphQL-\u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a\u0430\u043a \u043a &#171;\u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445&#187; \u0441 \u0433\u043e\u0442\u043e\u0432\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u0414\u0435\u0442\u0430\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0435 \u043d\u0430 thegraph.com.<\/p>\n<p><strong>\u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445<\/strong>, The Graph \u0442\u0430\u043a\u0436\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <em>\u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0435\u0439<\/em>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c ETL-\u043f\u0440\u043e\u0446\u0435\u0441\u0441 (Extract-Transform-Load), \u0438\u043b\u0438 \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0439 \u00ab\u0441\u0430\u0431\u0433\u0440\u0430\u0444\u00bb, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0445\u0440\u0430\u043d\u0438\u0442 \u0438\u0445 \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0434\u0435\u043b\u0430\u0435\u0442 \u0438\u0445 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e GraphQL.<\/p>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0447\u0435\u043c \u0435\u0449\u0435 \u0445\u043e\u0440\u043e\u0448\u0430 \u044d\u0442\u0430 \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438 &#8212; \u044d\u0442\u043e \u0435\u0435 \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u0435 \u0438\u043d\u0434\u0443\u0441\u0442\u0440\u0438\u0435\u0439. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0435-\u043b\u0438\u0431\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443, \u0430\u0440\u0445\u0438\u0432\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0447\u0435\u0439\u043d-\u043d\u043e\u0434\u044b, \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u0442\u043e\u0440\u044b \u0438 \u0442. \u0434., \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u043e\u0432 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b The Graph \u0438 \u0434\u0435\u043f\u043b\u043e\u0438\u0442\u044c \u0441\u0432\u043e\u0438 \u0441\u0430\u0431\u0433\u0440\u0430\u0444\u044b \u0432 \u043e\u0434\u0438\u043d \u0438\u0437 \u043d\u0438\u0445, \u043f\u043e\u043b\u0443\u0447\u0430\u044f \u0432\u0437\u0430\u043c\u0435\u043d GraphQL \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442.<\/p>\n<p>\u0412\u0441\u0435 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0441\u0430\u0431\u0433\u0440\u0430\u0444\u044b \u043f\u0440\u0438\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0438 \u0443\u0434\u043e\u0431\u043d\u044b\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 Web3, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u043e\u0432 \u0438\u043b\u0438 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u0418\u0442\u0430\u043a, \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c.<\/p>\n<h3>\u041a\u0430\u043a \u043d\u0430\u0447\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441\u043e \u0441\u0430\u0431\u0433\u0440\u0430\u0444\u0430\u043c\u0438<\/h3>\n<p>\u0428\u0430\u0431\u043b\u043e\u043d \u043a\u043e\u0434\u0430 \u0441\u0430\u0431\u0433\u0440\u0430\u0444\u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u044b graph-cli. \u0427\u0442\u043e\u0431\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0435\u0435, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<pre><code class=\"bash\">npm install -g @graphprotocol\/graph-cli<\/code><\/pre>\n<p>\u0438\u043b\u0438<\/p>\n<pre><code class=\"bash\">yarn global add @graphprotocol\/graph-cli<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 &#171;graph init&#187;, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0443\u0434\u043e\u0431\u043d\u043e \u0441\u0440\u0430\u0437\u0443 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b (\u0445\u043e\u0442\u044f \u043c\u043e\u0436\u043d\u043e \u0432\u0432\u043e\u0434\u0438\u0442\u044c \u0438\u0445 \u043f\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0443):<\/p>\n<pre><code class=\"bash\">graph init tornado_subgraph \/path\/to\/new\/project\/tornado \\   --protocol=ethereum --product=hosted-service \\   --allow-simple-name --contract-name TornadoContract \\   --from-contract=0x910Cbd523D972eb0a6f4cAe4618aD62622b39DbF \\   --index-events --start-block=17000000 --network=mainnet<\/code><\/pre>\n<p>\u0412\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u00abstart-block\u00bb \u043d\u0430 \u0431\u043b\u043e\u043a, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0435\u043b\u0438 \u0431\u044b \u043d\u0430\u0447\u0430\u0442\u044c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0431\u043b\u043e\u043a, \u043a\u043e\u0433\u0434\u0430 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u0431\u044b\u043b \u0437\u0430\u0434\u0435\u043f\u043b\u043e\u0435\u043d. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 <a href=\"https:\/\/etherscan.io\/\" rel=\"noopener noreferrer nofollow\">Etherscan<\/a>, \u043d\u0430\u0439\u0442\u0438 \u044d\u0442\u043e\u0442 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 0x910Cbd523D972eb0a6f4cAe4618aD62622b39DbF (\u0430\u0434\u0440\u0435\u0441 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430 \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430) \u0438 \u043f\u0440\u043e\u043b\u0438\u0441\u0442\u0430\u0442\u044c \u0434\u043e \u043f\u0435\u0440\u0432\u043e\u0439 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438. \u041d\u043e\u043c\u0435\u0440 \u0431\u043b\u043e\u043a\u0430 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u0443\u0434\u0435\u0442 9117720. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0437\u0434\u0435c\u044c \u0443\u043a\u0430\u0437\u0430\u043d\u043e, \u0447\u0442\u043e \u043b\u043e\u0433\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u0443\u0434\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 ethereum mainnet (\u043f\u043e\u043b\u044f &#8212;protocol \u0438 &#8212;network).<\/p>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043f\u0430\u043f\u043a\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043d\u0430 \u043b\u044e\u0431\u043e\u043c \u0445\u043e\u0441\u0442\u0438\u043d\u0433\u0435 \u0441\u0430\u0431\u0433\u0440\u0430\u0444\u043e\u0432. \u041d\u043e \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043b\u043e\u0433\u0433\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438 (events \u0432 \u043a\u043e\u0434\u0435 \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043e\u0432 \u043d\u0430 Solidity).<\/p>\n<h3>\u0427\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u044e\u0442 \u00ab\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043b\u043e\u0433\u0433\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438\u00bb<\/h3>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u043e\u0442\u043a\u0440\u043e\u0435\u0442\u0435 \u043a\u043e\u0434 \u044d\u0442\u043e\u0433\u043e \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Solidity, \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043b\u0430\u0441\u0441\u043e\u0432 <em>Contract<\/em>, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0438\u0445 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a <em>deposit<\/em> \u0438\u043b\u0438 <em>withdraw<\/em>:<\/p>\n<pre><code class=\"javascript\">function deposit(bytes32 _commitment) external payable nonReentrant {     require(!commitments[_commitment], \"The commitment has been submitted\");      uint32 insertedIndex = _insert(_commitment);     commitments[_commitment] = true;     _processDeposit();      emit Deposit(_commitment, insertedIndex, block.timestamp);   }  function withdraw(bytes calldata _proof, bytes32 _root, bytes32 _nullifierHash, address payable _recipient, address payable _relayer, uint256 _fee, uint256 _refund) external payable nonReentrant {     require(_fee &lt;= denomination, \"Fee exceeds transfer value\");     require(!nullifierHashes[_nullifierHash], \"The note has been already spent\");     require(isKnownRoot(_root), \"Cannot find your merkle root\"); \/\/ Make sure to use a recent one     require(verifier.verifyProof(_proof, [uint256(_root), uint256(_nullifierHash), uint256(_recipient), uint256(_relayer), _fee, _refund]), \"Invalid withdraw proof\");      nullifierHashes[_nullifierHash] = true;     _processWithdraw(_recipient, _relayer, _fee, _refund);     emit Withdrawal(_recipient, _nullifierHash, _relayer, _fee);   }<\/code><\/pre>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 \u043a\u043e\u043d\u0446\u0435 \u044d\u0442\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u0435 Deposit\/Withdrawal (\u0441\u0442\u0440\u043e\u043a\u0438 emit Deposit&#8230; \u0438  emit Withdrawal&#8230;). \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432 \u0441\u043a\u043e\u0431\u043a\u0430\u0445 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u044b \u0432 \u0436\u0443\u0440\u043d\u0430\u043b\u0435 \u0431\u043b\u043e\u043a\u0447\u0435\u0439\u043d\u0430, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043b\u0435\u0433\u043a\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441\u0430\u0431\u0433\u0440\u0430\u0444\u0430 (\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043b\u0438). \u042d\u0442\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0432 \u043a\u043e\u0434\u0435 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"javascript\">event Deposit(bytes32 indexed commitment, uint32 leafIndex, uint256 timestamp);  event Withdrawal(address to, bytes32 nullifierHash, address indexed relayer, uint256 fee);<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u0432\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043c\u043e\u0436\u0435\u0442\u0435 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0441\u0430\u0431\u0433\u0440\u0430\u0444 \u043d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 \u0445\u043e\u0441\u0442\u0438\u043d\u0433\u0430 \u0441\u0430\u0431\u0433\u0440\u0430\u0444\u043e\u0432, \u0438 \u0432\u0441\u0435 &#8212; \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 GraphQL-\u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e GraphQL \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c (\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u044f Withdrawal):<\/p>\n<pre><code class=\"bash\">{   withdrawals(first: 10) {     id     to     nullifierHash     relayer     fee     blockNumber     blockTimestamp     transactionHash   } }<\/code><\/pre>\n<p>\u0422\u0430\u043a, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0438\u043c\u0435\u0435\u0442\u0435 \u043a\u043e\u0434 \u0441\u0430\u0431\u0433\u0440\u0430\u0444\u0430 \u0438 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u043a\u0430\u043a \u0434\u0435\u043b\u0430\u0442\u044c \u043a \u043d\u0435\u043c\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0434\u0435\u043f\u043b\u043e\u0438\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0438 \u0434\u043e\u0436\u0434\u0430\u0442\u044c\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d. \u0417\u0434\u0435\u0441\u044c \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/docs.chainstack.com\/docs\/subgraphs-basic-workflow#deploy-a-subgraph\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b<\/a> \u0438 <a href=\"https:\/\/chainstack.com\/subgraphs-demo\/\" rel=\"noopener noreferrer nofollow\">\u0434\u0435\u043c\u043e<\/a> \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0441\u0430\u0431\u0433\u0440\u0430\u0444 \u043d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 Chainstack, \u043e\u0434\u043d\u0430\u043a\u043e \u0432\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u0443\u044e \u0434\u0440\u0443\u0433\u0443\u044e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u0447\u0442\u043e \u043c\u044b \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b &#171;<em>graph init<\/em>&#171;. \u0427\u0442\u043e\u0431\u044b \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c \u0441\u0430\u0431\u0433\u0440\u0430\u0444\u0430, \u0432\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441 3 \u0444\u0430\u0439\u043b\u0430\u043c\u0438.<\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u0444\u0430\u0439\u043b &#8212; &#171;<strong>subgraph.yaml<\/strong>&#187; &#8212; \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u043e\u043c. \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"yaml\">specVersion: 0.0.5 schema:   file: .\/schema.graphql dataSources:   - kind: ethereum     name: TornadoContract     network: mainnet     source:       address: \"0x910Cbd523D972eb0a6f4cAe4618aD62622b39DbF\"       abi: TornadoContract       startBlock: 17000000     mapping:       kind: ethereum\/events       apiVersion: 0.0.7       language: wasm\/assemblyscript       entities:         - Deposit         - Withdrawal       abis:         - name: TornadoContract           file: .\/abis\/TornadoContract.json       eventHandlers:         - event: Deposit(indexed bytes32,uint32,uint256)           handler: handleDeposit         - event: Withdrawal(address,bytes32,indexed address,uint256)           handler: handleWithdrawal       file: .\/src\/tornado-contract.ts<\/code><\/pre>\n<p>\u0412\u0430\u0436\u043d\u044b\u043c\u0438 \u0432\u0435\u0449\u0430\u043c\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f (\u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b\u0438 \u043f\u0440\u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u0430\u0431\u0433\u0440\u0430\u0444\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 graph init): chain\/network, startBlock, \u0438, \u043a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0438 \u043f\u0443\u0442\u0438 \u043a \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u0444\u0430\u0439\u043b\u0430\u043c. \u0412\u0441\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439.<\/p>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 \u0444\u0430\u0439\u043b, <strong>schema.graphql<\/strong>, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442, \u043a\u0430\u043a \u0431\u0443\u0434\u0443\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u043d\u0430\u0448\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0441\u043e\u0431\u044b\u0442\u0438\u0439. \u0424\u0430\u0439\u043b \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043c\u0430\u0440\u0442-\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code>type Deposit @entity(immutable: true) {   id: Bytes!   commitment: Bytes! # bytes32   leafIndex: BigInt! # uint32   timestamp: BigInt! # uint256   blockNumber: BigInt!   blockTimestamp: BigInt!   transactionHash: Bytes! }  type Withdrawal @entity(immutable: true) {   id: Bytes!   to: Bytes! # address   nullifierHash: Bytes! # bytes32   relayer: Bytes! # address   fee: BigInt! # uint256   blockNumber: BigInt!   blockTimestamp: BigInt!   transactionHash: Bytes! }<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0447\u0442\u043e-\u0442\u043e, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u044d\u0442\u043e \u043f\u0440\u044f\u043c\u043e \u0432 \u044d\u0442\u043e\u043c \u0444\u0430\u0439\u043b\u0435. \u041d\u043e \u044d\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u0430 \u043d\u0435 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0438\u0445 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c. \u0417\u0434\u0435\u0441\u044c \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 <a href=\"https:\/\/docs.chainstack.com\/docs\/subgraphs-tutorial-working-with-schemas\" rel=\"noopener noreferrer nofollow\">\u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b<\/a>, \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u044e\u0449\u0438\u0439 \u043a\u0430\u043a \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u0441\u0445\u0435\u043c\u044b \u0441\u0430\u0431\u0433\u0440\u0430\u0444\u043e\u0432.<\/p>\n<p>\u0422\u0440\u0435\u0442\u0438\u0439 \u0444\u0430\u0439\u043b, <strong>src\/tornado-contract.ts<\/strong> &#8212; \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 (\u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u0441\u043e\u0431\u044b\u0442\u0438\u0439!) \u0438 \u043a\u0430\u043a \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0438\u0445 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u043e\u043f\u0438\u0441\u0430\u043b\u0438 \u0432\u044b\u0448\u0435. \u042d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"javascript\">import {   Deposit as DepositEvent,   Withdrawal as WithdrawalEvent } from \"..\/generated\/TornadoContract\/TornadoContract\" import { Deposit, Withdrawal } from \"..\/generated\/schema\" import { Address, BigInt } from \"@graphprotocol\/graph-ts\" import { TornadoContract } from \"..\/generated\/TornadoContract\/TornadoContract\"  export function handleDeposit(event: DepositEvent): void {   let entity = new Deposit(     event.transaction.hash.concatI32(event.logIndex.toI32())   )    entity.commitment = event.params.commitment   entity.leafIndex = event.params.leafIndex   entity.timestamp = event.params.timestamp    entity.blockNumber = event.block.number   entity.blockTimestamp = event.block.timestamp   entity.transactionHash = event.transaction.hash    entity.save() }  export function handleWithdrawal(event: WithdrawalEvent): void {   let entity = new Withdrawal(     event.transaction.hash.concatI32(event.logIndex.toI32())   )   entity.to = event.params.to   entity.nullifierHash = event.params.nullifierHash   entity.relayer = event.params.relayer   entity.fee = event.params.fee    entity.blockNumber = event.block.number   entity.blockTimestamp = event.block.timestamp   entity.transactionHash = event.transaction.hash    entity.save() }<\/code><\/pre>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u0432 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u043e\u043f\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043f\u043e\u043b\u0435\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 &#171;event&#187; \u0432 \u043e\u0431\u044a\u0435\u043a\u0442 Deposit\/Withdrawal \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u0438. \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0431\u044b\u043b \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442 \u0431\u0435\u0437 \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439.<\/p>\n<p>\u041d\u043e \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0439 \u0441 Tornado<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-352106","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/352106","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=352106"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/352106\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=352106"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=352106"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=352106"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}