If you are connecting to RSKj running locally connected to the RSK Testnet, and an address does not exist;
but that same address does exist on the RSK public nodes;
then you should check that your local node is fully synchronised.
To do this:
(1) Find out what the block number is on the public node:
curl \
-X POST \
-H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \
https://public-node.testnet.rsk.co/
This yields a large value of 0x1bfe36
which is 1834550
.
{"jsonrpc":"2.0","id":1,"result":"0x1bfe36"}
(2) Find out what the block number is on your local node:
curl \
-X POST \
-H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \
http://localhost:4444/
If you have a fresh start on your local RSKj,
and it has not been running for long,
you might get a small number in the result,
such as 0x3fff
, which is 16383
.
{"jsonrpc":"2.0","id":1,"result":"0x3fff"}
(3) Compare the two values
If these commands are run within a short period of time of each other,
they should have the same value,
and that would mean that your local node is fully synchronised.
However, as seen in the example above,
the local node had a block number whose value was less than the public node.
This means that it has not been fully synchronised.
If the smart contract at this particular address was deployed
after this particular number,
you will get the above error,
because nothing exists at that address.
The solution is to wait until your local node is
fully synchronised with the rest of the network (including the public node);
before running your query again.