Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broadcast tx fail with JSON RPC #1282

Closed
bonustrack opened this issue Jul 29, 2017 · 5 comments
Closed

Broadcast tx fail with JSON RPC #1282

bonustrack opened this issue Jul 29, 2017 · 5 comments

Comments

@bonustrack
Copy link

I'm not able to broadcast a transaction using JSON RPC anymore with Steem.js and got this error:

{"id":2,"error":{"code":1,"message":"10 assert_exception: Assert Exception\nitr != _by_name.end(): no method with name 'broadcast_transaction_synchronous'\n ...

Using broadcast_transaction or broadcast_transaction_with_callback is also throwing the same error while exploring method like get_accounts working well.

Here is the payload i'm sending to https://steemd.steemit.com :

{
  "id": 2, 
  "jsonrpc": "2.0", 
  "method": "broadcast_transaction_synchronous",
  "params": [{
    "ref_block_num": 9507,
    "ref_block_prefix": 987201169,
    "expiration": "2017-07-29T06:08:39",
    "operations": [["vote", {
      "voter": "guest123",
      "author": "firepower",
      "permlink": "steemit-veni-vidi-vici-steemfest-2016-together-we-made-it-happen-thank-you-steemians",
      "weight": 10000
    }]],
    "extensions": [],
    "signatures": ["1f3b68b3a9367166256e5f5e6112c9f40b55565c2787990ddcc3cf229241ab3b99265f95605aa101bdcb12de009e2b0186e3c9df820cb22a1f8d981a3ba7ffb66d"]
  }]
}

Is the format correct or there is a different way to broadcast tx?

@mvandeberg
Copy link
Contributor

When you say "I'm not able to broadcast a transaction using JSON RPC anymore" does this mean that at one point you were able to call broadcast_transaction_synchronous with this jsonrpc syntax through Steem.js? If so, when was the last time you remember doing so?

@bonustrack
Copy link
Author

I'm sure it was working using old syntax 3 weeks ago with 'method': 'call', i've not been able to make it work since the new syntax changes.

@mvandeberg
Copy link
Contributor

I am fairly certain that the jsonrpc format you are using defaults to api 0 (database_api) while broadcast_transaction_synchronous lives in the network_broadcast_api. Use the other syntax and specify the api by name.

@bonustrack
Copy link
Author

bonustrack commented Jul 31, 2017

It's working with the old syntax. How to specify the api name using the new syntax then? Here is the current format used:

{ id: 2,
  jsonrpc: '2.0',
  method: 'broadcast_transaction_synchronous',
  params: 
   [ { ref_block_num: 12534,
       ref_block_prefix: 1692773755,
       expiration: '2017-07-31T15:18:15',
       operations: [Array],
       extensions: [],
       signatures: [Array]
   } ]
}

@mvandeberg
Copy link
Contributor

You cannot currently. We are working on some API changes that would let you specify it like:

{ id: 2,
  jsonrpc: '2.0',
  method: 'network_broadcast_api.broadcast_transaction_synchronous',
  params: 
   [ { ref_block_num: 12534,
       ref_block_prefix: 1692773755,
       expiration: '2017-07-31T15:18:15',
       operations: [Array],
       extensions: [],
       signatures: [Array]
   } ]
}

But we are not ready to release that code yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants