<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Developers Forum for XinFin XDC Network: xu zhaolin</title>
    <description>The latest articles on Developers Forum for XinFin XDC Network by xu zhaolin (@xu_zhaolin_fcf881856ae0b5).</description>
    <link>https://www.xdc.dev/xu_zhaolin_fcf881856ae0b5</link>
    <image>
      <url>https://www.xdc.dev/images/NHaXSESEEf6s38rcgooaK0lcfUVMdPis7kuSP7slZTM/rs:fill:90:90/mb:500000/ar:1/aHR0cHM6Ly93d3cu/eGRjLmRldi91cGxv/YWRzL3VzZXIvcHJv/ZmlsZV9pbWFnZS8x/ODIvOTc3N2ZhMjUt/OWY5ZC00NmY2LWJh/NmEtYjFlZGNkZDEy/ZTYyLnBuZw</url>
      <title>Developers Forum for XinFin XDC Network: xu zhaolin</title>
      <link>https://www.xdc.dev/xu_zhaolin_fcf881856ae0b5</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://www.xdc.dev/feed/xu_zhaolin_fcf881856ae0b5"/>
    <language>en</language>
    <item>
      <title>Weekly Update</title>
      <dc:creator>xu zhaolin</dc:creator>
      <pubDate>Fri, 28 Oct 2022 09:26:58 +0000</pubDate>
      <link>https://www.xdc.dev/xu_zhaolin_fcf881856ae0b5/weekly-update-2di5</link>
      <guid>https://www.xdc.dev/xu_zhaolin_fcf881856ae0b5/weekly-update-2di5</guid>
      <description>&lt;p&gt;Dear All Community Members&lt;br&gt;
Currently we have finished xsswap and supporting globiance by building sdk. In addition, we are trying to add XinFin and Apothem in metamask. Below are what we have done this week.Feel free to comment.&lt;/p&gt;

&lt;p&gt;1 Hummingbot&lt;br&gt;
Swith to xsswap from xdcswap:&lt;br&gt;
&lt;a href="https://github.com/Carry-So/xsswap-sdk"&gt;https://github.com/Carry-So/xsswap-sdk&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.npmjs.com/package/xsswap-sdk"&gt;https://www.npmjs.com/package/xsswap-sdk&lt;/a&gt;&lt;br&gt;
Create globiance-sdk v1.0.0-beta:&lt;br&gt;
&lt;a href="https://github.com/Carry-So/globiance-sdk"&gt;https://github.com/Carry-So/globiance-sdk&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.npmjs.com/package/globiance-sdk"&gt;https://www.npmjs.com/package/globiance-sdk&lt;/a&gt;&lt;br&gt;
Support globiance exchange on xinfin chain execpt WXDC token: symbol conflict with another WXDC token&lt;br&gt;
Refactor documents: &lt;a href="https://github.com/Carry-So/hummingbot/blob/xdc-release-1.8.0/README.md"&gt;https://github.com/Carry-So/hummingbot/blob/xdc-release-1.8.0/README.md&lt;/a&gt;&lt;br&gt;
1.2 MetaMask&lt;br&gt;
Read documents&lt;br&gt;
Setup development environment&lt;br&gt;
2) Doing&lt;br&gt;
2.1 MetaMask&lt;br&gt;
Add xinfin and apothem as build-in network&lt;br&gt;
2.2 Hummingbot&lt;br&gt;
handle symbol conflict of WXDC: add 0x8A3cc832Bb6B255622E92dc9d4611F2A94d200DA to token list as WXDC2, pro100skm/xdc-token-list#3&lt;br&gt;
3) Plan&lt;br&gt;
3.1 MetaMask&lt;br&gt;
Add xinfin and apothem as build-in network&lt;br&gt;
Support xdc-prefix address&lt;br&gt;
3.2 Hummingbot&lt;br&gt;
Support globiance exchange: waiting for new contracts of testnet&lt;br&gt;
Submit PR to hummingbot&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Graphnode Xinfin Compatibility Project （Done）</title>
      <dc:creator>xu zhaolin</dc:creator>
      <pubDate>Tue, 16 Aug 2022 06:52:53 +0000</pubDate>
      <link>https://www.xdc.dev/xu_zhaolin_fcf881856ae0b5/graphnode-xinfin-compatibility-project-done-44mp</link>
      <guid>https://www.xdc.dev/xu_zhaolin_fcf881856ae0b5/graphnode-xinfin-compatibility-project-done-44mp</guid>
      <description>&lt;p&gt;Dear all，&lt;/p&gt;

&lt;p&gt;We have finished all the work that needed for graphnode to be compatible with XinFin netwwork. You can duplicate our steps to get the same results!&lt;br&gt;
&lt;em&gt;**&lt;br&gt;
We have modified some of the graph source code to make it compatible with xdc network! you must use the code we provide to implement our method.**&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/gzliudan/graph-node"&gt;https://github.com/gzliudan/graph-node&lt;/a&gt;&lt;br&gt;
Graphnode overview,we have modifeid it to be compatitable with the xdc!!!!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/gzliudan/parity-common"&gt;https://github.com/gzliudan/parity-common&lt;/a&gt;&lt;br&gt;
gzliudan/parity-common: Collection of crates used in Parity projects&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/gzliudan/bad-token-subgraph"&gt;https://github.com/gzliudan/bad-token-subgraph&lt;/a&gt;&lt;br&gt;
The subgraph for XRC20 on blockchain XinFin and Apothem&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/gzliudan/stake-subgraph"&gt;https://github.com/gzliudan/stake-subgraph&lt;/a&gt;&lt;br&gt;
The subgraph for StakeContract on blockchain XinFin and Apothem&lt;/p&gt;

&lt;p&gt;Step-by-Step tutorial&lt;/p&gt;
&lt;h1&gt;
  
  
  Deploy the Graph
&lt;/h1&gt;

&lt;p&gt;Deploy three daemons：IPFS, PostgreSql, and graph-indexer. Ipfs and graph-indexer should run with the current user right.&lt;/p&gt;
&lt;h2&gt;
  
  
  1、Install IPFS
&lt;/h2&gt;

&lt;p&gt;full tutorial： &lt;a href="https://docs.ipfs.io/install/command-line/#official-distributions"&gt;https://docs.ipfs.io/install/command-line/#official-distributions&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  1.1 Modify UDP Receive Buffer Size
&lt;/h3&gt;

&lt;p&gt;Tutorial： &lt;a href="https://github.com/lucas-clemente/quic-go/wiki/UDP-Receive-Buffer-Size"&gt;https://github.com/lucas-clemente/quic-go/wiki/UDP-Receive-Buffer-Size&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;sysctl &lt;span class="nt"&gt;-w&lt;/span&gt; net.core.rmem_max&lt;span class="o"&gt;=&lt;/span&gt;2500000
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"net.core.rmem_max=2500000"&lt;/span&gt; | &lt;span class="nb"&gt;sudo tee&lt;/span&gt; &lt;span class="nt"&gt;-a&lt;/span&gt; /etc/sysctl.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  1.2 Instal IPFS
&lt;/h3&gt;

&lt;p&gt;Tutorial： &lt;a href="https://docs.ipfs.io/install/command-line/#official-distributions"&gt;https://docs.ipfs.io/install/command-line/#official-distributions&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;wget https://dist.ipfs.io/kubo/v0.14.0/kubo_v0.14.0_linux-amd64.tar.gz
&lt;span class="nb"&gt;tar&lt;/span&gt; &lt;span class="nt"&gt;-xvzf&lt;/span&gt; kubo_v0.14.0_linux-amd64.tar.gz
&lt;span class="nb"&gt;cd &lt;/span&gt;kubo
&lt;span class="nb"&gt;sudo &lt;/span&gt;bash install.sh
ipfs &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  1.3 Initialize IPFS
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;IPFS_PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"/var/lib/ipfs"&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s1"&gt;'export IPFS_PATH="/var/lib/ipfs"'&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;HOME&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;/.bashrc

&lt;span class="nv"&gt;USER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;&lt;span class="nb"&gt;whoami&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="nb"&gt;sudo mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; /var/lib/ipfs
&lt;span class="nb"&gt;sudo chown&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;USER&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;:&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;USER&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt; &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;IPFS_PATH&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;
&lt;span class="nb"&gt;sudo chmod &lt;/span&gt;ug+rwx &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;IPFS_PATH&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;

ipfs init
&lt;span class="nb"&gt;cp&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;IPFS_PATH&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;/config &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;IPFS_PATH&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;/config.bak
&lt;span class="nb"&gt;sed&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="s2"&gt;"s#/ip4/127.0.0.1/tcp/5001#/ip4/0.0.0.0/tcp/5001#g"&lt;/span&gt; &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;IPFS_PATH&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;/config
ipfs config &lt;span class="nt"&gt;--json&lt;/span&gt; API.HTTPHeaders.Access-Control-Allow-Origin &lt;span class="s1"&gt;'["http://192.168.2.162:5001", "http://127.0.0.1:5001"]'&lt;/span&gt;
ipfs config &lt;span class="nt"&gt;--json&lt;/span&gt; API.HTTPHeaders.Access-Control-Allow-Methods &lt;span class="s1"&gt;'["PUT", "POST"]'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  1.4 Creat Service
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo tee&lt;/span&gt; /etc/systemd/system/ipfs.service &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="no"&gt;EOF&lt;/span&gt;&lt;span class="sh"&gt;
[Unit]
Description=InterPlanetary File System (IPFS) daemon
Documentation=https://docs.ipfs.tech/
After=network.target
Requires=network.target

[Service]
Type=simple
User=&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;USER&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;
Group=&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;USER&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;
Environment="IPFS_PATH=&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;IPFS_PATH&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"
Environment="IPFS_FD_MAX=8192"
LimitNOFILE=8192
MemorySwapMax=0
# TimeoutStartSec=infinity
WorkingDirectory=&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;IPFS_PATH&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;
ExecStart=/usr/local/bin/ipfs daemon
RestartSec=10
Restart=always
KillSignal=SIGINT
StandardOutput=journal
StandardError=journal

[Install]
WantedBy=default.target
&lt;/span&gt;&lt;span class="no"&gt;EOF

&lt;/span&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl daemon-reload
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl &lt;span class="nb"&gt;enable &lt;/span&gt;ipfs
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl start ipfs
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl status ipfs
curl &lt;span class="nt"&gt;-X&lt;/span&gt; POST http://127.0.0.1:5001/api/v0/version
&lt;span class="c"&gt;# response: {"Version":"0.14.0","Commit":"","Repo":"12","System":"amd64/linux","Golang":"go1.18.3"}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2、Install PostgreSQL
&lt;/h2&gt;

&lt;p&gt;Tutorial： &lt;a href="https://www.postgresql.org/download/linux/ubuntu/"&gt;https://www.postgresql.org/download/linux/ubuntu/&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;database username: graph&lt;/li&gt;
&lt;li&gt;password: daniel2022&lt;/li&gt;
&lt;li&gt;listener ports: 5432&lt;/li&gt;
&lt;li&gt;database name: apothem_db、xinfin_db&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2.1 Modify the kernel parameter
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; /proc/sys/vm/swappiness
&lt;span class="nb"&gt;sudo &lt;/span&gt;bash &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s2"&gt;"sysctl -w vm.swappiness=1"&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"vm.swappiness=1"&lt;/span&gt; | &lt;span class="nb"&gt;sudo tee&lt;/span&gt; &lt;span class="nt"&gt;-a&lt;/span&gt; /etc/sysctl.conf
&lt;span class="nb"&gt;cat&lt;/span&gt; /proc/sys/vm/swappiness
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2.2 Install language support(i use Chinese here)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; language-pack-zh&lt;span class="k"&gt;*&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2.3 Install software
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Create the file repository configuration:&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;sh &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s1"&gt;'echo "deb [arch=$(dpkg --print-architecture)] http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" &amp;gt; /etc/apt/sources.list.d/pgdg.list'&lt;/span&gt;

&lt;span class="c"&gt;# Import the repository signing key:&lt;/span&gt;
&lt;span class="c"&gt;# wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -&lt;/span&gt;
wget &lt;span class="nt"&gt;--quiet&lt;/span&gt; &lt;span class="nt"&gt;-O&lt;/span&gt; - https://www.postgresql.org/media/keys/ACCC4CF8.asc | &lt;span class="nb"&gt;sudo tee&lt;/span&gt; /etc/apt/trusted.gpg.d/postgresql.asc

&lt;span class="c"&gt;# Update the package lists:&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update

