Unverified Commit 0d8b0474 authored by andyYuanFZM's avatar andyYuanFZM Committed by GitHub

Merge pull request #6 from jpeng-go/master

更新storage.proto
parents 1c627bbf db9944a5
......@@ -5,6 +5,7 @@ import (
"github.com/33cn/chain33-sdk-go/crypto"
. "github.com/33cn/chain33-sdk-go/types"
"math/rand"
"time"
)
/*
......@@ -35,10 +36,10 @@ func CreateContentStorageTx(paraName string, op int32, key string, content []byt
}},
}
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.Int63n(time.Now().UnixNano()), To: Addr}
return tx, nil
} 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.Int63n(time.Now().UnixNano()), To: crypto.GetExecAddress(paraName + StorageX)}
return tx, nil
}
}
......
......@@ -8,8 +8,9 @@ message Storage {
LinkNotaryStorage linkStorage = 3;
EncryptNotaryStorage encryptStorage = 4;
EncryptShareNotaryStorage encryptShareStorage = 5;
EncryptNotaryAdd encryptAdd = 6;
}
int32 ty = 6;
int32 ty = 7;
}
message StorageAction {
......@@ -19,12 +20,12 @@ message StorageAction {
LinkNotaryStorage linkStorage = 3;
EncryptNotaryStorage encryptStorage = 4;
EncryptShareNotaryStorage encryptShareStorage = 5;
EncryptNotaryAdd encryptAdd = 6;
}
int32 ty = 6;
int32 ty = 7;
}
// 内容存证模型
message ContentOnlyNotaryStorage {
//长度需要小于512k
bytes content = 1;
//自定义的主键,可以为空,如果没传,则用txhash为key
......@@ -85,6 +86,16 @@ message EncryptShareNotaryStorage {
//字符串值
string value = 5;
}
// 加密存证数据运算
message EncryptNotaryAdd {
//源操作数存证索引
string key = 1;
//待操作数据
bytes encryptAdd = 2;
}
service storage {}
//根据txhash去状态数据库中查询存储内容
message QueryStorage {
string txHash = 1;
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment