EOSIO / eosjs

General purpose library for the EOSIO blockchain.
http://eosio.github.io/eosjs
MIT License
1.43k stars 462 forks source link

getTransaction is returning trx:null and block_num: 0 #166

Closed ghost closed 6 years ago

ghost commented 6 years ago

So I'm experimenting with the jungle testnetwork. Although I'm able to execte transfers etc I'm not able to do getTransaction for my executed transactions. However if I get the block in which my transaction is mined I can see my transaction. I'm probably missing something but can't find out what...

const client = eosjs({
    chainId: '7d47aae09c97dbc21d52c6d9f17bb70a1f1f2fda5f81b3ef18979b74b2070d8c', // 32 byte (64 char) hex string
    keyProvider: [sk], // WIF string or array of keys..
    httpEndpoint: 'http://dev.cryptolions.io:38888',
    broadcast: true,
    sign: true,
    debug: false,
    expireInSeconds: 60

});

client.getTransaction({
    id : "500ecb9dc02a18e10e7d766492043f5d94d527c01db0e49548df4c80c956ecc0"
}).then(x => console.log(x))

returns:

{ id: '500ecb9dc02a18e10e7d766492043f5d94d527c01db0e49548df4c80c956ecc0',
  trx: null,
  block_time: '2000-01-01T00:00:00.000',
  block_num: 0,
  last_irreversible_block: 559860,
  traces: [] }
heifner commented 6 years ago

The jungle testnet would need to be configured to track your transfers in the history_plugin with the --filter-on option for you to use getTransaction.