eosjs icon indicating copy to clipboard operation
eosjs copied to clipboard

How to get valid list for getActions

Open jeaimetu opened this issue 8 years ago • 7 comments

Hi, I used getActions for get account history. However, it returns "null". and I found this "Get Actions by account We can also query list of actions that have an account as a receiver. The only accounts queryable are those listed as the receiver in the --filter-on receiver:action:actor option."

So is there any way to "filter?" or activate the "filter?"

Currently, I did not found proper way, so I monitored new block and get information from there. But this is very hard job.

If getActions works properly, then it will be very helpful.

thanks.

jeaimetu avatar Jun 15 '18 02:06 jeaimetu

You need to turn the filter on .. it only applies to activity after the setting was enabled unless you reply the chain.

https://github.com/EOSIO/eosjs/blob/8bfcb3a347bdaded723ac420375dbe0c02b9c46e/docker/config.ini#L43-L44

The command-line option to nodeosd is: --filter-on "*"

jcalfee avatar Jun 15 '18 14:06 jcalfee

Thanks. But is it configuration of nodeos? Then how can I change the filter which resides api endpoint?

jeaimetu avatar Jun 25 '18 03:06 jeaimetu

Talk to the API endpoint provider .. However, unless it is a testnet another solution may be needed because that consumes extra resources. Maybe there is someone offering this as a paid service? Or maybe one of the block producers is offering this as part of their terms for being a block producer.

jcalfee avatar Jun 25 '18 15:06 jcalfee

@jcaifee set the mentioned config on may not a good option,the node would crash soon if set this option on,I raised a issue on the repository https://github.com/EOSIO/eos/issues/4484

crazybits avatar Jul 04 '18 23:07 crazybits

Hey @jcalfee , Currently when I run the eosScatter.getActions(account.name) it actually returns me the latest 20 transactions. So how can I remove that limit or increase that number ? Also let me know if there is a way to get the list of transactions of particular type like(issue or transfer or create type only ) ?

amolmaid avatar Sep 04 '18 12:09 amolmaid

Looks like you can take the the last row returned and use it as the new position

PARAMETERS
{
  "account_name": "account_name",
  "pos": {
    "type": "int32?",
    "doc": "An absolute sequence positon -1 is the end/last action"
  },
  "offset": {
    "type": "int32?",
    "doc": "The number of actions relative to pos, negative numbers return [pos-offset,pos), positive numbers return [pos,pos+offset)"
  }
}

jcalfee avatar Sep 04 '18 13:09 jcalfee

Thanks jcalfee for quick response, it really helped. :)

amolmaid avatar Sep 04 '18 13:09 amolmaid