Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

admin接口问题 #175

Open
antgan opened this issue Jun 3, 2018 · 12 comments
Open

admin接口问题 #175

antgan opened this issue Jun 3, 2018 · 12 comments

Comments

@antgan
Copy link

antgan commented Jun 3, 2018

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

hope your reply.

@zhang1g2
Copy link

zhang1g2 commented Jun 3, 2018

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

@yupnano
Copy link
Contributor

yupnano commented Jun 4, 2018

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

@antgan
Copy link
Author

antgan commented Jun 4, 2018

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

@hiliushuo
Copy link
Contributor

同遇到这个问题,求解~

@hiliushuo
Copy link
Contributor

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

@yupnano
Copy link
Contributor

yupnano commented Jun 4, 2018

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

@hiliushuo
Copy link
Contributor

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

@hiliushuo
Copy link
Contributor

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

@yupnano
Copy link
Contributor

yupnano commented Jun 4, 2018

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

@hiliushuo
Copy link
Contributor

好的,感谢!~~~

@antgan
Copy link
Author

antgan commented Jun 5, 2018

感谢@yupnano

@weiht12
Copy link

weiht12 commented Dec 5, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants