### This article is targeted at developers. Primarily witnesses. If you don't understand what a witness is, or why a price feed is needed, [read my article explaining witnesses](https://steemit.com/witness-category/@someguy123/seriously-what-is-a-witness-why-should-i-care-how-do-i-become-one-answer) Due to recent changes in @xeroc's Piston, @jesta's witness price feed isn't working correctly. While I'm not a big fan of Javascript, @svk's SteemJS-lib is pretty good. I used it to build **Steemfeed-JS**, which is a witness price feed in Javascript. It does **NOT** require `cli_wallet`, it should work across Windows, OSX, and Linux, with all dependencies in JS (just like @jesta/@clayop's). The price data is retrieved from my service, [Steem Value](https://steemit.com/steem/@someguy123/steemvalue-instant-steem-sbd-btc-usd-conversion-rates-in-your-browser), since it offers direct `steem_usd` prices via the JSON API. If people want to add more exchanges, they can submit a Pull Request. ### How to install? The source code is up on Github: https://github.com/Someguy123/steemfeed-js/ It requires Node v6. However I've also packaged it up with Docker for quick setup on most platforms. First, download the git repository, then edit config.json as needed. The interval is in minutes. ``` git clone https://github.com/Someguy123/steemfeed-js.git cd steemfeed-js cp config.example.json config.json nano config.json ``` Now, you can run it either with Node v6, or through Docker (recommended). Using docker: ``` docker build -t steemfeed-js . docker run -it --rm --name feed steemfeed-js # Check the status with docker logs docker logs feed ``` Using NodeJS: ``` # I recommend using NVM to manage NodeJS versioning nvm use v6 npm install npm start ``` Small side note: If you see a warning like this: ``` WARNING! ws connection wss://node.steem.ws closed WebSocket: will try to reconnect in 1 sec, attempt #1 connecting to wss://node.steem.ws ``` This is **not an error**. This is simply STEEM.WS disconnecting after 60 seconds of being idle. The script will still function with no problems at all. --- Do you like what I'm doing for STEEM/Steemit? ---- [Vote for me to be a witness](https://steemit.com/~witnesses) - every vote counts. ---- Don't forget to follow me for more like this.
author | someguy123 |
---|---|
permlink | steemfeed-js-a-nodejs-price-feed-for-witneses |
category | witness-category |
json_metadata | {"tags":["witness-category","steem","steem-help","steemit"],"users":["xeroc","jesta","svk"],"links":["https://steemit.com/witness-category/@someguy123/seriously-what-is-a-witness-why-should-i-care-how-do-i-become-one-answer","https://steemit.com/steem/@someguy123/steemvalue-instant-steem-sbd-btc-usd-conversion-rates-in-your-browser","https://github.com/Someguy123/steemfeed-js/","https://steemit.com/~witnesses"]} |
created | 2016-09-16 21:45:30 |
last_update | 2016-09-16 23:44:18 |
depth | 0 |
children | 8 |
last_payout | 2016-10-17 23:20:15 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 20.884 HBD |
curator_payout_value | 2.059 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 2,309 |
author_reputation | 103,945,664,283,580 |
root_title | "Steemfeed-JS - A NodeJS price feed for witneses" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 1,270,641 |
net_rshares | 18,544,244,190,571 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
jamesc | 0 | 5,623,062,154,051 | 15% | ||
badassmother | 0 | 1,857,559,698,132 | 100% | ||
rossco99 | 0 | 1,175,067,540,909 | 100% | ||
steemychicken1 | 0 | 1,728,519,133,172 | 100% | ||
joseph | 0 | 1,376,548,257,557 | 100% | ||
masteryoda | 0 | 580,738,578,356 | 100% | ||
boatymcboatface | 0 | 464,651,221,253 | 100% | ||
pfunk | 0 | 816,415,100,639 | 100% | ||
proctologic | 0 | 40,082,693,284 | 100% | ||
idol | 0 | 7,971,943,331 | 100% | ||
sakr | 0 | 4,327,864,724 | 100% | ||
patrice | 0 | 9,711,480,973 | 100% | ||
yefet | 0 | 10,885,952,375 | 40% | ||
valtr | 0 | 14,796,684,641 | 100% | ||
jocelyn | 0 | 1,381,770,388 | 100% | ||
gregory-f | 0 | 14,623,519,390 | 100% | ||
ervin-lemark | 0 | 15,918,692,973 | 100% | ||
gregory60 | 0 | 9,029,450,149 | 100% | ||
eeks | 0 | 344,662,368,533 | 45.81% | ||
fkn | 0 | 3,024,769,005 | 11% | ||
kingscrown | 0 | 14,988,904,122 | 17% | ||
paco-steem | 0 | 468,392,089 | 100% | ||
spaninv | 0 | 5,645,187,061 | 100% | ||
instructor2121 | 0 | 31,759,935,380 | 100% | ||
james-show | 0 | 16,149,008,048 | 100% | ||
teamsteem | 0 | 300,356,804,969 | 100% | ||
elishagh1 | 0 | 3,975,901,022 | 11% | ||
weenfan | 0 | 1,066,112,722 | 100% | ||
acidyo | 0 | 13,206,679,238 | 44% | ||
klye | 0 | 44,234,613,050 | 100% | ||
coar | 0 | 717,301,883 | 100% | ||
murh | 0 | 1,051,479,606 | 55.55% | ||
error | 0 | 1,788,778,867 | 100% | ||
cyber | 0 | 1,018,520,107,862 | 100% | ||
theshell | 0 | 58,209,894,926 | 100% | ||
billbutler | 0 | 260,110,825,867 | 100% | ||
thecryptofiend | 0 | 23,552,912,742 | 30% | ||
stiletto | 0 | 365,411,886 | 100% | ||
samether | 0 | 18,507,632,491 | 100% | ||
faddat | 0 | 97,698,353,316 | 100% | ||
mark-waser | 0 | 5,825,093,988 | 100% | ||
kimziv | 0 | 21,392,612,446 | 11% | ||
the.bot | 0 | 2,619,617,638 | 100% | ||
asmolokalo | 0 | 53,014,114,804 | 100% | ||
lehard | 0 | 63,103,731,550 | 100% | ||
garik100 | 0 | 131,962,281 | 100% | ||
riscadox | 0 | 5,167,594,252 | 100% | ||
endaksi1 | 0 | 6,844,164,937 | 100% | ||
derekareith | 0 | 135,664,954,165 | 100% | ||
rxhector | 0 | 734,457,144 | 100% | ||
picokernel | 0 | 33,321,667,770 | 100% | ||
furion | 0 | 113,218,900,410 | 100% | ||
neoxian | 0 | 529,892,625,263 | 100% | ||
barbara2 | 0 | 70,830,070 | 11% | ||
ch0c0latechip | 0 | 78,727,702 | 11% | ||
doge4lyf | 0 | 72,863,914 | 11% | ||
ausbitbank | 0 | 13,039,135,654 | 100% | ||
anyx | 0 | 174,969,640,752 | 100% | ||
jesta | 0 | 7,244,624,817 | 0% | ||
biophil | 0 | 39,855,744,988 | 100% | ||
karen13 | 0 | 4,210,608,333 | 40% | ||
dwinblood | 0 | 30,683,226,482 | 100% | ||
igster | 0 | 23,993,195,129 | 100% | ||
deviedev | 0 | 11,337,552,390 | 100% | ||
kaptainkrayola | 0 | 10,171,667,355 | 100% | ||
noodhoog | 0 | 8,233,038,220 | 100% | ||
luisucv34 | 0 | 1,145,230,341 | 100% | ||
inertia | 0 | 90,679,731,865 | 100% | ||
blueorgy | 0 | 187,455,330,671 | 100% | ||
poseidon | 0 | 466,577,784 | 11% | ||
jdenismusic | 0 | 147,403,710 | 100% | ||
simon.braki.love | 0 | 3,507,087,243 | 100% | ||
jl777 | 0 | 204,678,401,037 | 40% | ||
positive | 0 | 2,453,028,659 | 11% | ||
proto | 0 | 17,271,964,300 | 40% | ||
sisterholics | 0 | 3,626,554,293 | 11% | ||
logic | 0 | 11,448,309,881 | 100% | ||
fnait | 0 | 82,938,645 | 11% | ||
keepcalmand | 0 | 73,358,201 | 11% | ||
smailer | 0 | 40,930,670,251 | 100% | ||
fabien | 0 | 31,759,317,362 | 100% | ||
sulev | 0 | 2,858,006,369 | 100% | ||
glitterpig | 0 | 3,404,362,814 | 100% | ||
metaflute | 0 | 819,508,809 | 100% | ||
taker | 0 | 8,652,272,709 | 40% | ||
laonie | 0 | 127,915,554,710 | 11% | ||
laonie1 | 0 | 22,456,304,961 | 100% | ||
laonie2 | 0 | 22,975,538,277 | 100% | ||
laonie3 | 0 | 22,983,516,469 | 100% | ||
myfirst | 0 | 5,334,160,856 | 11% | ||
somebody | 0 | 25,951,884,937 | 11% | ||
sunshine | 0 | 15,298,201,330 | 100% | ||
flysaga | 0 | 970,215,816 | 11% | ||
gmurph | 0 | 9,597,678,062 | 45.89% | ||
midnightoil | 0 | 5,732,449,353 | 11% | ||
laonie4 | 0 | 22,979,536,629 | 100% | ||
laonie5 | 0 | 22,977,498,361 | 100% | ||
laonie6 | 0 | 22,974,498,335 | 100% | ||
laonie7 | 0 | 22,970,284,209 | 100% | ||
laonie8 | 0 | 22,966,269,405 | 100% | ||
laonie9 | 0 | 22,964,184,630 | 100% | ||
xiaohui | 0 | 14,341,128,919 | 11% | ||
ekitcho | 0 | 225,743,023 | 0% | ||
elfkitchen | 0 | 809,355,498 | 11% | ||
sillygoon | 0 | 233,743,607 | 100% | ||
kurtrohlandt | 0 | 2,157,887,018 | 100% | ||
xiaokongcom | 0 | 448,220,462 | 11% | ||
gargon | 0 | 14,811,765,144 | 100% | ||
pgarcgo | 0 | 3,086,554,647 | 100% | ||
xianjun | 0 | 903,592,395 | 11% | ||
melek | 0 | 4,994,088,297 | 100% | ||
mione | 0 | 10,330,040,917 | 100% | ||
microluck | 0 | 73,930,699 | 11% | ||
movievertigo | 0 | 3,465,293,445 | 100% | ||
laonie10 | 0 | 22,957,216,685 | 100% | ||
claudia | 0 | 371,568,875 | 100% | ||
someguy123 | 0 | 82,717,364,821 | 100% | ||
mlpfrank | 0 | 117,344,778 | 100% | ||
laonie11 | 0 | 2,632,817,642 | 11% | ||
davidjkelley | 0 | 1,626,278,125 | 100% | ||
greatness | 0 | 895,072,752 | 100% | ||
digital-wisdom | 0 | 15,243,132,986 | 100% | ||
ethical-ai | 0 | 3,713,331,942 | 100% | ||
jwaser | 0 | 6,687,279,592 | 100% | ||
keverw | 0 | 1,234,424,279 | 100% | ||
bwaser | 0 | 2,618,962,754 | 100% | ||
peskov | 0 | 2,689,236,028 | 100% | ||
anomaly | 0 | 611,600,661 | 100% | ||
ellepdub | 0 | 2,402,741,727 | 100% | ||
herpetologyguy | 0 | 11,277,689,327 | 100% | ||
morgan.waser | 0 | 4,715,349,565 | 100% | ||
teo | 0 | 61,065,566 | 100% | ||
nil1511 | 0 | 1,660,138,078 | 100% | ||
dodders007 | 0 | 4,000,747,720 | 100% | ||
strong-ai | 0 | 3,611,918,405 | 100% | ||
ndea30 | 0 | 158,739,170 | 100% | ||
domenico | 0 | 158,732,014 | 100% | ||
serena199 | 0 | 157,911,014 | 100% | ||
gia7 | 0 | 157,865,016 | 100% | ||
richie4 | 0 | 157,393,206 | 100% | ||
coraline88 | 0 | 157,346,598 | 100% | ||
harlen | 0 | 157,067,793 | 100% | ||
yanuel | 0 | 157,044,691 | 100% | ||
daritza | 0 | 156,979,398 | 100% | ||
antaja | 0 | 191,907,698 | 100% | ||
royfft | 0 | 153,282,874 | 100% | ||
drakos | 0 | 0 | 100% | ||
ddeveloperr | 0 | 0 | 100% | ||
diabloza | 0 | 0 | 100% | ||
cjin | 0 | 0 | 100% |
hi someguy123 just a question when you edit the config.json file do you use your personal wif or the wif of your witness node ??
author | diabloza |
---|---|
permlink | re-someguy123-steemfeed-js-a-nodejs-price-feed-for-witneses-20170901t141000518z |
category | witness-category |
json_metadata | {"tags":["witness-category"],"app":"steemit/0.1"} |
created | 2017-09-01 14:10:03 |
last_update | 2017-09-01 14:10:03 |
depth | 1 |
children | 1 |
last_payout | 2017-09-08 14:10:03 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 128 |
author_reputation | 1,529,627,825 |
root_title | "Steemfeed-JS - A NodeJS price feed for witneses" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 13,555,710 |
net_rshares | 0 |
It is the active private key from the permissions page
author | jublo |
---|---|
permlink | re-diabloza-re-someguy123-steemfeed-js-a-nodejs-price-feed-for-witneses-20170911t085547401z |
category | witness-category |
json_metadata | {"tags":["witness-category"],"app":"steemit/0.1"} |
created | 2017-09-11 08:55:48 |
last_update | 2017-09-11 08:55:48 |
depth | 2 |
children | 0 |
last_payout | 2017-09-18 08:55:48 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 55 |
author_reputation | 179,662,301 |
root_title | "Steemfeed-JS - A NodeJS price feed for witneses" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 14,535,840 |
net_rshares | 0 |
Just an observation. The following command runs the process in the foreground: ```docker run -it --rm --name feed steemfeed-js``` It should be like this, if you want to run it detached in the background: ```docker run -itd --rm --name feed steemfeed-js```
author | drakos |
---|---|
permlink | re-someguy123-steemfeed-js-a-nodejs-price-feed-for-witneses-20170704t045645194z |
category | witness-category |
json_metadata | {"tags":["witness-category"],"app":"steemit/0.1"} |
created | 2017-07-04 04:57:15 |
last_update | 2017-07-04 05:30:39 |
depth | 1 |
children | 1 |
last_payout | 2017-07-11 04:57:15 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 255 |
author_reputation | 112,280,226,665,329 |
root_title | "Steemfeed-JS - A NodeJS price feed for witneses" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 7,231,552 |
net_rshares | 0 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
yunkzilla | 0 | 0 | 100% | ||
cubanhacker | 0 | 0 | 100% |
ahhh thanks for this! Just what I needed :-)
author | quochuy |
---|---|
permlink | re-drakos-re-someguy123-steemfeed-js-a-nodejs-price-feed-for-witneses-20180311t033931812z |
category | witness-category |
json_metadata | {"tags":["witness-category"],"app":"steemit/0.1"} |
created | 2018-03-11 03:39:24 |
last_update | 2018-03-11 03:39:24 |
depth | 2 |
children | 0 |
last_payout | 2018-03-18 03:39:24 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 44 |
author_reputation | 758,372,221,814,367 |
root_title | "Steemfeed-JS - A NodeJS price feed for witneses" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 43,630,969 |
net_rshares | 0 |
I have fixed the feed publishing, and tested against the latest development version of piston. Will be releasing it in a new module in [steemtools](https://steemit.com/steemtools/@furion/ann-steemtools-a-high-level-python-library-for-steem) next week. For anyone interested, the updated method looks a bit something like this: ``` def witness_publish_feed(self, steem_usd_price, witness_name, wif, sim_mode=True): op = Feed_publish( **{"publisher": witness_name, "exchange_rate": { "base": "%s SBD" % steem_usd_price, "quote": "1.000 STEEM" }} ) tx = self.steem.constructTx(op, wif) if sim_mode: return tx return self.steem.broadcast(tx) ``` I have some other witness related goodies in works as well...
author | furion |
---|---|
permlink | re-someguy123-steemfeed-js-a-nodejs-price-feed-for-witneses-20160916t215436225z |
category | witness-category |
json_metadata | {"tags":["witness-category"],"links":["https://steemit.com/steemtools/@furion/ann-steemtools-a-high-level-python-library-for-steem"]} |
created | 2016-09-16 21:54:36 |
last_update | 2016-09-16 21:56:54 |
depth | 1 |
children | 0 |
last_payout | 2016-10-17 23:20:15 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.030 HBD |
curator_payout_value | 0.002 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 842 |
author_reputation | 116,503,940,714,958 |
root_title | "Steemfeed-JS - A NodeJS price feed for witneses" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 1,270,712 |
net_rshares | 131,951,745,939 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
kingscrown | 0 | 4,996,301,374 | 5% | ||
klye | 0 | 43,367,267,696 | 100% | ||
murh | 0 | 1,051,532,466 | 55.55% | ||
someguy123 | 0 | 81,110,389,488 | 100% | ||
yamadapc | 0 | 1,426,254,915 | 100% |
I love the effort, but I think something got lost in the principals of how this should work, and the approach used here is fundamentally flawed. If you look at all of the other example scripts out there, they all attach to multiple external data sources and make their own judgement of price. When once fails, it's fine because there are still multiple data sources. This script is reliant on the value.steem.network API for pricing information exclusively, which to be honest, shouldn't be trusted as the sole source of this information. Each witnesses price updates shouldn't be derived exactly from the same source. This creates a single point of failure for failure or abuse. I'm sorry, I don't mean to rain on your parade, but no one should use this.
author | jesta |
---|---|
permlink | re-someguy123-steemfeed-js-a-nodejs-price-feed-for-witneses-20160916t222142047z |
category | witness-category |
json_metadata | {"tags":["witness-category"]} |
created | 2016-09-16 22:21:42 |
last_update | 2016-09-16 22:24:18 |
depth | 1 |
children | 2 |
last_payout | 2016-10-17 23:20:15 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 1.240 HBD |
curator_payout_value | 0.377 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 761 |
author_reputation | 140,605,453,893,072 |
root_title | "Steemfeed-JS - A NodeJS price feed for witneses" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 1,270,904 |
net_rshares | 3,578,127,553,217 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
clayop | 0 | 3,262,678,911,297 | 50% | ||
aizensou | 0 | 84,883,912,121 | 100% | ||
murh | 0 | 1,051,521,717 | 55.55% | ||
faddat | 0 | 97,698,353,316 | 100% | ||
furion | 0 | 49,234,753,775 | 44% | ||
someguy123 | 0 | 81,125,320,978 | 100% | ||
deaddy | 0 | 0 | 8% | ||
yamadapc | 0 | 1,454,780,013 | 100% |
Thanks for the information Jesta. It uses value.steem.network, just because I wanted an MVP out to temporarily replace the python feed as fast as possible. Steem Value uses Poloniex+BTC-e to determine the price, and has an API I could plug into very quickly. One of the reasons I'm able to personally trust this, is because the network doesn't exactly use a single witness as a source. One witness reporting $5 instead of $0.50 shouldn't shake the internal market. This isn't to say it's perfectly fine for this to be a permanent solution, I will add more exchanges later on. But the network itself is capable of filtering out bad price feeds, because some witnesses update their feeds by hand, some witnesses use their own scripts, and others use a variety of the third party scripts available, like yours, @steempty's or @clayop's original.
author | someguy123 |
---|---|
permlink | re-jesta-re-someguy123-steemfeed-js-a-nodejs-price-feed-for-witneses-20160916t225031447z |
category | witness-category |
json_metadata | {"tags":["witness-category"],"users":["steempty","clayop"]} |
created | 2016-09-16 22:50:33 |
last_update | 2016-09-16 22:50:33 |
depth | 2 |
children | 1 |
last_payout | 2016-10-17 23:20:15 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 846 |
author_reputation | 103,945,664,283,580 |
root_title | "Steemfeed-JS - A NodeJS price feed for witneses" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 1,271,153 |
net_rshares | 0 |
Every witness should have a control for its price feed, so the calculation should be transparent and easily modified by witnesses for their preferences. Relying on a single server lacks this aspect. It's fundamentally no difference with parsing price data from the coinmarketcap IMHO.
author | clayop |
---|---|
permlink | re-someguy123-re-jesta-re-someguy123-steemfeed-js-a-nodejs-price-feed-for-witneses-20160916t225529926z |
category | witness-category |
json_metadata | {"tags":["witness-category"]} |
created | 2016-09-16 22:55:30 |
last_update | 2016-09-16 22:55:30 |
depth | 3 |
children | 0 |
last_payout | 2016-10-17 23:20:15 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.096 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 285 |
author_reputation | 270,845,899,918,618 |
root_title | "Steemfeed-JS - A NodeJS price feed for witneses" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 1,271,184 |
net_rshares | 362,650,129,514 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
jesta | 0 | 362,650,129,514 | 100% |