Login
Discover
Waves
Communities
Write
Login
Signup
lemooljiang
@lemooljiang
76
Designer , Poet , Technology enthusiasts
Followers
2368
Following
95
Follow
Email digest
Resource Credits
Available
Used
Location
Guangzhou
Created
2016-07-16 04:39
RSS Feed
Subscribe
Comments
Blog
Posts
Comments
Communities
Wallet
lemooljiang
HiveDevs
7M
RE: Introducing the Chain State Dashboard
👍🏾👍🏾
$ 0.000
0
lemooljiang
HIVE CN 中文社区
8M
RE: MC我的世界马
马不错哦
$ 0.000
0
1
lemooljiang
HIVE CN 中文社区
8M
RE: 当一个失误哭哭马爆火,像极了我们草率的人生
是的,现在都是情绪价值啰
lemooljiang
HIVE CN 中文社区
8M
RE: 智谱登陆港交所,也算是国产AI之光啰
涨这么多?!看来还需要点运气啊
lemooljiang
starnote
8M
RE: Hivejs开发实战指南
hive.api.getVestingDelegations('ned', '', 2, function(err, result) { console.log(err, result) }) //null [] eg: async getDelegateHP(){ let user = 'lemooljiang' let res = await
lemooljiang
starnote
8M
RE: Hivejs开发实战指南
HP代理是以VESTS来计算的 hive.broadcast.delegateVestingShares(wif, delegator, delegatee, vesting_shares, function(err, result) { console.log(err, result) }) wif - 资金私钥 delegator - 代理人 delegatee - 被代理人 vesting_shares
lemooljiang
starnote
8M
RE: Hivejs开发实战指南
hive.auth.generateKeys 用于生成4组密钥(owner, active, posting, memo), hvie.broadcast.accountCreate 用于创建新账号 register() { let newAccountName = "betty" //新帐户名 let newAccountPassword =
lemooljiang
starnote
8M
RE: Hivejs开发实战指南
let author = "lemooljiang" let permlink = "pvw4dotxg" let res = await hive.api.getActiveVotesAsync(author, permlink) console.log(566, res)
lemooljiang
starnote
8M
RE: Hivejs开发实战指南
hive.broadcast.transfer(wif, from, to, amount, memo, function(err, result) { console.log(err, result) }) // wif, from, to, amount, memo // 转账私钥,发起转帐地址,转给谁, 金额, 备注 transfer("wif", "lemool",
lemooljiang
starnote
8M
RE: Hivejs开发实战指南
从帐户历史中遍历获取 async function getToAuthorReplies(author, limit){ //获取对作者的最新评论 let replies = [] let res = await hive.api.getAccountHistoryAsync(author, -1, limit) res.forEach(item => { if(item[1].op[0] ==
lemooljiang
starnote
8M
RE: Hivejs开发实战指南
let author = "lemooljiang" let query = { limit : 30, start_author: author, start_permlink: ""} hive.api.getDiscussionsByComments(query, function(err, result) { console.log(265, err,
lemooljiang
starnote
8M
RE: Hivejs开发实战指南
使用递归的方法获取 async function getAllReplies(author, permlink, res=[]) { let replies = await hive.api.getContentRepliesAsync(author, permlink) let children = [] replies.forEach(item => { res.push(item)
lemooljiang
starnote
8M
RE: Hivejs开发实战指南
hive.api.getContentReplies(author, permlink, function(err, result) { console.log(err, result) }) eg: hive.api.getContentReplies('lemooljiang', 'hivejs-dev', function(err, result) { console.log(err, result)
lemooljiang
starnote
8M
RE: Hivejs开发实战指南
基本上所有的Hivejs函数都可以直接加上Async成为异步函数 let res = await hive.broadcast.commentAsync(wif, parentAuthor, parentPermlink, author, permlink, title, body, jsonMetadata)
lemooljiang
starnote
8M
RE: Hivejs开发实战指南
let wif = '5pfffff' let parentAuthor = '' let parentPermlink = 'cn' let author = 'lemooljiang' let permlink = 'kdk54gf' let title = '这是标题' let body = '这是正文' let tags = ['cn', 'miao', 'bitcoin'] let
lemooljiang
starnote
8M
RE: Hivejs开发实战指南
出于备份或加快索引,将文章备份在本地或是数据库中。使用上一节中的函数getDiscussionsByAuthorBeforeDate轮询出所有的文章,再做保存的逻辑。 import hive from '@hiveio/hive-js' import fs from "fs" //初始化hive节点 const hiveConNode = ' hive.api.setOptions({
lemooljiang
starnote
8M
RE: Hivejs开发实战指南
getDiscussionsByAuthorBeforeDate 这个函数实现 //获取最新文章 hive.api.getDiscussionsByAuthorBeforeDate(author, startPermlink, beforeDate, limit, function(err, result) { console.log(err, result) }) let author =
lemooljiang
starnote
8M
RE: Hivejs开发实战指南
基本都是 getDiscussionsByXXX 这样的格式,用法差不多 //query的参数结构 string tag; uint32_t limit = 0; set<string> filter_tags; set<string> select_authors; set<string> select_tags; uint32_t truncate_body
lemooljiang
starnote
8M
RE: Hivejs开发实战指南
hive.api.getFollowing('lemooljiang', '', 'blog', 10, function(err, result) { console.log(222, err, result) })
lemooljiang
starnote
8M
RE: Hivejs开发实战指南
hive.api.getFollowers('lemooljiang', '', 'blog', 10, function(err, result) { console.log(111, err, result) })
← Latest
Older →