eos智能合约与主进程交互

1.启动wasm

参考eos智能合约执行流程.md

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()

最新文章

  1. 关于js中this关键字的补充
  2. opencv计算运行时间
  3. window.frameElement的使用
  4. JSON 和 XML 优缺点的比较
  5. C++:不同类型的指针的本质与差异
  6. requirejs实验001.对我来说,用AMD的方式来组织代码并不轻松.
  7. 【leetcode】Intersection of Two Linked Lists(easy)
  8. Invitation Cards(邻接表+逆向建图+SPFA)
  9. Codeforces 430B Balls Game(Two Pointers)
  10. webservice(soap)接口的加密,SHA-1实现
  11. apt-get命令失效
  12. 使用vs2015编写c语言程序
  13. java围棋游戏源代码
  14. spring 的OpenSessionInViewFilter简介
  15. MVC简单增删改
  16. Windows to go 慢,更换 user profile 路径
  17. Jenkins执行selenium报错unknown error: cannot find Chrome binary
  18. 基于node.js+socket.io+html5实现的斗地主游戏(1)概述
  19. 登录页面jsp跳转到另一个jsp 与jsp-Servlet-jsp
  20. 最全 C 语言常用算法详解-排序-队列-堆栈-链表-递归-树 (面试有用)

热门文章

  1. 安恒月赛 image up
  2. jmter+ANT+jekins之配置文件简单优化(build.xml)
  3. Shell脚本直接执行sql语句和不显示列名
  4. psql 工具详细使用介绍
  5. leetcode NO.7 反转整数 (python实现)
  6. redis 集群分配哈希曹
  7. spring boot redis代码与配置
  8. Socket通信入门小实例
  9. py2exe error: [Errno 2] No such file or directory: 'MSVCP90.dll'
  10. jmeter的参数化方法汇总