&lt;span class="c"&gt;# Install PostgreSQL 14&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; postgresql-14 postgresql-client-14 postgresql-server-dev-14 libpq-dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2.4 Backup config file
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /etc/postgresql/14/main
&lt;span class="nb"&gt;sudo cp&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; pg_hba.conf pg_hba.conf.&lt;span class="sb"&gt;`&lt;/span&gt;&lt;span class="nb"&gt;date&lt;/span&gt; +%Y%m%d-%H%M%S&lt;span class="sb"&gt;`&lt;/span&gt;
&lt;span class="nb"&gt;sudo cp&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; postgresql.conf postgresql.conf.&lt;span class="sb"&gt;`&lt;/span&gt;&lt;span class="nb"&gt;date&lt;/span&gt; +%Y%m%d-%H%M%S&lt;span class="sb"&gt;`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2.5 Modify pg_hba.conf
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo tee&lt;/span&gt; /etc/postgresql/14/main/pg_hba.conf &lt;span class="o"&gt;&amp;lt;&amp;lt;-&lt;/span&gt;&lt;span class="sh"&gt;\&lt;/span&gt;&lt;span class="no"&gt;EOF&lt;/span&gt;&lt;span class="sh"&gt;
# Database administrative login by Unix domain socket
local   all             postgres                                peer

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     md5
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
local   replication     all                                     peer
host    replication     all             127.0.0.1/32            md5
host    replication     all             ::1/128                 md5
&lt;/span&gt;&lt;span class="no"&gt;EOF
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2.6 Some parameters adjustments
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo tee&lt;/span&gt; /etc/postgresql/14/main/conf.d/liudan.conf &lt;span class="o"&gt;&amp;lt;&amp;lt;-&lt;/span&gt;&lt;span class="sh"&gt;\&lt;/span&gt;&lt;span class="no"&gt;EOF&lt;/span&gt;&lt;span class="sh"&gt;
listen_addresses = '*'
port = 5432

tcp_keepalives_idle = 300
tcp_keepalives_interval = 20
tcp_keepalives_count = 9

log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log'
log_line_prefix = '%m:%r:%u@%d:[%p]: '
log_rotation_age = 1d
lc_messages = 'en_US.UTF-8'            # log is shown in English

shared_preload_libraries = 'pg_stat_statements'
&lt;/span&gt;&lt;span class="no"&gt;EOF
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2.7 change os user's postgres password
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo &lt;/span&gt;postgres:daniel2022 | &lt;span class="nb"&gt;sudo &lt;/span&gt;chpasswd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2.8 start the database
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# pg_ctlcluster 14 main start&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl daemon-reload
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart postgresql@14-main
systemctl status postgresql@14-main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2.9 change database user's postgres password
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;su - postgres
psql &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s2"&gt;"ALTER ROLE postgres WITH PASSWORD 'daniel2022';"&lt;/span&gt;
&lt;span class="nb"&gt;exit&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2.10 Creat Database
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;create user of the database: graph&lt;/li&gt;
&lt;li&gt;create database： apothem_db and xinfin_db
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;PGPASSWORD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;daniel2022 psql &lt;span class="nt"&gt;-X&lt;/span&gt; &lt;span class="nt"&gt;-h&lt;/span&gt; 127.0.0.1 &lt;span class="nt"&gt;-U&lt;/span&gt; postgres postgres &lt;span class="o"&gt;&amp;lt;&amp;lt;-&lt;/span&gt;&lt;span class="sh"&gt;\&lt;/span&gt;&lt;span class="no"&gt;EOF&lt;/span&gt;&lt;span class="sh"&gt;
CREATE USER graph WITH PASSWORD 'daniel2022' nocreatedb;
CREATE DATABASE apothem_db WITH OWNER=graph TEMPLATE=template0 LC_COLLATE='zh_CN.UTF8' LC_CTYPE='zh_CN.UTF8' ENCODING='utf8';
CREATE DATABASE xinfin_db WITH OWNER=graph TEMPLATE=template0 LC_COLLATE='zh_CN.UTF8' LC_CTYPE='zh_CN.UTF8' ENCODING='utf8';
&lt;/span&gt;&lt;span class="no"&gt;EOF
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2.11 Create extension
&lt;/h3&gt;

&lt;p&gt;create extension： pg_trgm、pg_stat_statements、btree_gist、postgres_fdw&lt;/p&gt;

&lt;h4&gt;
  
  
  2.11.1 testnet apothem
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;PGPASSWORD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;daniel2022 psql &lt;span class="nt"&gt;-X&lt;/span&gt; &lt;span class="nt"&gt;-h&lt;/span&gt; 127.0.0.1 &lt;span class="nt"&gt;-U&lt;/span&gt; postgres apothem_db &lt;span class="o"&gt;&amp;lt;&amp;lt;-&lt;/span&gt;&lt;span class="sh"&gt;\&lt;/span&gt;&lt;span class="no"&gt;EOF&lt;/span&gt;&lt;span class="sh"&gt;
CREATE EXTENSION pg_trgm;
CREATE EXTENSION pg_stat_statements;
GRANT ALL ON FUNCTION pg_stat_statements_reset TO graph;
CREATE EXTENSION btree_gist;
CREATE EXTENSION postgres_fdw;
GRANT USAGE ON FOREIGN DATA WRAPPER postgres_fdw TO graph;
&lt;/span&gt;&lt;span class="no"&gt;EOF
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  2.11.2 production net xinfin
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;PGPASSWORD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;daniel2022 psql &lt;span class="nt"&gt;-X&lt;/span&gt; &lt;span class="nt"&gt;-h&lt;/span&gt; 127.0.0.1 &lt;span class="nt"&gt;-U&lt;/span&gt; postgres xinfin_db &lt;span class="o"&gt;&amp;lt;&amp;lt;-&lt;/span&gt;&lt;span class="sh"&gt;\&lt;/span&gt;&lt;span class="no"&gt;EOF&lt;/span&gt;&lt;span class="sh"&gt;
CREATE EXTENSION pg_trgm;
CREATE EXTENSION pg_stat_statements;
GRANT ALL ON FUNCTION pg_stat_statements_reset TO graph;
CREATE EXTENSION btree_gist;
CREATE EXTENSION postgres_fdw;
GRANT USAGE ON FOREIGN DATA WRAPPER postgres_fdw TO graph;
&lt;/span&gt;&lt;span class="no"&gt;EOF
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2.12 setting up environment for psql ：
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;HOME&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;/.bashrc &lt;span class="o"&gt;&amp;lt;&amp;lt;-&lt;/span&gt;&lt;span class="sh"&gt;\&lt;/span&gt;&lt;span class="no"&gt;EOF&lt;/span&gt;&lt;span class="sh"&gt;
export PGHOST=127.0.0.1
export PGPORT=5432
export PGDATABASE=apothem_db
export PGUSER=graph
export PGPASSWORD=daniel2022
&lt;/span&gt;&lt;span class="no"&gt;EOF

&lt;/span&gt;&lt;span class="nb"&gt;source&lt;/span&gt; &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;HOME&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;/.bashrc

&lt;span class="nb"&gt;cat&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;HOME&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;/.psqlrc &lt;span class="o"&gt;&amp;lt;&amp;lt;-&lt;/span&gt;&lt;span class="sh"&gt;\&lt;/span&gt;&lt;span class="no"&gt;EOF&lt;/span&gt;&lt;span class="sh"&gt;
&lt;/span&gt;&lt;span class="se"&gt;\s&lt;/span&gt;&lt;span class="sh"&gt;et PROMPT1 '%`date +%H:%M:%S` (%n@%M:%&amp;gt;)%/%R%#%x '
&lt;/span&gt;&lt;span class="se"&gt;\s&lt;/span&gt;&lt;span class="sh"&gt;et PROMPT2 '%M %n@%/%R%# '
&lt;/span&gt;&lt;span class="se"&gt;\t&lt;/span&gt;&lt;span class="sh"&gt;iming on
&lt;/span&gt;&lt;span class="no"&gt;EOF
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  3、Install graph-node
&lt;/h2&gt;

&lt;p&gt;Tutorial：&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/graphprotocol/graph-node/blob/master/docs/config.md"&gt;https://github.com/graphprotocol/graph-node/blob/master/docs/config.md&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/graphprotocol/graph-node/blob/master/node/resources/tests/full_config.toml"&gt;https://github.com/graphprotocol/graph-node/blob/master/node/resources/tests/full_config.toml&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Running a Graph Node on Moonbeam: &lt;a href="https://docs.moonbeam.network/node-operators/indexer-nodes/thegraph-node/"&gt;https://docs.moonbeam.network/node-operators/indexer-nodes/thegraph-node/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Deploy and Configure Graph-node: &lt;a href="https://docs.thegraph.academy/official-docs/indexer/testnet/graph-protocol-testnet-baremetal/3_deployandconfiguregraphnode"&gt;https://docs.thegraph.academy/official-docs/indexer/testnet/graph-protocol-testnet-baremetal/3_deployandconfiguregraphnode&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3.1 Create log files directory
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;USER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;&lt;span class="nb"&gt;whoami&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="nb"&gt;sudo mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; /var/log/graph
&lt;span class="nb"&gt;sudo chown&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;USER&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;:&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;USER&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt; /var/log/graph
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3.2 Create config files directory
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;USER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;&lt;span class="nb"&gt;whoami&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="nb"&gt;sudo mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; /etc/graph-node
&lt;span class="nb"&gt;sudo chown&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;USER&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;:&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;USER&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt; /etc/graph-node
&lt;span class="nb"&gt;touch&lt;/span&gt; /etc/graph-node/expensive-queries.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3.3 Install Rust
&lt;/h3&gt;

