Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
chain33-sdk-go
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
chain33-sdk-go
Commits
0d8b0474
Unverified
Commit
0d8b0474
authored
Jan 22, 2021
by
andyYuanFZM
Committed by
GitHub
Jan 22, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6 from jpeng-go/master
更新storage.proto
parents
1c627bbf
db9944a5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
5 deletions
+17
-5
storage.go
dapp/storage/storage.go
+3
-2
storage.proto
proto/storage.proto
+14
-3
storage.pb.go
types/storage.pb.go
+0
-0
No files found.
dapp/storage/storage.go
View file @
0d8b0474
...
@@ -5,6 +5,7 @@ import (
...
@@ -5,6 +5,7 @@ import (
"github.com/33cn/chain33-sdk-go/crypto"
"github.com/33cn/chain33-sdk-go/crypto"
.
"github.com/33cn/chain33-sdk-go/types"
.
"github.com/33cn/chain33-sdk-go/types"
"math/rand"
"math/rand"
"time"
)
)
/*
/*
...
@@ -35,10 +36,10 @@ func CreateContentStorageTx(paraName string, op int32, key string, content []byt
...
@@ -35,10 +36,10 @@ func CreateContentStorageTx(paraName string, op int32, key string, content []byt
}},
}},
}
}
if
paraName
==
""
{
if
paraName
==
""
{
tx
:=
&
Transaction
{
Execer
:
[]
byte
(
StorageX
),
Payload
:
Encode
(
payload
),
Fee
:
1e5
,
Nonce
:
rand
.
Int63
(
),
To
:
Addr
}
tx
:=
&
Transaction
{
Execer
:
[]
byte
(
StorageX
),
Payload
:
Encode
(
payload
),
Fee
:
1e5
,
Nonce
:
rand
.
Int63
n
(
time
.
Now
()
.
UnixNano
()
),
To
:
Addr
}
return
tx
,
nil
return
tx
,
nil
}
else
{
}
else
{
tx
:=
&
Transaction
{
Execer
:
[]
byte
(
paraName
+
StorageX
),
Payload
:
Encode
(
payload
),
Fee
:
1e5
,
Nonce
:
rand
.
Int63
(
),
To
:
crypto
.
GetExecAddress
(
paraName
+
StorageX
)}
tx
:=
&
Transaction
{
Execer
:
[]
byte
(
paraName
+
StorageX
),
Payload
:
Encode
(
payload
),
Fee
:
1e5
,
Nonce
:
rand
.
Int63
n
(
time
.
Now
()
.
UnixNano
()
),
To
:
crypto
.
GetExecAddress
(
paraName
+
StorageX
)}
return
tx
,
nil
return
tx
,
nil
}
}
}
}
...
...
proto/storage.proto
View file @
0d8b0474
...
@@ -8,8 +8,9 @@ message Storage {
...
@@ -8,8 +8,9 @@ message Storage {
LinkNotaryStorage
linkStorage
=
3
;
LinkNotaryStorage
linkStorage
=
3
;
EncryptNotaryStorage
encryptStorage
=
4
;
EncryptNotaryStorage
encryptStorage
=
4
;
EncryptShareNotaryStorage
encryptShareStorage
=
5
;
EncryptShareNotaryStorage
encryptShareStorage
=
5
;
EncryptNotaryAdd
encryptAdd
=
6
;
}
}
int32
ty
=
6
;
int32
ty
=
7
;
}
}
message
StorageAction
{
message
StorageAction
{
...
@@ -19,12 +20,12 @@ message StorageAction {
...
@@ -19,12 +20,12 @@ message StorageAction {
LinkNotaryStorage
linkStorage
=
3
;
LinkNotaryStorage
linkStorage
=
3
;
EncryptNotaryStorage
encryptStorage
=
4
;
EncryptNotaryStorage
encryptStorage
=
4
;
EncryptShareNotaryStorage
encryptShareStorage
=
5
;
EncryptShareNotaryStorage
encryptShareStorage
=
5
;
EncryptNotaryAdd
encryptAdd
=
6
;
}
}
int32
ty
=
6
;
int32
ty
=
7
;
}
}
// 内容存证模型
// 内容存证模型
message
ContentOnlyNotaryStorage
{
message
ContentOnlyNotaryStorage
{
//长度需要小于512k
//长度需要小于512k
bytes
content
=
1
;
bytes
content
=
1
;
//自定义的主键,可以为空,如果没传,则用txhash为key
//自定义的主键,可以为空,如果没传,则用txhash为key
...
@@ -85,6 +86,16 @@ message EncryptShareNotaryStorage {
...
@@ -85,6 +86,16 @@ message EncryptShareNotaryStorage {
//字符串值
//字符串值
string
value
=
5
;
string
value
=
5
;
}
}
// 加密存证数据运算
message
EncryptNotaryAdd
{
//源操作数存证索引
string
key
=
1
;
//待操作数据
bytes
encryptAdd
=
2
;
}
service
storage
{}
//根据txhash去状态数据库中查询存储内容
//根据txhash去状态数据库中查询存储内容
message
QueryStorage
{
message
QueryStorage
{
string
txHash
=
1
;
string
txHash
=
1
;
...
...
types/storage.pb.go
View file @
0d8b0474
This diff is collapsed.
Click to expand it.
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