wiki icon indicating copy to clipboard operation
wiki copied to clipboard

admin接口问题

Open antgan opened this issue 6 years ago • 12 comments

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

hope your reply.

antgan avatar Jun 03 '18 10:06 antgan

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

zhang1g2 avatar Jun 03 '18 23:06 zhang1g2

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

yupnano avatar Jun 04 '18 08:06 yupnano

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

antgan avatar Jun 04 '18 09:06 antgan

同遇到这个问题,求解~

hiliushuo avatar Jun 04 '18 16:06 hiliushuo

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

hiliushuo avatar Jun 04 '18 16:06 hiliushuo

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

yupnano avatar Jun 04 '18 16:06 yupnano

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

hiliushuo avatar Jun 04 '18 16:06 hiliushuo

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

hiliushuo avatar Jun 04 '18 16:06 hiliushuo

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

yupnano avatar Jun 04 '18 16:06 yupnano

好的,感谢!~~~

hiliushuo avatar Jun 04 '18 16:06 hiliushuo

感谢@yupnano

antgan avatar Jun 05 '18 03:06 antgan

你好,此版本为星云旧版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)

weiht12 avatar Dec 05 '18 07:12 weiht12