&lt;p&gt;安装或者更新:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cargo &lt;span class="nt"&gt;-V&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$?&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; 0 &lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
    &lt;/span&gt;rustup update stable
&lt;span class="k"&gt;else
    &lt;/span&gt;curl &lt;span class="nt"&gt;--proto&lt;/span&gt; &lt;span class="s1"&gt;'=https'&lt;/span&gt; &lt;span class="nt"&gt;--tlsv1&lt;/span&gt;.2 &lt;span class="nt"&gt;-sSf&lt;/span&gt; https://sh.rustup.rs | sh
    &lt;span class="nb"&gt;source&lt;/span&gt; &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;HOME&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;/.cargo/env
&lt;span class="k"&gt;fi
&lt;/span&gt;cargo &lt;span class="nt"&gt;-V&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3.4 Download graph-node complier,we have modified the graphnode code! Make sure you download it from our github!
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; cmake

&lt;span class="nb"&gt;cd&lt;/span&gt; &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;HOME&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;
git clone https://github.com/gzliudan/graph-node graph-node.xdc
&lt;span class="nb"&gt;cd &lt;/span&gt;graph-node.xdc
git checkout &lt;span class="nt"&gt;-b&lt;/span&gt; xdc origin/xdc
cargo build &lt;span class="nt"&gt;--release&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3.5 Create a startup Script
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;HOME&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;/start-graph-indexer.sh &lt;span class="o"&gt;&amp;lt;&amp;lt;-&lt;/span&gt;&lt;span class="sh"&gt;\&lt;/span&gt;&lt;span class="no"&gt;EOF&lt;/span&gt;&lt;span class="sh"&gt;
#!/bin/bash

export CHAIN="&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="sh"&gt;"

# export GRAPH_LOG="trace"
# export GRAPH_LOG="debug"
export GRAPH_LOG_TIME_FORMAT="%Y-%m-%d %H:%M:%S"
LOG_FILE="/var/log/graph/indexer-&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;CHAIN&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;-`/usr/bin/date +%Y%m%d`.log"

&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;HOME&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;/graph-node.xdc/target/release/graph-node &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="sh"&gt;
  --node-id indexer_&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;CHAIN&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="sh"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="sh"&gt;
  --postgres-url postgresql://graph:daniel2022@localhost:5432/&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;CHAIN&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;_db &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="sh"&gt;
  --ethereum-rpc &lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;CHAIN&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;:https://arpc.&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;CHAIN&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;.network &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="sh"&gt;
  --ipfs 127.0.0.1:5001 &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="sh"&gt;
  --expensive-queries-filename /etc/graph-node/expensive-queries.txt &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="sh"&gt;
  &amp;gt;&amp;gt; &lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;LOG_FILE&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="sh"&gt; 2&amp;gt;&amp;amp;1
&lt;/span&gt;&lt;span class="no"&gt;EOF
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;chmod +x ${HOME}/start-graph-indexer.sh&lt;/p&gt;

&lt;h3&gt;
  
  
  3.6 Create service files
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;USER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;&lt;span class="nb"&gt;whoami&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="nb"&gt;sudo tee&lt;/span&gt; /usr/lib/systemd/system/graph-indexer@.service &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="no"&gt;EOF&lt;/span&gt;&lt;span class="sh"&gt;
[Unit]
Description=Graph indexer node %i
After=network.target ipfs.service
Wants=network.target ipfs.service

[Service]
User=&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;USER&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;
Group=&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;USER&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;
WorkingDirectory=/home/&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;USER&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;/
StandardOutput=journal
StandardError=journal
Type=simple
Restart=always
RestartSec=5
ExecStart=/home/&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;USER&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;/start-graph-indexer.sh %i

[Install]
WantedBy=default.target
&lt;/span&gt;&lt;span class="no"&gt;EOF

&lt;/span&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl daemon-reload
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl &lt;span class="nb"&gt;enable &lt;/span&gt;graph-indexer@apothem
&lt;span class="c"&gt;# sudo systemctl disable graph-indexer@apothem&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl start graph-indexer@apothem
systemctl status graph-indexer@apothem
&lt;span class="c"&gt;# sudo systemctl stop graph-indexer@apothem&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3.7 Time setting to restart the indexer service
&lt;/h3&gt;

&lt;p&gt;examine cron job: &lt;code&gt;sudo crontab -l -u root&lt;/code&gt;&lt;br&gt;
add corn job to root account: &lt;code&gt;sudo crontab -e -u root&lt;/code&gt;&lt;br&gt;&lt;br&gt;
restart service daily: &lt;code&gt;0 0 * * * /usr/bin/systemctl restart graph-indexer@apothem.service&lt;/code&gt;&lt;br&gt;&lt;br&gt;
examine the task: &lt;code&gt;sudo crontab -l -u root&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  3.8 TODO
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;you can always pull the source code, comply and restart the service by adding a timed task if you need.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Query with sample
&lt;/h2&gt;

&lt;p&gt;Tutorial： &lt;a href="https://thegraph.com/hosted-service/subgraph/gzliudan/bad-token-mumbai"&gt;https://thegraph.com/hosted-service/subgraph/gzliudan/bad-token-mumbai&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://103.101.129.136:8000/subgraphs/name/gzliudan/bad-token-subgraph-apothem"&gt;http://103.101.129.136:8000/subgraphs/name/gzliudan/bad-token-subgraph-apothem&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight graphql"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="n"&gt;erc20Contracts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;first&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="n"&gt;symbol&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="n"&gt;decimals&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="n"&gt;totalSupply&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="n"&gt;valueExact&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="n"&gt;accounts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;first&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="n"&gt;isErc20&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="n"&gt;blackLists&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="n"&gt;Erc20balances&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="n"&gt;blackLists&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;first&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="n"&gt;members&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>xdc dosent suport eth_call with specific blockhash</title>
      <dc:creator>xu zhaolin</dc:creator>
      <pubDate>Fri, 12 Aug 2022 16:46:05 +0000</pubDate>
      <link>https://www.xdc.dev/xu_zhaolin_fcf881856ae0b5/xdc-dosent-suport-ethcall-with-specific-blockhash-2p65</link>
      <guid>https://www.xdc.dev/xu_zhaolin_fcf881856ae0b5/xdc-dosent-suport-ethcall-with-specific-blockhash-2p65</guid>
      <description>&lt;p&gt;We are doing graph-node compatibility project.&lt;/p&gt;

&lt;p&gt;We post &lt;/p&gt;

&lt;p&gt;curl -X POST &lt;a href="https://arpc.apothem.network/"&gt;https://arpc.apothem.network/&lt;/a&gt; -H "Content-Type: application/json" -d '&lt;br&gt;
{&lt;br&gt;
    "id": 348,&lt;br&gt;
    "jsonrpc": "2.0",&lt;br&gt;
    "method": "eth_call",&lt;br&gt;
    "params": [&lt;br&gt;
        {&lt;br&gt;
            "data": "0x06fdde03",&lt;br&gt;
            "gas": "0x2faf080",&lt;br&gt;
            "to": "0x53350795c11cee781a7e174479778f848d76ab2a"&lt;br&gt;
        },&lt;br&gt;
        {&lt;br&gt;
            "blockHash": "0xe8ec0bfc021f839fd0a69ae89689e309632af2cc434e8a096732068f0736864b"&lt;br&gt;
        }&lt;br&gt;
    ]&lt;br&gt;
}'&lt;/p&gt;

&lt;p&gt;The response became &lt;/p&gt;

&lt;p&gt;{"jsonrpc":"2.0","id":348,"error":{"code":-32602,"message":"invalidargument 1: hex string without 0x prefix"}}&lt;/p&gt;

&lt;p&gt;It seems like xdc doesn’t support eth_call ?&lt;/p&gt;

&lt;p&gt;One more thing worth mentioning here.&lt;/p&gt;

