nebulasio / wiki

This repository is out of date, please check the new wiki:
http://wiki.nebulas.io/en/latest/
GNU General Public License v3.0
421 stars 154 forks source link

admin接口问题 #175

Open antgan opened 6 years ago

antgan commented 6 years ago

官方说 admin不开放给用户。 问题: 那如果想实现一个定时任务,某个时间执行一个合约方法。那如何让它生效。 /v1/admin/transactionWithPassphrase 和/v1/admin/sign 都无法调用。

hope your reply.

zhang1g2 commented 6 years ago

如何在合约中实现定时任务?还是只能在客户端触发?

yupnano commented 6 years ago

实现定时任务和开放admin没关系呀。 目前的区块链没有定时执行某个合约的功能,只能自己定时发送交易去调用合约。

antgan commented 6 years ago

实现定时任务和开放admin没关系呀。 目前的区块链没有定时执行某个合约的功能,只能自己定时发送交易去调用合约。 ————> 你没理解我的问题,因为无法调用transactionWithPassphrase,所以定时任务只能call不能上链。

hiliushuo commented 6 years ago

同遇到这个问题,求解~

hiliushuo commented 6 years ago

@yupnano 他的意思是调用的合约方法需要消耗 gas(比如方法中有操作存储区的动作),这种方法直接调用 call 可以操作成功?

yupnano commented 6 years ago

@hiliushuo @antgan 不实用admin也是可以发送交易的,请参考https://github.com/nebulasio/neb.js/blob/master/example/node-example-transaction.js

hiliushuo commented 6 years ago

@yupnano 只能用 js 调用吗?总感觉 js 轮询不靠谱,用 Java 可以实现吗?想做监控~感谢

hiliushuo commented 6 years ago

@yupnano 我是只能用 java 调用 js 代码了吗😂

yupnano commented 6 years ago

不一定是JS,目前还有Java,PHP,Python的api SDK。 https://github.com/nebulasio/nebulasj https://github.com/nebulasio/neb.php

hiliushuo commented 6 years ago

好的,感谢!~~~

antgan commented 6 years ago

感谢@yupnano

weiht12 commented 5 years ago

你好,此版本为星云旧版wiki(后期逐步停止维护),欢迎将您的问题提交星云新版wiki,以便于获得及时解答。同时,参与wiki的编辑维护工作还会有奖励哦。新版wiki链接:https://wiki.nebulas.io/en/latest/ (英文);https://wiki.nebulas.io/zh_CN/latest/ (中文) Hello, this version is the nebulas old wiki (later stop maintenance), welcome to submit your question to the new nebulas wiki, in order to get timely answers. At the same time, there will be rewards for editing and maintaining the wiki. New wiki link: https://wiki.nebulas.io/en/latest/ (English); https://wiki.nebulas.io/zh_CN/latest/ (Chinese)