Commit d449d86c authored by inertia's avatar inertia
Browse files

Merge branch 'fast-biscuit' into 'develop'

Fast biscuit

See merge request !112
parents 46972dcf e4a5117f
......@@ -1258,7 +1258,7 @@
purpose: |
**Deprecated as of HF20** If an account creation service would still like to provide a delegation of Hive Power
to the accounts they create, they can still follow the account creation operation with an additional call to
`delegate_vesting_shares` to add a delegation of SP to the account.
`delegate_vesting_shares` to add a delegation of HP to the account.
>Instead of paying the entire account creation fee with Hive, creators
can now pay a smaller fee (30x less) and delegate some Hive Power for
......@@ -1684,7 +1684,7 @@
purpose: |
Created once per maintenance interval to document how much HBD was
added to the threasury from inflation in that maintenance interval
(i.e., to track the funding of the SPS).
(i.e., to track the funding of the DHF).
roles:
- active
owner
......
......@@ -70,7 +70,7 @@
- term: RocksDB
def: A fast-on-disk data store with an advanced caching layer, which minimizes latency when reading/writing to and from disk.
- term: MIRA
def: Multi Index Rocksdb Adapter that updates the database backend of Hive from memory mapped files to a disk log-structured merge-tree implemented via the RocksDB library.
def: Multi Index Rocksdb Adapter (removed in HF25) that updates the database backend of Hive from memory mapped files to a disk log-structured merge-tree implemented via the RocksDB library.
- term: Manabar
def: |
<p>
......
......@@ -3,9 +3,14 @@ title: 'MIRA: Performance Tuning'
position: 6
description: Provides a way to get the most performance on specific hardware.
exclude: true
layout: hive-post
layout: full
canonical_url: https://gitlab.syncad.com/hive/hive/-/blob/master/doc/mira-tuning.md
---
<h4 class="danger well">
Please note, MIRA removed in HF25 (see: <a href="https://gitlab.syncad.com/hive/hive/-/merge_requests/185">!185</a>). This document is outdated and will remain in place to give historical context prior to HF25.
</h4>
# Preface
After MIRAs initial development efforts we released the [Basic MIRA Configuration Guide](https://gitlab.syncad.com/hive/hive/-/blob/master/doc/mira.md) to help bootstrap users attempting to use MIRA enabled `hived`. There is actually much more fine tuning that can be done to improve MIRA's performance. We will break up this process into three phases:
......
......@@ -39,7 +39,7 @@ The following are *only* available as command-line options.
* [`dump-memory-details`](#dump-memory-details)
* [`check-locks`](#check-locks)
* [`validate-database-invariants`](#validate-database-invariants)
* [`database-cfg`](#database-cfg)
* ~~[`database-cfg`](#database-cfg)~~
* [`account-history-rocksdb-immediate-import`](#account-history-rocksdb-immediate-import)
* [`exit-after-replay`](#exit-after-replay)
* [`force-replay`](#force-replay)
......@@ -189,12 +189,14 @@ See: [#1477]({{ 'https://github.com/steemit/steem/issues/1477' | archived_url }}
### `database-cfg`<a style="float: right" href="#sections"><i class="fas fa-chevron-up fa-sm" /></a>
The database configuration file location **MIRA only.**
The database configuration file location **MIRA only (prior to HF25).**
```bash
--database-cfg=database.cfg
```
**Removed in:** HF25
### `account-history-rocksdb-immediate-import`<a style="float: right" href="#sections"><i class="fas fa-chevron-up fa-sm" /></a>
Allows to force immediate data import at plugin startup. By default storage is supplied during reindex process.
......
......@@ -96,14 +96,15 @@ $ git clone https://gitlab.syncad.com/hive/hivemind.git
$ cd hivemind
$ git submodule update --init --recursive
$ python3 setup.py build
$ sudo pip3 install jinja2
$ sudo python3 setup.py install
```
By default Hivemind will connect to the mainnet [https://api.hive.blog](https://api.hive.blog) but if required you can change this to connect to a testnet. To do this set the environment variable as described below.
```bash
# Note as of 2021-03-30, hivemind still internally uses the environment variable called STEEMD_URL for this.
$ export STEEMD_URL='{"default":"http://127.0.0.1:8091"}'
# Note as of 2021-05-14, hivemind still internally uses the environment variable called STEEMD_URL for this.
$ export STEEMD_URL='http://127.0.0.1:8091'
```
Now that the basic setup is done you are able to sync the database.
......
......@@ -719,6 +719,14 @@ a[href*='tutorials-ruby'] {
padding-left: .90em;
}
#search-process {
background-image: url(../images/loading.gif);
background-size: .90em .90em;
background-repeat: no-repeat;
background-position: right top;
padding-left: .90em;
}
// See: https://github.com/turbolinks/turbolinks#displaying-progress
.turbolinks-progress-bar {
height: 5px;
......
......@@ -58,7 +58,7 @@ const reward_hive = _accounts[0].reward_hive_balance.split(' ')[0];
const reward_hbd = _accounts[0].reward_hbd_balance.split(' ')[0];
const reward_sp = _accounts[0].reward_vesting_hive.split(' ')[0];
const reward_vests = _accounts[0].reward_vesting_balance.split(' ')[0];
const unclaimed_balance = `Unclaimed balance for ${name}: ${reward_hive} HIVE, ${reward_hbd} HBD, ${reward_sp} SP = ${reward_vests} VESTS<br/>`;
const unclaimed_balance = `Unclaimed balance for ${name}: ${reward_hive} HIVE, ${reward_hbd} HBD, ${reward_sp} HP = ${reward_vests} VESTS<br/>`;
document.getElementById('accList').innerHTML = unclaimed_balance;
document.getElementById('hive').value = reward_hive;
document.getElementById('hbd').value = reward_hbd;
......
......@@ -7,18 +7,15 @@ canonical_url: get_account_comments.html
---
Full, runnable src of [Get Account Comments](https://gitlab.syncad.com/hive/devportal/-/tree/master/tutorials/javascript/09_get_account_comments) can be downloaded as part of: [tutorials/javascript](https://gitlab.syncad.com/hive/devportal/-/tree/master/tutorials/javascript) (or download just this tutorial: [devportal-master-tutorials-javascript-09_get_account_comments.zip](https://gitlab.syncad.com/hive/devportal/-/archive/master/devportal-master.zip?path=tutorials/javascript/09_get_account_comments)).
This tutorial will show how to fetch comments made by a specific account (in this case `@hiveio`) by demonstrating how to use the `get_state` api function call. We will also demonstrate the most commonly used fields from the response object as well as how to parse the body of each comment.
This tutorial will show how to fetch comments made by a specific account (in this case `@hiveio`) by demonstrating how to use the `bridge.get_account_posts` api function call. We will also demonstrate the most commonly used fields from the response object as well as how to parse the body of each comment.
## Intro
We are using the `get_state` function with `dhive` that returns the current state of the network as well as additional content. Each content body is written in markdown and could be submitted to the blockchain by many different applications built on top of Hive. For that reason we are using the `remarkable` npm package to parse markdown in a readable format.
We are using the `bridge.get_account_posts` function with `dhive` that returns the current state of the network as well as additional content. Each content body is written in markdown and could be submitted to the blockchain by many different applications built on top of Hive. For that reason we are using the `remarkable` npm package to parse markdown in a readable format.
Also see:
* [get discussions]({{ '/search/?q=get discussions' | relative_url }})
* [tags_api.get_discussions_by_comments]({{ '/apidefinitions/#tags_api.get_discussions_by_comments' | relative_url }})
* [condenser_api.get_discussions_by_comments]({{ '/apidefinitions/#condenser_api.get_discussions_by_comments' | relative_url }})
* [tags_api.get_discussions_by_created]({{ '/apidefinitions/#tags_api.get_discussions_by_created' | relative_url }})
* [condenser_api.get_discussions_by_created]({{ '/apidefinitions/#condenser_api.get_discussions_by_created' | relative_url }})
* [bridge.get_account_posts]({{ '/apidefinitions/#bridge.get_account_posts' | relative_url }})
## Steps
......@@ -52,10 +49,10 @@ const md = new Remarkable({ html: true, linkify: true });
Next, we have the `main` function which runs when the page is loaded.
```javascript
// query string, fetching comments made by @hiveio account
const query = '/@hiveio/comments';
// fetching comments made by author
const author = prompt('Account?', 'hiveio');
client.database.call('get_state', [query]).then(result => {
client.hivemind.call('get_account_posts', {sort: 'comments', account: author, limit: 100})
// work with state object
});
```
......@@ -65,166 +62,54 @@ client.database.call('get_state', [query]).then(result => {
The following is an example of the returned object:
```json
{
"current_route":"/@hiveio/comments",
"props":{
"head_block_number":22307429,
"head_block_id":"01546265c9dc3e761add4c4b652743e3c640fa19",
"time":"2018-05-10T12:15:30",
"current_witness":"smooth.witness",
"total_pow":514415,
"num_pow_witnesses":172,
"virtual_supply":"271970374.699 HIVE",
"current_supply":"268140818.508 HIVE",
"confidential_supply":"0.000 HIVE",
"current_hbd_supply":"13342173.771 HBD",
"confidential_hbd_supply":"0.000 HBD",
"total_vesting_fund_hive":"191002132.498 HIVE",
"total_vesting_shares":"388786707656.308148 VESTS",
"total_reward_fund_hive":"0.000 HIVE",
"total_reward_shares2":"0",
"pending_rewarded_vesting_shares":"366359809.533218 VESTS",
"pending_rewarded_vesting_hive":"178575.754 HIVE",
"hbd_interest_rate":0,
"hbd_print_rate":10000,
"maximum_block_size":65536,
"current_aslot":22373110,
"recent_slots_filled":"340282366920938463463374607431768211455",
"participation_count":128,
"last_irreversible_block_num":22307411,
"vote_power_reserve_rate":10,
"average_block_size":14881,
"current_reserve_ratio":200000000,
"max_virtual_bandwidth":"264241152000000000000"
},
"tag_idx":{
"trending":["","life","photography","hiveio","kr","introduceyourself","bitcoin","art","travel","cryptocurrency","spanish","food","hive","blog","funny","news","nature","colorchallenge","dtube","indonesia","story","cn","money","music","writing","crypto","contest","busy","health","poetry","meme","video","utopian-io","photo","new","love","blockchain","deutsch","dmania","science","technology","aceh","entertainment","gaming","politics","myanmar","esteem","sports","fun","tr"]
},
"tags":{},
"content":{
"hiveio/afm007-re-hiveio-devportal-update-3-ux-improvements-more-javascript-tutorials-and-more-20180509t050215510z":{
"id":47669989,
"author":"hiveio",
"permlink":"afm007-re-hiveio-devportal-update-3-ux-improvements-more-javascript-tutorials-and-more-20180509t050215510z",
"category":"hive",
"parent_author":"afm007",
"parent_permlink":"devportal-update-3-ux-improvements-more-javascript-tutorials-and-more","title":"","body":"I want to learn the Python language.",
"json_metadata":"{''}",
"last_update":"2018-05-09T05:02:15",
"created":"2018-05-09T05:02:15",
"active":"2018-05-09T05:02:15",
"last_payout":"1970-01-01T00:00:00",
"depth":1,
"children":0,
"net_rshares":1057692008,
"abs_rshares":1057692008,
"vote_rshares":1057692008,
"children_abs_rshares":0,
"cashout_time":"2018-05-16T05:02:15",
"max_cashout_time":"1969-12-31T23:59:59",
"total_vote_weight":32523,
"reward_weight":10000,
"total_payout_value":"0.000 HBD",
"curator_payout_value":"0.000 HBD",
"author_rewards":0,
"net_votes":1,
"root_author":"hiveio",
"root_permlink":"devportal-update-3-ux-improvements-more-javascript-tutorials-and-more",
"max_accepted_payout":"1000000.000 HBD",
"percent_hbd":10000,
"allow_replies":true,
"allow_votes":true,
"allow_curation_rewards":true,
"beneficiaries":[],
"url":"/hive/@hiveio/devportal-update-3-ux-improvements-more-javascript-tutorials-and-more#@afm007/afm007-re-hiveio-devportal-update-3-ux-improvements-more-javascript-tutorials-and-more-20180509t050215510z",
"root_title":"DevPortal Update #3: UX Improvements, More Javascript Tutorials and More!",
"pending_payout_value":"0.005 HBD",
"total_pending_payout_value":"0.000 HIVE",
"active_votes":[{"voter":"afm007","weight":17182,"rshares":1057692008,"percent":10000,"reputation":"855556264424","time":"2018-05-09T05:18:06"}],
"replies":[],
"author_reputation":"855556264424",
"promoted":"0.000 HBD",
"body_length":0,
"reblogged_by":[]
},
"hiveio/re-hiveio-devportal-update-3-ux-improvements-more-javascript-tutorials-and-more-20180509t045305223z":{
"id":47669080,
"author":"hiveio",
"permlink":"re-hiveio-devportal-update-3-ux-improvements-more-javascript-tutorials-and-more-20180509t045305223z",
"category":"hive",
"parent_author":"andreina89",
"parent_permlink":"devportal-update-3-ux-improvements-more-javascript-tutorials-and-more",
"title":"",
"body":"Excellent post very interesting friend, thanks",
"json_metadata":"{\"tags\":[\"hive\"],\"app\":\"hiveblog/0.1\"}",
"last_update":"2018-05-09T04:53:21",
"created":"2018-05-09T04:53:21",
"active":"2018-05-09T04:53:27",
"last_payout":"1970-01-01T00:00:00",
"depth":1,
"children":1,
"net_rshares":0,
"abs_rshares":0,
"vote_rshares":0,
"children_abs_rshares":0,
"cashout_time":"2018-05-16T04:53:21",
"max_cashout_time":"1969-12-31T23:59:59",
"total_vote_weight":0,
"reward_weight":10000,
"total_payout_value":"0.000 HBD",
"curator_payout_value":"0.000 HBD",
"author_rewards":0,
"net_votes":0,
"root_author":"hiveio",
"root_permlink":"devportal-update-3-ux-improvements-more-javascript-tutorials-and-more",
"max_accepted_payout":"1000000.000 HBD",
"percent_hbd":10000,
"allow_replies":true,
"allow_votes":true,
"allow_curation_rewards":true,
"beneficiaries":[],
"url":"/hive/@hiveio/devportal-update-3-ux-improvements-more-javascript-tutorials-and-more#@andreina89/re-hiveio-devportal-update-3-ux-improvements-more-javascript-tutorials-and-more-20180509t045305223z",
"root_title":"DevPortal Update #3: UX Improvements, More Javascript Tutorials and More!",
"pending_payout_value":"0.000 HBD",
"total_pending_payout_value":"0.000 HIVE",
"active_votes":[],
"replies":[],
"author_reputation":"174938588721",
"promoted":"0.000 HBD",
"body_length":0,"reblogged_by":[]
}
},
"accounts":{
"hiveio":{},
},
"witnesses":{},
"discussion_idx":{},
"witness_schedule":{
"id":0,
"current_virtual_time":"326078326927286190874576091",
"next_shuffle_block_num":22307439,
"current_shuffled_witnesses":["furion","someguy123","good-karma","blocktrades","smooth.witness"],
"num_scheduled_witnesses":21,
"top19_weight":1,
"timeshare_weight":5,
"miner_weight":1,
"witness_pay_normalization_factor":25,
"median_props":{
"account_creation_fee":"0.100 HIVE",
"maximum_block_size":65536,
"hbd_interest_rate":0
},
"majority_version":"0.19.3",
"max_voted_witnesses":20,
"max_miner_witnesses":0,
"max_runner_witnesses":1,
"hardfork_required_witnesses":17
},
"feed_price":{
"base":"3.484 HBD",
"quote":"1.000 HIVE"
}
}
[
{
"post_id":103793175,
"author":"blocktrades",
"permlink":"qtbpx4",
"category":"hive-139531",
"title":"RE: 12th update of 2021 on BlockTrades work on Hive software",
"body":"Yes, I think the above is quite probable.",
"json_metadata":{"app":"hiveblog\/0.1"},
"created":"2021-05-18T22:17:30",
"updated":"2021-05-18T22:17:30",
"depth":4,
"children":0,
"net_rshares":45572072190,
"is_paidout":false,
"payout_at":"2021-05-25T22:17:30",
"payout":0.021,
"pending_payout_value":"0.021 HBD",
"author_payout_value":"0.000 HBD",
"curator_payout_value":"0.000 HBD",
"promoted":"0.000 HBD",
"replies":[],
"author_reputation":77.33,
"stats":{
"hide":false,
"gray":false,
"total_votes":1,
"flag_weight":0.0
},
"url":"\/hive-139531\/@blocktrades\/12th-update-of-2021-on-blocktrades-work-on-hive-software#@blocktrades\/qtbpx4",
"beneficiaries":[],
"max_accepted_payout":"1000000.000 HBD",
"percent_hbd":10000,
"parent_author":"urun",
"parent_permlink":"re-blocktrades-qtblai",
"active_votes":[
{
"rshares":45572072190,
"voter":"urun"
}
],
"blacklists":[],
"community":"hive-139531",
"community_title":"HiveDevs",
"author_role":"mod",
"author_title":""
}
]
```
#### 3. Formatting<a name="formatting"></a>
......@@ -234,18 +119,18 @@ Next we will format the above object properly to view in a simple user interface
```javascript
if (
!(
Object.keys(result.content).length === 0 &&
result.content.constructor === Object
Object.keys(result).length === 0 &&
result.constructor === Object
)
) {
var comments = [];
Object.keys(result.content).forEach(key => {
const comment = result.content[key];
const comment = result[key];
const parent_author = comment.parent_author;
const parent_permlink = comment.parent_permlink;
const created = new Date(comment.created).toDateString();
const body = md.render(comment.body);
const netvotes = comment.net_votes;
const totalVotes = comment.stats.total_votes;
comments.push(
`<div class="list-group-item list-group-item-action flex-column align-items-start">\
<div class="d-flex w-100 justify-content-between">\
......@@ -253,22 +138,23 @@ if (
<small class="text-muted">${created}</small>\
</div>\
<p class="mb-1">${body}</p>\
<small class="text-muted">&#9650; ${netvotes}, Replied to: @${parent_author}/${parent_permlink}</small>\
<small class="text-muted">&#9650; ${totalVotes}, Replied to: @${parent_author}/${parent_permlink}</small>\
</div>`
);
});
document.getElementById('author').innerHTML = author;
document.getElementById('comments').style.display = 'block';
document.getElementById('comments').innerHTML = comments.join('');
}
```
We first check if `content` is not an empty object. We then iterate through each object in `content` and extract:
We first check if `result` is not an empty object. We then iterate through each object in `result` and extract:
* `parent_author`
* `parent_permlink`
* and the post or comment the `@hiveio` account is replying to
* and the post or comment the author is replying to
We format `created` date and time, parse `body` markdown and get `net_votes` on that comment.
We format `created` date and time, parse `body` markdown and get `totalVotes` on that comment.
Each line is then pushed and displayed separately.
### To Run the tutorial
......
......@@ -11,7 +11,7 @@ This tutorial will take you through the process of checking a specific users' da
Providing another user active permission for your account enables them to do fund transfers from your account. This can be usefull in setting up a secondary account(s) to manage funds for a main account or having a backup should you lose passwords for the main account.
One of the common practice nowadays is to lend/delegate SP to another account, above same technique can be used to create market around it with minimum 3rd party trust. All your funds stay in your account. You can use/create automated system where you can lease for certain period of time and system can take care of payments and release of delegations (notify clients). Even better, you can use multi-signature feature to establish 100% trust where clients will have to confirm, approve transactions.
One of the common practice nowadays is to lend/delegate HP to another account, above same technique can be used to create market around it with minimum 3rd party trust. All your funds stay in your account. You can use/create automated system where you can lease for certain period of time and system can take care of payments and release of delegations (notify clients). Even better, you can use multi-signature feature to establish 100% trust where clients will have to confirm, approve transactions.
Active permissions and authority should be used with utmost care, you don't want to loose your funds. It is really not easy to hack Hive accounts, let alone take control over it. But without careful use (revealing private keys) loosing liquid funds are not that difficult and it takes only couple seconds to do that, keeping most value powered up always helps.
......
This diff is collapsed.
......@@ -11,7 +11,7 @@ In this tutorial we show you how to check if someone has got active permission f
Providing another user active permission for your account enables them to do fund transfers from your account. This can be useful in setting up a secondary account(s) to manage funds for a main account or having a backup should you lose passwords for the main account.
One of the common practice nowadays is to lend/delegate SP to another account, above same technique can be used to create market around it with minimum 3rd party trust. All your funds stay in your account. You can use/create automated system where you can lease for certain period of time and system can take care of payments and release of delegations (notify clients). Even better, you can use [multi-signature <i class="fas fa-search fa-xs" />]({{ '/search?q=multisig' | relative_url }}) feature to establish 100% trust where clients will have to confirm, approve transactions.
One of the common practice nowadays is to lend/delegate HP to another account, above same technique can be used to create market around it with minimum 3rd party trust. All your funds stay in your account. You can use/create automated system where you can lease for certain period of time and system can take care of payments and release of delegations (notify clients). Even better, you can use [multi-signature <i class="fas fa-search fa-xs" />]({{ '/search?q=multisig' | relative_url }}) feature to establish 100% trust where clients will have to confirm, approve transactions.
Active permissions and authority should be used with utmost care, you don't want to lose your funds. It is really not easy to hack Hive accounts, let alone take control over it. But without careful use (revealing private keys) losing liquid funds are not that difficult and it takes only couple seconds to do that, keeping most value powered up always helps.
......
......@@ -97,11 +97,11 @@ Suppose an account has 15 Hive Power. How much can it vote?
```
This is the amount of Hive Power (in satoshis) that would be needed by an account to transact once per 5 days ([`HIVE_RC_REGEN_TIME`]({{ '/tutorials-recipes/understanding-configuration-values.html#HIVE_RC_REGEN_TIME' | relative_url }})).
Our 15 SP account has 15000 SP, so it would be able to do `15000 / 138`, or about `108`, such transactions per 5 days.
Our 15 HP account has 15000 HP, so it would be able to do `15000 / 138`, or about `108`, such transactions per 5 days.
You can regard the number `138` (or `0.138`) as the "cost" of a "standardized" vote transaction. It plays an analogous role to a
transaction fee in Bitcoin, but it is not exactly a fee. Because the word "fee" implies giving up a permanent token with a limited,
controlled emission rate. It is the amount of SP which will allow a user an additional vote transaction every 5 days (but it might
controlled emission rate. It is the amount of HP which will allow a user an additional vote transaction every 5 days (but it might
be slightly more or less, if your vote transactions use a slightly different amount of resources.)
### Integrating the demo script
......
......@@ -78,7 +78,7 @@ Once you have claimed a token, broadcast the `create_claimed_account` operation
]
```
Accounts created with this method, don't have any SP, but do have enough RC to interact with the chain at a starting level.
Accounts created with this method, don't have any HP, but do have enough RC to interact with the chain at a starting level.
#### 2. Non-discounted account creation<a name="nondisc"></a>
......
......@@ -11,7 +11,7 @@ Since HF20 a Resource Credit (RC) system has been implemented to manage the numb
## Intro
RCs are non-transferable credits that accrue to each Hive account based on how much Hive Power(SP) it has. An account spends RC when it transacts on the Hive blockchain. RCs regenerate over a 5 day period. If an account doesn’t have sufficient credits, the transaction will not be allowed to occur.
RCs are non-transferable credits that accrue to each Hive account based on how much Hive Power (HP) it has. An account spends RC when it transacts on the Hive blockchain. RCs regenerate over a 5 day period. If an account doesn’t have sufficient credits, the transaction will not be allowed to occur.
The price of a transaction (which consumes a particular resource, or resources) is based on the current stockpile of those resources. As a stockpile of a resource decreases, the RC cost of that resource increases. In other words, as the stockpile goes down, accounts will have to pay more RCs to use the remaining resources. This system disincentivize the over-consumption of resources by users as well as spam.
......@@ -21,7 +21,7 @@ There are applications available to check an account's status, like [hiveblocks.
## Calculating available RC
Since RC is calculated relative to SP, we first need to know the available SP before we can calculate how much RC we have left. The value of the current available mana(RC) is also accessible as a field from the `getAccounts` function.
Since RC is calculated relative to HP, we first need to know the available HP before we can calculate how much RC we have left. The value of the current available mana(RC) is also accessible as a field from the `getAccounts` function.
```javascript
//capture account
......@@ -29,7 +29,7 @@ var _account = await client.database.getAccounts(['username'])
var account = _account[0]
var props = await client.database.getDynamicGlobalProperties()
var CURRENT_UNIX_TIMESTAMP = parseInt((new Date(props.time).getTime() / 1000).toFixed(0))
//calculate available SP
//calculate available HP
var totalShares = parseFloat(account.vesting_shares) + parseFloat(account.received_vesting_shares) - parseFloat(account.delegated_vesting_shares);
//determine elapsed time since last RC update
var elapsed = CURRENT_UNIX_TIMESTAMP - account.voting_manabar.last_update_time;
......
......@@ -13,7 +13,7 @@ See also [RC Bandwidth Parameters]({{ '/tutorials-recipes/rc-bandwidth-parameter
The *RC bandwidth system* is a complete rewrite of the bandwidth system. Its goals include:
- Enable simple, effective UI feedback to users about bandwidth usage and remaining bandwidth
- Simplify the mental model of what buying additional SP gives users
- Simplify the mental model of what buying additional HP gives users
- Reduce or eliminate unstable feedback in current bandwidth system
### History
......
......@@ -71,9 +71,11 @@
searchResultsEl.innerHTML = resultsHTML;
searchProcessEl.innerText = "Showing";
searchProcessEl.style.backgroundImage = "none";
} else {
searchResultsEl.style.display = "none";
searchProcessEl.innerText = "No";
searchProcessEl.style.backgroundImage = "none";
}
}
......@@ -92,7 +94,7 @@
searchInputEl = document.getElementById("search-input");
searchInputEl.value = query;
searchQueryEl.innerText = query;
searchQueryEl.innerHTML = '<a href="https://www.google.com/search?q=site%3Adevelopers.hive.io+' + query + '">' + query + '</a>';
searchQueryContainerEl.style.display = "inline";
for (var key in window.data) {
......
......@@ -35,46 +35,46 @@ data_defined_ids:
---
<div class="search-page">
<h2>Search Results</h2>
<h2>Search Results</h2>
<p><span id="search-process">Loading</span> results <span id="search-query-container" style="display: none;">for "<strong id="search-query"></strong>"</span></p>
<ul id="search-results"></ul>
<p><span id="search-process">Loading &nbsp;&nbsp;&nbsp;</span> results <span id="search-query-container" style="display: none;">for "<strong id="search-query"></strong>"</span></p>
<ul id="search-results"></ul>
</div>
<script>
window.data = {
{% for collection in site.collections %}
{% for item in collection.docs %}
{% assign item_id = item.id | strip | slugify %}
{% unless page.data_defined_ids contains item_id %}
{% if item.title %}
{% unless item.excluded_in_search %}
{% if added %},{% endif %}
{% assign added = false %}
"{{ item_id }}": {
"id": "{{ item_id }}",
"title": "{{ item.title | strip | xml_escape }}",
"category": "{{ collection.label | strip | xml_escape }}",
"description": "{{ item.description | strip | xml_escape }}",
"type": "{{ item.type | strip | xml_escape }}",
"url": "{{ item.url | strip }}.html",
"content": {{ item.content | strip_html | replace_regex: "[\s/\n]+"," " | strip | jsonify }}
}
{% assign added = true %}
{% endunless %}
{% endif %}
{% endunless %}
{% endfor %}
{% endfor %}
window.data = {
{% for collection in site.collections -%}
{%- for item in collection.docs -%}
{%- assign item_id = item.id | strip | slugify -%}
{%- unless page.data_defined_ids contains item_id -%}
{%- if item.title -%}
{%- unless item.excluded_in_search -%}
{%- if added -%},{%- endif -%}
{%- assign added = false -%}
"{{ item_id }}": {
"id": "{{ item_id }}",
"title": "{{ item.title | strip | xml_escape }}",
"category": "{{ collection.label | strip | xml_escape }}",
"description": "{{ item.description | strip | xml_escape }}",
"type": "{{ item.type | strip | xml_escape }}",
"url": "{{ item.url | strip }}.html",
"content": "{{ item.content | strip_html | strip | replace: "\n", ' ' | jsonify | replace: '"', '' | replace: '\n', ' ' | replace: '\', '' | replace: ' ', ' ' }}"
}
{%- assign added = true -%}
{%- endunless -%}
{%- endif -%}
{%- endunless -%}
{%- endfor -%}
{%- endfor -%}
// # data_defined_ids is as follows