&lt;p&gt;curl -X POST &lt;a href="https://arpc.apothem.network/"&gt;https://arpc.apothem.network/&lt;/a&gt; -H "Content-Type: application/json" -d '&lt;br&gt;
{&lt;br&gt;
    "id": 348,&lt;br&gt;
    "jsonrpc": "2.0",&lt;br&gt;
    "method": "eth_call",&lt;br&gt;
    "params": [&lt;br&gt;
        {&lt;br&gt;
            "data": "0x06fdde03",&lt;br&gt;
            "gas": "0x2faf080",&lt;br&gt;
            "to": "0x53350795c11cee781a7e174479778f848d76ab2a"&lt;br&gt;
        },&lt;br&gt;
        "latest"&lt;br&gt;
    ]&lt;br&gt;
}'&lt;/p&gt;

&lt;p&gt;If we change the second parameter to “latest “ it will return the correct value&lt;/p&gt;

&lt;p&gt;{"jsonrpc":"2.0","id":348,"result":"0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f44656d6f20476f6c6420546f6b656e0000000000000000000000000000000000"}&lt;/p&gt;

&lt;p&gt;which means xdc only supports eth_call when parameter is “latest”&lt;br&gt;
but not specific blockhash.&lt;/p&gt;

&lt;p&gt;This is a serious problem for graph-node compatibility because graph’s subgraph will extract readonly function via eth_call. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>issue：arpc responses with a blockhash that doesnt exist.</title>
      <dc:creator>xu zhaolin</dc:creator>
      <pubDate>Fri, 05 Aug 2022 09:27:06 +0000</pubDate>
      <link>https://www.xdc.dev/xu_zhaolin_fcf881856ae0b5/issue-30lo</link>
      <guid>https://www.xdc.dev/xu_zhaolin_fcf881856ae0b5/issue-30lo</guid>
      <description>&lt;p&gt;we are currently doing graphnode compatibility project,when we send request to arpc&lt;/p&gt;

&lt;p&gt;curl -X POST &lt;a href="https://arpc.apothem.network/"&gt;https://arpc.apothem.network/&lt;/a&gt; -H "Content-Type: application/json" -d '&lt;br&gt;
{&lt;br&gt;
    "id": 1610,&lt;br&gt;
    "jsonrpc": "2.0",&lt;br&gt;
    "method": "eth_getLogs",&lt;br&gt;
    "params": [&lt;br&gt;
        {&lt;br&gt;
            "address": "0x53350795c11cee781a7e174479778f848d76ab2a",&lt;br&gt;
            "fromBlock": "0x22b2277",&lt;br&gt;
            "toBlock": "0x22b2277",&lt;br&gt;
            "topics": [&lt;br&gt;
                [&lt;br&gt;
                    "0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925",&lt;br&gt;
                    "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",&lt;br&gt;
                    "0x6a12b3df6cba4203bd7fd06b816789f87de8c594299aed5717ae070fac781bac"&lt;br&gt;
                ]&lt;br&gt;
            ]&lt;br&gt;
        }&lt;br&gt;
    ]&lt;br&gt;
}'&lt;/p&gt;

&lt;p&gt;it returns the following&lt;/p&gt;

&lt;p&gt;{&lt;br&gt;
  "id": 1610,&lt;br&gt;
  "jsonrpc": "2.0",&lt;br&gt;
  "result": [&lt;br&gt;
    {&lt;br&gt;
      "address": "xdc53350795c11cee781a7e174479778f848d76ab2a",&lt;br&gt;
      "blockHash": "0x194a513ea40c94fccaca470cccb24c2ff3bd6398dec9a04e3eb3a4bfef8a330e",&lt;br&gt;
      "blockNumber": "0x22b2277",&lt;br&gt;
      "data": "0x000000000000000000000000000000000000000000084595161401484a000000",&lt;br&gt;
      "logIndex": "0x2",&lt;br&gt;
      "removed": false,&lt;br&gt;
      "topics": [&lt;br&gt;
        "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",&lt;br&gt;
        "0x0000000000000000000000000000000000000000000000000000000000000000",&lt;br&gt;
        "0x000000000000000000000000ce77393582d39048a4fc73770ab19d2b239c45dd"&lt;br&gt;
      ],&lt;br&gt;
      "transactionHash": "0xbebc0bab1a0f9844b86b8edf3a169bb1eef9337ac8d2684d5ae758b6521c12fe",&lt;br&gt;
      "transactionIndex": "0x1"&lt;br&gt;
    }&lt;br&gt;
  ]&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;and we found that the blockHash is 0x194a513ea40c94fccaca470cccb24c2ff3bd6398dec9a04e3eb3a4bfef8a330e which doesnt exist.&lt;/p&gt;

&lt;p&gt;Anyone knows the reason?&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
