<script src="https://unpkg.com/dsteem/dist/dsteem.js"></script>
<script src="https://cdn.jsdelivr.net/npm/steem-tx/dist/steem-tx.min.js"></script>
<script>
var tx = {
ref_block_num: 1234,
ref_block_prefix: 445566,
expiration: '2017-07-09T10:00:00.000',
operations: [
[
'vote',
{
voter: 'foo',
author: 'bar',
permlink: 'i-like-turtles',
weight: 10000
}
]
],
extensions: [],
signatures: []
};
var keyWif = '5JQy7moK9SvNNDxn8rKNfQYFME5VDYC2j9Mv2tb7uXV5jz3fQR8';
var dsteemKey = dsteem.PrivateKey.fromString(keyWif);
var dsteemClient = new dsteem.Client();
var trans = new steemTx.Transaction(tx);
var txKey = steemTx.PrivateKey.fromString(keyWif);
</script>
trans.sign(txKey);
dsteemClient.broadcast.sign(tx, dsteemKey);
--enable-precise-memory-info
flag.
Test case name | Result |
---|---|
steem-tx | |
dsteem |
Test name | Executions per second |
---|---|
steem-tx | 230.1 Ops/sec |
dsteem | 216.1 Ops/sec |
I'd be happy to help you understand the benchmark and its various aspects.
What is being tested?
The provided JSON represents two JavaScript microbenchmarks, dsteem
and steem-tx
, which compare the performance of two libraries for interacting with the Steemit blockchain. The test focuses on signing a transaction using each library.
Options compared:
dsteem
: A JavaScript library developed by Steve Sumner, providing an implementation of the Steemit blockchain API.steem-tx
: Another JavaScript library that also provides an implementation of the Steemit blockchain API, specifically focusing on transactions.Pros and Cons:
dsteem
:steem-tx
steem-tx
:Library used:
The dsteem
library is used in the benchmark. It's a more comprehensive implementation of the Steemit blockchain API, providing features beyond just transaction signing.
Special JavaScript feature or syntax:
There are no specific JavaScript features or syntax mentioned in the provided code snippet. However, it's worth noting that both libraries likely rely on other external dependencies, such as the Web3.js library for Ethereum-related functionality (although this is not explicitly mentioned).
Other alternatives:
If you're looking for alternative libraries for interacting with blockchain APIs, some popular options include:
steem-js
: A lightweight JavaScript implementation of the Steemit blockchain API.@steemnet/api
: A Python library providing an interface to the Steemit blockchain API.web3.js
: A JavaScript library for interacting with the Ethereum blockchain.Please note that each alternative has its own strengths and weaknesses, and the choice of which one to use depends on your specific requirements and project needs.