bnb-chain / node-binary

Binaries for full nodes, light-weighted clients
179 stars 118 forks source link

Cannot find transaction by tx.height #252

Closed PeKir closed 4 years ago

PeKir commented 4 years ago

Hello, I have tried to run some tests in private-net:

Testnet-binaries docker file

FROM ubuntu:19.10

ARG BNC_VERSION=0.7.1
ARG CLI_VERSION=0.7.0
ARG CHAIN_ID=Binance-Dev

RUN apt-get update && \
    apt-get install -y git git-lfs

WORKDIR /binaries

RUN git clone --depth 1 https://github.com/binance-chain/node-binary.git .

RUN git lfs pull -I fullnode/testnet/${BNC_VERSION}/linux
RUN git lfs pull -I cli/testnet/${CLI_VERSION}/linux

RUN ./fullnode/testnet/${BNC_VERSION}/linux/bnbchaind testnet --acc-prefix tbnb --chain-id ${CHAIN_ID} --v 1

RUN sed -i "s/BEP12Height = 9223372036854775807/BEP12Height = 1/" ./mytestnet/node0/gaiad/config/app.toml

Node docker file

FROM alpine:3.9.4

ARG BNC_VERSION=0.7.1
ARG CLI_VERSION=0.7.0

WORKDIR /bnc

COPY --from=testnet-binaries /binaries/fullnode/testnet/${BNC_VERSION}/linux/bnbchaind ./
COPY --from=testnet-binaries /binaries/cli/testnet/${CLI_VERSION}/linux/tbnbcli ./
COPY --from=testnet-binaries /binaries/mytestnet/node0/gaiacli /root/.bnbcli
COPY --from=testnet-binaries /binaries/mytestnet/node0/gaiad /root/.bnbchaind

VOLUME ["/root/.bnbchaind/data"]

EXPOSE 26657

ENTRYPOINT ["./bnbchaind", "start"]

Docer-compose.yml

version: '3.0'
services:
  node:
    image: internal.cardinalchain.com:8123/bnc-node:0.7.1
    networks:
      - binance_rpc_net
    ports:
      - '26657:26657'
    volumes:
      - 'binance_data:/root/.bnbchaind/data'
  api-server:
    image: internal.cardinalchain.com:8123/bnc-api-server:0.7.1
    networks:
      - binance_rpc_net
    ports:
      - '8070:8080'
    command: ["http://node:26657"]
networks:
  binance_rpc_net:
volumes:
  binance_data:

After starting node everything works fine. I can create new address and send BNB token to it and get transaction by tx-hash from node, but request to Node:

curl "localhost:26657/tx_search?query=\"tx.height=10000\"&prove=true"

returns empty list.

Please tell me, maybe this is a problem with the NODE settings or problem with request to API?

chainwhisper commented 4 years ago

When your node is using state-sync to catch up, it will not store all the history blocks before the snapshot height it got. You can only query blocks after that snapshot height.

https://docs.binance.org/fullnodeissue.html#cannot-query-a-specific-block

PeKir commented 4 years ago

Thanks a lot! I missed this

chainwhisper commented 4 years ago

Close this for now.