Git Product home page Git Product logo

Comments (6)

abourget avatar abourget commented on July 17, 2024

So what are you trying to achieve? Is it your goal to make sure a transaction was properly included in a block after submitting it?

from eos-go.

smallnest avatar smallnest commented on July 17, 2024

I just want to test whether all APIs of EOS work well.

from eos-go.

abourget avatar abourget commented on July 17, 2024

I see.. GetTransaction require the history_api_plugin to be enabled. Do you have that enabled in your config.ini ?

from eos-go.

smallnest avatar smallnest commented on July 17, 2024

I have enabled history_plugin and history_api_plugin, but the code still does not work.

I have test with cleos and find it can returns the tx if I set block hint.

1、don't set block hint

cleos -u http://10.41.14.195:8888 get transaction a1e92e03acb199875aa859e5502778be0bd4b3dbd5bc391a8011ec08401d0771

returns

Error 3040011: The transaction can not be found
Error Details:
Transaction a1e92e03acb199875aa859e5502778be0bd4b3dbd5bc391a8011ec08401d0771 not found in history and no block hint was given

2、set block hint

cleos -u http://10.41.14.195:8888 get transaction -b 848 a1e92e03acb199875aa859e5502778be0bd4b3dbd5bc391a8011ec08401d0771
{
  "id": "a1e92e03acb199875aa859e5502778be0bd4b3dbd5bc391a8011ec08401d0771",
  "trx": {
    "receipt": {
      "status": "executed",
      "cpu_usage_us": 366,
      "net_usage_words": 55,
      "trx": [
        1,{
          "signatures": [
            "SIG_K1_KgqDGK5MJwFDphSEQib5qxyaCEYuvuf1oB8Z42kKKM2YABL4yFvvDYjokvx3UEPndq1uLMpQnMRXV27eechDG6DgZCi9Y8"
          ],
          "compression": "none",
          "packed_context_free_data": "",
          "packed_trx": "11d5995b4e03ef544bd9000000000100000000007a9ce200000000009031ad0100000000007a9ce20000000080ab26a7d902d7027b2274797065223a22706f7374222c2276657273696f6e223a312c22757269223a227376646476776566337172677267657267726567657267747267746572676567656740776569626f222c2264617461223a2265794a7a636d4d694f694a335a576c6962794973496d527559534936496a49784d7a45794d7a4930636a497a636d5a784d33517a4e4846305a6a4d305a6e4a6c6432646d5a584a6e636d566e5a534973496d6868633267694f694a7a646d526b646e646c5a6a4e78636d64795a3256795a334a6c5a3256795a3352795a33526c636d646c5a32566e49697769636d566a5a576c325a57526664476c745a534936496a49774d5467744d446b744d544e554d5445364d446b364d7a6b754d7a6b7a4d6a67314b7a41344f6a4177496e303d222c22636f6d6d69745f74696d65223a22323031382d30392d31335431313a30393a33392e3339333331332b30383a3030227d00"
        }
      ]
    },
    "trx": {
      "expiration": "2018-09-13T03:10:09",
      "ref_block_num": 846,
      "ref_block_prefix": 3645592815,
      "max_net_usage_words": 0,
      "max_cpu_usage_ms": 0,
      "delay_sec": 0,
      "context_free_actions": [],

from eos-go.

smallnest avatar smallnest commented on July 17, 2024

can add a method in API?

image

from eos-go.

smallnest avatar smallnest commented on July 17, 2024

@abourget Thanks.

I found the root is that I have not configured the filter-on so history_plugin has not make index for actions.

BTW, GetTransactionByIDAndHint is convenient if it will be added into the API

from eos-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.