terra-money / LocalTerra

One-click local Terra testnet and ecosystem for rapid prototyping

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't view transaction on LocalTerra in TerraStation and TerraFinder but contract is queriable through terrad

pchristou opened this issue · comments

terrad version: 0.5.10-oracle
localterra: v0.5.2
contract used: https://docs.terra.money/Tutorials/Smart-contracts/Interact-with-smart-contract.html#executing-the-contract

Weird issue: I can do everything, execute and query messages etc using terrad and I can see the LUNA going down in TerraStation for that testuser due to gas but, I can't see any contracts or trx history in TerraStation, LocalTerra or the LocalTerra Finder.

Here's the sequence of commands and messages I've sent. Contract is deployed to localterra and is queriable via terrad yet doesn't appear in TerraStation and when attempting to view via ui, it errors. Anything else I can check?

image

terrad tx wasm store artifacts/sc101.wasm --from test2 --chain-id=localterra --gas=auto --fees=100000uluna --broadcast-mode=block
// codeid = 9, tx = 846CBC4D6135F4F2FE5DBEA49ACCF80E10ED1D7194B5B371C4DDBDFBFC8F1002

terrad tx wasm instantiate 9 '{"count":0}' --from test2 --chain-id=localterra --fees=10000uluna --gas=auto --broadcast-mode=block --trace
// tx = E3D38B2D79985964464A36A763FBA6E47109CBEBC406434026B262BF6DD452F9
// Contract address: terra1qjrvlf27upqhqnrqmmu2y205ed2c3tc87dnku3

terrad tx wasm execute terra1qjrvlf27upqhqnrqmmu2y205ed2c3tc87dnku3 '{"reset":{"count":9}}' --from test2 --chain-id=localterra --fees=1000000uluna --gas=auto --broadcast-mode=block
// Reset counter to 9

terrad query wasm contract-store terra1qjrvlf27upqhqnrqmmu2y205ed2c3tc87dnku3 '{"get_count":{}}' 
// query_result:
//  count: 9

@pchristou

I believe the issue is because of outdated Docker version you have.

  • upgrade your Docker to most recent ( I had the same issue you have with Docker v 17.xx )
    or:
  • change Postgres version to older one:
  postgres:
    image: postgres:buster

in docker-compose.yml and run docker-compose up again.

@jeka-kiselyov thanks for the reply. Strangely enough, it started working about 10 days ago and then stopped working again after 4-5 days despite me not changing anything.

I updated my docker to version 20.10.10 but made no difference. I can only see the contract and related transactions I made Nov14th-17th. Very odd.

Is there a trace/debug log I can have a look at to try to get further insight into the issue? Or, any other ideas of what I can try? Manually uploading the .wasm file in TerraStation, just shows the "Broadcasting" message indefinitely.

Everything works fine via CLI/

@pchristou there's logs folder in localterra installation, I had the issue in api_error... one, showing Error: getaddrinfo EAI_AGAIN postgres..... Postgres error was one of the first messages when I run docker-compose up, so it was not that easy to notice. Downgrading Postgres helped.

cli worked ok too. The issue was with api only.

I ended up removing localterra entirely and cloning it fresh. I also made sure all containers/images were deleted in Docker. After re-running, it worked! Some dependency must have got mixed up at some point... if I get myself in a mess again, at least I know to repeat those steps. Thanks for all your help @jeka-kiselyov