create account

Steem-Tx | Now on Browsers + benchmark by mahdiyari

View this thread on: hive.blogpeakd.comecency.com
· @mahdiyari ·
$26.92
Steem-Tx | Now on Browsers + benchmark
<center>![steem-tx.jpg](https://cdn.steemitimages.com/DQmey8L7LptP2BF4YkQm5wXQWroegu4uwYGVVuJLkfwfwBA/steem-tx.jpg)</center>

[Steem-Tx](https://github.com/mahdiyari/steem-tx-js) is a lightweight and complete JavaScript library for using Steem blockchain in Javascript environments such as Web or NodeJS.

Two months ago [Steem-tx has been announced](https://steemit.com/steem/@mahdiyari/steem-tx-or-lightweight-javascript-library-for-creating-and-signing-transactions-on-the-steem-blockchain). At that time, using it only was possible in the NodeJS applications (and not Websites).

With the help of [browserify](http://browserify.org/) and [tinyify](https://github.com/browserify/tinyify) now it's possible to use [Steem-tx](https://github.com/mahdiyari/steem-tx-js) on the browser too.

Thanks to [JSDeliver](https://www.jsdelivr.com/), minified Javascript file is available on the CDN and also on the GitHub repository:
https://cdn.jsdelivr.net/npm/steem-tx/dist/steem-tx.min.js
```
<script src="https://cdn.jsdelivr.net/npm/steem-tx/dist/steem-tx.min.js"></script>
```
---
Everything works like NodeJS apps.
A full example of Web usage which you can copy and run in your browser too:

```
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <script src="https://cdn.jsdelivr.net/npm/steem-tx/dist/steem-tx.min.js"></script>
    <title>Test steem-tx</title>
  </head>
  <body>
    <script>
      // change api
      steemTx.config.node = 'https://anyx.io'

      const operations = [
        [
          'vote',
          {
            voter: 'guest123',
            author: 'guest123',
            permlink: '20191107t125713486z-post',
            weight: 9900
          }
        ]
      ]
      const myKey = '5JRaypasxMx1L97ZUX7YuC5Psb5EAbF821kkAGtBj7xCJFQcbLg'
      const privateKey = steemTx.PrivateKey.from(myKey)

      const tx = new steemTx.Transaction()

      // create transaction
      tx.create(operations).then(() => {
        console.log('Created transaction:', tx.transaction)

        // sign the transaction
        tx.sign(privateKey)
        console.log('Signed transaction:', tx.signedTransaction)

        // broadcast the transaction
        tx.broadcast().then(res => console.log('Broadcast result:', res))
      })

      // get accounts
      steemTx
        .call('condenser_api.get_accounts', [['mahdiyari']])
        .then(res => console.log('Get accounts:', res))
    </script>
  </body>
</html>
```
This example is also available in the [GitHub repository](https://github.com/mahdiyari/steem-tx-js/blob/master/examples/example1.html) 

---

### Benchmark
I don't know how precise `measurethat.net` is, but [here is the benchmark link](https://measurethat.net/Benchmarks/Show/6890/0/dsteem-vs-steem-tx).
I believe results should be bigger than 1,000 ops/sec for both dsteem and steem-tx. (maybe I'm wrong)
<center>![](https://cdn.steemitimages.com/DQmapN6jk5wPhqdp4YTKfAvE6LmiCTJYyjtB8ojLnfw7DCH/image.png)</center>

Also, on the NodeJS:
<center>![](https://cdn.steemitimages.com/DQmaqWaYJ8hkqXvv8h9oYk1cWkWuumW7R7TCcQmTiP5HDzF/image.png)</center>

---
GitHub repository: https://github.com/mahdiyari/steem-tx-js
NPM package: https://www.npmjs.com/package/steem-tx

Feel free to test, use, and share. With the hope for better Steem!
πŸ‘  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 587 others
πŸ‘Ž  , ,
properties (23)
authormahdiyari
permlinksteem-tx-or-now-on-browsers-benchmark
categorysteem
json_metadata{"tags":["steem","dev","steem-tx","steem-dev","browser","benchmark"],"image":["https://cdn.steemitimages.com/DQmey8L7LptP2BF4YkQm5wXQWroegu4uwYGVVuJLkfwfwBA/steem-tx.jpg","https://cdn.steemitimages.com/DQmapN6jk5wPhqdp4YTKfAvE6LmiCTJYyjtB8ojLnfw7DCH/image.png","https://cdn.steemitimages.com/DQmaqWaYJ8hkqXvv8h9oYk1cWkWuumW7R7TCcQmTiP5HDzF/image.png"],"links":["https://github.com/mahdiyari/steem-tx-js","https://steemit.com/steem/@mahdiyari/steem-tx-or-lightweight-javascript-library-for-creating-and-signing-transactions-on-the-steem-blockchain","http://browserify.org/","https://github.com/browserify/tinyify","https://www.jsdelivr.com/","https://cdn.jsdelivr.net/npm/steem-tx/dist/steem-tx.min.js","https://github.com/mahdiyari/steem-tx-js/blob/master/examples/example1.html","https://measurethat.net/Benchmarks/Show/6890/0/dsteem-vs-steem-tx","https://www.npmjs.com/package/steem-tx"],"app":"steemit/0.1","format":"markdown"}
created2020-01-17 12:15:57
last_update2020-01-17 12:15:57
depth0
children8
last_payout2020-01-24 12:15:57
cashout_time1969-12-31 23:59:59
total_payout_value14.433 HBD
curator_payout_value12.489 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length3,429
author_reputation199,864,818,197,856
root_title"Steem-Tx | Now on Browsers + benchmark"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id94,479,764
net_rshares95,961,904,683,204
author_curate_reward""
vote details (654)
@june0620 ·
Hi~
My account(@june0620) has not been able to automatically upvote recently. Can you help me find out why? (I recently modified my master key)

![](https://cdn.steemitimages.com/DQmUSdziG7QPCgYxdV9ExFV9iQokV3TgLgpMmWcAjbFF9cz/image.png)
properties (22)
authorjune0620
permlinkq5fg6g
categorysteem
json_metadata{"users":["june0620"],"image":["https://cdn.steemitimages.com/DQmUSdziG7QPCgYxdV9ExFV9iQokV3TgLgpMmWcAjbFF9cz/image.png"],"app":"steemit/0.1"}
created2020-02-09 09:11:06
last_update2020-02-09 09:11:06
depth1
children2
last_payout2020-02-16 09:11:06
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length237
author_reputation118,592,211,436,406
root_title"Steem-Tx | Now on Browsers + benchmark"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id95,252,485
net_rshares0
@mahdiyari ·
Explained under that section you sent here. Change "Upvote Mana threshold" to something like 70%
properties (22)
authormahdiyari
permlinkq5fske
categorysteem
json_metadata{"app":"steemit/0.1"}
created2020-02-09 13:38:39
last_update2020-02-09 13:38:39
depth2
children1
last_payout2020-02-16 13:38:39
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length96
author_reputation199,864,818,197,856
root_title"Steem-Tx | Now on Browsers + benchmark"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id95,257,823
net_rshares0
@june0620 ·
ThanksπŸ˜€
properties (22)
authorjune0620
permlinkre-mahdiyari-202029t224915910z
categorysteem
json_metadata{"tags":["esteem"],"app":"esteem/2.2.4-mobile","format":"markdown+html","community":"hive-125125"}
created2020-02-09 13:49:18
last_update2020-02-09 13:49:18
depth3
children0
last_payout2020-02-16 13:49:18
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length7
author_reputation118,592,211,436,406
root_title"Steem-Tx | Now on Browsers + benchmark"
beneficiaries
0.
accountesteemapp
weight300
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id95,258,096
net_rshares0
@kingscrown ·
hi @mahdiyari when trying to use steemauto - "error":"access_token is wrong"
πŸ‘  
properties (23)
authorkingscrown
permlinkq4l5tx
categorysteem
json_metadata{"users":["mahdiyari"],"app":"steemit/0.1"}
created2020-01-24 00:39:33
last_update2020-01-24 00:39:33
depth1
children1
last_payout2020-01-31 00:39:33
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length76
author_reputation2,115,776,279,560,447
root_title"Steem-Tx | Now on Browsers + benchmark"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id94,703,992
net_rshares2,113,883
author_curate_reward""
vote details (1)
@mahdiyari ·
Already answered you off the chain.

For other users:
This type of error about "access_token" usually means "Steemconnect" is not working correctly at that moment. And usually gets fixed in a few hours.

Steemconnect is a third-party app that we use to authorize our users with more security.
properties (22)
authormahdiyari
permlinkq4mqty
categorysteem
json_metadata{"app":"steemit/0.1"}
created2020-01-24 21:10:45
last_update2020-01-24 21:10:45
depth2
children0
last_payout2020-01-31 21:10:45
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length292
author_reputation199,864,818,197,856
root_title"Steem-Tx | Now on Browsers + benchmark"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id94,737,094
net_rshares0
@stuffbyspencer ·
**Nice work!**

*Slight noob question:* What's the difference between using this vs. embedding Steem KeyChain into a project? Does one do more than the other?

Or is it simply an alternative?
properties (22)
authorstuffbyspencer
permlinkre-mahdiyari-2020117t211828390z
categorysteem
json_metadata{"tags":["steem","dev","steem-tx","steem-dev","browser","benchmark"],"app":"esteem/2.2.2-mobile","format":"markdown+html","community":"esteem.app"}
created2020-01-18 02:18:30
last_update2020-01-18 02:18:30
depth1
children2
last_payout2020-01-25 02:18:30
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length191
author_reputation13,003,870,677,623
root_title"Steem-Tx | Now on Browsers + benchmark"
beneficiaries
0.
accountesteemapp
weight300
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id94,496,963
net_rshares0
@mahdiyari ·
Steem keychain is for users to interact with steem blockchain and perform actions like sending STEEM.
Libraries like this (steem-tx, steem-js, dsteem) give the ability to the Steem keychain to communicate with Steem blockchain and perform such actions.
πŸ‘  
properties (23)
authormahdiyari
permlinkq4asuy
categorysteem
json_metadata{"app":"steemit/0.1"}
created2020-01-18 10:23:24
last_update2020-01-18 10:23:24
depth2
children1
last_payout2020-01-25 10:23:24
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length252
author_reputation199,864,818,197,856
root_title"Steem-Tx | Now on Browsers + benchmark"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id94,505,812
net_rshares5,352,929,903
author_curate_reward""
vote details (1)
@stuffbyspencer ·
Ah, so, in terms of hierarchy, it would be:
- steem blockchain stores transactions
- steem-tx communicates with steem blockchain
- keychain uses steem-tx ( *theoretically* ) to allow users access

Got ya. Thanks! :^)
properties (22)
authorstuffbyspencer
permlinkre-mahdiyari-2020118t172913993z
categorysteem
json_metadata{"tags":["esteem"],"app":"esteem/2.2.2-mobile","format":"markdown+html","community":"esteem.app"}
created2020-01-18 22:29:15
last_update2020-01-18 22:29:15
depth3
children0
last_payout2020-01-25 22:29:15
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length216
author_reputation13,003,870,677,623
root_title"Steem-Tx | Now on Browsers + benchmark"
beneficiaries
0.
accountesteemapp
weight300
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id94,524,620
net_rshares0