Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
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
plugin
Commits
ee7a9adf
Commit
ee7a9adf
authored
Apr 09, 2020
by
harrylee
Committed by
vipwzw
Apr 09, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add value field for storage
parent
28885ad0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
2 deletions
+19
-2
storagedb.go
plugin/dapp/storage/executor/storagedb.go
+9
-2
storage.proto
plugin/dapp/storage/proto/storage.proto
+10
-0
storage.pb.go
plugin/dapp/storage/types/storage.pb.go
+0
-0
No files found.
plugin/dapp/storage/executor/storagedb.go
View file @
ee7a9adf
...
@@ -55,8 +55,15 @@ func (s *StorageAction) ContentStorage(payload *ety.ContentOnlyNotaryStorage) (*
...
@@ -55,8 +55,15 @@ func (s *StorageAction) ContentStorage(payload *ety.ContentOnlyNotaryStorage) (*
if
err
==
nil
&&
storage
.
Ty
!=
ety
.
TyContentStorageAction
{
if
err
==
nil
&&
storage
.
Ty
!=
ety
.
TyContentStorageAction
{
return
nil
,
ety
.
ErrStorageType
return
nil
,
ety
.
ErrStorageType
}
}
content
:=
append
(
storage
.
GetContentStorage
()
.
Content
,
[]
byte
(
","
)
...
)
if
payload
.
GetContent
()
!=
nil
{
payload
.
Content
=
append
(
content
,
payload
.
Content
...
)
content
:=
append
(
storage
.
GetContentStorage
()
.
Content
,
[]
byte
(
","
)
...
)
payload
.
Content
=
append
(
content
,
payload
.
Content
...
)
}
if
payload
.
GetValue
()
!=
""
{
value
:=
storage
.
GetContentStorage
()
.
GetValue
()
+
","
+
payload
.
GetValue
()
payload
.
Value
=
value
}
}
}
stg
:=
&
ety
.
Storage
{
Value
:
&
ety
.
Storage_ContentStorage
{
ContentStorage
:
payload
},
Ty
:
ety
.
TyContentStorageAction
}
stg
:=
&
ety
.
Storage
{
Value
:
&
ety
.
Storage_ContentStorage
{
ContentStorage
:
payload
},
Ty
:
ety
.
TyContentStorageAction
}
log
:=
&
types
.
ReceiptLog
{
Ty
:
ety
.
TyContentStorageLog
,
Log
:
types
.
Encode
(
stg
)}
log
:=
&
types
.
ReceiptLog
{
Ty
:
ety
.
TyContentStorageLog
,
Log
:
types
.
Encode
(
stg
)}
...
...
plugin/dapp/storage/proto/storage.proto
View file @
ee7a9adf
...
@@ -30,6 +30,8 @@ message ContentOnlyNotaryStorage {
...
@@ -30,6 +30,8 @@ message ContentOnlyNotaryStorage {
bytes
content
=
2
;
bytes
content
=
2
;
//自定义的主键,可以为空,如果没传,则用txhash为key
//自定义的主键,可以为空,如果没传,则用txhash为key
string
key
=
3
;
string
key
=
3
;
//字符串值
string
value
=
4
;
}
}
//哈希存证模型,推荐使用sha256哈希,限制256位得摘要值
//哈希存证模型,推荐使用sha256哈希,限制256位得摘要值
...
@@ -39,6 +41,8 @@ message HashOnlyNotaryStorage {
...
@@ -39,6 +41,8 @@ message HashOnlyNotaryStorage {
bytes
hash
=
1
;
bytes
hash
=
1
;
//自定义的主键,可以为空,如果没传,则用txhash为key
//自定义的主键,可以为空,如果没传,则用txhash为key
string
key
=
2
;
string
key
=
2
;
//字符串值
string
value
=
3
;
}
}
// 链接存证模型
// 链接存证模型
...
@@ -49,6 +53,8 @@ message LinkNotaryStorage {
...
@@ -49,6 +53,8 @@ message LinkNotaryStorage {
bytes
hash
=
2
;
bytes
hash
=
2
;
//自定义的主键,可以为空,如果没传,则用txhash为key
//自定义的主键,可以为空,如果没传,则用txhash为key
string
key
=
3
;
string
key
=
3
;
//字符串值
string
value
=
4
;
}
}
// 隐私存证模型,如果一个文件需要存证,且不公开内容,可以选择将源文件通过对称加密算法加密后上链
// 隐私存证模型,如果一个文件需要存证,且不公开内容,可以选择将源文件通过对称加密算法加密后上链
...
@@ -61,6 +67,8 @@ message EncryptNotaryStorage {
...
@@ -61,6 +67,8 @@ message EncryptNotaryStorage {
bytes
nonce
=
3
;
bytes
nonce
=
3
;
//自定义的主键,可以为空,如果没传,则用txhash为key
//自定义的主键,可以为空,如果没传,则用txhash为key
string
key
=
4
;
string
key
=
4
;
//字符串值
string
value
=
5
;
}
}
// 分享隐私存证模型,需要完备的sdk或者相应的密钥库支持
// 分享隐私存证模型,需要完备的sdk或者相应的密钥库支持
...
@@ -73,6 +81,8 @@ message EncryptShareNotaryStorage {
...
@@ -73,6 +81,8 @@ message EncryptShareNotaryStorage {
bytes
pubKey
=
3
;
bytes
pubKey
=
3
;
//自定义的主键,可以为空,如果没传,则用txhash为key
//自定义的主键,可以为空,如果没传,则用txhash为key
string
key
=
4
;
string
key
=
4
;
//字符串值
string
value
=
5
;
}
}
service
storage
{}
service
storage
{}
...
...
plugin/dapp/storage/types/storage.pb.go
View file @
ee7a9adf
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