GithubHelp home page GithubHelp logo

Comments (18)

jcalfee avatar jcalfee commented on June 16, 2024 1

published [email protected]

from eosjs.

blockplay avatar blockplay commented on June 16, 2024 1

@jcalfee I follow you steps, now can transfer without errors, and can query the transfer transaction, but the user balance no change. any idea ?

function testEos() {
      config = {
         keyProvider: ['5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3'], // WIF string or array of keys..
         httpEndpoint: 'http://127.0.0.1:8888',
         expireInSeconds: 60,
         broadcast: true,
         debug: false,
         sign: true
      }

      var eos = Eos.Localnet(config);
      eos.transfer('eosio', 'inita', '10 EOS', '', (err, res)=>{console.log(err,res)});
{transaction_id: "863d91727faf34f46399e93a293a21be2799535c513ad5a62875026c0b8dba41", broadcast: true, transaction: {…}}
cleos get transaction 863d91727faf34f46399e93a293a21be2799535c513ad5a62875026c0b8dba41

{
  "transaction_id": "863d91727faf34f46399e93a293a21be2799535c513ad5a62875026c0b8dba41",
  "transaction": {
    "signatures": [
      "EOSKBH73cAmQoPufAbuoQSYV6US4Pk6JVCLHHUmkGHjVaDgivuvd9L9wgc5jmAWP4hhwiMLQmd8syZpXZ4PjwHZaxNwqiAB8o"
    ],
    "compression": "none",
    "packed_context_free_data": "",
    "context_free_data": [],
    "packed_trx": "2048e15a00008744acd59d4100000000010000000000ea3055000000572d3ccdcd010000000000ea305500000000a8ed3232210000000000ea3055000000000093dd74a08601000000000004454f530000000000",
    "transaction": {
      "expiration": "2018-04-26T03:31:44",
      "region": 0,
      "ref_block_num": 17543,
      "ref_block_prefix": 1100862892,
      "max_net_usage_words": 0,
      "max_kcpu_usage": 0,
      "delay_sec": 0,
      "context_free_actions": [],
      "actions": [{
          "account": "eosio",
          "name": "transfer",
          "authorization": [{
              "actor": "eosio",
              "permission": "active"
            }
          ],
          "data": {
            "from": "eosio",
            "to": "inita",
            "quantity": "10.0000 EOS",
            "memo": ""
          },
          "hex_data": "0000000000ea3055000000000093dd74a08601000000000004454f530000000000"
        }
      ]
    }
  }
}

But query the inita balance, will return empty.

cleos get currency balance eosio.token inita

from eosjs.

nazmussakibsanim avatar nazmussakibsanim commented on June 16, 2024

+1 having the same error.

from eosjs.

nsjames avatar nsjames commented on June 16, 2024

I indeed ran into this as well. It looks like transfer is pointing at the eosio account which is bios now.

from eosjs.

nazmussakibsanim avatar nazmussakibsanim commented on June 16, 2024

Found the solution, you need to specify the currency contract and initiate a transaction from there.
eos.transaction('currency', currency => {
currency.transfer('inita', 'initb', '1 CUR', '')
})

from eosjs.

jcalfee avatar jcalfee commented on June 16, 2024

I think you have a version mis-match between eosjs and Localnet.. The unit tests in the eosjs/docker folder are passing. There is a simple version chart with links at the top of the README.md..

from eosjs.

jcalfee avatar jcalfee commented on June 16, 2024

If your building yourself from eosio master it can of course break on you at anytime. The keep tags and branches though. I prefer docker, so much easier..

from eosjs.

blockplay avatar blockplay commented on June 16, 2024

@jcalfee I run eos with version dawn-3.0, and eosjs with master branch(I cannot find dawn-3.0 eosjs).

from eosjs.

blockplay avatar blockplay commented on June 16, 2024

Ok, let me try the docker, Thanks

from eosjs.

deepchainone avatar deepchainone commented on June 16, 2024

@jcalfee I run lastest version eos(master) or run Docker with ./up.sh, same error occured.
But ./run_test.sh can pass.

at process._tickCallback (internal/process/next_tick.js:188:7) status: 500, statusText: 'Internal Server Error' }
[push_transaction error] '{"code":500,"message":"Internal Service Error","error":{"code":10,"name":"assert_exception","what":"Assert Exception","details":[{"message":"itr != structs.end(): Unknown struct ","file":"abi_serializer.cpp","line_number":184,"method":"get_struct"},{"message":"Failed to serialize type","file":"abi_serializer.hpp","line_number":439,"method":"to_variant"}]}}', transaction '10e6de5a0000be0394d91c1f00000000010000000000ea3055000000572d3ccdcd010000000000ea305500000000a8ed3232210000000000ea30550000000080ab20ad102700000000000004454f530000000000'
{"code":500,"message":"Internal Service Error","error":{"code":10,"name":"assert_exception","what":"Assert Exception","details":[{"message":"itr != structs.end(): Unknown struct ","file":"abi_serializer.cpp","line_number":184,"method":"get_struct"},{"message":"Failed to serialize type","file":"abi_serializer.hpp","line_number":439,"method":"to_variant"}]}}
(node:24471) UnhandledPromiseRejectionWarning: {"code":500,"message":"Internal Service Error","error":{"code":10,"name":"assert_exception","what":"Assert Exception","details":[{"message":"itr != structs.end(): Unknown struct ","file":"abi_serializer.cpp","line_number":184,"method":"get_struct"},{"message":"Failed to serialize type","file":"abi_serializer.hpp","line_number":439,"method":"to_variant"}]}}

Any idea ?

from eosjs.

deepchainone avatar deepchainone commented on June 16, 2024

More information:
eos@master, eosjs@dawn3

from eosjs.

jcalfee avatar jcalfee commented on June 16, 2024

This might help (for testing only):

<script src="https://unpkg.com/[email protected]/dist/eos.js" />

Use ./up.sh in eosjs [master] and make sure the docker image eosio/eos:dawn3x is used.

from eosjs.

jcalfee avatar jcalfee commented on June 16, 2024

I'll test eosio.token now.. I'll look at that now. They add new structs to nodeos that I need to sync with.

from eosjs.

jcalfee avatar jcalfee commented on June 16, 2024

Looks like it is a version problem. I was able to deploy eosio.token using cleos then make a transfer like your example. I did upgrade some functions, lets go with [email protected] (i'll deploy shortly) ..

setup:

cleos create account eosio eosio.token EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV

cleos set contract eosio.token contracts/eosio.token -p eosio.token@active

cleos push action eosio issue '{"to":"eosio.token", "quantity": "1000000000.0000 EOS", "memo": ""}' -p eosio@active
<script src="https://unpkg.com/[email protected]/dist/eos.js" />
> eos.transfer('eosio.token', 'inita', '1.0000 EOS', '', (err, res)=>{console.log(err,res)})
undefined
> null { transaction_id: '68dc224bc0b34500968148f13f1d49a1fd358e154885aed45f4498a145d3b35b',
  broadcast: true,
  transaction: 
   { compression: 'none',
     transaction: 
      { expiration: '2018-04-24T17:15:25',
        region: 0,
        ref_block_num: 383,
        ref_block_prefix: 160059228,
        max_net_usage_words: 0,
        max_kcpu_usage: 0,
        delay_sec: 0,
        context_free_actions: [],
        actions: [Array] },
     signatures: [ 'EOSK1eYuAbLz1pY4J1JKCB8dGrXPeaxP7wiVNhypoAJCXBUPNj28Xcts6ruqsdNWkaGQeNNZyhDKdchXouYKdQGo7aifhtVN6' ] } }

from eosjs.

blockplay avatar blockplay commented on June 16, 2024

@jcalfee Thanks, I will try asap.

from eosjs.

blockplay avatar blockplay commented on June 16, 2024

@jcalfee did you submit last source code? I pull lastest source, still have same error.
and https://unpkg.com/[email protected]/dist/eos.js cannot be access.

from eosjs.

jcalfee avatar jcalfee commented on June 16, 2024

DAWN-2018-04-23-ALPHA (docker eosio/eos:DAWN-2018-04-23-ALPHA) fixes the get currency command. Eosjs 8.0.1 is compatible unless you get into the eosio.system calls.

I'll have a eosjs release for DAWN-2018-04-23-ALPHA today.

# eosio/eos:DAWN-2018-04-23-ALPHA
cleos get currency balance currency inita
982.0000 CUR

from eosjs.

blockplay avatar blockplay commented on June 16, 2024

OK, let me try again, Thanks

from eosjs.

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.