Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
share
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄刚
share
Commits
0c84ad7b
Commit
0c84ad7b
authored
Jan 11, 2019
by
Hugo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add js合约
parent
0af31f0b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
82 additions
and
0 deletions
+82
-0
js合约.md
js合约.md
+0
-0
数据发布预言机合约接口及测试.md
数据发布预言机合约接口及测试.md
+82
-0
No files found.
js合约.md
0 → 100644
View file @
0c84ad7b
This diff is collapsed.
Click to expand it.
数据发布预言机合约接口及测试.md
0 → 100644
View file @
0c84ad7b
# 一、接口描述
# 一、接口描述
## 1 发布事件
### 1.1 生成发布事件的交易(未签名)
**请求报文:**
```
json
{
"jsonrpc"
:
"2.0"
,
"method"
:
"Chain33.CreateTransaction"
,
"params"
:
[
{
"execer"
:
"oracle"
,
"actionName"
:
"EventPublish"
,
"payload"
:
{
"type"
:
"string"
,
"subType"
:
"string"
,
"time"
:
int
64
,
"content"
:
"string"
,
"introduction"
:
"string"
}
}
],
"id"
:
int
32
}
```
**参数说明:**
|参数|类型|说明|
|----|----|----|
|type|string|事件类型|
|subType|string|事件子类型|
|time|int64|事件结果预计公布时间,UTC时间|
|content|string|事件内容,例如可以用json格式表示|
|introduction|string|事件介绍|
**响应报文**
```
json
{
"id"
:
int
32
,
"result"
:
"string"
,
"error"
:
null
}
```
**参数说明:**
|参数|类型|说明|
|----|----|----|
|result|string|交易十六进制编码后的字符串|
**示例**
Request:
```
json
{
"method"
:
"Chain33.CreateTransaction"
,
"params"
:
[
{
"execer"
:
"oracle"
,
"actionName"
:
"EventPublish"
,
"payload"
:
{
"type"
:
"football"
,
"subType"
:
"Premier League"
,
"time"
:
1548084600
,
"content"
:
"test"
,
"introduction"
:
"test2"
}
}
],
"id"
:
0
}
```
Response:
```
json
{
"id"
:
0
,
"result"
:
"0a066f7261636c65123138010a2d1208666f6f7462616c6c1a0e5072656d696572204c656167756520f8ca97e2052a04746573743205746573743220a08d06309a95a2ce81b6aabf1d3a22314350794a7152427a4c4b537a504c44416845454d64666f53464450513965477448"
,
"error"
:
null
}
```
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment