HiveJS: get info and vote for witness - Informationen erhalten und für Witness voten #16
DE (EN below)
In meinem letzten Beitrag habe ich gezeigt, wie man mit HiveJS HivePower delegiert.
In diesem Beitrag zeige ich wie man Witnesse abruft und wie man für einen Wittness ein Vote abgibt.
Wittness nach Votes abrufen
In der Dokumentation finden wir diverse Möglichkeiten, um Witnesse abzurufen. Eine davon ist die Witnesse nach den Votes, die sie erhalten abzurufen.
Dies erfolgt über die Funktion hive.api.getWitnessesByVote, die 2 Parameter erwartet.
- from Witnessname ab dem die Ausgabe erfolgen soll
- limit Anzahl der Witnesses die ausgegeben werden soll.
Um die Top 100 auszugeben, gibt man einen leeren String und 100 an.
für einen Witness Voten
Mit der Funktion hive.broadcast.accountWitnessVote kann ein Vote für einen Witness abgegeben werden.
- wif private Aktiv-Key des Voters
- account Nutzername des Voters
- witness Witnessname für den gevotet wird
- approve true order false um eine Stimme abzugeben bzw. wieder zu entziehen.
Witness proxy
Mit der Funktion hive.broadcast.accountWitnessProxy kann ein Witness proxy gesetzt werden, sodass man automatisch die gleichen Witnesses votet wie der gesetzte Proxy.
- wif private Aktiv-Key des Nutzers
- account Nutzername des Nutzers, der dem Proxy folgen soll
- proxy Nutzername, dessen Votes man folgt.
Witness Votes eines Nutzers
Möchte man wissen, für welche Witnesse ein Nutzer ein Vote abgegeben hat, nutzt man die Funktion hive.api.getAccounts. Die Witnesses sind über Witness_votes abrufbar.
Diesmal gibt es kein Beispielcode von mir, da es doch sehr simpel ist.
Wer Fragen hat, kann gern ein Kommentar da lassen. Am besten erwähnen, damit ich es mitbekomme.
EN
In my last post, I showed how to delegate HivePower using HiveJS.
In this post I show how to retrieve Witnesse and how to cast a vote for a Wittness.
Retrieve Wittness by Votes
In the documentation we can find various ways to retrieve Witnesse. One of them is to retrieve wittnesses according to the votes they receive.
This is done using the hive.api.getWitnessesByVote function, which expects 2 parameters.
- from witness name from which the output should be done.
- limit number of witnesses to be output.
To output the top 100, specify an empty string and 100.
for one witness vote
The hive.broadcast.accountWitnessVote function can be used to cast a vote for a Witness.
- wif private active key of the voter.
account username of the voter
witness Witnessname for which a vote is made - approve true or false to cast or withdraw a vote.
Witness proxy
With the function hive.broadcast.accountWitnessProxy a witness proxy can be set, so that you automatically vote the same witnesses as the set proxy.
- wif private active key of the user
- account username of the user who should follow the proxy
- proxy username whose votes to follow.
Witness votes of a user
If one wants to know for which witnesses a user has cast a vote, one uses the function hive.api.getAccounts. The witnesses can be retrieved via Witness_votes.
This time there is no example code from me, because it is very simple.
If you have any questions, feel free to leave a comment. It's best to mention , so I get it.
Translated with www.DeepL.com/Translator (free version)
Leave HiveJS: get info and vote for witness - Informationen erhalten und für Witness voten #16 to:
Read more #hive-169321 posts
Best Posts From hive-coding
We have not curated any of hive-coding's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From hive-coding
- Google VS ChatGPT (Plesk), and the winner is
- HiveSQL: Time of posts / Uhrzeit der Posts
- HiveSQL: Unused Hivepower - Ungenutze Hivepower
- HiveSQL: Age of active accounts
- HiveSQL: Monthly Active Users / User Registrations / Monthly Posts & Comments
- beneficiaries from DHF- begünstigte vom DHF
- HiveSQL: Top 100 HBD holders HiveSQL: Top 100 HBD Besitzer
- Which frontend ist used for Posting - Welches Frontend wird fürs Posten genutzt?
- KE with hive.min.js not possible - KE mit hive.min.js nicht möglich
- Get KE in HiveSQL - KE mit HiveSQL abfragen
- SPlex.gg Attack-Hide and Sort -Update
- SPlex.gg Attack-Hide and Sort
- hive-engine: How to retrieve data - Wie Daten abrufen
- Hivekeychain: how to send a comment - Wie sendet man ein Kommentar
- Keychain: How to sell your Dust Token - Wie verkauft man seine Staub-Token #19
- Hive-Engine: How to sell your Dust Token - Wie verkauft man seine Staub-Token
- HSBI API: Show Sponsor with HSBI unit and Date - Sponsoren anzeigen mit der HSBI Anzahl und dem Datum
- HiveJS: How to get current Voting Power ? - Wie erhält man die aktuelle Voting Power? #17
- HiveJS: get info and vote for witness - Informationen erhalten und für Witness voten #16
- Hivejs: How to delegtae hivepower - Wie delegiert man Hivepower? # 15