eos智能合约与主进程交互
eos智能合约与主进程交互
1.启动wasm
2.智能合约调用主进程api
如何实现wasm代码与eos宿主交互还需要摸索!
大致:在wasm_interface.cpp文件中,通过如下宏来实现wasm与宿主程序的api桥接
REGISTER_INTRINSICS(action_api,
(read_action_data, int(int, int))(action_data_size, int())(current_receiver, int64_t()));
3.整体流程
- 注册接口
REGISTER_INTRINSICS(authorization_api,
(require_recipient, void(int64_t))(require_authorization, void(int64_t), "require_auth", void (authorization_api::*)(const account_name &))(require_authorization, void(int64_t, int64_t), "require_auth2", void (authorization_api::*)(const account_name &, const permission_name &permission))(has_authorization, int(int64_t), "has_auth", bool (authorization_api::*)(const account_name &) const)(is_account, int(int64_t)));
- 接口调用
推测 智能合约代码 apply_social_vote() -> require_recipient() // 通过如上代码注入 -> authorization_api::require_recipient() -> apply_context::require_recipient()
最新文章
- 关于js中this关键字的补充
- opencv计算运行时间
- window.frameElement的使用
- JSON 和 XML 优缺点的比较
- C++:不同类型的指针的本质与差异
- requirejs实验001.对我来说,用AMD的方式来组织代码并不轻松.
- 【leetcode】Intersection of Two Linked Lists(easy)
- Invitation Cards(邻接表+逆向建图+SPFA)
- Codeforces 430B Balls Game(Two Pointers)
- webservice(soap)接口的加密,SHA-1实现
- apt-get命令失效
- 使用vs2015编写c语言程序
- java围棋游戏源代码
- spring 的OpenSessionInViewFilter简介
- MVC简单增删改
- Windows to go 慢,更换 user profile 路径
- Jenkins执行selenium报错unknown error: cannot find Chrome binary
- 基于node.js+socket.io+html5实现的斗地主游戏(1)概述
- 登录页面jsp跳转到另一个jsp 与jsp-Servlet-jsp
- 最全 C 语言常用算法详解-排序-队列-堆栈-链表-递归-树 (面试有用)
热门文章
- 安恒月赛 image up
- jmter+ANT+jekins之配置文件简单优化(build.xml)
- Shell脚本直接执行sql语句和不显示列名
- psql 工具详细使用介绍
- leetcode NO.7 反转整数 (python实现)
- redis 集群分配哈希曹
- spring boot redis代码与配置
- Socket通信入门小实例
- py2exe error: [Errno 2] No such file or directory: 'MSVCP90.dll'
- jmeter的参数化方法汇总