From 848f078aa6a2f6f11ee04d5622cd13dcb70825dd Mon Sep 17 00:00:00 2001 From: asettouf Date: Mon, 8 Jan 2018 00:38:31 +0100 Subject: [PATCH 1/2] Add go example, same as nodejs Signed-off-by: asettouf --- .../sawtooth_sdk/client/encoder.go | 260 +++ .../sawtooth_sdk/client/pem_loader.go | 52 + .../sawtooth_sdk/client/signer.go | 156 ++ .../sawtooth_sdk/logging/logger.go | 132 ++ .../sawtooth_sdk/messaging/connection.go | 246 +++ .../sawtooth_sdk/processor/errors.go | 38 + .../sawtooth_sdk/processor/handler.go | 70 + .../sawtooth_sdk/processor/processor.go | 358 ++++ .../sawtooth_sdk/processor/state.go | 313 +++ .../sawtooth_sdk/processor/worker.go | 207 ++ .../go-processor/src/handler/handler.go | 220 ++ .../go-processor/src/processor/main.go | 33 + .../src/sawtooth_sdk/client/encoder.go | 260 +++ .../src/sawtooth_sdk/client/pem_loader.go | 52 + .../src/sawtooth_sdk/client/signer.go | 156 ++ .../src/sawtooth_sdk/logging/logger.go | 132 ++ .../src/sawtooth_sdk/messaging/connection.go | 246 +++ .../src/sawtooth_sdk/processor/errors.go | 38 + .../src/sawtooth_sdk/processor/handler.go | 70 + .../src/sawtooth_sdk/processor/processor.go | 358 ++++ .../src/sawtooth_sdk/processor/state.go | 313 +++ .../src/sawtooth_sdk/processor/worker.go | 207 ++ .../authorization_pb2/authorization.pb.go | 373 ++++ .../protobuf/batch_pb2/batch.pb.go | 150 ++ .../protobuf/block_pb2/block.pb.go | 165 ++ .../protobuf/client_pb2/client.pb.go | 1861 +++++++++++++++++ .../client_peers_pb2/client_peers.pb.go | 115 + .../protobuf/events_pb2/events.pb.go | 468 +++++ .../protobuf/genesis_pb2/genesis.pb.go | 65 + .../protobuf/identity_pb2/identity.pb.go | 199 ++ .../protobuf/jvm_sc_pb2/jvm_sc.pb.go | 135 ++ .../protobuf/network_pb2/network.pb.go | 445 ++++ .../protobuf/processor_pb2/processor.pb.go | 380 ++++ .../protobuf/setting_pb2/setting.pb.go | 92 + .../state_context_pb2/state_context.pb.go | 476 +++++ .../state_delta_pb2/state_delta.pb.go | 454 ++++ .../transaction_pb2/transaction.pb.go | 228 ++ .../txn_receipt_pb2/txn_receipt.pb.go | 216 ++ .../protobuf/validator_pb2/validator.pb.go | 469 +++++ 39 files changed, 10208 insertions(+) create mode 100644 LFS171x/sawtooth-material/sawtooth-tuna/go-processor/sawtooth_sdk/client/encoder.go create mode 100644 LFS171x/sawtooth-material/sawtooth-tuna/go-processor/sawtooth_sdk/client/pem_loader.go create mode 100644 LFS171x/sawtooth-material/sawtooth-tuna/go-processor/sawtooth_sdk/client/signer.go create mode 100644 LFS171x/sawtooth-material/sawtooth-tuna/go-processor/sawtooth_sdk/logging/logger.go create mode 100644 LFS171x/sawtooth-material/sawtooth-tuna/go-processor/sawtooth_sdk/messaging/connection.go create mode 100644 LFS171x/sawtooth-material/sawtooth-tuna/go-processor/sawtooth_sdk/processor/errors.go create mode 100644 LFS171x/sawtooth-material/sawtooth-tuna/go-processor/sawtooth_sdk/processor/handler.go create mode 100644 LFS171x/sawtooth-material/sawtooth-tuna/go-processor/sawtooth_sdk/processor/processor.go create mode 100644 LFS171x/sawtooth-material/sawtooth-tuna/go-processor/sawtooth_sdk/processor/state.go create mode 100644 LFS171x/sawtooth-material/sawtooth-tuna/go-processor/sawtooth_sdk/processor/worker.go create mode 100644 LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/handler/handler.go create mode 100644 LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/processor/main.go create mode 100644 LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/client/encoder.go create mode 100644 LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/client/pem_loader.go create mode 100644 LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/client/signer.go create mode 100644 LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/logging/logger.go create mode 100644 LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/messaging/connection.go create mode 100644 LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/processor/errors.go create mode 100644 LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/processor/handler.go create mode 100644 LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/processor/processor.go create mode 100644 LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/processor/state.go create mode 100644 LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/processor/worker.go create mode 100644 LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/authorization_pb2/authorization.pb.go create mode 100644 LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/batch_pb2/batch.pb.go create mode 100644 LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/block_pb2/block.pb.go create mode 100644 LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/client_pb2/client.pb.go create mode 100644 LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/client_peers_pb2/client_peers.pb.go create mode 100644 LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/events_pb2/events.pb.go create mode 100644 LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/genesis_pb2/genesis.pb.go create mode 100644 LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/identity_pb2/identity.pb.go create mode 100644 LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/jvm_sc_pb2/jvm_sc.pb.go create mode 100644 LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/network_pb2/network.pb.go create mode 100644 LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/processor_pb2/processor.pb.go create mode 100644 LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/setting_pb2/setting.pb.go create mode 100644 LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/state_context_pb2/state_context.pb.go create mode 100644 LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/state_delta_pb2/state_delta.pb.go create mode 100644 LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/transaction_pb2/transaction.pb.go create mode 100644 LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/txn_receipt_pb2/txn_receipt.pb.go create mode 100644 LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/validator_pb2/validator.pb.go diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/sawtooth_sdk/client/encoder.go b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/sawtooth_sdk/client/encoder.go new file mode 100644 index 00000000..d2238e88 --- /dev/null +++ b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/sawtooth_sdk/client/encoder.go @@ -0,0 +1,260 @@ +/** + * Copyright 2017 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ------------------------------------------------------------------------------ + */ + +package client + +import ( + "encoding/hex" + "fmt" + "github.com/golang/protobuf/proto" + "sawtooth_sdk/protobuf/batch_pb2" + "sawtooth_sdk/protobuf/transaction_pb2" + "time" +) + +type TransactionParams struct { + FamilyName string + FamilyVersion string + PayloadEncoding string + Nonce string + BatcherPubkey string + Dependencies []string + Inputs []string + Outputs []string +} + +type Encoder struct { + privkey []byte + pubkey string + defaults TransactionParams +} + +// NewTransactionEncoder constructs a new encoder which can be used to generate +// transactions and batches, and to serialize batches for submitting to the +// REST API. +func NewEncoder(privkey []byte, defaults TransactionParams) *Encoder { + return &Encoder{ + privkey: privkey, + pubkey: hex.EncodeToString(GenPubKey(privkey)), + defaults: defaults, + } +} + +// -- Transactions -- + +// NewTransaction Creates a new transaction and handles the construction and +// signing of the transaction header. +func (self *Encoder) NewTransaction(payload []byte, p TransactionParams) *Transaction { + h := &transaction_pb2.TransactionHeader{ + // Load defaults + FamilyName: self.defaults.FamilyName, + FamilyVersion: self.defaults.FamilyVersion, + PayloadEncoding: self.defaults.PayloadEncoding, + Nonce: self.defaults.Nonce, + BatcherPubkey: self.defaults.BatcherPubkey, + + Inputs: self.defaults.Inputs, + Outputs: self.defaults.Outputs, + Dependencies: self.defaults.Dependencies, + + // Set unique fields + PayloadSha512: hex.EncodeToString(SHA512(payload)), + SignerPubkey: self.pubkey, + } + + // Override defaults if set + if p.FamilyName != "" { + h.FamilyName = p.FamilyName + } + if p.FamilyVersion != "" { + h.FamilyVersion = p.FamilyVersion + } + if p.PayloadEncoding != "" { + h.PayloadEncoding = p.PayloadEncoding + } + if p.Nonce != "" { + h.Nonce = p.Nonce + } + if p.BatcherPubkey != "" { + h.BatcherPubkey = p.BatcherPubkey + } + + if p.Inputs != nil { + h.Inputs = p.Inputs[:] + } + if p.Outputs != nil { + h.Outputs = p.Outputs[:] + } + if p.Dependencies != nil { + h.Dependencies = p.Dependencies[:] + } + + // Generate a nonce if none has been set yet + if h.Nonce == "" { + h.Nonce = fmt.Sprintf("%x", time.Now().UTC().UnixNano()) + } + + // If a BatcherPubkey hasn't been set yet, assume its our key + if h.BatcherPubkey == "" { + h.BatcherPubkey = self.pubkey + } + + hb, err := proto.Marshal(h) + if err != nil { + panic(err) + } + hs := hex.EncodeToString(Sign(hb, self.privkey)) + + transaction := &transaction_pb2.Transaction{ + Header: hb, + HeaderSignature: hs, + Payload: payload, + } + + return (*Transaction)(transaction) +} + +// SerializeTransactions serializes the given transactions to bytes for +// transmission to a separate batcher. +func SerializeTransactions(transactions []*Transaction) []byte { + txns := make([]*transaction_pb2.Transaction, 0, len(transactions)) + for _, tx := range transactions { + txns = append(txns, tx.ToPb()) + } + + tl := &transaction_pb2.TransactionList{ + Transactions: txns, + } + + tlb, err := proto.Marshal(tl) + if err != nil { + panic(err) + } + + return tlb +} + +// ParseTransactions deserializes the given bytes into a list of transactions. +// The bytes are assumed to be in the format returned by SerializeTransactions. +func ParseTransactions(b []byte) ([]*Transaction, error) { + tl := &transaction_pb2.TransactionList{} + err := proto.Unmarshal(b, tl) + if err != nil { + return nil, err + } + + txns := tl.GetTransactions() + + transactions := make([]*Transaction, 0, len(txns)) + for _, tx := range txns { + transactions = append(transactions, (*Transaction)(tx)) + } + + return transactions, nil +} + +// -- Batches -- + +// NewBatch creates a new batch from the given transactions created by +// NewTransaction. It handles the construction and signing of the batch header. +func (self *Encoder) NewBatch(transactions []*Transaction) *Batch { + txnIds := make([]string, 0, len(transactions)) + txns := make([]*transaction_pb2.Transaction, 0, len(transactions)) + for _, tx := range transactions { + txnIds = append(txnIds, tx.Id()) + txns = append(txns, tx.ToPb()) + } + + h := &batch_pb2.BatchHeader{ + SignerPubkey: self.pubkey, + TransactionIds: txnIds, + } + + hb, err := proto.Marshal(h) + if err != nil { + panic(err) + } + + hs := hex.EncodeToString(Sign(hb, self.privkey)) + + batch := &batch_pb2.Batch{ + Header: hb, + HeaderSignature: hs, + Transactions: txns, + } + + return (*Batch)(batch) +} + +// SerializeBatches serializes the given batches to bytes in the form expected +// by the REST API. +func SerializeBatches(batches []*Batch) []byte { + bs := make([]*batch_pb2.Batch, 0, len(batches)) + for _, b := range batches { + bs = append(bs, b.ToPb()) + } + bl := &batch_pb2.BatchList{ + Batches: bs, + } + + blb, err := proto.Marshal(bl) + if err != nil { + panic(err) + } + + return blb +} + +// ParseBatches deserializes the given bytes into a list of batches. The bytes +// are assumed to be in the format returned by SerializeBatches. +func ParseBatches(b []byte) ([]*Batch, error) { + bl := &batch_pb2.BatchList{} + err := proto.Unmarshal(b, bl) + if err != nil { + return nil, err + } + + bs := bl.GetBatches() + + batches := make([]*Batch, 0, len(bs)) + for _, b := range bs { + batches = append(batches, (*Batch)(b)) + } + + return batches, nil +} + +// -- Wrap Protobuf -- + +// Wrap the protobuf types so that they do not need to be imported separately. +type Transaction transaction_pb2.Transaction + +func (t *Transaction) ToPb() *transaction_pb2.Transaction { + return (*transaction_pb2.Transaction)(t) +} + +// GetId Returns the Transaction ID which can be used to specify this +// transaction as a dependency for other transactions. +func (t *Transaction) Id() string { + return t.ToPb().GetHeaderSignature() +} + +type Batch batch_pb2.Batch + +func (b *Batch) ToPb() *batch_pb2.Batch { + return (*batch_pb2.Batch)(b) +} diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/sawtooth_sdk/client/pem_loader.go b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/sawtooth_sdk/client/pem_loader.go new file mode 100644 index 00000000..51852341 --- /dev/null +++ b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/sawtooth_sdk/client/pem_loader.go @@ -0,0 +1,52 @@ +/** + * Copyright 2017 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ------------------------------------------------------------------------------ + */ + +package client + +// #cgo LDFLAGS: -lcrypto +// #include "../../../../c/loader.c" +import "C" + +import "fmt" + +func loadPemKey(pemstr string, pemstrLen int, password string) (priv_key string, pub_key string, err error) { + cPemstr := C.CString(pemstr) + cPemstrLen := C.size_t(pemstrLen) + cPassword := C.CString(password) + cOutPrivKey := C.CString("-----------------------------------------------------------------") + cOutPubKey := C.CString("-----------------------------------------------------------------------------------------------------------------------------------") + errnum := C.load_pem_key(cPemstr, cPemstrLen, cPassword, cOutPrivKey, cOutPubKey) + if errnum < 0 { + var errstr string + switch errnum { + case -1: + errstr = "Failed to decrypt or decode private key" + case -2: + errstr = "Failed to create new big number context" + case -3: + errstr = "Failed to load group" + case -4: + errstr = "Failed to load private key" + case -5: + errstr = "Failed to load public key point" + case -6: + errstr = "Failed to construct public key from point" + } + return "", "", fmt.Errorf(errstr) + } + return C.GoString(cOutPrivKey), C.GoString(cOutPubKey), nil +} diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/sawtooth_sdk/client/signer.go b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/sawtooth_sdk/client/signer.go new file mode 100644 index 00000000..c3f20c09 --- /dev/null +++ b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/sawtooth_sdk/client/signer.go @@ -0,0 +1,156 @@ +/** + * Copyright 2017 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ------------------------------------------------------------------------------ + */ + +package client + +import ( + "crypto/sha256" + "crypto/sha512" + "encoding/hex" + "fmt" + ellcurv "github.com/btcsuite/btcd/btcec" + "github.com/btcsuite/btcutil/base58" + "math/big" +) + +// -- Key Gen -- + +// GenPrivKey generates a new private key and returns it as bytes +func GenPrivKey() []byte { + priv, err := ellcurv.NewPrivateKey(ellcurv.S256()) + if err != nil { + panic("Failed to generate private key") + } + return priv.Serialize() +} + +// GenPubKey generates a new public key from a given private key and returns it +// using the 33 byte compressed format +func GenPubKey(privkey []byte) []byte { + _, pub := ellcurv.PrivKeyFromBytes(ellcurv.S256(), privkey) + return pub.SerializeCompressed() +} + +// -- Signing -- + +// Sign uses the given private key to calculate a signature for the given data. +// A sha256 hash of the data is first calculated and this is what is actually +// signed. Returns the signature as bytes using the compact serialization +// (which is just (r, s)). +func Sign(data, privkey []byte) []byte { + priv, _ := ellcurv.PrivKeyFromBytes(ellcurv.S256(), privkey) + + hash := SHA256(data) + + sig, err := priv.Sign(hash) + if err != nil { + panic("Signing failed") + } + + return serializeCompact(sig) +} + +// Verify uses the given public key to verify that the given signature was +// created from the given data using the associated private key. A sha256 hash +// of the data is calculated first and this is what is actually used to verify +// the signature. +func Verify(data, signature, pubkey []byte) bool { + sig := deserializeCompact(signature) + hash := SHA256(data) + pub, err := ellcurv.ParsePubKey(pubkey, ellcurv.S256()) + if err != nil { + panic(err.Error()) + } + return sig.Verify(hash, pub) +} + +// -- SHA -- + +// SHA512 calculates a sha512 has from the given input byte slice +func SHA512(input []byte) []byte { + hash := sha512.New() + hash.Write(input) + return hash.Sum(nil) +} + +// SHA256 calculates a sha256 has from the given input byte slice +func SHA256(input []byte) []byte { + hash := sha256.New() + hash.Write(input) + return hash.Sum(nil) +} + +// -- WIF -- + +// PrivToWif converts a private key generated to a WIF string +func PrivToWif(priv []byte) string { + extended := append([]byte{0x80}, priv...) + checksum := SHA256(SHA256(extended))[:4] + extcheck := append(extended, checksum...) + return base58.Encode(extcheck) +} + +// WifToPriv converts a WIF string to a private key +func WifToPriv(wif string) (key []byte, err error) { + defer func() { + if recover() != nil { + err = fmt.Errorf("Failed to load WIF key") + } + }() + extcheck := base58.Decode(wif) + return extcheck[1 : len(extcheck)-4], nil +} + +func PemToPriv(pem string, password string) ([]byte, error) { + pemlen := len(pem) + priv, _, err := loadPemKey(pem, pemlen, password) + if err != nil { + return nil, err + } + return hex.DecodeString(priv) +} + +// --- + +func serializeCompact(sig *ellcurv.Signature) []byte { + b := make([]byte, 0, 64) + // TODO: Padding + rbytes := pad(sig.R.Bytes(), 32) + sbytes := pad(sig.S.Bytes(), 32) + b = append(b, rbytes...) + b = append(b, sbytes...) + if len(b) != 64 { + panic("Invalid signature length") + } + return b +} + +func deserializeCompact(b []byte) *ellcurv.Signature { + return &ellcurv.Signature{ + R: new(big.Int).SetBytes(b[:32]), + S: new(big.Int).SetBytes(b[32:]), + } +} + +func pad(buf []byte, size int) []byte { + newbuf := make([]byte, 0, size) + padLength := size - len(buf) + for i := 0; i < padLength; i++ { + newbuf = append(newbuf, 0) + } + return append(newbuf, buf...) +} diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/sawtooth_sdk/logging/logger.go b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/sawtooth_sdk/logging/logger.go new file mode 100644 index 00000000..5090a04a --- /dev/null +++ b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/sawtooth_sdk/logging/logger.go @@ -0,0 +1,132 @@ +/** + * Copyright 2017 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ------------------------------------------------------------------------------ + */ + +package logging + +import ( + "fmt" + "io" + "log" + "os" +) + +const ( + CRITICAL = 50 + ERROR = 40 + WARN = 30 + INFO = 20 + DEBUG = 10 +) + +// Set the calldepth so we get the right file when logging +const ( + CALLDEPTH = 3 + FLAGS = log.Lshortfile | log.LstdFlags | log.Lmicroseconds +) + +type Logger struct { + logger *log.Logger + level int +} + +var _LOGGER *Logger = nil + +func Get() *Logger { + if _LOGGER == nil { + _LOGGER = &Logger{ + logger: log.New(os.Stdout, "", FLAGS), + level: DEBUG, + } + } + return _LOGGER +} + +func (self *Logger) SetLevel(level int) { + self.level = level +} + +func (self *Logger) SetOutput(w io.Writer) { + self.logger.SetOutput(w) +} + +func (self *Logger) Debugf(format string, v ...interface{}) { + if self.level <= DEBUG { + self.logf("DEBUG", format, v...) + } +} + +func (self *Logger) Debug(v ...interface{}) { + if self.level <= DEBUG { + self.log("DEBUG", v...) + } +} + +func (self *Logger) Infof(format string, v ...interface{}) { + if self.level <= INFO { + self.logf("INFO", format, v...) + } +} + +func (self *Logger) Info(v ...interface{}) { + if self.level <= INFO { + self.log("INFO", v...) + } +} + +func (self *Logger) Warnf(format string, v ...interface{}) { + if self.level <= WARN { + self.logf("WARN", format, v...) + } +} + +func (self *Logger) Warn(v ...interface{}) { + if self.level <= WARN { + self.log("WARN", v...) + } +} + +func (self *Logger) Errorf(format string, v ...interface{}) { + if self.level <= ERROR { + self.logf("ERROR", format, v...) + } +} + +func (self *Logger) Error(v ...interface{}) { + if self.level <= ERROR { + self.log("ERROR", v...) + } +} + +func (self *Logger) Criticalf(format string, v ...interface{}) { + if self.level <= CRITICAL { + self.logf("CRITICAL", format, v...) + } +} + +func (self *Logger) Critical(v ...interface{}) { + if self.level <= CRITICAL { + self.log("CRITICAL", v...) + } +} + +func (self *Logger) logf(prefix string, format string, v ...interface{}) { + self.logger.Output(CALLDEPTH, "["+prefix+"] "+fmt.Sprintf(format, v...)) +} + +func (self *Logger) log(prefix string, v ...interface{}) { + self.logger.Output(CALLDEPTH, "["+prefix+"] "+fmt.Sprint(v...)) +} diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/sawtooth_sdk/messaging/connection.go b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/sawtooth_sdk/messaging/connection.go new file mode 100644 index 00000000..99ed4088 --- /dev/null +++ b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/sawtooth_sdk/messaging/connection.go @@ -0,0 +1,246 @@ +/** + * Copyright 2017 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ------------------------------------------------------------------------------ + */ + +// Package messaging handles lower-level communication between a transaction +// processor and validator. +package messaging + +import ( + "fmt" + "github.com/golang/protobuf/proto" + zmq "github.com/pebbe/zmq4" + uuid "github.com/satori/go.uuid" + "sawtooth_sdk/logging" + "sawtooth_sdk/protobuf/validator_pb2" +) + +var logger *logging.Logger = logging.Get() + +// Generate a new UUID +func GenerateId() string { + return fmt.Sprint(uuid.NewV4()) +} + +// DumpMsg serializes a validator message +func DumpMsg(t validator_pb2.Message_MessageType, c []byte, corrId string) ([]byte, error) { + msg := &validator_pb2.Message{ + MessageType: t, + CorrelationId: corrId, + Content: c, + } + return proto.Marshal(msg) +} + +// LoadMsg deserializes a validator message +func LoadMsg(data []byte) (msg *validator_pb2.Message, err error) { + msg = &validator_pb2.Message{} + err = proto.Unmarshal(data, msg) + return +} + +type Connection interface { + SendData(id string, data []byte) error + SendNewMsg(t validator_pb2.Message_MessageType, c []byte) (corrId string, err error) + SendNewMsgTo(id string, t validator_pb2.Message_MessageType, c []byte) (corrId string, err error) + SendMsg(t validator_pb2.Message_MessageType, c []byte, corrId string) error + SendMsgTo(id string, t validator_pb2.Message_MessageType, c []byte, corrId string) error + RecvData() (string, []byte, error) + RecvMsg() (string, *validator_pb2.Message, error) + RecvMsgWithId(corrId string) (string, *validator_pb2.Message, error) + Close() + Socket() *zmq.Socket + Identity() string +} + +// Connection wraps a ZMQ DEALER socket or ROUTER socket and provides some +// utility methods for sending and receiving messages. +type ZmqConnection struct { + identity string + uri string + socket *zmq.Socket + incoming map[string]*storedMsg +} + +type storedMsg struct { + Id string + Msg *validator_pb2.Message +} + +// NewConnection establishes a new connection using the given ZMQ context and +// socket type to the given URI. +func NewConnection(context *zmq.Context, t zmq.Type, uri string) (*ZmqConnection, error) { + socket, err := context.NewSocket(t) + if err != nil { + return nil, fmt.Errorf("Failed to create ZMQ socket: %v", err) + } + + identity := GenerateId() + socket.SetIdentity(identity) + + logger.Info("Connecting to ", uri) + switch t { + case zmq.ROUTER: + err = socket.Bind(uri) + case zmq.DEALER: + err = socket.Connect(uri) + } + if err != nil { + return nil, fmt.Errorf("Failed to connect to %v: %v", uri, err) + } + + return &ZmqConnection{ + identity: identity, + uri: uri, + socket: socket, + incoming: make(map[string]*storedMsg), + }, nil +} + +// SendData sends the byte array. +// +// If id is not "", the id is included as the first part of the message. This +// is useful for passing messages to a ROUTER socket so it can route them. +func (self *ZmqConnection) SendData(id string, data []byte) error { + if id != "" { + _, err := self.socket.SendMessage(id, [][]byte{data}) + if err != nil { + return err + } + } else { + _, err := self.socket.SendMessage([][]byte{data}) + if err != nil { + return err + } + } + return nil +} + +// SendNewMsg creates a new validator message, assigns a new correlation id, +// serializes it, and sends it. It returns the correlation id created. +func (self *ZmqConnection) SendNewMsg(t validator_pb2.Message_MessageType, c []byte) (corrId string, err error) { + return self.SendNewMsgTo("", t, c) +} + +// SendNewMsgTo sends a new message validator message with the given id sent as +// the first part of the message. This is required when sending to a ROUTER +// socket, so it knows where to route the message. +func (self *ZmqConnection) SendNewMsgTo(id string, t validator_pb2.Message_MessageType, c []byte) (corrId string, err error) { + corrId = GenerateId() + return corrId, self.SendMsgTo(id, t, c, corrId) +} + +// Send a message with the given correlation id +func (self *ZmqConnection) SendMsg(t validator_pb2.Message_MessageType, c []byte, corrId string) error { + return self.SendMsgTo("", t, c, corrId) +} + +// Send a message with the given correlation id and the prepends the id like +// SendNewMsgTo() +func (self *ZmqConnection) SendMsgTo(id string, t validator_pb2.Message_MessageType, c []byte, corrId string) error { + data, err := DumpMsg(t, c, corrId) + if err != nil { + return err + } + + return self.SendData(id, data) +} + +// RecvData receives a ZMQ message from the wrapped socket and returns the +// identity of the sender and the data sent. If ZmqConnection does not wrap a +// ROUTER socket, the identity returned will be "". +func (self *ZmqConnection) RecvData() (string, []byte, error) { + msg, err := self.socket.RecvMessage(0) + + if err != nil { + return "", nil, err + } + switch len(msg) { + case 1: + data := []byte(msg[0]) + return "", data, nil + case 2: + id := msg[0] + data := []byte(msg[1]) + return id, data, nil + default: + return "", nil, fmt.Errorf( + "Receive message with unexpected length: %v", len(msg), + ) + } +} + +// RecvMsg receives a new validator message and returns it deserialized. If +// ZmqConnection wraps a ROUTER socket, id will be the identity of the sender. +// Otherwise, id will be "". +func (self *ZmqConnection) RecvMsg() (string, *validator_pb2.Message, error) { + for corrId, stored := range self.incoming { + delete(self.incoming, corrId) + return stored.Id, stored.Msg, nil + } + + // Receive a message from the socket + id, bytes, err := self.RecvData() + if err != nil { + return "", nil, err + } + + msg, err := LoadMsg(bytes) + return id, msg, err +} + +// RecvMsgWithId receives validator messages until a message with the given +// correlation id is found and returns this message. Any messages received that +// do not match the id are saved for subsequent receives. +func (self *ZmqConnection) RecvMsgWithId(corrId string) (string, *validator_pb2.Message, error) { + // If the message is already stored, just return it + stored, exists := self.incoming[corrId] + if exists { + return stored.Id, stored.Msg, nil + } + + for { + // If the message isn't stored, keep getting messages until it shows up + id, bytes, err := self.RecvData() + if err != nil { + return "", nil, err + } + msg, err := LoadMsg(bytes) + + // If the ids match, return it + if msg.GetCorrelationId() == corrId { + return id, msg, err + } + + // Otherwise, keep the message for later + self.incoming[msg.GetCorrelationId()] = &storedMsg{Id: id, Msg: msg} + } +} + +// Close closes the wrapped socket. This should be called with defer() after opening the socket. +func (self *ZmqConnection) Close() { + self.socket.Close() +} + +// Socket returns the wrapped socket. +func (self *ZmqConnection) Socket() *zmq.Socket { + return self.socket +} + +// Identity returns the identity assigned to the wrapped socket. +func (self *ZmqConnection) Identity() string { + return self.identity +} diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/sawtooth_sdk/processor/errors.go b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/sawtooth_sdk/processor/errors.go new file mode 100644 index 00000000..419b698a --- /dev/null +++ b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/sawtooth_sdk/processor/errors.go @@ -0,0 +1,38 @@ +/** + * Copyright 2017 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ------------------------------------------------------------------------------ + */ + +package processor + +import "fmt" + +type InvalidTransactionError struct { + Msg string + ExtendedData []byte +} + +func (err *InvalidTransactionError) Error() string { + return fmt.Sprint("Invalid transaction: ", err.Msg) +} + +type InternalError struct { + Msg string + ExtendedData []byte +} + +func (err *InternalError) Error() string { + return fmt.Sprint("Internal error: ", err.Msg) +} diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/sawtooth_sdk/processor/handler.go b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/sawtooth_sdk/processor/handler.go new file mode 100644 index 00000000..a0451e7c --- /dev/null +++ b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/sawtooth_sdk/processor/handler.go @@ -0,0 +1,70 @@ +/** + * Copyright 2017 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ------------------------------------------------------------------------------ + */ + +// Package processor defines: +// 1. A TransactionHandler interface to be used to create new transaction +// families. +// +// 2. A high-level, general purpose, multi-threaded TransactionProcessor that +// any number of handlers can be added to. +// +// 3. A Context class used to abstract getting and setting addresses in global +// validator state. +package processor + +import ( + "sawtooth_sdk/protobuf/processor_pb2" +) + +// TransactionHandler is the interface that defines the business logic for a +// new transaction family. This is the only interface that needs to be +// implemented to create a new transaction family. +// +// To create a transaction processor that uses a new transaction handler: +// +// validatorEndpoint := "tcp://localhost:4004" +// myHandler := NewMyHandler() +// processor := NewTransactionProcessor(validatorEndpoint) +// processor.AddHandler(myHandler) +// processor.Start() +// +// The FamilyName(), FamilyVersion(), Encoding(), and Namespaces() methods are +// used by the processor to route processing requests to the handler. +type TransactionHandler interface { + // FamilyName should return the name of the transaction family that this + // handler can process. Eg., "intkey" + FamilyName() string + + // FamilyVersion should return the version of the transaction family that + // this handler can process. Eg., "1.0" + FamilyVersion() string + + // Encoding should return the encoding that this handler can interpret. + // Eg., "application/cbor" + Encoding() string + + // Namespaces should return a slice containing all the handler's + // namespaces. Eg., []string{"abcdef"} + Namespaces() []string + + // Apply is the single method where all the business logic for a + // transaction family is defined. The method will be called by the + // transaction processor upon receiving a TpProcessRequest that the handler + // understands and will pass in the TpProcessRequest and an initialized + // instance of the Context type. + Apply(*processor_pb2.TpProcessRequest, *Context) error +} diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/sawtooth_sdk/processor/processor.go b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/sawtooth_sdk/processor/processor.go new file mode 100644 index 00000000..23ac668f --- /dev/null +++ b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/sawtooth_sdk/processor/processor.go @@ -0,0 +1,358 @@ +/** + * Copyright 2017 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ------------------------------------------------------------------------------ + */ + +package processor + +import ( + "fmt" + "github.com/golang/protobuf/proto" + zmq "github.com/pebbe/zmq4" + "os" + "os/signal" + "runtime" + "sawtooth_sdk/logging" + "sawtooth_sdk/messaging" + "sawtooth_sdk/protobuf/processor_pb2" + "sawtooth_sdk/protobuf/validator_pb2" +) + +var logger *logging.Logger = logging.Get() + +const MAX_WORK_QUEUE_SIZE = 100 + +// TransactionProcessor is a generic class for communicating with a validator +// and routing transaction processing requests to a registered handler. It uses +// ZMQ and channels to handle requests concurrently. +type TransactionProcessor struct { + uri string + context *zmq.Context + ids map[string]string + handlers []TransactionHandler + nThreads int + shutdown chan int +} + +// NewTransactionProcessor initializes a new Transaction Process and points it +// at the given URI. If it fails to initialize, it will panic. +func NewTransactionProcessor(uri string) *TransactionProcessor { + context, err := zmq.NewContext() + if err != nil { + panic(fmt.Sprint("Failed to create ZMQ context: ", err)) + } + return &TransactionProcessor{ + uri: uri, + context: context, + ids: make(map[string]string), + handlers: make([]TransactionHandler, 0), + nThreads: runtime.GOMAXPROCS(0), + shutdown: make(chan int), + } +} + +// AddHandler adds the given handler to the TransactionProcessor so it can +// receive transaction processing requests. All handlers must be added prior +// to starting the processor. +func (self *TransactionProcessor) AddHandler(handler TransactionHandler) { + self.handlers = append(self.handlers, handler) +} + +// Set the number of worker threads to be created for handling requests. Must +// be set before calling Start() +func (self *TransactionProcessor) SetThreadCount(n int) { + self.nThreads = n +} + +// Start connects the TransactionProcessor to a validator and starts listening +// for requests and routing them to an appropriate handler. +func (self *TransactionProcessor) Start() error { + // Establish a connection to the validator + validator, err := messaging.NewConnection(self.context, zmq.DEALER, self.uri) + if err != nil { + return fmt.Errorf("Could not connect to validator: %v", err) + } + defer validator.Close() + + // Setup connection to internal worker thread pool + workers, err := messaging.NewConnection(self.context, zmq.ROUTER, "inproc://workers") + if err != nil { + return fmt.Errorf("Could not create thread pool router: %v", err) + } + + // Make work queue. Buffer so the router doesn't block + queue := make(chan *validator_pb2.Message, MAX_WORK_QUEUE_SIZE) + + // Keep track of which correlation ids go to which worker threads, i.e. map + // corrId->workerThreadId + ids := make(map[string]string) + + // Startup worker thread pool + for i := 0; i < self.nThreads; i++ { + go worker(self.context, "inproc://workers", queue, self.handlers) + } + // Setup shutdown thread + go shutdown(self.context, "inproc://workers", queue, self.shutdown) + + workersLeft := uint(self.nThreads) + 1 + + // Setup ZMQ poller for routing messages between worker threads and validator + poller := zmq.NewPoller() + poller.Add(validator.Socket(), zmq.POLLIN) + poller.Add(workers.Socket(), zmq.POLLIN) + + // Register all handlers with the validator + for _, h := range self.handlers { + err := register(validator, h, queue) + if err != nil { + return fmt.Errorf( + "Error registering handler (%v, %v, %v, %v): %v", + h.FamilyName(), h.FamilyVersion, h.Encoding(), + h.Namespaces(), err, + ) + } + } + + // Poll for messages from worker threads or validator + for { + polled, err := poller.Poll(-1) + if err != nil { + return fmt.Errorf("Polling failed: %v", err) + } + for _, ready := range polled { + switch socket := ready.Socket; socket { + case validator.Socket(): + receiveValidator(ids, validator, workers, queue) + + case workers.Socket(): + receiveWorkers(ids, validator, workers, &workersLeft) + if workersLeft == 0 { + return nil + } + } + } + } +} + +// Shutdown sends a message to the processor telling it to deregister. +func (self *TransactionProcessor) Shutdown() { + // Initiate a clean shutdown + self.shutdown <- 0 +} + +// ShutdownOnSignal sets up signal handling to shutdown the processor when one +// of the signals passed is received. +func (self *TransactionProcessor) ShutdownOnSignal(siglist ...os.Signal) { + // Setup signal handlers + ch := make(chan os.Signal) + signal.Notify(ch, siglist...) + + go func() { + // Wait for a signal + _ = <-ch + + // Reset signal handlers + signal.Reset(siglist...) + logger.Warnf("Shutting down gracefully (Press Ctrl+C again to force)") + + self.Shutdown() + }() +} + +// Handle incoming messages from the validator +func receiveValidator(ids map[string]string, validator, workers messaging.Connection, queue chan *validator_pb2.Message) { + defer func() { + if r := recover(); r != nil { + logger.Errorf( + "Panic occured while routing message from validator: %v", r, + ) + } + }() + + // Receive a message from the validator + _, data, err := validator.RecvData() + if err != nil { + logger.Errorf("Receiving message from validator failed: %v", err) + return + } + // We need to deserialize the message to get the correlation id + msg, err := messaging.LoadMsg(data) + if err != nil { + logger.Errorf("Deserializing message from validator failed: %v", err) + return + } + + // Check if this is a new request or a response to a message sent by a + // worker thread. + t := msg.GetMessageType() + corrId := msg.GetCorrelationId() + + // If this is a new request, put in on the work queue + switch t { + case validator_pb2.Message_TP_PROCESS_REQUEST: + select { + case queue <- msg: + + default: + logger.Warnf("Work queue is full, denying request %v", corrId) + data, err := proto.Marshal(&processor_pb2.TpProcessResponse{ + Status: processor_pb2.TpProcessResponse_INTERNAL_ERROR, + Message: "Work queue is full, denying request", + }) + if err != nil { + logger.Errorf( + "Failed to notify validator the request is denied: %v", err, + ) + } + err = validator.SendMsg( + validator_pb2.Message_TP_PROCESS_RESPONSE, data, corrId, + ) + if err != nil { + logger.Errorf( + "Failed to notify validator the request is denied: %v", err, + ) + } + } + return + case validator_pb2.Message_TP_PING: + data, err := proto.Marshal(&processor_pb2.TpPingResponse{ + Status: processor_pb2.TpPingResponse_OK, + }) + if err != nil { + logger.Errorf( + "Failed to respond to TpPing %v", err, + ) + } + err = validator.SendMsg( + validator_pb2.Message_TP_PING_RESPONSE, data, corrId, + ) + return + } + + // If this is a response, send it to the worker. + workerId, exists := ids[corrId] + if exists && corrId != "" { + err = workers.SendData(workerId, data) + if err != nil { + logger.Errorf( + "Failed to send response with correlationd id %v to worker %v: %v", + corrId, workerId, err, + ) + return + } + delete(ids, corrId) + return + } + + logger.Warnf( + "Received unexpected message from validator: (%v, %v)", t, corrId, + ) +} + +// Handle incoming messages from the workers +func receiveWorkers(ids map[string]string, validator, workers messaging.Connection, workersLeft *uint) { + // Receive a mesasge from the workers + workerId, data, err := workers.RecvData() + if err != nil { + logger.Errorf("Receiving message from workers failed: %v", err) + return + } + + msg, err := messaging.LoadMsg(data) + if err != nil { + logger.Errorf("Deserializing message from workers failed: %v", err) + return + } + + t := msg.GetMessageType() + corrId := msg.GetCorrelationId() + + if t == validator_pb2.Message_DEFAULT && corrId == "shutdown" { + *workersLeft = *workersLeft - 1 + return + } + + // Store which thread the response should be routed to + if t != validator_pb2.Message_TP_PROCESS_RESPONSE { + ids[corrId] = workerId + } + + // Pass the message on to the validator + err = validator.SendData("", data) + if err != nil { + logger.Errorf("Failed to send message (%v) to validator: %v", corrId, err) + return + } +} + +// Register a handler with the validator +func register(validator messaging.Connection, handler TransactionHandler, queue chan *validator_pb2.Message) error { + regRequest := &processor_pb2.TpRegisterRequest{ + Family: handler.FamilyName(), + Version: handler.FamilyVersion(), + Encoding: handler.Encoding(), + Namespaces: handler.Namespaces(), + } + + regRequestData, err := proto.Marshal(regRequest) + if err != nil { + return err + } + + corrId, err := validator.SendNewMsg( + validator_pb2.Message_TP_REGISTER_REQUEST, + regRequestData, + ) + if err != nil { + return err + } + + // The validator is impatient and will send requests before confirming + // registration. + var msg *validator_pb2.Message + for { + _, msg, err = validator.RecvMsg() + if err != nil { + return err + } + + if msg.GetCorrelationId() != corrId { + queue <- msg + } else { + break + } + } + + if msg.GetMessageType() != validator_pb2.Message_TP_REGISTER_RESPONSE { + return fmt.Errorf("Received unexpected message type: %v", msg.GetMessageType()) + } + + regResponse := &processor_pb2.TpRegisterResponse{} + err = proto.Unmarshal(msg.GetContent(), regResponse) + if err != nil { + return err + } + + if regResponse.GetStatus() != processor_pb2.TpRegisterResponse_OK { + return fmt.Errorf("Got response: %v", regResponse.GetStatus()) + } + logger.Infof( + "Successfully registered handler (%v, %v, %v, %v)", + handler.FamilyName(), handler.FamilyVersion, + handler.Encoding(), handler.Namespaces(), + ) + + return nil +} diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/sawtooth_sdk/processor/state.go b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/sawtooth_sdk/processor/state.go new file mode 100644 index 00000000..de360b82 --- /dev/null +++ b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/sawtooth_sdk/processor/state.go @@ -0,0 +1,313 @@ +/** + * Copyright 2017 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ------------------------------------------------------------------------------ + */ + +package processor + +import ( + "fmt" + "github.com/golang/protobuf/proto" + "sawtooth_sdk/messaging" + "sawtooth_sdk/protobuf/events_pb2" + "sawtooth_sdk/protobuf/state_context_pb2" + "sawtooth_sdk/protobuf/validator_pb2" +) + +// Context provides an abstract interface for getting and setting validator +// state. All validator interactions by a handler should be through a Context +// instance. Currently, the Context class is NOT thread-safe and Context classes +// may not share the same messaging.Connection object. +type Context struct { + connection messaging.Connection + contextId string +} + +type Attribute struct { + Key string + Value string +} + +// Construct a new context object given an initialized Stream and Context ID. +func NewContext(connection messaging.Connection, contextId string) *Context { + return &Context{ + connection: connection, + contextId: contextId, + } +} + +// GetState queries the validator state for data at each of the addresses in the +// given slice. A string->[]byte map is returned. If an address is not set, +// it will not exist in the map. +// +// results, err := context.Get(addresses) +// if err != nil { +// fmt.Println("Error getting data!") +// } +// data, ok := results[address] +// if !ok { +// fmt.Prinln("No data stored at address!") +// } +// +func (self *Context) GetState(addresses []string) (map[string][]byte, error) { + // Construct the message + request := &state_context_pb2.TpStateGetRequest{ + ContextId: self.contextId, + Addresses: addresses, + } + bytes, err := proto.Marshal(request) + if err != nil { + return nil, fmt.Errorf("Failed to marshal TpStateGetRequest: %v", err) + } + + // Send the message and get the response + corrId, err := self.connection.SendNewMsg( + validator_pb2.Message_TP_STATE_GET_REQUEST, bytes, + ) + if err != nil { + return nil, fmt.Errorf("Failed to send TpStateGetRequest: %v", err) + } + + _, msg, err := self.connection.RecvMsgWithId(corrId) + if msg.GetCorrelationId() != corrId { + return nil, fmt.Errorf( + "Expected message with correlation id %v but got %v", + corrId, msg.GetCorrelationId(), + ) + } + + if msg.GetMessageType() != validator_pb2.Message_TP_STATE_GET_RESPONSE { + return nil, fmt.Errorf( + "Expected TpStateGetResponse but got %v", msg.GetMessageType(), + ) + } + + // Parse the result + response := &state_context_pb2.TpStateGetResponse{} + err = proto.Unmarshal(msg.GetContent(), response) + if err != nil { + return nil, fmt.Errorf("Failed to unmarshal TpStateGetResponse: %v", err) + } + + // Use a switch in case new Status values are added + switch response.Status { + case state_context_pb2.TpStateGetResponse_AUTHORIZATION_ERROR: + return nil, fmt.Errorf( + "Tried to get unauthorized address: %v", addresses, + ) + } + + // Construct and return a map + results := make(map[string][]byte) + for _, entry := range response.GetEntries() { + if len(entry.GetData()) != 0 { + results[entry.GetAddress()] = entry.GetData() + } + } + + return results, nil +} + +// SetState requests that each address in the validator state be set to the given +// value. A slice of addresses set is returned or an error if there was a +// problem setting the addresses. For example: +// +// responses, err := context.Set(dataMap) +// if err != nil { +// fmt.Println("Error setting addresses!") +// } +// set, ok := results[address] +// if !ok { +// fmt.Prinln("Address was not set!") +// } +// +func (self *Context) SetState(pairs map[string][]byte) ([]string, error) { + // Construct the message + entries := make([]*state_context_pb2.Entry, 0, len(pairs)) + for address, data := range pairs { + entries = append(entries, &state_context_pb2.Entry{ + Address: address, + Data: data, + }) + } + + request := &state_context_pb2.TpStateSetRequest{ + ContextId: self.contextId, + Entries: entries, + } + bytes, err := proto.Marshal(request) + if err != nil { + return nil, fmt.Errorf("Failed to marshal: %v", err) + } + + // Send the message and get the response + corrId, err := self.connection.SendNewMsg( + validator_pb2.Message_TP_STATE_SET_REQUEST, bytes, + ) + if err != nil { + return nil, fmt.Errorf("Failed to send set: %v", err) + } + + _, msg, err := self.connection.RecvMsgWithId(corrId) + if msg.GetCorrelationId() != corrId { + return nil, fmt.Errorf( + "Expected message with correlation id %v but got %v", + corrId, msg.GetCorrelationId(), + ) + } + + if msg.GetMessageType() != validator_pb2.Message_TP_STATE_SET_RESPONSE { + return nil, fmt.Errorf( + "Expected TP_STATE_SET_RESPONSE but got %v", msg.GetMessageType(), + ) + } + + // Parse the result + response := &state_context_pb2.TpStateSetResponse{} + err = proto.Unmarshal(msg.Content, response) + if err != nil { + return nil, fmt.Errorf("Failed to unmarshal TpStateSetResponse: %v", err) + } + + // Use a switch in case new Status values are added + switch response.GetStatus() { + case state_context_pb2.TpStateSetResponse_AUTHORIZATION_ERROR: + addresses := make([]string, 0, len(pairs)) + for a, _ := range pairs { + addresses = append(addresses, a) + } + return nil, fmt.Errorf("Tried to set unauthorized address: %v", addresses) + } + + return response.GetAddresses(), nil +} + +func (self *Context) Get(addresses []string) (map[string][]byte, error) { + return self.GetState(addresses) +} + +func (self *Context) Set(pairs map[string][]byte) ([]string, error) { + return self.SetState(pairs) +} + +func (self *Context) AddReceiptData(data_type string, data []byte) error { + // Append the data to the transaction receipt and set the type + request := &state_context_pb2.TpAddReceiptDataRequest{ + ContextId: self.contextId, + DataType: data_type, + Data: data, + } + bytes, err := proto.Marshal(request) + if err != nil { + return fmt.Errorf("Failed to marshal: %v", err) + } + + // Send the message and get the response + corrId, err := self.connection.SendNewMsg( + validator_pb2.Message_TP_ADD_RECEIPT_DATA_REQUEST, bytes, + ) + if err != nil { + return fmt.Errorf("Failed to add receipt data: %v", err) + } + + _, msg, err := self.connection.RecvMsgWithId(corrId) + if msg.GetCorrelationId() != corrId { + return fmt.Errorf( + "Expected message with correlation id %v but got %v", + corrId, msg.GetCorrelationId(), + ) + } + + if msg.GetMessageType() != validator_pb2.Message_TP_ADD_RECEIPT_DATA_RESPONSE { + return fmt.Errorf( + "Expected TP_ADD_RECEIPT_DATA_RESPONSE but got %v", msg.GetMessageType(), + ) + } + + // Parse the result + response := &state_context_pb2.TpAddReceiptDataResponse{} + err = proto.Unmarshal(msg.Content, response) + if err != nil { + return fmt.Errorf("Failed to unmarshal TpAddReceiptDataResponse: %v", err) + } + + // Use a switch in case new Status values are added + switch response.GetStatus() { + case state_context_pb2.TpAddReceiptDataResponse_ERROR: + return fmt.Errorf("Failed to add receipt data") + } + + return nil +} + +func (self *Context) AddEvent(event_type string, attributes []Attribute, event_data []byte) error { + event_attributes := make([]*events_pb2.Event_Attribute, 0, len(attributes)) + for _, attribute := range attributes { + event_attributes = append(event_attributes, &events_pb2.Event_Attribute{attribute.Key, attribute.Value}) + } + + event := &events_pb2.Event{ + EventType: event_type, + Attributes: event_attributes, + Data: event_data, + } + + // Construct message + request := &state_context_pb2.TpAddEventRequest{ + ContextId: self.contextId, + Event: event, + } + bytes, err := proto.Marshal(request) + if err != nil { + return fmt.Errorf("Failed to marshal: %v", err) + } + + // Send the message and get the response + corrId, err := self.connection.SendNewMsg( + validator_pb2.Message_TP_ADD_EVENT_REQUEST, bytes, + ) + if err != nil { + return fmt.Errorf("Failed to add event: %v", err) + } + + _, msg, err := self.connection.RecvMsgWithId(corrId) + if msg.GetCorrelationId() != corrId { + return fmt.Errorf( + "Expected message with correlation id %v but got %v", + corrId, msg.GetCorrelationId(), + ) + } + + if msg.GetMessageType() != validator_pb2.Message_TP_ADD_EVENT_RESPONSE { + return fmt.Errorf( + "Expected TP_ADD_EVENT_RESPONSE but got %v", msg.GetMessageType(), + ) + } + + // Parse the result + response := &state_context_pb2.TpAddEventResponse{} + err = proto.Unmarshal(msg.Content, response) + if err != nil { + return fmt.Errorf("Failed to unmarshal TpAddEventResponse: %v", err) + } + + // Use a switch in case new Status values are added + switch response.GetStatus() { + case state_context_pb2.TpAddEventResponse_ERROR: + return fmt.Errorf("Failed to add event") + } + + return nil +} diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/sawtooth_sdk/processor/worker.go b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/sawtooth_sdk/processor/worker.go new file mode 100644 index 00000000..6cf33e8a --- /dev/null +++ b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/sawtooth_sdk/processor/worker.go @@ -0,0 +1,207 @@ +/** + * Copyright 2017 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ------------------------------------------------------------------------------ + */ + +package processor + +import ( + "fmt" + "github.com/golang/protobuf/proto" + zmq "github.com/pebbe/zmq4" + "sawtooth_sdk/messaging" + "sawtooth_sdk/protobuf/processor_pb2" + "sawtooth_sdk/protobuf/transaction_pb2" + "sawtooth_sdk/protobuf/validator_pb2" +) + +// The main worker thread finds an appropriate handler and processes the request +func worker(context *zmq.Context, uri string, queue chan *validator_pb2.Message, handlers []TransactionHandler) { + // Connect to the main send/receive thread + connection, err := messaging.NewConnection(context, zmq.DEALER, uri) + if err != nil { + logger.Errorf("Failed to connect to main thread: %v", err) + return + } + defer connection.Close() + id := connection.Identity() + + // Receive work off of the queue until the queue is closed + for msg := range queue { + request := &processor_pb2.TpProcessRequest{} + err = proto.Unmarshal(msg.GetContent(), request) + if err != nil { + logger.Errorf( + "(%v) Failed to unmarshal TpProcessRequest: %v", id, err, + ) + break + } + + header := &transaction_pb2.TransactionHeader{} + err = proto.Unmarshal(request.Header, header) + if err != nil { + logger.Errorf( + "(%v) Failed to unmarshal TransactionHeader: %v", id, err) + break + } + + // Try to find a handler + handler, err := findHandler(handlers, header) + if err != nil { + logger.Errorf("(%v) Failed to find handler: %v", id, err) + break + } + + // Construct a new Context instance for the handler + contextId := request.GetContextId() + context := NewContext(connection, contextId) + + // Run the handler + err = handler.Apply(request, context) + + // Process the handler response + response := &processor_pb2.TpProcessResponse{} + if err != nil { + switch e := err.(type) { + case *InvalidTransactionError: + logger.Warnf("(%v) %v", id, e) + response.Status = processor_pb2.TpProcessResponse_INVALID_TRANSACTION + response.Message = e.Msg + response.ExtendedData = e.ExtendedData + case *InternalError: + logger.Warnf("(%v) %v", id, e) + response.Status = processor_pb2.TpProcessResponse_INTERNAL_ERROR + response.Message = e.Msg + response.ExtendedData = e.ExtendedData + default: + logger.Errorf("(%v) Unknown error: %v", id, err) + response.Status = processor_pb2.TpProcessResponse_INTERNAL_ERROR + response.Message = e.Error() + } + } else { + response.Status = processor_pb2.TpProcessResponse_OK + } + + responseData, err := proto.Marshal(response) + if err != nil { + logger.Errorf("(%v) Failed to marshal TpProcessResponse: %v", id, err) + break + } + + // Send back a response to the validator + err = connection.SendMsg( + validator_pb2.Message_TP_PROCESS_RESPONSE, + responseData, msg.GetCorrelationId(), + ) + if err != nil { + logger.Errorf("(%v) Error sending TpProcessResponse: %v", id, err) + break + } + } + + // Queue has closed, so send shutdown signal + logger.Infof("(%v) No more work in queue, shutting down", id) + err = connection.SendMsg( + validator_pb2.Message_DEFAULT, + []byte{byte(0)}, "shutdown", + ) + if err != nil { + logger.Errorf("(%v) Error sending shutdown: %v", id, err) + } +} + +// Searches for and returns a handler that matches the header. If a suitable +// handler is not found, returns an error. +func findHandler(handlers []TransactionHandler, header *transaction_pb2.TransactionHeader) (TransactionHandler, error) { + for _, handler := range handlers { + if header.GetFamilyName() != handler.FamilyName() { + break + } + + if header.GetFamilyVersion() != handler.FamilyVersion() { + break + } + + if header.GetPayloadEncoding() != handler.Encoding() { + break + } + + return handler, nil + } + return nil, fmt.Errorf( + "Unknown handler: (%v, %v, %v)", header.GetFamilyName(), + header.GetFamilyVersion(), header.GetPayloadEncoding(), + ) +} + +// Waits for something to come along a channel and then initiates processor shutdown +func shutdown(context *zmq.Context, uri string, queue chan *validator_pb2.Message, wait chan int) { + // Wait for a request to shutdown + connection, err := messaging.NewConnection(context, zmq.DEALER, uri) + if err != nil { + logger.Errorf("Failed to connect to main thread: %v", err) + return + } + defer connection.Close() + id := "shutdown" + + <-wait + + // Send a request to be unregistered + data, err := proto.Marshal(&processor_pb2.TpUnregisterRequest{}) + if err != nil { + logger.Errorf( + "Failed to unregister: %v", err, + ) + } + corrId, err := connection.SendNewMsg( + validator_pb2.Message_TP_UNREGISTER_REQUEST, data, + ) + if err != nil { + logger.Errorf( + "Failed to unregister: %v", err, + ) + } + + // Wait for a response + _, msg, err := connection.RecvMsgWithId(corrId) + if err != nil { + logger.Errorf("Failed to receive TpUnregisterResponse: %v", err) + } + if msg.GetCorrelationId() != corrId { + logger.Errorf( + "Expected message with correlation id %v but got %v", + corrId, msg.GetCorrelationId(), + ) + } + if msg.GetMessageType() != validator_pb2.Message_TP_UNREGISTER_RESPONSE { + logger.Errorf( + "Expected TP_UNREGISTER_RESPONSE but got %v", msg.GetMessageType(), + ) + } + + // Close the work queue, telling the worker threads there's no more work + close(queue) + + err = connection.SendMsg( + validator_pb2.Message_DEFAULT, + []byte{byte(0)}, "shutdown", + ) + if err != nil { + logger.Errorf("(%v) Error sending shutdown message to router: %v", id, err) + } else { + logger.Infof("(%v) Sent shutdown message to router", id) + } +} diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/handler/handler.go b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/handler/handler.go new file mode 100644 index 00000000..bc669392 --- /dev/null +++ b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/handler/handler.go @@ -0,0 +1,220 @@ +package handler + +import "fmt" +import "bytes" +import "crypto/sha512" +import "encoding/hex" +import "sawtooth_sdk/processor" +import "sawtooth_sdk/protobuf/processor_pb2" +// import "sawtooth_sdk/protobuf/transaction_pb2" +import "encoding/json" +import "strings" +import "sawtooth_sdk/logging" +import "unicode/utf8" + +var logger = logging.Get() + +type jsonHandler struct { + familyName string + familyVersion string + namespaces []string + encoding string +} + +type TransactionPayload struct { + Action string + Asset string + Owner string +} + +func (j jsonHandler) FamilyName() (string){ + return j.familyName +} + +func (j jsonHandler) FamilyVersion() (string){ + return j.familyVersion +} + +func (j jsonHandler) Namespaces() ([]string) { + return j.namespaces +} + +func (self jsonHandler) Encoding() string { + return "application/json" +} + +func buildString(strs ...string) string { + var buffer bytes.Buffer + for _, s := range strs{ + buffer.WriteString(s) + } + return buffer.String() +} + +func getTransferAddress(asset string) string{ + return buildString(prefix, "01", Hexdigest(asset, 62)) +} + +func getAssetAddress(asset string) string{ + return buildString(prefix, "00", Hexdigest(asset, 62)) +} + +func createAsset(tp *TransactionPayload, c *processor.Context, signer string) ([]string, error) { + address := getAssetAddress(tp.Asset) + entries, err := c.Get([]string{address}) + if err != nil { + return nil,&processor.InvalidTransactionError{Msg: err.Error()} + } + var collisionMap map[string][]byte + data, exists := entries[address] + if exists && len(data) > 0 { + return nil,&processor.InvalidTransactionError{Msg: "Asset already in use!"} + } + tp.Owner = signer + collisionMap = make(map[string][]byte) + collisionMap[address], err = json.Marshal(map[string]string{"name": tp.Asset, "owner": tp.Owner}) + if err!= nil { + return nil,&processor.InvalidTransactionError{Msg: err.Error()} + } + return c.Set(collisionMap) +} + +func transferAsset(tp *TransactionPayload, c *processor.Context, signer string) ([]string, error) { + address := getTransferAddress(tp.Asset) + assetAddress := getAssetAddress(tp.Asset) + + entries, err := c.Get([]string{assetAddress}) + if err != nil { + return nil,&processor.InvalidTransactionError{Msg: err.Error()} + } + var collisionMap map[string][]byte + data, exists := entries[assetAddress] + if !exists && len(data) == 0 { + return nil,&processor.InvalidTransactionError{Msg: "Asset does not exist"} + } + tpData := TransactionPayload{} + err = json.Unmarshal(data, &tpData) + if err != nil { + return nil,&processor.InvalidTransactionError{Msg: "Could not unmarshall entry"} + } + if (signer != tpData.Owner){ + return nil,&processor.InvalidTransactionError{Msg: "Signer cannot be different from owner"} + } + + collisionMap = make(map[string][]byte) + collisionMap[address], err = json.Marshal(map[string]string{"asset": tp.Asset, "owner": tp.Owner}) + logger.Warn(fmt.Sprintf("address %v asset %v", address, string(collisionMap[address]))) + if err!= nil { + return nil,&processor.InvalidTransactionError{Msg: err.Error()} + } + logger.Info("Transfer awaiting approval") + return c.Set(collisionMap) +} + +func acceptAsset(tp *TransactionPayload, c *processor.Context, signer string) ([]string, error) { + address := getTransferAddress(tp.Asset) + + entries, err := c.Get([]string{address}) + if err != nil { + return nil,&processor.InvalidTransactionError{Msg: err.Error()} + } + + data, exists := entries[address] + if !exists && len(data) == 0 { + return nil,&processor.InvalidTransactionError{Msg: "Asset cannot be accepted for transfer"} + } + tpData := TransactionPayload{} + err = json.Unmarshal(data, &tpData) + if err != nil { + return nil,&processor.InvalidTransactionError{Msg: "Could not unmarshall entry"} + } + if (signer != tpData.Owner){ + return nil,&processor.InvalidTransactionError{Msg: "Signer cannot be different from owner"} + } + var collisionMap map[string][]byte + collisionMap = make(map[string][]byte) + collisionMap[address] = []byte{} + collisionMap[getAssetAddress(tp.Asset)], err = json.Marshal(map[string]string{"name": tp.Asset, "owner": tpData.Owner}) + if err!= nil { + return nil,&processor.InvalidTransactionError{Msg: err.Error()} + } + return c.Set(collisionMap) +} + +func rejectAsset(tp *TransactionPayload, c *processor.Context, signer string) ([]string, error) { + address := getTransferAddress(tp.Asset) + + entries, err := c.Get([]string{address}) + if err != nil { + return nil,&processor.InvalidTransactionError{Msg: err.Error()} + } + + data, exists := entries[address] + if !exists && len(data) == 0 { + return nil,&processor.InvalidTransactionError{Msg: "Asset cannot be transfered"} + } + tpData := TransactionPayload{} + err = json.Unmarshal(data, &tpData) + if err != nil { + return nil,&processor.InvalidTransactionError{Msg: "Could not unmarshall entry"} + } + if (signer != tpData.Owner){ + return nil,&processor.InvalidTransactionError{Msg: "Signer cannot be different from owner"} + } + var collisionMap map[string][]byte + collisionMap = make(map[string][]byte) + collisionMap[address] = []byte{} + return c.Set(collisionMap) +} + +func (j jsonHandler) Apply(txn *processor_pb2.TpProcessRequest , c *processor.Context) error{ + logger.Info("In Handler") + header := txn.GetHeader() + signer := string(header)[2:68] //dodgy code needs improvement + tp := TransactionPayload{} + logger.Info() + err := json.Unmarshal(txn.GetPayload(), &tp) + if err != nil{ + logger.Error("Cannot unmarshall current payload") + } + logger.Info(fmt.Sprintf("Handling transaction %v > %v with owner %v signed by %v", tp.Action, tp.Asset, tp.Owner[0:utf8.RuneCountInString(tp.Owner)], signer[0:8])) + if tp.Action == "create"{ + _, err = createAsset(&tp, c, signer) + return err + } + if tp.Action == "transfer"{ + _, err = transferAsset(&tp, c, signer) + return err + } + if tp.Action == "accept"{ + _, err = acceptAsset(&tp, c, signer) + return err + } + if tp.Action == "reject"{ + _, err = rejectAsset(&tp, c, signer) + return err + } + return &processor.InvalidTransactionError{Msg: "Action must be 'create', 'transfer', 'accept', or 'reject'"} +} + +var family = "transfer-chain" + +func Hexdigest(str string, l int) string { + hash := sha512.New() + hash.Write([]byte(str)) + hashBytes := hash.Sum(nil) + return strings.ToLower(hex.EncodeToString(hashBytes))[0:l] +} + + +var prefix = Hexdigest(family, 6) + + +//NewJSONHandler handles transaction in json +func NewJSONHandler()(processor.TransactionHandler) { + logger.Infof("Creating Handler") + handler := jsonHandler {familyName: family, + familyVersion: "0.0", + namespaces: []string{prefix}} + return handler +} diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/processor/main.go b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/processor/main.go new file mode 100644 index 00000000..95983459 --- /dev/null +++ b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/processor/main.go @@ -0,0 +1,33 @@ +package main + +import ( + "fmt" + "handler" + "sawtooth_sdk/processor" + "sawtooth_sdk/logging" + "syscall" +) + +func main() { + endpoint := "tcp://localhost:4004" + logger := logging.Get() + tp := processor.NewTransactionProcessor(endpoint) + // tp.SetMaxQueueSize(10) + tp.SetThreadCount(1) + tp.AddHandler(handler.NewJSONHandler()) + fmt.Printf("Handler added \n") + tp.ShutdownOnSignal(syscall.SIGINT, syscall.SIGTERM) + err := tp.Start() + if err != nil { + logger.Error("Processor stopped: ", err) + } + // prefix := handler.Hexdigest("noop")[:6] + // handler := handler.NewNoopHandler(prefix) + // processor := processor.NewTransactionProcessor(endpoint) + // processor.AddHandler(handler) + // processor.ShutdownOnSignal(syscall.SIGINT, syscall.SIGTERM) + // err := processor.Start() + // if err != nil { + // logger.Error("Processor stopped: ", err) + // } +} diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/client/encoder.go b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/client/encoder.go new file mode 100644 index 00000000..d2238e88 --- /dev/null +++ b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/client/encoder.go @@ -0,0 +1,260 @@ +/** + * Copyright 2017 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ------------------------------------------------------------------------------ + */ + +package client + +import ( + "encoding/hex" + "fmt" + "github.com/golang/protobuf/proto" + "sawtooth_sdk/protobuf/batch_pb2" + "sawtooth_sdk/protobuf/transaction_pb2" + "time" +) + +type TransactionParams struct { + FamilyName string + FamilyVersion string + PayloadEncoding string + Nonce string + BatcherPubkey string + Dependencies []string + Inputs []string + Outputs []string +} + +type Encoder struct { + privkey []byte + pubkey string + defaults TransactionParams +} + +// NewTransactionEncoder constructs a new encoder which can be used to generate +// transactions and batches, and to serialize batches for submitting to the +// REST API. +func NewEncoder(privkey []byte, defaults TransactionParams) *Encoder { + return &Encoder{ + privkey: privkey, + pubkey: hex.EncodeToString(GenPubKey(privkey)), + defaults: defaults, + } +} + +// -- Transactions -- + +// NewTransaction Creates a new transaction and handles the construction and +// signing of the transaction header. +func (self *Encoder) NewTransaction(payload []byte, p TransactionParams) *Transaction { + h := &transaction_pb2.TransactionHeader{ + // Load defaults + FamilyName: self.defaults.FamilyName, + FamilyVersion: self.defaults.FamilyVersion, + PayloadEncoding: self.defaults.PayloadEncoding, + Nonce: self.defaults.Nonce, + BatcherPubkey: self.defaults.BatcherPubkey, + + Inputs: self.defaults.Inputs, + Outputs: self.defaults.Outputs, + Dependencies: self.defaults.Dependencies, + + // Set unique fields + PayloadSha512: hex.EncodeToString(SHA512(payload)), + SignerPubkey: self.pubkey, + } + + // Override defaults if set + if p.FamilyName != "" { + h.FamilyName = p.FamilyName + } + if p.FamilyVersion != "" { + h.FamilyVersion = p.FamilyVersion + } + if p.PayloadEncoding != "" { + h.PayloadEncoding = p.PayloadEncoding + } + if p.Nonce != "" { + h.Nonce = p.Nonce + } + if p.BatcherPubkey != "" { + h.BatcherPubkey = p.BatcherPubkey + } + + if p.Inputs != nil { + h.Inputs = p.Inputs[:] + } + if p.Outputs != nil { + h.Outputs = p.Outputs[:] + } + if p.Dependencies != nil { + h.Dependencies = p.Dependencies[:] + } + + // Generate a nonce if none has been set yet + if h.Nonce == "" { + h.Nonce = fmt.Sprintf("%x", time.Now().UTC().UnixNano()) + } + + // If a BatcherPubkey hasn't been set yet, assume its our key + if h.BatcherPubkey == "" { + h.BatcherPubkey = self.pubkey + } + + hb, err := proto.Marshal(h) + if err != nil { + panic(err) + } + hs := hex.EncodeToString(Sign(hb, self.privkey)) + + transaction := &transaction_pb2.Transaction{ + Header: hb, + HeaderSignature: hs, + Payload: payload, + } + + return (*Transaction)(transaction) +} + +// SerializeTransactions serializes the given transactions to bytes for +// transmission to a separate batcher. +func SerializeTransactions(transactions []*Transaction) []byte { + txns := make([]*transaction_pb2.Transaction, 0, len(transactions)) + for _, tx := range transactions { + txns = append(txns, tx.ToPb()) + } + + tl := &transaction_pb2.TransactionList{ + Transactions: txns, + } + + tlb, err := proto.Marshal(tl) + if err != nil { + panic(err) + } + + return tlb +} + +// ParseTransactions deserializes the given bytes into a list of transactions. +// The bytes are assumed to be in the format returned by SerializeTransactions. +func ParseTransactions(b []byte) ([]*Transaction, error) { + tl := &transaction_pb2.TransactionList{} + err := proto.Unmarshal(b, tl) + if err != nil { + return nil, err + } + + txns := tl.GetTransactions() + + transactions := make([]*Transaction, 0, len(txns)) + for _, tx := range txns { + transactions = append(transactions, (*Transaction)(tx)) + } + + return transactions, nil +} + +// -- Batches -- + +// NewBatch creates a new batch from the given transactions created by +// NewTransaction. It handles the construction and signing of the batch header. +func (self *Encoder) NewBatch(transactions []*Transaction) *Batch { + txnIds := make([]string, 0, len(transactions)) + txns := make([]*transaction_pb2.Transaction, 0, len(transactions)) + for _, tx := range transactions { + txnIds = append(txnIds, tx.Id()) + txns = append(txns, tx.ToPb()) + } + + h := &batch_pb2.BatchHeader{ + SignerPubkey: self.pubkey, + TransactionIds: txnIds, + } + + hb, err := proto.Marshal(h) + if err != nil { + panic(err) + } + + hs := hex.EncodeToString(Sign(hb, self.privkey)) + + batch := &batch_pb2.Batch{ + Header: hb, + HeaderSignature: hs, + Transactions: txns, + } + + return (*Batch)(batch) +} + +// SerializeBatches serializes the given batches to bytes in the form expected +// by the REST API. +func SerializeBatches(batches []*Batch) []byte { + bs := make([]*batch_pb2.Batch, 0, len(batches)) + for _, b := range batches { + bs = append(bs, b.ToPb()) + } + bl := &batch_pb2.BatchList{ + Batches: bs, + } + + blb, err := proto.Marshal(bl) + if err != nil { + panic(err) + } + + return blb +} + +// ParseBatches deserializes the given bytes into a list of batches. The bytes +// are assumed to be in the format returned by SerializeBatches. +func ParseBatches(b []byte) ([]*Batch, error) { + bl := &batch_pb2.BatchList{} + err := proto.Unmarshal(b, bl) + if err != nil { + return nil, err + } + + bs := bl.GetBatches() + + batches := make([]*Batch, 0, len(bs)) + for _, b := range bs { + batches = append(batches, (*Batch)(b)) + } + + return batches, nil +} + +// -- Wrap Protobuf -- + +// Wrap the protobuf types so that they do not need to be imported separately. +type Transaction transaction_pb2.Transaction + +func (t *Transaction) ToPb() *transaction_pb2.Transaction { + return (*transaction_pb2.Transaction)(t) +} + +// GetId Returns the Transaction ID which can be used to specify this +// transaction as a dependency for other transactions. +func (t *Transaction) Id() string { + return t.ToPb().GetHeaderSignature() +} + +type Batch batch_pb2.Batch + +func (b *Batch) ToPb() *batch_pb2.Batch { + return (*batch_pb2.Batch)(b) +} diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/client/pem_loader.go b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/client/pem_loader.go new file mode 100644 index 00000000..51852341 --- /dev/null +++ b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/client/pem_loader.go @@ -0,0 +1,52 @@ +/** + * Copyright 2017 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ------------------------------------------------------------------------------ + */ + +package client + +// #cgo LDFLAGS: -lcrypto +// #include "../../../../c/loader.c" +import "C" + +import "fmt" + +func loadPemKey(pemstr string, pemstrLen int, password string) (priv_key string, pub_key string, err error) { + cPemstr := C.CString(pemstr) + cPemstrLen := C.size_t(pemstrLen) + cPassword := C.CString(password) + cOutPrivKey := C.CString("-----------------------------------------------------------------") + cOutPubKey := C.CString("-----------------------------------------------------------------------------------------------------------------------------------") + errnum := C.load_pem_key(cPemstr, cPemstrLen, cPassword, cOutPrivKey, cOutPubKey) + if errnum < 0 { + var errstr string + switch errnum { + case -1: + errstr = "Failed to decrypt or decode private key" + case -2: + errstr = "Failed to create new big number context" + case -3: + errstr = "Failed to load group" + case -4: + errstr = "Failed to load private key" + case -5: + errstr = "Failed to load public key point" + case -6: + errstr = "Failed to construct public key from point" + } + return "", "", fmt.Errorf(errstr) + } + return C.GoString(cOutPrivKey), C.GoString(cOutPubKey), nil +} diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/client/signer.go b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/client/signer.go new file mode 100644 index 00000000..c3f20c09 --- /dev/null +++ b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/client/signer.go @@ -0,0 +1,156 @@ +/** + * Copyright 2017 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ------------------------------------------------------------------------------ + */ + +package client + +import ( + "crypto/sha256" + "crypto/sha512" + "encoding/hex" + "fmt" + ellcurv "github.com/btcsuite/btcd/btcec" + "github.com/btcsuite/btcutil/base58" + "math/big" +) + +// -- Key Gen -- + +// GenPrivKey generates a new private key and returns it as bytes +func GenPrivKey() []byte { + priv, err := ellcurv.NewPrivateKey(ellcurv.S256()) + if err != nil { + panic("Failed to generate private key") + } + return priv.Serialize() +} + +// GenPubKey generates a new public key from a given private key and returns it +// using the 33 byte compressed format +func GenPubKey(privkey []byte) []byte { + _, pub := ellcurv.PrivKeyFromBytes(ellcurv.S256(), privkey) + return pub.SerializeCompressed() +} + +// -- Signing -- + +// Sign uses the given private key to calculate a signature for the given data. +// A sha256 hash of the data is first calculated and this is what is actually +// signed. Returns the signature as bytes using the compact serialization +// (which is just (r, s)). +func Sign(data, privkey []byte) []byte { + priv, _ := ellcurv.PrivKeyFromBytes(ellcurv.S256(), privkey) + + hash := SHA256(data) + + sig, err := priv.Sign(hash) + if err != nil { + panic("Signing failed") + } + + return serializeCompact(sig) +} + +// Verify uses the given public key to verify that the given signature was +// created from the given data using the associated private key. A sha256 hash +// of the data is calculated first and this is what is actually used to verify +// the signature. +func Verify(data, signature, pubkey []byte) bool { + sig := deserializeCompact(signature) + hash := SHA256(data) + pub, err := ellcurv.ParsePubKey(pubkey, ellcurv.S256()) + if err != nil { + panic(err.Error()) + } + return sig.Verify(hash, pub) +} + +// -- SHA -- + +// SHA512 calculates a sha512 has from the given input byte slice +func SHA512(input []byte) []byte { + hash := sha512.New() + hash.Write(input) + return hash.Sum(nil) +} + +// SHA256 calculates a sha256 has from the given input byte slice +func SHA256(input []byte) []byte { + hash := sha256.New() + hash.Write(input) + return hash.Sum(nil) +} + +// -- WIF -- + +// PrivToWif converts a private key generated to a WIF string +func PrivToWif(priv []byte) string { + extended := append([]byte{0x80}, priv...) + checksum := SHA256(SHA256(extended))[:4] + extcheck := append(extended, checksum...) + return base58.Encode(extcheck) +} + +// WifToPriv converts a WIF string to a private key +func WifToPriv(wif string) (key []byte, err error) { + defer func() { + if recover() != nil { + err = fmt.Errorf("Failed to load WIF key") + } + }() + extcheck := base58.Decode(wif) + return extcheck[1 : len(extcheck)-4], nil +} + +func PemToPriv(pem string, password string) ([]byte, error) { + pemlen := len(pem) + priv, _, err := loadPemKey(pem, pemlen, password) + if err != nil { + return nil, err + } + return hex.DecodeString(priv) +} + +// --- + +func serializeCompact(sig *ellcurv.Signature) []byte { + b := make([]byte, 0, 64) + // TODO: Padding + rbytes := pad(sig.R.Bytes(), 32) + sbytes := pad(sig.S.Bytes(), 32) + b = append(b, rbytes...) + b = append(b, sbytes...) + if len(b) != 64 { + panic("Invalid signature length") + } + return b +} + +func deserializeCompact(b []byte) *ellcurv.Signature { + return &ellcurv.Signature{ + R: new(big.Int).SetBytes(b[:32]), + S: new(big.Int).SetBytes(b[32:]), + } +} + +func pad(buf []byte, size int) []byte { + newbuf := make([]byte, 0, size) + padLength := size - len(buf) + for i := 0; i < padLength; i++ { + newbuf = append(newbuf, 0) + } + return append(newbuf, buf...) +} diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/logging/logger.go b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/logging/logger.go new file mode 100644 index 00000000..5090a04a --- /dev/null +++ b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/logging/logger.go @@ -0,0 +1,132 @@ +/** + * Copyright 2017 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ------------------------------------------------------------------------------ + */ + +package logging + +import ( + "fmt" + "io" + "log" + "os" +) + +const ( + CRITICAL = 50 + ERROR = 40 + WARN = 30 + INFO = 20 + DEBUG = 10 +) + +// Set the calldepth so we get the right file when logging +const ( + CALLDEPTH = 3 + FLAGS = log.Lshortfile | log.LstdFlags | log.Lmicroseconds +) + +type Logger struct { + logger *log.Logger + level int +} + +var _LOGGER *Logger = nil + +func Get() *Logger { + if _LOGGER == nil { + _LOGGER = &Logger{ + logger: log.New(os.Stdout, "", FLAGS), + level: DEBUG, + } + } + return _LOGGER +} + +func (self *Logger) SetLevel(level int) { + self.level = level +} + +func (self *Logger) SetOutput(w io.Writer) { + self.logger.SetOutput(w) +} + +func (self *Logger) Debugf(format string, v ...interface{}) { + if self.level <= DEBUG { + self.logf("DEBUG", format, v...) + } +} + +func (self *Logger) Debug(v ...interface{}) { + if self.level <= DEBUG { + self.log("DEBUG", v...) + } +} + +func (self *Logger) Infof(format string, v ...interface{}) { + if self.level <= INFO { + self.logf("INFO", format, v...) + } +} + +func (self *Logger) Info(v ...interface{}) { + if self.level <= INFO { + self.log("INFO", v...) + } +} + +func (self *Logger) Warnf(format string, v ...interface{}) { + if self.level <= WARN { + self.logf("WARN", format, v...) + } +} + +func (self *Logger) Warn(v ...interface{}) { + if self.level <= WARN { + self.log("WARN", v...) + } +} + +func (self *Logger) Errorf(format string, v ...interface{}) { + if self.level <= ERROR { + self.logf("ERROR", format, v...) + } +} + +func (self *Logger) Error(v ...interface{}) { + if self.level <= ERROR { + self.log("ERROR", v...) + } +} + +func (self *Logger) Criticalf(format string, v ...interface{}) { + if self.level <= CRITICAL { + self.logf("CRITICAL", format, v...) + } +} + +func (self *Logger) Critical(v ...interface{}) { + if self.level <= CRITICAL { + self.log("CRITICAL", v...) + } +} + +func (self *Logger) logf(prefix string, format string, v ...interface{}) { + self.logger.Output(CALLDEPTH, "["+prefix+"] "+fmt.Sprintf(format, v...)) +} + +func (self *Logger) log(prefix string, v ...interface{}) { + self.logger.Output(CALLDEPTH, "["+prefix+"] "+fmt.Sprint(v...)) +} diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/messaging/connection.go b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/messaging/connection.go new file mode 100644 index 00000000..99ed4088 --- /dev/null +++ b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/messaging/connection.go @@ -0,0 +1,246 @@ +/** + * Copyright 2017 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ------------------------------------------------------------------------------ + */ + +// Package messaging handles lower-level communication between a transaction +// processor and validator. +package messaging + +import ( + "fmt" + "github.com/golang/protobuf/proto" + zmq "github.com/pebbe/zmq4" + uuid "github.com/satori/go.uuid" + "sawtooth_sdk/logging" + "sawtooth_sdk/protobuf/validator_pb2" +) + +var logger *logging.Logger = logging.Get() + +// Generate a new UUID +func GenerateId() string { + return fmt.Sprint(uuid.NewV4()) +} + +// DumpMsg serializes a validator message +func DumpMsg(t validator_pb2.Message_MessageType, c []byte, corrId string) ([]byte, error) { + msg := &validator_pb2.Message{ + MessageType: t, + CorrelationId: corrId, + Content: c, + } + return proto.Marshal(msg) +} + +// LoadMsg deserializes a validator message +func LoadMsg(data []byte) (msg *validator_pb2.Message, err error) { + msg = &validator_pb2.Message{} + err = proto.Unmarshal(data, msg) + return +} + +type Connection interface { + SendData(id string, data []byte) error + SendNewMsg(t validator_pb2.Message_MessageType, c []byte) (corrId string, err error) + SendNewMsgTo(id string, t validator_pb2.Message_MessageType, c []byte) (corrId string, err error) + SendMsg(t validator_pb2.Message_MessageType, c []byte, corrId string) error + SendMsgTo(id string, t validator_pb2.Message_MessageType, c []byte, corrId string) error + RecvData() (string, []byte, error) + RecvMsg() (string, *validator_pb2.Message, error) + RecvMsgWithId(corrId string) (string, *validator_pb2.Message, error) + Close() + Socket() *zmq.Socket + Identity() string +} + +// Connection wraps a ZMQ DEALER socket or ROUTER socket and provides some +// utility methods for sending and receiving messages. +type ZmqConnection struct { + identity string + uri string + socket *zmq.Socket + incoming map[string]*storedMsg +} + +type storedMsg struct { + Id string + Msg *validator_pb2.Message +} + +// NewConnection establishes a new connection using the given ZMQ context and +// socket type to the given URI. +func NewConnection(context *zmq.Context, t zmq.Type, uri string) (*ZmqConnection, error) { + socket, err := context.NewSocket(t) + if err != nil { + return nil, fmt.Errorf("Failed to create ZMQ socket: %v", err) + } + + identity := GenerateId() + socket.SetIdentity(identity) + + logger.Info("Connecting to ", uri) + switch t { + case zmq.ROUTER: + err = socket.Bind(uri) + case zmq.DEALER: + err = socket.Connect(uri) + } + if err != nil { + return nil, fmt.Errorf("Failed to connect to %v: %v", uri, err) + } + + return &ZmqConnection{ + identity: identity, + uri: uri, + socket: socket, + incoming: make(map[string]*storedMsg), + }, nil +} + +// SendData sends the byte array. +// +// If id is not "", the id is included as the first part of the message. This +// is useful for passing messages to a ROUTER socket so it can route them. +func (self *ZmqConnection) SendData(id string, data []byte) error { + if id != "" { + _, err := self.socket.SendMessage(id, [][]byte{data}) + if err != nil { + return err + } + } else { + _, err := self.socket.SendMessage([][]byte{data}) + if err != nil { + return err + } + } + return nil +} + +// SendNewMsg creates a new validator message, assigns a new correlation id, +// serializes it, and sends it. It returns the correlation id created. +func (self *ZmqConnection) SendNewMsg(t validator_pb2.Message_MessageType, c []byte) (corrId string, err error) { + return self.SendNewMsgTo("", t, c) +} + +// SendNewMsgTo sends a new message validator message with the given id sent as +// the first part of the message. This is required when sending to a ROUTER +// socket, so it knows where to route the message. +func (self *ZmqConnection) SendNewMsgTo(id string, t validator_pb2.Message_MessageType, c []byte) (corrId string, err error) { + corrId = GenerateId() + return corrId, self.SendMsgTo(id, t, c, corrId) +} + +// Send a message with the given correlation id +func (self *ZmqConnection) SendMsg(t validator_pb2.Message_MessageType, c []byte, corrId string) error { + return self.SendMsgTo("", t, c, corrId) +} + +// Send a message with the given correlation id and the prepends the id like +// SendNewMsgTo() +func (self *ZmqConnection) SendMsgTo(id string, t validator_pb2.Message_MessageType, c []byte, corrId string) error { + data, err := DumpMsg(t, c, corrId) + if err != nil { + return err + } + + return self.SendData(id, data) +} + +// RecvData receives a ZMQ message from the wrapped socket and returns the +// identity of the sender and the data sent. If ZmqConnection does not wrap a +// ROUTER socket, the identity returned will be "". +func (self *ZmqConnection) RecvData() (string, []byte, error) { + msg, err := self.socket.RecvMessage(0) + + if err != nil { + return "", nil, err + } + switch len(msg) { + case 1: + data := []byte(msg[0]) + return "", data, nil + case 2: + id := msg[0] + data := []byte(msg[1]) + return id, data, nil + default: + return "", nil, fmt.Errorf( + "Receive message with unexpected length: %v", len(msg), + ) + } +} + +// RecvMsg receives a new validator message and returns it deserialized. If +// ZmqConnection wraps a ROUTER socket, id will be the identity of the sender. +// Otherwise, id will be "". +func (self *ZmqConnection) RecvMsg() (string, *validator_pb2.Message, error) { + for corrId, stored := range self.incoming { + delete(self.incoming, corrId) + return stored.Id, stored.Msg, nil + } + + // Receive a message from the socket + id, bytes, err := self.RecvData() + if err != nil { + return "", nil, err + } + + msg, err := LoadMsg(bytes) + return id, msg, err +} + +// RecvMsgWithId receives validator messages until a message with the given +// correlation id is found and returns this message. Any messages received that +// do not match the id are saved for subsequent receives. +func (self *ZmqConnection) RecvMsgWithId(corrId string) (string, *validator_pb2.Message, error) { + // If the message is already stored, just return it + stored, exists := self.incoming[corrId] + if exists { + return stored.Id, stored.Msg, nil + } + + for { + // If the message isn't stored, keep getting messages until it shows up + id, bytes, err := self.RecvData() + if err != nil { + return "", nil, err + } + msg, err := LoadMsg(bytes) + + // If the ids match, return it + if msg.GetCorrelationId() == corrId { + return id, msg, err + } + + // Otherwise, keep the message for later + self.incoming[msg.GetCorrelationId()] = &storedMsg{Id: id, Msg: msg} + } +} + +// Close closes the wrapped socket. This should be called with defer() after opening the socket. +func (self *ZmqConnection) Close() { + self.socket.Close() +} + +// Socket returns the wrapped socket. +func (self *ZmqConnection) Socket() *zmq.Socket { + return self.socket +} + +// Identity returns the identity assigned to the wrapped socket. +func (self *ZmqConnection) Identity() string { + return self.identity +} diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/processor/errors.go b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/processor/errors.go new file mode 100644 index 00000000..419b698a --- /dev/null +++ b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/processor/errors.go @@ -0,0 +1,38 @@ +/** + * Copyright 2017 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ------------------------------------------------------------------------------ + */ + +package processor + +import "fmt" + +type InvalidTransactionError struct { + Msg string + ExtendedData []byte +} + +func (err *InvalidTransactionError) Error() string { + return fmt.Sprint("Invalid transaction: ", err.Msg) +} + +type InternalError struct { + Msg string + ExtendedData []byte +} + +func (err *InternalError) Error() string { + return fmt.Sprint("Internal error: ", err.Msg) +} diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/processor/handler.go b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/processor/handler.go new file mode 100644 index 00000000..a0451e7c --- /dev/null +++ b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/processor/handler.go @@ -0,0 +1,70 @@ +/** + * Copyright 2017 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ------------------------------------------------------------------------------ + */ + +// Package processor defines: +// 1. A TransactionHandler interface to be used to create new transaction +// families. +// +// 2. A high-level, general purpose, multi-threaded TransactionProcessor that +// any number of handlers can be added to. +// +// 3. A Context class used to abstract getting and setting addresses in global +// validator state. +package processor + +import ( + "sawtooth_sdk/protobuf/processor_pb2" +) + +// TransactionHandler is the interface that defines the business logic for a +// new transaction family. This is the only interface that needs to be +// implemented to create a new transaction family. +// +// To create a transaction processor that uses a new transaction handler: +// +// validatorEndpoint := "tcp://localhost:4004" +// myHandler := NewMyHandler() +// processor := NewTransactionProcessor(validatorEndpoint) +// processor.AddHandler(myHandler) +// processor.Start() +// +// The FamilyName(), FamilyVersion(), Encoding(), and Namespaces() methods are +// used by the processor to route processing requests to the handler. +type TransactionHandler interface { + // FamilyName should return the name of the transaction family that this + // handler can process. Eg., "intkey" + FamilyName() string + + // FamilyVersion should return the version of the transaction family that + // this handler can process. Eg., "1.0" + FamilyVersion() string + + // Encoding should return the encoding that this handler can interpret. + // Eg., "application/cbor" + Encoding() string + + // Namespaces should return a slice containing all the handler's + // namespaces. Eg., []string{"abcdef"} + Namespaces() []string + + // Apply is the single method where all the business logic for a + // transaction family is defined. The method will be called by the + // transaction processor upon receiving a TpProcessRequest that the handler + // understands and will pass in the TpProcessRequest and an initialized + // instance of the Context type. + Apply(*processor_pb2.TpProcessRequest, *Context) error +} diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/processor/processor.go b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/processor/processor.go new file mode 100644 index 00000000..23ac668f --- /dev/null +++ b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/processor/processor.go @@ -0,0 +1,358 @@ +/** + * Copyright 2017 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ------------------------------------------------------------------------------ + */ + +package processor + +import ( + "fmt" + "github.com/golang/protobuf/proto" + zmq "github.com/pebbe/zmq4" + "os" + "os/signal" + "runtime" + "sawtooth_sdk/logging" + "sawtooth_sdk/messaging" + "sawtooth_sdk/protobuf/processor_pb2" + "sawtooth_sdk/protobuf/validator_pb2" +) + +var logger *logging.Logger = logging.Get() + +const MAX_WORK_QUEUE_SIZE = 100 + +// TransactionProcessor is a generic class for communicating with a validator +// and routing transaction processing requests to a registered handler. It uses +// ZMQ and channels to handle requests concurrently. +type TransactionProcessor struct { + uri string + context *zmq.Context + ids map[string]string + handlers []TransactionHandler + nThreads int + shutdown chan int +} + +// NewTransactionProcessor initializes a new Transaction Process and points it +// at the given URI. If it fails to initialize, it will panic. +func NewTransactionProcessor(uri string) *TransactionProcessor { + context, err := zmq.NewContext() + if err != nil { + panic(fmt.Sprint("Failed to create ZMQ context: ", err)) + } + return &TransactionProcessor{ + uri: uri, + context: context, + ids: make(map[string]string), + handlers: make([]TransactionHandler, 0), + nThreads: runtime.GOMAXPROCS(0), + shutdown: make(chan int), + } +} + +// AddHandler adds the given handler to the TransactionProcessor so it can +// receive transaction processing requests. All handlers must be added prior +// to starting the processor. +func (self *TransactionProcessor) AddHandler(handler TransactionHandler) { + self.handlers = append(self.handlers, handler) +} + +// Set the number of worker threads to be created for handling requests. Must +// be set before calling Start() +func (self *TransactionProcessor) SetThreadCount(n int) { + self.nThreads = n +} + +// Start connects the TransactionProcessor to a validator and starts listening +// for requests and routing them to an appropriate handler. +func (self *TransactionProcessor) Start() error { + // Establish a connection to the validator + validator, err := messaging.NewConnection(self.context, zmq.DEALER, self.uri) + if err != nil { + return fmt.Errorf("Could not connect to validator: %v", err) + } + defer validator.Close() + + // Setup connection to internal worker thread pool + workers, err := messaging.NewConnection(self.context, zmq.ROUTER, "inproc://workers") + if err != nil { + return fmt.Errorf("Could not create thread pool router: %v", err) + } + + // Make work queue. Buffer so the router doesn't block + queue := make(chan *validator_pb2.Message, MAX_WORK_QUEUE_SIZE) + + // Keep track of which correlation ids go to which worker threads, i.e. map + // corrId->workerThreadId + ids := make(map[string]string) + + // Startup worker thread pool + for i := 0; i < self.nThreads; i++ { + go worker(self.context, "inproc://workers", queue, self.handlers) + } + // Setup shutdown thread + go shutdown(self.context, "inproc://workers", queue, self.shutdown) + + workersLeft := uint(self.nThreads) + 1 + + // Setup ZMQ poller for routing messages between worker threads and validator + poller := zmq.NewPoller() + poller.Add(validator.Socket(), zmq.POLLIN) + poller.Add(workers.Socket(), zmq.POLLIN) + + // Register all handlers with the validator + for _, h := range self.handlers { + err := register(validator, h, queue) + if err != nil { + return fmt.Errorf( + "Error registering handler (%v, %v, %v, %v): %v", + h.FamilyName(), h.FamilyVersion, h.Encoding(), + h.Namespaces(), err, + ) + } + } + + // Poll for messages from worker threads or validator + for { + polled, err := poller.Poll(-1) + if err != nil { + return fmt.Errorf("Polling failed: %v", err) + } + for _, ready := range polled { + switch socket := ready.Socket; socket { + case validator.Socket(): + receiveValidator(ids, validator, workers, queue) + + case workers.Socket(): + receiveWorkers(ids, validator, workers, &workersLeft) + if workersLeft == 0 { + return nil + } + } + } + } +} + +// Shutdown sends a message to the processor telling it to deregister. +func (self *TransactionProcessor) Shutdown() { + // Initiate a clean shutdown + self.shutdown <- 0 +} + +// ShutdownOnSignal sets up signal handling to shutdown the processor when one +// of the signals passed is received. +func (self *TransactionProcessor) ShutdownOnSignal(siglist ...os.Signal) { + // Setup signal handlers + ch := make(chan os.Signal) + signal.Notify(ch, siglist...) + + go func() { + // Wait for a signal + _ = <-ch + + // Reset signal handlers + signal.Reset(siglist...) + logger.Warnf("Shutting down gracefully (Press Ctrl+C again to force)") + + self.Shutdown() + }() +} + +// Handle incoming messages from the validator +func receiveValidator(ids map[string]string, validator, workers messaging.Connection, queue chan *validator_pb2.Message) { + defer func() { + if r := recover(); r != nil { + logger.Errorf( + "Panic occured while routing message from validator: %v", r, + ) + } + }() + + // Receive a message from the validator + _, data, err := validator.RecvData() + if err != nil { + logger.Errorf("Receiving message from validator failed: %v", err) + return + } + // We need to deserialize the message to get the correlation id + msg, err := messaging.LoadMsg(data) + if err != nil { + logger.Errorf("Deserializing message from validator failed: %v", err) + return + } + + // Check if this is a new request or a response to a message sent by a + // worker thread. + t := msg.GetMessageType() + corrId := msg.GetCorrelationId() + + // If this is a new request, put in on the work queue + switch t { + case validator_pb2.Message_TP_PROCESS_REQUEST: + select { + case queue <- msg: + + default: + logger.Warnf("Work queue is full, denying request %v", corrId) + data, err := proto.Marshal(&processor_pb2.TpProcessResponse{ + Status: processor_pb2.TpProcessResponse_INTERNAL_ERROR, + Message: "Work queue is full, denying request", + }) + if err != nil { + logger.Errorf( + "Failed to notify validator the request is denied: %v", err, + ) + } + err = validator.SendMsg( + validator_pb2.Message_TP_PROCESS_RESPONSE, data, corrId, + ) + if err != nil { + logger.Errorf( + "Failed to notify validator the request is denied: %v", err, + ) + } + } + return + case validator_pb2.Message_TP_PING: + data, err := proto.Marshal(&processor_pb2.TpPingResponse{ + Status: processor_pb2.TpPingResponse_OK, + }) + if err != nil { + logger.Errorf( + "Failed to respond to TpPing %v", err, + ) + } + err = validator.SendMsg( + validator_pb2.Message_TP_PING_RESPONSE, data, corrId, + ) + return + } + + // If this is a response, send it to the worker. + workerId, exists := ids[corrId] + if exists && corrId != "" { + err = workers.SendData(workerId, data) + if err != nil { + logger.Errorf( + "Failed to send response with correlationd id %v to worker %v: %v", + corrId, workerId, err, + ) + return + } + delete(ids, corrId) + return + } + + logger.Warnf( + "Received unexpected message from validator: (%v, %v)", t, corrId, + ) +} + +// Handle incoming messages from the workers +func receiveWorkers(ids map[string]string, validator, workers messaging.Connection, workersLeft *uint) { + // Receive a mesasge from the workers + workerId, data, err := workers.RecvData() + if err != nil { + logger.Errorf("Receiving message from workers failed: %v", err) + return + } + + msg, err := messaging.LoadMsg(data) + if err != nil { + logger.Errorf("Deserializing message from workers failed: %v", err) + return + } + + t := msg.GetMessageType() + corrId := msg.GetCorrelationId() + + if t == validator_pb2.Message_DEFAULT && corrId == "shutdown" { + *workersLeft = *workersLeft - 1 + return + } + + // Store which thread the response should be routed to + if t != validator_pb2.Message_TP_PROCESS_RESPONSE { + ids[corrId] = workerId + } + + // Pass the message on to the validator + err = validator.SendData("", data) + if err != nil { + logger.Errorf("Failed to send message (%v) to validator: %v", corrId, err) + return + } +} + +// Register a handler with the validator +func register(validator messaging.Connection, handler TransactionHandler, queue chan *validator_pb2.Message) error { + regRequest := &processor_pb2.TpRegisterRequest{ + Family: handler.FamilyName(), + Version: handler.FamilyVersion(), + Encoding: handler.Encoding(), + Namespaces: handler.Namespaces(), + } + + regRequestData, err := proto.Marshal(regRequest) + if err != nil { + return err + } + + corrId, err := validator.SendNewMsg( + validator_pb2.Message_TP_REGISTER_REQUEST, + regRequestData, + ) + if err != nil { + return err + } + + // The validator is impatient and will send requests before confirming + // registration. + var msg *validator_pb2.Message + for { + _, msg, err = validator.RecvMsg() + if err != nil { + return err + } + + if msg.GetCorrelationId() != corrId { + queue <- msg + } else { + break + } + } + + if msg.GetMessageType() != validator_pb2.Message_TP_REGISTER_RESPONSE { + return fmt.Errorf("Received unexpected message type: %v", msg.GetMessageType()) + } + + regResponse := &processor_pb2.TpRegisterResponse{} + err = proto.Unmarshal(msg.GetContent(), regResponse) + if err != nil { + return err + } + + if regResponse.GetStatus() != processor_pb2.TpRegisterResponse_OK { + return fmt.Errorf("Got response: %v", regResponse.GetStatus()) + } + logger.Infof( + "Successfully registered handler (%v, %v, %v, %v)", + handler.FamilyName(), handler.FamilyVersion, + handler.Encoding(), handler.Namespaces(), + ) + + return nil +} diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/processor/state.go b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/processor/state.go new file mode 100644 index 00000000..de360b82 --- /dev/null +++ b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/processor/state.go @@ -0,0 +1,313 @@ +/** + * Copyright 2017 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ------------------------------------------------------------------------------ + */ + +package processor + +import ( + "fmt" + "github.com/golang/protobuf/proto" + "sawtooth_sdk/messaging" + "sawtooth_sdk/protobuf/events_pb2" + "sawtooth_sdk/protobuf/state_context_pb2" + "sawtooth_sdk/protobuf/validator_pb2" +) + +// Context provides an abstract interface for getting and setting validator +// state. All validator interactions by a handler should be through a Context +// instance. Currently, the Context class is NOT thread-safe and Context classes +// may not share the same messaging.Connection object. +type Context struct { + connection messaging.Connection + contextId string +} + +type Attribute struct { + Key string + Value string +} + +// Construct a new context object given an initialized Stream and Context ID. +func NewContext(connection messaging.Connection, contextId string) *Context { + return &Context{ + connection: connection, + contextId: contextId, + } +} + +// GetState queries the validator state for data at each of the addresses in the +// given slice. A string->[]byte map is returned. If an address is not set, +// it will not exist in the map. +// +// results, err := context.Get(addresses) +// if err != nil { +// fmt.Println("Error getting data!") +// } +// data, ok := results[address] +// if !ok { +// fmt.Prinln("No data stored at address!") +// } +// +func (self *Context) GetState(addresses []string) (map[string][]byte, error) { + // Construct the message + request := &state_context_pb2.TpStateGetRequest{ + ContextId: self.contextId, + Addresses: addresses, + } + bytes, err := proto.Marshal(request) + if err != nil { + return nil, fmt.Errorf("Failed to marshal TpStateGetRequest: %v", err) + } + + // Send the message and get the response + corrId, err := self.connection.SendNewMsg( + validator_pb2.Message_TP_STATE_GET_REQUEST, bytes, + ) + if err != nil { + return nil, fmt.Errorf("Failed to send TpStateGetRequest: %v", err) + } + + _, msg, err := self.connection.RecvMsgWithId(corrId) + if msg.GetCorrelationId() != corrId { + return nil, fmt.Errorf( + "Expected message with correlation id %v but got %v", + corrId, msg.GetCorrelationId(), + ) + } + + if msg.GetMessageType() != validator_pb2.Message_TP_STATE_GET_RESPONSE { + return nil, fmt.Errorf( + "Expected TpStateGetResponse but got %v", msg.GetMessageType(), + ) + } + + // Parse the result + response := &state_context_pb2.TpStateGetResponse{} + err = proto.Unmarshal(msg.GetContent(), response) + if err != nil { + return nil, fmt.Errorf("Failed to unmarshal TpStateGetResponse: %v", err) + } + + // Use a switch in case new Status values are added + switch response.Status { + case state_context_pb2.TpStateGetResponse_AUTHORIZATION_ERROR: + return nil, fmt.Errorf( + "Tried to get unauthorized address: %v", addresses, + ) + } + + // Construct and return a map + results := make(map[string][]byte) + for _, entry := range response.GetEntries() { + if len(entry.GetData()) != 0 { + results[entry.GetAddress()] = entry.GetData() + } + } + + return results, nil +} + +// SetState requests that each address in the validator state be set to the given +// value. A slice of addresses set is returned or an error if there was a +// problem setting the addresses. For example: +// +// responses, err := context.Set(dataMap) +// if err != nil { +// fmt.Println("Error setting addresses!") +// } +// set, ok := results[address] +// if !ok { +// fmt.Prinln("Address was not set!") +// } +// +func (self *Context) SetState(pairs map[string][]byte) ([]string, error) { + // Construct the message + entries := make([]*state_context_pb2.Entry, 0, len(pairs)) + for address, data := range pairs { + entries = append(entries, &state_context_pb2.Entry{ + Address: address, + Data: data, + }) + } + + request := &state_context_pb2.TpStateSetRequest{ + ContextId: self.contextId, + Entries: entries, + } + bytes, err := proto.Marshal(request) + if err != nil { + return nil, fmt.Errorf("Failed to marshal: %v", err) + } + + // Send the message and get the response + corrId, err := self.connection.SendNewMsg( + validator_pb2.Message_TP_STATE_SET_REQUEST, bytes, + ) + if err != nil { + return nil, fmt.Errorf("Failed to send set: %v", err) + } + + _, msg, err := self.connection.RecvMsgWithId(corrId) + if msg.GetCorrelationId() != corrId { + return nil, fmt.Errorf( + "Expected message with correlation id %v but got %v", + corrId, msg.GetCorrelationId(), + ) + } + + if msg.GetMessageType() != validator_pb2.Message_TP_STATE_SET_RESPONSE { + return nil, fmt.Errorf( + "Expected TP_STATE_SET_RESPONSE but got %v", msg.GetMessageType(), + ) + } + + // Parse the result + response := &state_context_pb2.TpStateSetResponse{} + err = proto.Unmarshal(msg.Content, response) + if err != nil { + return nil, fmt.Errorf("Failed to unmarshal TpStateSetResponse: %v", err) + } + + // Use a switch in case new Status values are added + switch response.GetStatus() { + case state_context_pb2.TpStateSetResponse_AUTHORIZATION_ERROR: + addresses := make([]string, 0, len(pairs)) + for a, _ := range pairs { + addresses = append(addresses, a) + } + return nil, fmt.Errorf("Tried to set unauthorized address: %v", addresses) + } + + return response.GetAddresses(), nil +} + +func (self *Context) Get(addresses []string) (map[string][]byte, error) { + return self.GetState(addresses) +} + +func (self *Context) Set(pairs map[string][]byte) ([]string, error) { + return self.SetState(pairs) +} + +func (self *Context) AddReceiptData(data_type string, data []byte) error { + // Append the data to the transaction receipt and set the type + request := &state_context_pb2.TpAddReceiptDataRequest{ + ContextId: self.contextId, + DataType: data_type, + Data: data, + } + bytes, err := proto.Marshal(request) + if err != nil { + return fmt.Errorf("Failed to marshal: %v", err) + } + + // Send the message and get the response + corrId, err := self.connection.SendNewMsg( + validator_pb2.Message_TP_ADD_RECEIPT_DATA_REQUEST, bytes, + ) + if err != nil { + return fmt.Errorf("Failed to add receipt data: %v", err) + } + + _, msg, err := self.connection.RecvMsgWithId(corrId) + if msg.GetCorrelationId() != corrId { + return fmt.Errorf( + "Expected message with correlation id %v but got %v", + corrId, msg.GetCorrelationId(), + ) + } + + if msg.GetMessageType() != validator_pb2.Message_TP_ADD_RECEIPT_DATA_RESPONSE { + return fmt.Errorf( + "Expected TP_ADD_RECEIPT_DATA_RESPONSE but got %v", msg.GetMessageType(), + ) + } + + // Parse the result + response := &state_context_pb2.TpAddReceiptDataResponse{} + err = proto.Unmarshal(msg.Content, response) + if err != nil { + return fmt.Errorf("Failed to unmarshal TpAddReceiptDataResponse: %v", err) + } + + // Use a switch in case new Status values are added + switch response.GetStatus() { + case state_context_pb2.TpAddReceiptDataResponse_ERROR: + return fmt.Errorf("Failed to add receipt data") + } + + return nil +} + +func (self *Context) AddEvent(event_type string, attributes []Attribute, event_data []byte) error { + event_attributes := make([]*events_pb2.Event_Attribute, 0, len(attributes)) + for _, attribute := range attributes { + event_attributes = append(event_attributes, &events_pb2.Event_Attribute{attribute.Key, attribute.Value}) + } + + event := &events_pb2.Event{ + EventType: event_type, + Attributes: event_attributes, + Data: event_data, + } + + // Construct message + request := &state_context_pb2.TpAddEventRequest{ + ContextId: self.contextId, + Event: event, + } + bytes, err := proto.Marshal(request) + if err != nil { + return fmt.Errorf("Failed to marshal: %v", err) + } + + // Send the message and get the response + corrId, err := self.connection.SendNewMsg( + validator_pb2.Message_TP_ADD_EVENT_REQUEST, bytes, + ) + if err != nil { + return fmt.Errorf("Failed to add event: %v", err) + } + + _, msg, err := self.connection.RecvMsgWithId(corrId) + if msg.GetCorrelationId() != corrId { + return fmt.Errorf( + "Expected message with correlation id %v but got %v", + corrId, msg.GetCorrelationId(), + ) + } + + if msg.GetMessageType() != validator_pb2.Message_TP_ADD_EVENT_RESPONSE { + return fmt.Errorf( + "Expected TP_ADD_EVENT_RESPONSE but got %v", msg.GetMessageType(), + ) + } + + // Parse the result + response := &state_context_pb2.TpAddEventResponse{} + err = proto.Unmarshal(msg.Content, response) + if err != nil { + return fmt.Errorf("Failed to unmarshal TpAddEventResponse: %v", err) + } + + // Use a switch in case new Status values are added + switch response.GetStatus() { + case state_context_pb2.TpAddEventResponse_ERROR: + return fmt.Errorf("Failed to add event") + } + + return nil +} diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/processor/worker.go b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/processor/worker.go new file mode 100644 index 00000000..6cf33e8a --- /dev/null +++ b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/processor/worker.go @@ -0,0 +1,207 @@ +/** + * Copyright 2017 Intel Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ------------------------------------------------------------------------------ + */ + +package processor + +import ( + "fmt" + "github.com/golang/protobuf/proto" + zmq "github.com/pebbe/zmq4" + "sawtooth_sdk/messaging" + "sawtooth_sdk/protobuf/processor_pb2" + "sawtooth_sdk/protobuf/transaction_pb2" + "sawtooth_sdk/protobuf/validator_pb2" +) + +// The main worker thread finds an appropriate handler and processes the request +func worker(context *zmq.Context, uri string, queue chan *validator_pb2.Message, handlers []TransactionHandler) { + // Connect to the main send/receive thread + connection, err := messaging.NewConnection(context, zmq.DEALER, uri) + if err != nil { + logger.Errorf("Failed to connect to main thread: %v", err) + return + } + defer connection.Close() + id := connection.Identity() + + // Receive work off of the queue until the queue is closed + for msg := range queue { + request := &processor_pb2.TpProcessRequest{} + err = proto.Unmarshal(msg.GetContent(), request) + if err != nil { + logger.Errorf( + "(%v) Failed to unmarshal TpProcessRequest: %v", id, err, + ) + break + } + + header := &transaction_pb2.TransactionHeader{} + err = proto.Unmarshal(request.Header, header) + if err != nil { + logger.Errorf( + "(%v) Failed to unmarshal TransactionHeader: %v", id, err) + break + } + + // Try to find a handler + handler, err := findHandler(handlers, header) + if err != nil { + logger.Errorf("(%v) Failed to find handler: %v", id, err) + break + } + + // Construct a new Context instance for the handler + contextId := request.GetContextId() + context := NewContext(connection, contextId) + + // Run the handler + err = handler.Apply(request, context) + + // Process the handler response + response := &processor_pb2.TpProcessResponse{} + if err != nil { + switch e := err.(type) { + case *InvalidTransactionError: + logger.Warnf("(%v) %v", id, e) + response.Status = processor_pb2.TpProcessResponse_INVALID_TRANSACTION + response.Message = e.Msg + response.ExtendedData = e.ExtendedData + case *InternalError: + logger.Warnf("(%v) %v", id, e) + response.Status = processor_pb2.TpProcessResponse_INTERNAL_ERROR + response.Message = e.Msg + response.ExtendedData = e.ExtendedData + default: + logger.Errorf("(%v) Unknown error: %v", id, err) + response.Status = processor_pb2.TpProcessResponse_INTERNAL_ERROR + response.Message = e.Error() + } + } else { + response.Status = processor_pb2.TpProcessResponse_OK + } + + responseData, err := proto.Marshal(response) + if err != nil { + logger.Errorf("(%v) Failed to marshal TpProcessResponse: %v", id, err) + break + } + + // Send back a response to the validator + err = connection.SendMsg( + validator_pb2.Message_TP_PROCESS_RESPONSE, + responseData, msg.GetCorrelationId(), + ) + if err != nil { + logger.Errorf("(%v) Error sending TpProcessResponse: %v", id, err) + break + } + } + + // Queue has closed, so send shutdown signal + logger.Infof("(%v) No more work in queue, shutting down", id) + err = connection.SendMsg( + validator_pb2.Message_DEFAULT, + []byte{byte(0)}, "shutdown", + ) + if err != nil { + logger.Errorf("(%v) Error sending shutdown: %v", id, err) + } +} + +// Searches for and returns a handler that matches the header. If a suitable +// handler is not found, returns an error. +func findHandler(handlers []TransactionHandler, header *transaction_pb2.TransactionHeader) (TransactionHandler, error) { + for _, handler := range handlers { + if header.GetFamilyName() != handler.FamilyName() { + break + } + + if header.GetFamilyVersion() != handler.FamilyVersion() { + break + } + + if header.GetPayloadEncoding() != handler.Encoding() { + break + } + + return handler, nil + } + return nil, fmt.Errorf( + "Unknown handler: (%v, %v, %v)", header.GetFamilyName(), + header.GetFamilyVersion(), header.GetPayloadEncoding(), + ) +} + +// Waits for something to come along a channel and then initiates processor shutdown +func shutdown(context *zmq.Context, uri string, queue chan *validator_pb2.Message, wait chan int) { + // Wait for a request to shutdown + connection, err := messaging.NewConnection(context, zmq.DEALER, uri) + if err != nil { + logger.Errorf("Failed to connect to main thread: %v", err) + return + } + defer connection.Close() + id := "shutdown" + + <-wait + + // Send a request to be unregistered + data, err := proto.Marshal(&processor_pb2.TpUnregisterRequest{}) + if err != nil { + logger.Errorf( + "Failed to unregister: %v", err, + ) + } + corrId, err := connection.SendNewMsg( + validator_pb2.Message_TP_UNREGISTER_REQUEST, data, + ) + if err != nil { + logger.Errorf( + "Failed to unregister: %v", err, + ) + } + + // Wait for a response + _, msg, err := connection.RecvMsgWithId(corrId) + if err != nil { + logger.Errorf("Failed to receive TpUnregisterResponse: %v", err) + } + if msg.GetCorrelationId() != corrId { + logger.Errorf( + "Expected message with correlation id %v but got %v", + corrId, msg.GetCorrelationId(), + ) + } + if msg.GetMessageType() != validator_pb2.Message_TP_UNREGISTER_RESPONSE { + logger.Errorf( + "Expected TP_UNREGISTER_RESPONSE but got %v", msg.GetMessageType(), + ) + } + + // Close the work queue, telling the worker threads there's no more work + close(queue) + + err = connection.SendMsg( + validator_pb2.Message_DEFAULT, + []byte{byte(0)}, "shutdown", + ) + if err != nil { + logger.Errorf("(%v) Error sending shutdown message to router: %v", id, err) + } else { + logger.Infof("(%v) Sent shutdown message to router", id) + } +} diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/authorization_pb2/authorization.pb.go b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/authorization_pb2/authorization.pb.go new file mode 100644 index 00000000..86317dfe --- /dev/null +++ b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/authorization_pb2/authorization.pb.go @@ -0,0 +1,373 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: sawtooth_sdk/protobuf/authorization_pb2/authorization.proto + +/* +Package authorization_pb2 is a generated protocol buffer package. + +It is generated from these files: + sawtooth_sdk/protobuf/authorization_pb2/authorization.proto + +It has these top-level messages: + ConnectionRequest + ConnectionResponse + AuthorizationTrustRequest + AuthorizationTrustResponse + AuthorizationViolation + AuthorizationChallengeRequest + AuthorizationChallengeResponse + AuthorizationChallengeSubmit + AuthorizationChallengeResult +*/ +package authorization_pb2 + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +type RoleType int32 + +const ( + // A shorthand request for asking for all allowed roles. + RoleType_ALL RoleType = 0 + // Role defining validator to validator communication + RoleType_NETWORK RoleType = 1 +) + +var RoleType_name = map[int32]string{ + 0: "ALL", + 1: "NETWORK", +} +var RoleType_value = map[string]int32{ + "ALL": 0, + "NETWORK": 1, +} + +func (x RoleType) String() string { + return proto.EnumName(RoleType_name, int32(x)) +} +func (RoleType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +// Whether the connection can participate in authorization +type ConnectionResponse_Status int32 + +const ( + ConnectionResponse_OK ConnectionResponse_Status = 0 + ConnectionResponse_ERROR ConnectionResponse_Status = 1 +) + +var ConnectionResponse_Status_name = map[int32]string{ + 0: "OK", + 1: "ERROR", +} +var ConnectionResponse_Status_value = map[string]int32{ + "OK": 0, + "ERROR": 1, +} + +func (x ConnectionResponse_Status) String() string { + return proto.EnumName(ConnectionResponse_Status_name, int32(x)) +} +func (ConnectionResponse_Status) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{1, 0} } + +// Authorization Type required for the authorization procedure +type ConnectionResponse_AuthorizationType int32 + +const ( + ConnectionResponse_TRUST ConnectionResponse_AuthorizationType = 0 + ConnectionResponse_CHALLENGE ConnectionResponse_AuthorizationType = 1 +) + +var ConnectionResponse_AuthorizationType_name = map[int32]string{ + 0: "TRUST", + 1: "CHALLENGE", +} +var ConnectionResponse_AuthorizationType_value = map[string]int32{ + "TRUST": 0, + "CHALLENGE": 1, +} + +func (x ConnectionResponse_AuthorizationType) String() string { + return proto.EnumName(ConnectionResponse_AuthorizationType_name, int32(x)) +} +func (ConnectionResponse_AuthorizationType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{1, 1} +} + +type ConnectionRequest struct { + // This is the first message that must be sent to start off authorization. + // The endpoint of the connection. + Endpoint string `protobuf:"bytes,1,opt,name=endpoint" json:"endpoint,omitempty"` +} + +func (m *ConnectionRequest) Reset() { *m = ConnectionRequest{} } +func (m *ConnectionRequest) String() string { return proto.CompactTextString(m) } +func (*ConnectionRequest) ProtoMessage() {} +func (*ConnectionRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *ConnectionRequest) GetEndpoint() string { + if m != nil { + return m.Endpoint + } + return "" +} + +type ConnectionResponse struct { + Roles []*ConnectionResponse_RoleEntry `protobuf:"bytes,1,rep,name=roles" json:"roles,omitempty"` + Status ConnectionResponse_Status `protobuf:"varint,2,opt,name=status,enum=ConnectionResponse_Status" json:"status,omitempty"` +} + +func (m *ConnectionResponse) Reset() { *m = ConnectionResponse{} } +func (m *ConnectionResponse) String() string { return proto.CompactTextString(m) } +func (*ConnectionResponse) ProtoMessage() {} +func (*ConnectionResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *ConnectionResponse) GetRoles() []*ConnectionResponse_RoleEntry { + if m != nil { + return m.Roles + } + return nil +} + +func (m *ConnectionResponse) GetStatus() ConnectionResponse_Status { + if m != nil { + return m.Status + } + return ConnectionResponse_OK +} + +type ConnectionResponse_RoleEntry struct { + // The role type for this role entry + Role RoleType `protobuf:"varint,1,opt,name=role,enum=RoleType" json:"role,omitempty"` + // The Authorization Type required for the above role + AuthType ConnectionResponse_AuthorizationType `protobuf:"varint,2,opt,name=auth_type,json=authType,enum=ConnectionResponse_AuthorizationType" json:"auth_type,omitempty"` +} + +func (m *ConnectionResponse_RoleEntry) Reset() { *m = ConnectionResponse_RoleEntry{} } +func (m *ConnectionResponse_RoleEntry) String() string { return proto.CompactTextString(m) } +func (*ConnectionResponse_RoleEntry) ProtoMessage() {} +func (*ConnectionResponse_RoleEntry) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1, 0} } + +func (m *ConnectionResponse_RoleEntry) GetRole() RoleType { + if m != nil { + return m.Role + } + return RoleType_ALL +} + +func (m *ConnectionResponse_RoleEntry) GetAuthType() ConnectionResponse_AuthorizationType { + if m != nil { + return m.AuthType + } + return ConnectionResponse_TRUST +} + +type AuthorizationTrustRequest struct { + // A set of requested RoleTypes + Roles []RoleType `protobuf:"varint,1,rep,packed,name=roles,enum=RoleType" json:"roles,omitempty"` + PublicKey string `protobuf:"bytes,2,opt,name=public_key,json=publicKey" json:"public_key,omitempty"` +} + +func (m *AuthorizationTrustRequest) Reset() { *m = AuthorizationTrustRequest{} } +func (m *AuthorizationTrustRequest) String() string { return proto.CompactTextString(m) } +func (*AuthorizationTrustRequest) ProtoMessage() {} +func (*AuthorizationTrustRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *AuthorizationTrustRequest) GetRoles() []RoleType { + if m != nil { + return m.Roles + } + return nil +} + +func (m *AuthorizationTrustRequest) GetPublicKey() string { + if m != nil { + return m.PublicKey + } + return "" +} + +type AuthorizationTrustResponse struct { + // The actual set the requester has access to + Roles []RoleType `protobuf:"varint,1,rep,packed,name=roles,enum=RoleType" json:"roles,omitempty"` +} + +func (m *AuthorizationTrustResponse) Reset() { *m = AuthorizationTrustResponse{} } +func (m *AuthorizationTrustResponse) String() string { return proto.CompactTextString(m) } +func (*AuthorizationTrustResponse) ProtoMessage() {} +func (*AuthorizationTrustResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *AuthorizationTrustResponse) GetRoles() []RoleType { + if m != nil { + return m.Roles + } + return nil +} + +type AuthorizationViolation struct { + // The Role the requester did not have access to + Violation RoleType `protobuf:"varint,1,opt,name=violation,enum=RoleType" json:"violation,omitempty"` +} + +func (m *AuthorizationViolation) Reset() { *m = AuthorizationViolation{} } +func (m *AuthorizationViolation) String() string { return proto.CompactTextString(m) } +func (*AuthorizationViolation) ProtoMessage() {} +func (*AuthorizationViolation) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *AuthorizationViolation) GetViolation() RoleType { + if m != nil { + return m.Violation + } + return RoleType_ALL +} + +type AuthorizationChallengeRequest struct { +} + +func (m *AuthorizationChallengeRequest) Reset() { *m = AuthorizationChallengeRequest{} } +func (m *AuthorizationChallengeRequest) String() string { return proto.CompactTextString(m) } +func (*AuthorizationChallengeRequest) ProtoMessage() {} +func (*AuthorizationChallengeRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +type AuthorizationChallengeResponse struct { + // Random payload that the connecting node must sign + Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` +} + +func (m *AuthorizationChallengeResponse) Reset() { *m = AuthorizationChallengeResponse{} } +func (m *AuthorizationChallengeResponse) String() string { return proto.CompactTextString(m) } +func (*AuthorizationChallengeResponse) ProtoMessage() {} +func (*AuthorizationChallengeResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *AuthorizationChallengeResponse) GetPayload() []byte { + if m != nil { + return m.Payload + } + return nil +} + +type AuthorizationChallengeSubmit struct { + // public key of node + PublicKey string `protobuf:"bytes,1,opt,name=public_key,json=publicKey" json:"public_key,omitempty"` + // payload bytes that was signed to make the signature + Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` + // signature derived from signing the challenge payload + Signature string `protobuf:"bytes,3,opt,name=signature" json:"signature,omitempty"` + // A set of requested Roles + Roles []RoleType `protobuf:"varint,4,rep,packed,name=roles,enum=RoleType" json:"roles,omitempty"` +} + +func (m *AuthorizationChallengeSubmit) Reset() { *m = AuthorizationChallengeSubmit{} } +func (m *AuthorizationChallengeSubmit) String() string { return proto.CompactTextString(m) } +func (*AuthorizationChallengeSubmit) ProtoMessage() {} +func (*AuthorizationChallengeSubmit) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *AuthorizationChallengeSubmit) GetPublicKey() string { + if m != nil { + return m.PublicKey + } + return "" +} + +func (m *AuthorizationChallengeSubmit) GetPayload() []byte { + if m != nil { + return m.Payload + } + return nil +} + +func (m *AuthorizationChallengeSubmit) GetSignature() string { + if m != nil { + return m.Signature + } + return "" +} + +func (m *AuthorizationChallengeSubmit) GetRoles() []RoleType { + if m != nil { + return m.Roles + } + return nil +} + +type AuthorizationChallengeResult struct { + // The approved roles for that connection + Roles []RoleType `protobuf:"varint,1,rep,packed,name=roles,enum=RoleType" json:"roles,omitempty"` +} + +func (m *AuthorizationChallengeResult) Reset() { *m = AuthorizationChallengeResult{} } +func (m *AuthorizationChallengeResult) String() string { return proto.CompactTextString(m) } +func (*AuthorizationChallengeResult) ProtoMessage() {} +func (*AuthorizationChallengeResult) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *AuthorizationChallengeResult) GetRoles() []RoleType { + if m != nil { + return m.Roles + } + return nil +} + +func init() { + proto.RegisterType((*ConnectionRequest)(nil), "ConnectionRequest") + proto.RegisterType((*ConnectionResponse)(nil), "ConnectionResponse") + proto.RegisterType((*ConnectionResponse_RoleEntry)(nil), "ConnectionResponse.RoleEntry") + proto.RegisterType((*AuthorizationTrustRequest)(nil), "AuthorizationTrustRequest") + proto.RegisterType((*AuthorizationTrustResponse)(nil), "AuthorizationTrustResponse") + proto.RegisterType((*AuthorizationViolation)(nil), "AuthorizationViolation") + proto.RegisterType((*AuthorizationChallengeRequest)(nil), "AuthorizationChallengeRequest") + proto.RegisterType((*AuthorizationChallengeResponse)(nil), "AuthorizationChallengeResponse") + proto.RegisterType((*AuthorizationChallengeSubmit)(nil), "AuthorizationChallengeSubmit") + proto.RegisterType((*AuthorizationChallengeResult)(nil), "AuthorizationChallengeResult") + proto.RegisterEnum("RoleType", RoleType_name, RoleType_value) + proto.RegisterEnum("ConnectionResponse_Status", ConnectionResponse_Status_name, ConnectionResponse_Status_value) + proto.RegisterEnum("ConnectionResponse_AuthorizationType", ConnectionResponse_AuthorizationType_name, ConnectionResponse_AuthorizationType_value) +} + +func init() { + proto.RegisterFile("sawtooth_sdk/protobuf/authorization_pb2/authorization.proto", fileDescriptor0) +} + +var fileDescriptor0 = []byte{ + // 489 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x84, 0x53, 0xd1, 0x6e, 0xd3, 0x30, + 0x14, 0x25, 0xed, 0xd6, 0xd6, 0x77, 0x30, 0xb5, 0x96, 0x40, 0xa5, 0xac, 0x6c, 0xb2, 0x84, 0x98, + 0x10, 0xa4, 0x52, 0xf6, 0x06, 0x42, 0xa8, 0xab, 0x22, 0x90, 0x3a, 0xad, 0xc8, 0x2d, 0x20, 0xc1, + 0x43, 0x95, 0xac, 0x66, 0x8d, 0x16, 0xec, 0x10, 0x3b, 0xa0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b, 0x12, 0xdc, 0xbb, 0x6d, 0x7d, 0xe9, 0xa1, 0x92, 0x70, 0xf7, 0xbb, 0xbe, 0x38, + 0x81, 0x46, 0x01, 0xe1, 0x3a, 0x54, 0xf5, 0xef, 0xa2, 0xff, 0x9c, 0x03, 0xa8, 0x5f, 0xba, 0x93, + 0x2f, 0x23, 0x3a, 0x6c, 0x5a, 0xe7, 0x2f, 0xe1, 0x61, 0xb1, 0xe3, 0xb6, 0xde, 0x71, 0xbb, 0xd8, + 0xf1, 0x8f, 0xd6, 0xd7, 0xd6, 0xda, 0x9a, 0xfb, 0x35, 0x73, 0x7d, 0xf6, 0x3f, 0x00, 0x00, 0xff, + 0xff, 0x84, 0x7c, 0xe7, 0x87, 0x18, 0x04, 0x00, 0x00, +} diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/batch_pb2/batch.pb.go b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/batch_pb2/batch.pb.go new file mode 100644 index 00000000..2aeee1f1 --- /dev/null +++ b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/batch_pb2/batch.pb.go @@ -0,0 +1,150 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: sawtooth_sdk/protobuf/batch_pb2/batch.proto + +/* +Package batch_pb2 is a generated protocol buffer package. + +It is generated from these files: + sawtooth_sdk/protobuf/batch_pb2/batch.proto + +It has these top-level messages: + BatchHeader + Batch + BatchList +*/ +package batch_pb2 + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import transaction "sawtooth_sdk/protobuf/transaction_pb2" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +type BatchHeader struct { + // Public key for the client that signed the BatchHeader + SignerPubkey string `protobuf:"bytes,1,opt,name=signer_pubkey,json=signerPubkey" json:"signer_pubkey,omitempty"` + // List of transaction.header_signatures that match the order of + // transactions required for the batch + TransactionIds []string `protobuf:"bytes,2,rep,name=transaction_ids,json=transactionIds" json:"transaction_ids,omitempty"` +} + +func (m *BatchHeader) Reset() { *m = BatchHeader{} } +func (m *BatchHeader) String() string { return proto.CompactTextString(m) } +func (*BatchHeader) ProtoMessage() {} +func (*BatchHeader) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *BatchHeader) GetSignerPubkey() string { + if m != nil { + return m.SignerPubkey + } + return "" +} + +func (m *BatchHeader) GetTransactionIds() []string { + if m != nil { + return m.TransactionIds + } + return nil +} + +type Batch struct { + // The serialized version of the BlockHeader + Header []byte `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + // The signature derived from signing the header + HeaderSignature string `protobuf:"bytes,2,opt,name=header_signature,json=headerSignature" json:"header_signature,omitempty"` + // A list of the transactions that match the list of + // transaction_ids listed in the batch header + Transactions []*transaction.Transaction `protobuf:"bytes,3,rep,name=transactions" json:"transactions,omitempty"` + // A debugging flag which indicates this batch should be traced through the + // system, resulting in a higher level of debugging output. + Trace bool `protobuf:"varint,4,opt,name=trace" json:"trace,omitempty"` +} + +func (m *Batch) Reset() { *m = Batch{} } +func (m *Batch) String() string { return proto.CompactTextString(m) } +func (*Batch) ProtoMessage() {} +func (*Batch) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *Batch) GetHeader() []byte { + if m != nil { + return m.Header + } + return nil +} + +func (m *Batch) GetHeaderSignature() string { + if m != nil { + return m.HeaderSignature + } + return "" +} + +func (m *Batch) GetTransactions() []*transaction.Transaction { + if m != nil { + return m.Transactions + } + return nil +} + +func (m *Batch) GetTrace() bool { + if m != nil { + return m.Trace + } + return false +} + +type BatchList struct { + Batches []*Batch `protobuf:"bytes,1,rep,name=batches" json:"batches,omitempty"` +} + +func (m *BatchList) Reset() { *m = BatchList{} } +func (m *BatchList) String() string { return proto.CompactTextString(m) } +func (*BatchList) ProtoMessage() {} +func (*BatchList) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *BatchList) GetBatches() []*Batch { + if m != nil { + return m.Batches + } + return nil +} + +func init() { + proto.RegisterType((*BatchHeader)(nil), "BatchHeader") + proto.RegisterType((*Batch)(nil), "Batch") + proto.RegisterType((*BatchList)(nil), "BatchList") +} + +func init() { proto.RegisterFile("sawtooth_sdk/protobuf/batch_pb2/batch.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 279 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x6c, 0x91, 0x41, 0x4b, 0xf4, 0x30, + 0x10, 0x86, 0xe9, 0xb7, 0xdf, 0x56, 0x3b, 0x5b, 0x5d, 0x09, 0x2a, 0xc5, 0x53, 0xa9, 0x82, 0x8a, + 0x98, 0x95, 0xf5, 0xe0, 0x7d, 0x4f, 0x0a, 0x1e, 0x96, 0xe8, 0x49, 0x0f, 0x25, 0x69, 0xa3, 0x2d, + 0x0b, 0x4d, 0x49, 0x52, 0xc4, 0xbf, 0xe1, 0x2f, 0x36, 0x9d, 0x58, 0xad, 0xe0, 0x2d, 0xf3, 0x64, + 0xf2, 0xcc, 0xf0, 0x06, 0x2e, 0x0c, 0x7f, 0xb3, 0x4a, 0xd9, 0x2a, 0x37, 0xe5, 0x66, 0xd1, 0x6a, + 0x65, 0x95, 0xe8, 0x5e, 0x16, 0x82, 0xdb, 0xa2, 0xca, 0x5b, 0xb1, 0xf4, 0x27, 0x8a, 0x17, 0x47, + 0x37, 0x7f, 0x37, 0x5b, 0xcd, 0x1b, 0xc3, 0x0b, 0x5b, 0xab, 0x06, 0x9f, 0x8c, 0x6a, 0xff, 0x30, + 0x7b, 0x86, 0xd9, 0xaa, 0xf7, 0xdc, 0x4a, 0x5e, 0x4a, 0x4d, 0x8e, 0x61, 0xc7, 0xd4, 0xaf, 0x8d, + 0xd4, 0x79, 0xdb, 0x89, 0x8d, 0x7c, 0x4f, 0x82, 0x34, 0x38, 0x8b, 0x58, 0xec, 0xe1, 0x1a, 0x19, + 0x39, 0x85, 0xf9, 0x58, 0x5c, 0x97, 0x26, 0xf9, 0x97, 0x4e, 0x5c, 0xdb, 0xee, 0x08, 0xdf, 0x95, + 0x26, 0xfb, 0x08, 0x60, 0x8a, 0x76, 0x72, 0x08, 0x61, 0x85, 0x13, 0x50, 0x18, 0xb3, 0xaf, 0x8a, + 0x9c, 0xc3, 0x9e, 0x3f, 0xe5, 0xfd, 0x04, 0x6e, 0x3b, 0x2d, 0x9d, 0xab, 0x1f, 0x39, 0xf7, 0xfc, + 0x61, 0xc0, 0xe4, 0x0a, 0xe2, 0x91, 0xde, 0x24, 0x13, 0x37, 0x72, 0xb6, 0x8c, 0xe9, 0xe3, 0x0f, + 0x64, 0xbf, 0x3a, 0xc8, 0x3e, 0x4c, 0x5d, 0x5d, 0xc8, 0xe4, 0xbf, 0x33, 0x6e, 0x33, 0x5f, 0x64, + 0x97, 0x10, 0xe1, 0x4e, 0xf7, 0xb5, 0xb1, 0x24, 0x85, 0x2d, 0x8c, 0x51, 0x1a, 0xb7, 0x58, 0xef, + 0x0b, 0x29, 0x5e, 0xb2, 0x01, 0xaf, 0x4e, 0xe0, 0x60, 0xc8, 0x96, 0xba, 0x6c, 0xe9, 0x90, 0xed, + 0x3a, 0x78, 0x8a, 0xbe, 0xff, 0x42, 0x84, 0x88, 0xaf, 0x3f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xf7, + 0x42, 0xc5, 0x99, 0xb5, 0x01, 0x00, 0x00, +} diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/block_pb2/block.pb.go b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/block_pb2/block.pb.go new file mode 100644 index 00000000..80f2ad90 --- /dev/null +++ b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/block_pb2/block.pb.go @@ -0,0 +1,165 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: sawtooth_sdk/protobuf/block_pb2/block.proto + +/* +Package block_pb2 is a generated protocol buffer package. + +It is generated from these files: + sawtooth_sdk/protobuf/block_pb2/block.proto + +It has these top-level messages: + BlockHeader + Block +*/ +package block_pb2 + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import batch "sawtooth_sdk/protobuf/batch_pb2" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +type BlockHeader struct { + // Block number in the chain + BlockNum uint64 `protobuf:"varint,1,opt,name=block_num,json=blockNum" json:"block_num,omitempty"` + // The header_signature of the previous block that was added to the chain. + PreviousBlockId string `protobuf:"bytes,2,opt,name=previous_block_id,json=previousBlockId" json:"previous_block_id,omitempty"` + // Public key for the component internal to the validator that + // signed the BlockHeader + SignerPubkey string `protobuf:"bytes,3,opt,name=signer_pubkey,json=signerPubkey" json:"signer_pubkey,omitempty"` + // List of batch.header_signatures that match the order of batches + // required for the block + BatchIds []string `protobuf:"bytes,4,rep,name=batch_ids,json=batchIds" json:"batch_ids,omitempty"` + // Bytes that are set and verified by the consensus algorithm used to + // create and validate the block + Consensus []byte `protobuf:"bytes,5,opt,name=consensus,proto3" json:"consensus,omitempty"` + // The state_root_hash should match the final state_root after all + // transactions in the batches have been applied, otherwise the block + // is not valid + StateRootHash string `protobuf:"bytes,6,opt,name=state_root_hash,json=stateRootHash" json:"state_root_hash,omitempty"` +} + +func (m *BlockHeader) Reset() { *m = BlockHeader{} } +func (m *BlockHeader) String() string { return proto.CompactTextString(m) } +func (*BlockHeader) ProtoMessage() {} +func (*BlockHeader) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *BlockHeader) GetBlockNum() uint64 { + if m != nil { + return m.BlockNum + } + return 0 +} + +func (m *BlockHeader) GetPreviousBlockId() string { + if m != nil { + return m.PreviousBlockId + } + return "" +} + +func (m *BlockHeader) GetSignerPubkey() string { + if m != nil { + return m.SignerPubkey + } + return "" +} + +func (m *BlockHeader) GetBatchIds() []string { + if m != nil { + return m.BatchIds + } + return nil +} + +func (m *BlockHeader) GetConsensus() []byte { + if m != nil { + return m.Consensus + } + return nil +} + +func (m *BlockHeader) GetStateRootHash() string { + if m != nil { + return m.StateRootHash + } + return "" +} + +type Block struct { + // The serialized version of the BlockHeader + Header []byte `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + // The signature derived from signing the header + HeaderSignature string `protobuf:"bytes,2,opt,name=header_signature,json=headerSignature" json:"header_signature,omitempty"` + // A list of batches. The batches may contain new batches that other + // validators may not have received yet, or they will be all batches needed + // for block validation when passed to the journal + Batches []*batch.Batch `protobuf:"bytes,3,rep,name=batches" json:"batches,omitempty"` +} + +func (m *Block) Reset() { *m = Block{} } +func (m *Block) String() string { return proto.CompactTextString(m) } +func (*Block) ProtoMessage() {} +func (*Block) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *Block) GetHeader() []byte { + if m != nil { + return m.Header + } + return nil +} + +func (m *Block) GetHeaderSignature() string { + if m != nil { + return m.HeaderSignature + } + return "" +} + +func (m *Block) GetBatches() []*batch.Batch { + if m != nil { + return m.Batches + } + return nil +} + +func init() { + proto.RegisterType((*BlockHeader)(nil), "BlockHeader") + proto.RegisterType((*Block)(nil), "Block") +} + +func init() { proto.RegisterFile("sawtooth_sdk/protobuf/block_pb2/block.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 309 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08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0xf4, 0x09, 0xac, 0x0b, 0x64, 0x57, + 0x10, 0x6d, 0x65, 0x8d, 0xa2, 0x46, 0x83, 0x71, 0xcf, 0xbe, 0x1e, 0xa6, 0x7f, 0x80, 0xdd, 0xc2, + 0x18, 0x75, 0xa6, 0x05, 0x57, 0x36, 0x2a, 0x2f, 0x33, 0x2c, 0xe3, 0x90, 0x26, 0x8c, 0x08, 0xa7, + 0x96, 0xae, 0x2c, 0x9c, 0xee, 0xa1, 0x47, 0x96, 0xd8, 0x39, 0x84, 0x25, 0x65, 0xa4, 0x58, 0xc3, + 0xf4, 0xe7, 0xc4, 0xee, 0xe0, 0xc4, 0x55, 0xbc, 0xb5, 0x96, 0x69, 0xa3, 0x84, 0xcf, 0xe4, 0xf8, + 0xb3, 0xc7, 0x6c, 0x02, 0xc7, 0xe4, 0x4e, 0xa0, 0x4d, 0xd3, 0x99, 0x0d, 0x16, 0x61, 0xb2, 0x6c, + 0xcf, 0xa9, 0xc7, 0xcb, 0x1b, 0x38, 0xf3, 0xdb, 0x4f, 0xec, 0xf6, 0x13, 0xbf, 0xfd, 0x4d, 0xf0, + 0x12, 0xfd, 0xfe, 0x56, 0x1e, 0x12, 0x7e, 0xfc, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x25, 0x57, 0x8a, + 0x71, 0xd7, 0x01, 0x00, 0x00, +} diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/client_pb2/client.pb.go b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/client_pb2/client.pb.go new file mode 100644 index 00000000..f4588440 --- /dev/null +++ b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/client_pb2/client.pb.go @@ -0,0 +1,1861 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: sawtooth_sdk/protobuf/client_pb2/client.proto + +/* +Package client_pb2 is a generated protocol buffer package. + +It is generated from these files: + sawtooth_sdk/protobuf/client_pb2/client.proto + +It has these top-level messages: + Leaf + BatchStatus + PagingControls + PagingResponse + SortControls + ClientBatchSubmitRequest + ClientBatchSubmitResponse + ClientBatchStatusRequest + ClientBatchStatusResponse + ClientStateCurrentRequest + ClientStateCurrentResponse + ClientStateListRequest + ClientStateListResponse + ClientStateGetRequest + ClientStateGetResponse + ClientBlockListRequest + ClientBlockListResponse + ClientBlockGetRequest + ClientBlockGetResponse + ClientBatchListRequest + ClientBatchListResponse + ClientBatchGetRequest + ClientBatchGetResponse + ClientTransactionListRequest + ClientTransactionListResponse + ClientTransactionGetRequest + ClientTransactionGetResponse +*/ +package client_pb2 + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import block "sawtooth_sdk/protobuf/block_pb2" +import batch "sawtooth_sdk/protobuf/batch_pb2" +import transaction "sawtooth_sdk/protobuf/transaction_pb2" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +type BatchStatus_Status int32 + +const ( + BatchStatus_COMMITTED BatchStatus_Status = 0 + BatchStatus_INVALID BatchStatus_Status = 1 + BatchStatus_PENDING BatchStatus_Status = 2 + BatchStatus_UNKNOWN BatchStatus_Status = 3 +) + +var BatchStatus_Status_name = map[int32]string{ + 0: "COMMITTED", + 1: "INVALID", + 2: "PENDING", + 3: "UNKNOWN", +} +var BatchStatus_Status_value = map[string]int32{ + "COMMITTED": 0, + "INVALID": 1, + "PENDING": 2, + "UNKNOWN": 3, +} + +func (x BatchStatus_Status) String() string { + return proto.EnumName(BatchStatus_Status_name, int32(x)) +} +func (BatchStatus_Status) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{1, 0} } + +type ClientBatchSubmitResponse_Status int32 + +const ( + ClientBatchSubmitResponse_OK ClientBatchSubmitResponse_Status = 0 + ClientBatchSubmitResponse_INTERNAL_ERROR ClientBatchSubmitResponse_Status = 1 + ClientBatchSubmitResponse_INVALID_BATCH ClientBatchSubmitResponse_Status = 2 +) + +var ClientBatchSubmitResponse_Status_name = map[int32]string{ + 0: "OK", + 1: "INTERNAL_ERROR", + 2: "INVALID_BATCH", +} +var ClientBatchSubmitResponse_Status_value = map[string]int32{ + "OK": 0, + "INTERNAL_ERROR": 1, + "INVALID_BATCH": 2, +} + +func (x ClientBatchSubmitResponse_Status) String() string { + return proto.EnumName(ClientBatchSubmitResponse_Status_name, int32(x)) +} +func (ClientBatchSubmitResponse_Status) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{6, 0} +} + +type ClientBatchStatusResponse_Status int32 + +const ( + ClientBatchStatusResponse_OK ClientBatchStatusResponse_Status = 0 + ClientBatchStatusResponse_INTERNAL_ERROR ClientBatchStatusResponse_Status = 1 + ClientBatchStatusResponse_NO_RESOURCE ClientBatchStatusResponse_Status = 4 +) + +var ClientBatchStatusResponse_Status_name = map[int32]string{ + 0: "OK", + 1: "INTERNAL_ERROR", + 4: "NO_RESOURCE", +} +var ClientBatchStatusResponse_Status_value = map[string]int32{ + "OK": 0, + "INTERNAL_ERROR": 1, + "NO_RESOURCE": 4, +} + +func (x ClientBatchStatusResponse_Status) String() string { + return proto.EnumName(ClientBatchStatusResponse_Status_name, int32(x)) +} +func (ClientBatchStatusResponse_Status) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{8, 0} +} + +type ClientStateCurrentResponse_Status int32 + +const ( + ClientStateCurrentResponse_OK ClientStateCurrentResponse_Status = 0 + ClientStateCurrentResponse_INTERNAL_ERROR ClientStateCurrentResponse_Status = 1 + ClientStateCurrentResponse_NOT_READY ClientStateCurrentResponse_Status = 2 +) + +var ClientStateCurrentResponse_Status_name = map[int32]string{ + 0: "OK", + 1: "INTERNAL_ERROR", + 2: "NOT_READY", +} +var ClientStateCurrentResponse_Status_value = map[string]int32{ + "OK": 0, + "INTERNAL_ERROR": 1, + "NOT_READY": 2, +} + +func (x ClientStateCurrentResponse_Status) String() string { + return proto.EnumName(ClientStateCurrentResponse_Status_name, int32(x)) +} +func (ClientStateCurrentResponse_Status) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{10, 0} +} + +type ClientStateListResponse_Status int32 + +const ( + ClientStateListResponse_OK ClientStateListResponse_Status = 0 + ClientStateListResponse_INTERNAL_ERROR ClientStateListResponse_Status = 1 + ClientStateListResponse_NOT_READY ClientStateListResponse_Status = 2 + ClientStateListResponse_NO_ROOT ClientStateListResponse_Status = 3 + ClientStateListResponse_NO_RESOURCE ClientStateListResponse_Status = 4 + ClientStateListResponse_INVALID_PAGING ClientStateListResponse_Status = 5 + ClientStateListResponse_INVALID_SORT ClientStateListResponse_Status = 6 +) + +var ClientStateListResponse_Status_name = map[int32]string{ + 0: "OK", + 1: "INTERNAL_ERROR", + 2: "NOT_READY", + 3: "NO_ROOT", + 4: "NO_RESOURCE", + 5: "INVALID_PAGING", + 6: "INVALID_SORT", +} +var ClientStateListResponse_Status_value = map[string]int32{ + "OK": 0, + "INTERNAL_ERROR": 1, + "NOT_READY": 2, + "NO_ROOT": 3, + "NO_RESOURCE": 4, + "INVALID_PAGING": 5, + "INVALID_SORT": 6, +} + +func (x ClientStateListResponse_Status) String() string { + return proto.EnumName(ClientStateListResponse_Status_name, int32(x)) +} +func (ClientStateListResponse_Status) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{12, 0} +} + +type ClientStateGetResponse_Status int32 + +const ( + ClientStateGetResponse_OK ClientStateGetResponse_Status = 0 + ClientStateGetResponse_INTERNAL_ERROR ClientStateGetResponse_Status = 1 + ClientStateGetResponse_NOT_READY ClientStateGetResponse_Status = 2 + ClientStateGetResponse_NO_ROOT ClientStateGetResponse_Status = 3 + ClientStateGetResponse_NO_RESOURCE ClientStateGetResponse_Status = 4 + ClientStateGetResponse_INVALID_ADDRESS ClientStateGetResponse_Status = 5 +) + +var ClientStateGetResponse_Status_name = map[int32]string{ + 0: "OK", + 1: "INTERNAL_ERROR", + 2: "NOT_READY", + 3: "NO_ROOT", + 4: "NO_RESOURCE", + 5: "INVALID_ADDRESS", +} +var ClientStateGetResponse_Status_value = map[string]int32{ + "OK": 0, + "INTERNAL_ERROR": 1, + "NOT_READY": 2, + "NO_ROOT": 3, + "NO_RESOURCE": 4, + "INVALID_ADDRESS": 5, +} + +func (x ClientStateGetResponse_Status) String() string { + return proto.EnumName(ClientStateGetResponse_Status_name, int32(x)) +} +func (ClientStateGetResponse_Status) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{14, 0} +} + +type ClientBlockListResponse_Status int32 + +const ( + ClientBlockListResponse_OK ClientBlockListResponse_Status = 0 + ClientBlockListResponse_INTERNAL_ERROR ClientBlockListResponse_Status = 1 + ClientBlockListResponse_NOT_READY ClientBlockListResponse_Status = 2 + ClientBlockListResponse_NO_ROOT ClientBlockListResponse_Status = 3 + ClientBlockListResponse_NO_RESOURCE ClientBlockListResponse_Status = 4 + ClientBlockListResponse_INVALID_PAGING ClientBlockListResponse_Status = 5 + ClientBlockListResponse_INVALID_SORT ClientBlockListResponse_Status = 6 +) + +var ClientBlockListResponse_Status_name = map[int32]string{ + 0: "OK", + 1: "INTERNAL_ERROR", + 2: "NOT_READY", + 3: "NO_ROOT", + 4: "NO_RESOURCE", + 5: "INVALID_PAGING", + 6: "INVALID_SORT", +} +var ClientBlockListResponse_Status_value = map[string]int32{ + "OK": 0, + "INTERNAL_ERROR": 1, + "NOT_READY": 2, + "NO_ROOT": 3, + "NO_RESOURCE": 4, + "INVALID_PAGING": 5, + "INVALID_SORT": 6, +} + +func (x ClientBlockListResponse_Status) String() string { + return proto.EnumName(ClientBlockListResponse_Status_name, int32(x)) +} +func (ClientBlockListResponse_Status) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{16, 0} +} + +type ClientBlockGetResponse_Status int32 + +const ( + ClientBlockGetResponse_OK ClientBlockGetResponse_Status = 0 + ClientBlockGetResponse_INTERNAL_ERROR ClientBlockGetResponse_Status = 1 + ClientBlockGetResponse_NO_RESOURCE ClientBlockGetResponse_Status = 4 +) + +var ClientBlockGetResponse_Status_name = map[int32]string{ + 0: "OK", + 1: "INTERNAL_ERROR", + 4: "NO_RESOURCE", +} +var ClientBlockGetResponse_Status_value = map[string]int32{ + "OK": 0, + "INTERNAL_ERROR": 1, + "NO_RESOURCE": 4, +} + +func (x ClientBlockGetResponse_Status) String() string { + return proto.EnumName(ClientBlockGetResponse_Status_name, int32(x)) +} +func (ClientBlockGetResponse_Status) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{18, 0} +} + +type ClientBatchListResponse_Status int32 + +const ( + ClientBatchListResponse_OK ClientBatchListResponse_Status = 0 + ClientBatchListResponse_INTERNAL_ERROR ClientBatchListResponse_Status = 1 + ClientBatchListResponse_NOT_READY ClientBatchListResponse_Status = 2 + ClientBatchListResponse_NO_ROOT ClientBatchListResponse_Status = 3 + ClientBatchListResponse_NO_RESOURCE ClientBatchListResponse_Status = 4 + ClientBatchListResponse_INVALID_PAGING ClientBatchListResponse_Status = 5 + ClientBatchListResponse_INVALID_SORT ClientBatchListResponse_Status = 6 +) + +var ClientBatchListResponse_Status_name = map[int32]string{ + 0: "OK", + 1: "INTERNAL_ERROR", + 2: "NOT_READY", + 3: "NO_ROOT", + 4: "NO_RESOURCE", + 5: "INVALID_PAGING", + 6: "INVALID_SORT", +} +var ClientBatchListResponse_Status_value = map[string]int32{ + "OK": 0, + "INTERNAL_ERROR": 1, + "NOT_READY": 2, + "NO_ROOT": 3, + "NO_RESOURCE": 4, + "INVALID_PAGING": 5, + "INVALID_SORT": 6, +} + +func (x ClientBatchListResponse_Status) String() string { + return proto.EnumName(ClientBatchListResponse_Status_name, int32(x)) +} +func (ClientBatchListResponse_Status) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{20, 0} +} + +type ClientBatchGetResponse_Status int32 + +const ( + ClientBatchGetResponse_OK ClientBatchGetResponse_Status = 0 + ClientBatchGetResponse_INTERNAL_ERROR ClientBatchGetResponse_Status = 1 + ClientBatchGetResponse_NO_RESOURCE ClientBatchGetResponse_Status = 4 +) + +var ClientBatchGetResponse_Status_name = map[int32]string{ + 0: "OK", + 1: "INTERNAL_ERROR", + 4: "NO_RESOURCE", +} +var ClientBatchGetResponse_Status_value = map[string]int32{ + "OK": 0, + "INTERNAL_ERROR": 1, + "NO_RESOURCE": 4, +} + +func (x ClientBatchGetResponse_Status) String() string { + return proto.EnumName(ClientBatchGetResponse_Status_name, int32(x)) +} +func (ClientBatchGetResponse_Status) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{22, 0} +} + +type ClientTransactionListResponse_Status int32 + +const ( + ClientTransactionListResponse_OK ClientTransactionListResponse_Status = 0 + ClientTransactionListResponse_INTERNAL_ERROR ClientTransactionListResponse_Status = 1 + ClientTransactionListResponse_NOT_READY ClientTransactionListResponse_Status = 2 + ClientTransactionListResponse_NO_ROOT ClientTransactionListResponse_Status = 3 + ClientTransactionListResponse_NO_RESOURCE ClientTransactionListResponse_Status = 4 + ClientTransactionListResponse_INVALID_PAGING ClientTransactionListResponse_Status = 5 + ClientTransactionListResponse_INVALID_SORT ClientTransactionListResponse_Status = 6 +) + +var ClientTransactionListResponse_Status_name = map[int32]string{ + 0: "OK", + 1: "INTERNAL_ERROR", + 2: "NOT_READY", + 3: "NO_ROOT", + 4: "NO_RESOURCE", + 5: "INVALID_PAGING", + 6: "INVALID_SORT", +} +var ClientTransactionListResponse_Status_value = map[string]int32{ + "OK": 0, + "INTERNAL_ERROR": 1, + "NOT_READY": 2, + "NO_ROOT": 3, + "NO_RESOURCE": 4, + "INVALID_PAGING": 5, + "INVALID_SORT": 6, +} + +func (x ClientTransactionListResponse_Status) String() string { + return proto.EnumName(ClientTransactionListResponse_Status_name, int32(x)) +} +func (ClientTransactionListResponse_Status) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{24, 0} +} + +type ClientTransactionGetResponse_Status int32 + +const ( + ClientTransactionGetResponse_OK ClientTransactionGetResponse_Status = 0 + ClientTransactionGetResponse_INTERNAL_ERROR ClientTransactionGetResponse_Status = 1 + ClientTransactionGetResponse_NO_RESOURCE ClientTransactionGetResponse_Status = 4 +) + +var ClientTransactionGetResponse_Status_name = map[int32]string{ + 0: "OK", + 1: "INTERNAL_ERROR", + 4: "NO_RESOURCE", +} +var ClientTransactionGetResponse_Status_value = map[string]int32{ + "OK": 0, + "INTERNAL_ERROR": 1, + "NO_RESOURCE": 4, +} + +func (x ClientTransactionGetResponse_Status) String() string { + return proto.EnumName(ClientTransactionGetResponse_Status_name, int32(x)) +} +func (ClientTransactionGetResponse_Status) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{26, 0} +} + +// An entry in the State +type Leaf struct { + Address string `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` +} + +func (m *Leaf) Reset() { *m = Leaf{} } +func (m *Leaf) String() string { return proto.CompactTextString(m) } +func (*Leaf) ProtoMessage() {} +func (*Leaf) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *Leaf) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *Leaf) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +// Information about the status of a batch submitted to the validator. +// +// Attributes: +// batch_id: The id (header_signature) of the batch +// status: The committed status of the batch +// invalid_transactions: Info for transactions that failed, if any +// +// Statuses: +// COMMITTED - the batch was accepted and has been committed to the chain +// INVALID - the batch failed validation, it should be resubmitted +// PENDING - the batch is still being processed +// UNKNOWN - no status for the batch could be found (possibly invalid) +type BatchStatus struct { + BatchId string `protobuf:"bytes,1,opt,name=batch_id,json=batchId" json:"batch_id,omitempty"` + Status BatchStatus_Status `protobuf:"varint,2,opt,name=status,enum=BatchStatus_Status" json:"status,omitempty"` + InvalidTransactions []*BatchStatus_InvalidTransaction `protobuf:"bytes,3,rep,name=invalid_transactions,json=invalidTransactions" json:"invalid_transactions,omitempty"` +} + +func (m *BatchStatus) Reset() { *m = BatchStatus{} } +func (m *BatchStatus) String() string { return proto.CompactTextString(m) } +func (*BatchStatus) ProtoMessage() {} +func (*BatchStatus) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *BatchStatus) GetBatchId() string { + if m != nil { + return m.BatchId + } + return "" +} + +func (m *BatchStatus) GetStatus() BatchStatus_Status { + if m != nil { + return m.Status + } + return BatchStatus_COMMITTED +} + +func (m *BatchStatus) GetInvalidTransactions() []*BatchStatus_InvalidTransaction { + if m != nil { + return m.InvalidTransactions + } + return nil +} + +type BatchStatus_InvalidTransaction struct { + TransactionId string `protobuf:"bytes,1,opt,name=transaction_id,json=transactionId" json:"transaction_id,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"` + ExtendedData []byte `protobuf:"bytes,3,opt,name=extended_data,json=extendedData,proto3" json:"extended_data,omitempty"` +} + +func (m *BatchStatus_InvalidTransaction) Reset() { *m = BatchStatus_InvalidTransaction{} } +func (m *BatchStatus_InvalidTransaction) String() string { return proto.CompactTextString(m) } +func (*BatchStatus_InvalidTransaction) ProtoMessage() {} +func (*BatchStatus_InvalidTransaction) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{1, 0} +} + +func (m *BatchStatus_InvalidTransaction) GetTransactionId() string { + if m != nil { + return m.TransactionId + } + return "" +} + +func (m *BatchStatus_InvalidTransaction) GetMessage() string { + if m != nil { + return m.Message + } + return "" +} + +func (m *BatchStatus_InvalidTransaction) GetExtendedData() []byte { + if m != nil { + return m.ExtendedData + } + return nil +} + +// Paging controls to be sent with List requests. +// Attributes: +// start_id: The id of a resource to start the page with +// end_id: The id of a resource to end the page with +// min_index: A resource index relative to the query, the newest being 0 +// count: The number of results per page, defaults to and maxes out at 1000 +type PagingControls struct { + // Types that are valid to be assigned to LocationMarker: + // *PagingControls_StartId + // *PagingControls_EndId + // *PagingControls_StartIndex + LocationMarker isPagingControls_LocationMarker `protobuf_oneof:"location_marker"` + Count int32 `protobuf:"varint,4,opt,name=count" json:"count,omitempty"` +} + +func (m *PagingControls) Reset() { *m = PagingControls{} } +func (m *PagingControls) String() string { return proto.CompactTextString(m) } +func (*PagingControls) ProtoMessage() {} +func (*PagingControls) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +type isPagingControls_LocationMarker interface { + isPagingControls_LocationMarker() +} + +type PagingControls_StartId struct { + StartId string `protobuf:"bytes,1,opt,name=start_id,json=startId,oneof"` +} +type PagingControls_EndId struct { + EndId string `protobuf:"bytes,2,opt,name=end_id,json=endId,oneof"` +} +type PagingControls_StartIndex struct { + StartIndex int32 `protobuf:"varint,3,opt,name=start_index,json=startIndex,oneof"` +} + +func (*PagingControls_StartId) isPagingControls_LocationMarker() {} +func (*PagingControls_EndId) isPagingControls_LocationMarker() {} +func (*PagingControls_StartIndex) isPagingControls_LocationMarker() {} + +func (m *PagingControls) GetLocationMarker() isPagingControls_LocationMarker { + if m != nil { + return m.LocationMarker + } + return nil +} + +func (m *PagingControls) GetStartId() string { + if x, ok := m.GetLocationMarker().(*PagingControls_StartId); ok { + return x.StartId + } + return "" +} + +func (m *PagingControls) GetEndId() string { + if x, ok := m.GetLocationMarker().(*PagingControls_EndId); ok { + return x.EndId + } + return "" +} + +func (m *PagingControls) GetStartIndex() int32 { + if x, ok := m.GetLocationMarker().(*PagingControls_StartIndex); ok { + return x.StartIndex + } + return 0 +} + +func (m *PagingControls) GetCount() int32 { + if m != nil { + return m.Count + } + return 0 +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*PagingControls) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _PagingControls_OneofMarshaler, _PagingControls_OneofUnmarshaler, _PagingControls_OneofSizer, []interface{}{ + (*PagingControls_StartId)(nil), + (*PagingControls_EndId)(nil), + (*PagingControls_StartIndex)(nil), + } +} + +func _PagingControls_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*PagingControls) + // location_marker + switch x := m.LocationMarker.(type) { + case *PagingControls_StartId: + b.EncodeVarint(1<<3 | proto.WireBytes) + b.EncodeStringBytes(x.StartId) + case *PagingControls_EndId: + b.EncodeVarint(2<<3 | proto.WireBytes) + b.EncodeStringBytes(x.EndId) + case *PagingControls_StartIndex: + b.EncodeVarint(3<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.StartIndex)) + case nil: + default: + return fmt.Errorf("PagingControls.LocationMarker has unexpected type %T", x) + } + return nil +} + +func _PagingControls_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*PagingControls) + switch tag { + case 1: // location_marker.start_id + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.LocationMarker = &PagingControls_StartId{x} + return true, err + case 2: // location_marker.end_id + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.LocationMarker = &PagingControls_EndId{x} + return true, err + case 3: // location_marker.start_index + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.LocationMarker = &PagingControls_StartIndex{int32(x)} + return true, err + default: + return false, nil + } +} + +func _PagingControls_OneofSizer(msg proto.Message) (n int) { + m := msg.(*PagingControls) + // location_marker + switch x := m.LocationMarker.(type) { + case *PagingControls_StartId: + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.StartId))) + n += len(x.StartId) + case *PagingControls_EndId: + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.EndId))) + n += len(x.EndId) + case *PagingControls_StartIndex: + n += proto.SizeVarint(3<<3 | proto.WireVarint) + n += proto.SizeVarint(uint64(x.StartIndex)) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// Information about the pagination used, sent back with List responses. +// Attributes: +// next_id: The id of the first resource in the next page +// previous_id: The id of the last resource in the previous page +// start_index: The index of the first resource in this page +// total_resources: The total resources available from the requested query +type PagingResponse struct { + NextId string `protobuf:"bytes,1,opt,name=next_id,json=nextId" json:"next_id,omitempty"` + PreviousId string `protobuf:"bytes,2,opt,name=previous_id,json=previousId" json:"previous_id,omitempty"` + StartIndex int32 `protobuf:"varint,3,opt,name=start_index,json=startIndex" json:"start_index,omitempty"` + TotalResources int32 `protobuf:"varint,4,opt,name=total_resources,json=totalResources" json:"total_resources,omitempty"` +} + +func (m *PagingResponse) Reset() { *m = PagingResponse{} } +func (m *PagingResponse) String() string { return proto.CompactTextString(m) } +func (*PagingResponse) ProtoMessage() {} +func (*PagingResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *PagingResponse) GetNextId() string { + if m != nil { + return m.NextId + } + return "" +} + +func (m *PagingResponse) GetPreviousId() string { + if m != nil { + return m.PreviousId + } + return "" +} + +func (m *PagingResponse) GetStartIndex() int32 { + if m != nil { + return m.StartIndex + } + return 0 +} + +func (m *PagingResponse) GetTotalResources() int32 { + if m != nil { + return m.TotalResources + } + return 0 +} + +// Sorting controls to be sent with List requests. More than one can be sent. +// If so, the first is used, and additional controls are tie-breakers. +// Attributes: +// keys: Nested set of keys to sort by (i.e. ['header', 'signer_pubkey']) +// reverse: Whether or not to reverse the sort (i.e. descending order) +// compare_length: Sorts by value length, rather than the property itself +type SortControls struct { + Keys []string `protobuf:"bytes,1,rep,name=keys" json:"keys,omitempty"` + Reverse bool `protobuf:"varint,2,opt,name=reverse" json:"reverse,omitempty"` + CompareLength bool `protobuf:"varint,3,opt,name=compare_length,json=compareLength" json:"compare_length,omitempty"` +} + +func (m *SortControls) Reset() { *m = SortControls{} } +func (m *SortControls) String() string { return proto.CompactTextString(m) } +func (*SortControls) ProtoMessage() {} +func (*SortControls) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *SortControls) GetKeys() []string { + if m != nil { + return m.Keys + } + return nil +} + +func (m *SortControls) GetReverse() bool { + if m != nil { + return m.Reverse + } + return false +} + +func (m *SortControls) GetCompareLength() bool { + if m != nil { + return m.CompareLength + } + return false +} + +// Submits a list of Batches to be added to the blockchain. +// If `wait_for_commit` is set to true, the validator will wait to respond +// until all batches are committed, or until the specified `timeout` +// in seconds has elapsed. Defaults to 300. +type ClientBatchSubmitRequest struct { + Batches []*batch.Batch `protobuf:"bytes,1,rep,name=batches" json:"batches,omitempty"` + WaitForCommit bool `protobuf:"varint,2,opt,name=wait_for_commit,json=waitForCommit" json:"wait_for_commit,omitempty"` + Timeout int32 `protobuf:"varint,3,opt,name=timeout" json:"timeout,omitempty"` +} + +func (m *ClientBatchSubmitRequest) Reset() { *m = ClientBatchSubmitRequest{} } +func (m *ClientBatchSubmitRequest) String() string { return proto.CompactTextString(m) } +func (*ClientBatchSubmitRequest) ProtoMessage() {} +func (*ClientBatchSubmitRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *ClientBatchSubmitRequest) GetBatches() []*batch.Batch { + if m != nil { + return m.Batches + } + return nil +} + +func (m *ClientBatchSubmitRequest) GetWaitForCommit() bool { + if m != nil { + return m.WaitForCommit + } + return false +} + +func (m *ClientBatchSubmitRequest) GetTimeout() int32 { + if m != nil { + return m.Timeout + } + return 0 +} + +// This is a response to a submission of one or more Batches. +// If `wait_for_commit` was set in the request, this response will include a +// `batch_statuses` property, with the status of each batch submitted. +// Statuses: +// * OK - everything with the request worked as expected +// * INTERNAL_ERROR - general error, such as protobuf failing to deserialize +// * INVALID_BATCH - the batch failed validation, likely due to a bad signature +type ClientBatchSubmitResponse struct { + Status ClientBatchSubmitResponse_Status `protobuf:"varint,1,opt,name=status,enum=ClientBatchSubmitResponse_Status" json:"status,omitempty"` + BatchStatuses []*BatchStatus `protobuf:"bytes,2,rep,name=batch_statuses,json=batchStatuses" json:"batch_statuses,omitempty"` +} + +func (m *ClientBatchSubmitResponse) Reset() { *m = ClientBatchSubmitResponse{} } +func (m *ClientBatchSubmitResponse) String() string { return proto.CompactTextString(m) } +func (*ClientBatchSubmitResponse) ProtoMessage() {} +func (*ClientBatchSubmitResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *ClientBatchSubmitResponse) GetStatus() ClientBatchSubmitResponse_Status { + if m != nil { + return m.Status + } + return ClientBatchSubmitResponse_OK +} + +func (m *ClientBatchSubmitResponse) GetBatchStatuses() []*BatchStatus { + if m != nil { + return m.BatchStatuses + } + return nil +} + +// A request for the status of one or more batches, specified by id. +// If `wait_for_commit` is set to true, the validator will wait to respond +// until all batches are committed, or until the specified `timeout` +// in seconds has elapsed. Defaults to 300. +type ClientBatchStatusRequest struct { + BatchIds []string `protobuf:"bytes,1,rep,name=batch_ids,json=batchIds" json:"batch_ids,omitempty"` + WaitForCommit bool `protobuf:"varint,2,opt,name=wait_for_commit,json=waitForCommit" json:"wait_for_commit,omitempty"` + Timeout int32 `protobuf:"varint,3,opt,name=timeout" json:"timeout,omitempty"` +} + +func (m *ClientBatchStatusRequest) Reset() { *m = ClientBatchStatusRequest{} } +func (m *ClientBatchStatusRequest) String() string { return proto.CompactTextString(m) } +func (*ClientBatchStatusRequest) ProtoMessage() {} +func (*ClientBatchStatusRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *ClientBatchStatusRequest) GetBatchIds() []string { + if m != nil { + return m.BatchIds + } + return nil +} + +func (m *ClientBatchStatusRequest) GetWaitForCommit() bool { + if m != nil { + return m.WaitForCommit + } + return false +} + +func (m *ClientBatchStatusRequest) GetTimeout() int32 { + if m != nil { + return m.Timeout + } + return 0 +} + +// This is a response to a request for the status of specific batches. +// Statuses: +// * OK - everything with the request worked as expected +// * INTERNAL_ERROR - general error, such as protobuf failing to deserialize +// * NO_RESOURCE - the response contains no data, likely because +// no ids were specified in the request +type ClientBatchStatusResponse struct { + Status ClientBatchStatusResponse_Status `protobuf:"varint,1,opt,name=status,enum=ClientBatchStatusResponse_Status" json:"status,omitempty"` + BatchStatuses []*BatchStatus `protobuf:"bytes,2,rep,name=batch_statuses,json=batchStatuses" json:"batch_statuses,omitempty"` +} + +func (m *ClientBatchStatusResponse) Reset() { *m = ClientBatchStatusResponse{} } +func (m *ClientBatchStatusResponse) String() string { return proto.CompactTextString(m) } +func (*ClientBatchStatusResponse) ProtoMessage() {} +func (*ClientBatchStatusResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *ClientBatchStatusResponse) GetStatus() ClientBatchStatusResponse_Status { + if m != nil { + return m.Status + } + return ClientBatchStatusResponse_OK +} + +func (m *ClientBatchStatusResponse) GetBatchStatuses() []*BatchStatus { + if m != nil { + return m.BatchStatuses + } + return nil +} + +type ClientStateCurrentRequest struct { +} + +func (m *ClientStateCurrentRequest) Reset() { *m = ClientStateCurrentRequest{} } +func (m *ClientStateCurrentRequest) String() string { return proto.CompactTextString(m) } +func (*ClientStateCurrentRequest) ProtoMessage() {} +func (*ClientStateCurrentRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +type ClientStateCurrentResponse struct { + Status ClientStateCurrentResponse_Status `protobuf:"varint,1,opt,name=status,enum=ClientStateCurrentResponse_Status" json:"status,omitempty"` + MerkleRoot string `protobuf:"bytes,2,opt,name=merkle_root,json=merkleRoot" json:"merkle_root,omitempty"` +} + +func (m *ClientStateCurrentResponse) Reset() { *m = ClientStateCurrentResponse{} } +func (m *ClientStateCurrentResponse) String() string { return proto.CompactTextString(m) } +func (*ClientStateCurrentResponse) ProtoMessage() {} +func (*ClientStateCurrentResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +func (m *ClientStateCurrentResponse) GetStatus() ClientStateCurrentResponse_Status { + if m != nil { + return m.Status + } + return ClientStateCurrentResponse_OK +} + +func (m *ClientStateCurrentResponse) GetMerkleRoot() string { + if m != nil { + return m.MerkleRoot + } + return "" +} + +// A request to list every entry in the merkle tree. Defaults to the most +// current tree, but can fetch older state by specifying either a merkle root +// or a previous head block's id. Results can be further filtered by +// specifying a subtree with a partial address. +type ClientStateListRequest struct { + // Types that are valid to be assigned to RootKey: + // *ClientStateListRequest_MerkleRoot + // *ClientStateListRequest_HeadId + RootKey isClientStateListRequest_RootKey `protobuf_oneof:"root_key"` + Address string `protobuf:"bytes,3,opt,name=address" json:"address,omitempty"` + Paging *PagingControls `protobuf:"bytes,4,opt,name=paging" json:"paging,omitempty"` + Sorting []*SortControls `protobuf:"bytes,5,rep,name=sorting" json:"sorting,omitempty"` +} + +func (m *ClientStateListRequest) Reset() { *m = ClientStateListRequest{} } +func (m *ClientStateListRequest) String() string { return proto.CompactTextString(m) } +func (*ClientStateListRequest) ProtoMessage() {} +func (*ClientStateListRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } + +type isClientStateListRequest_RootKey interface { + isClientStateListRequest_RootKey() +} + +type ClientStateListRequest_MerkleRoot struct { + MerkleRoot string `protobuf:"bytes,1,opt,name=merkle_root,json=merkleRoot,oneof"` +} +type ClientStateListRequest_HeadId struct { + HeadId string `protobuf:"bytes,2,opt,name=head_id,json=headId,oneof"` +} + +func (*ClientStateListRequest_MerkleRoot) isClientStateListRequest_RootKey() {} +func (*ClientStateListRequest_HeadId) isClientStateListRequest_RootKey() {} + +func (m *ClientStateListRequest) GetRootKey() isClientStateListRequest_RootKey { + if m != nil { + return m.RootKey + } + return nil +} + +func (m *ClientStateListRequest) GetMerkleRoot() string { + if x, ok := m.GetRootKey().(*ClientStateListRequest_MerkleRoot); ok { + return x.MerkleRoot + } + return "" +} + +func (m *ClientStateListRequest) GetHeadId() string { + if x, ok := m.GetRootKey().(*ClientStateListRequest_HeadId); ok { + return x.HeadId + } + return "" +} + +func (m *ClientStateListRequest) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *ClientStateListRequest) GetPaging() *PagingControls { + if m != nil { + return m.Paging + } + return nil +} + +func (m *ClientStateListRequest) GetSorting() []*SortControls { + if m != nil { + return m.Sorting + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*ClientStateListRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _ClientStateListRequest_OneofMarshaler, _ClientStateListRequest_OneofUnmarshaler, _ClientStateListRequest_OneofSizer, []interface{}{ + (*ClientStateListRequest_MerkleRoot)(nil), + (*ClientStateListRequest_HeadId)(nil), + } +} + +func _ClientStateListRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*ClientStateListRequest) + // root_key + switch x := m.RootKey.(type) { + case *ClientStateListRequest_MerkleRoot: + b.EncodeVarint(1<<3 | proto.WireBytes) + b.EncodeStringBytes(x.MerkleRoot) + case *ClientStateListRequest_HeadId: + b.EncodeVarint(2<<3 | proto.WireBytes) + b.EncodeStringBytes(x.HeadId) + case nil: + default: + return fmt.Errorf("ClientStateListRequest.RootKey has unexpected type %T", x) + } + return nil +} + +func _ClientStateListRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*ClientStateListRequest) + switch tag { + case 1: // root_key.merkle_root + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.RootKey = &ClientStateListRequest_MerkleRoot{x} + return true, err + case 2: // root_key.head_id + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.RootKey = &ClientStateListRequest_HeadId{x} + return true, err + default: + return false, nil + } +} + +func _ClientStateListRequest_OneofSizer(msg proto.Message) (n int) { + m := msg.(*ClientStateListRequest) + // root_key + switch x := m.RootKey.(type) { + case *ClientStateListRequest_MerkleRoot: + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.MerkleRoot))) + n += len(x.MerkleRoot) + case *ClientStateListRequest_HeadId: + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.HeadId))) + n += len(x.HeadId) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +type ClientStateListResponse struct { + Status ClientStateListResponse_Status `protobuf:"varint,1,opt,name=status,enum=ClientStateListResponse_Status" json:"status,omitempty"` + Leaves []*Leaf `protobuf:"bytes,2,rep,name=leaves" json:"leaves,omitempty"` + HeadId string `protobuf:"bytes,3,opt,name=head_id,json=headId" json:"head_id,omitempty"` + Paging *PagingResponse `protobuf:"bytes,4,opt,name=paging" json:"paging,omitempty"` +} + +func (m *ClientStateListResponse) Reset() { *m = ClientStateListResponse{} } +func (m *ClientStateListResponse) String() string { return proto.CompactTextString(m) } +func (*ClientStateListResponse) ProtoMessage() {} +func (*ClientStateListResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } + +func (m *ClientStateListResponse) GetStatus() ClientStateListResponse_Status { + if m != nil { + return m.Status + } + return ClientStateListResponse_OK +} + +func (m *ClientStateListResponse) GetLeaves() []*Leaf { + if m != nil { + return m.Leaves + } + return nil +} + +func (m *ClientStateListResponse) GetHeadId() string { + if m != nil { + return m.HeadId + } + return "" +} + +func (m *ClientStateListResponse) GetPaging() *PagingResponse { + if m != nil { + return m.Paging + } + return nil +} + +// A request from a client for a particular entry in the merkle tree. +// Like State List, it defaults to the newest state, but a merkle root +// or head block id can be used to specify older data. Unlike State List +// the request must be provided with a full address that corresponds to +// a single entry. +type ClientStateGetRequest struct { + // Types that are valid to be assigned to RootKey: + // *ClientStateGetRequest_MerkleRoot + // *ClientStateGetRequest_HeadId + RootKey isClientStateGetRequest_RootKey `protobuf_oneof:"root_key"` + Address string `protobuf:"bytes,3,opt,name=address" json:"address,omitempty"` +} + +func (m *ClientStateGetRequest) Reset() { *m = ClientStateGetRequest{} } +func (m *ClientStateGetRequest) String() string { return proto.CompactTextString(m) } +func (*ClientStateGetRequest) ProtoMessage() {} +func (*ClientStateGetRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } + +type isClientStateGetRequest_RootKey interface { + isClientStateGetRequest_RootKey() +} + +type ClientStateGetRequest_MerkleRoot struct { + MerkleRoot string `protobuf:"bytes,1,opt,name=merkle_root,json=merkleRoot,oneof"` +} +type ClientStateGetRequest_HeadId struct { + HeadId string `protobuf:"bytes,2,opt,name=head_id,json=headId,oneof"` +} + +func (*ClientStateGetRequest_MerkleRoot) isClientStateGetRequest_RootKey() {} +func (*ClientStateGetRequest_HeadId) isClientStateGetRequest_RootKey() {} + +func (m *ClientStateGetRequest) GetRootKey() isClientStateGetRequest_RootKey { + if m != nil { + return m.RootKey + } + return nil +} + +func (m *ClientStateGetRequest) GetMerkleRoot() string { + if x, ok := m.GetRootKey().(*ClientStateGetRequest_MerkleRoot); ok { + return x.MerkleRoot + } + return "" +} + +func (m *ClientStateGetRequest) GetHeadId() string { + if x, ok := m.GetRootKey().(*ClientStateGetRequest_HeadId); ok { + return x.HeadId + } + return "" +} + +func (m *ClientStateGetRequest) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*ClientStateGetRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _ClientStateGetRequest_OneofMarshaler, _ClientStateGetRequest_OneofUnmarshaler, _ClientStateGetRequest_OneofSizer, []interface{}{ + (*ClientStateGetRequest_MerkleRoot)(nil), + (*ClientStateGetRequest_HeadId)(nil), + } +} + +func _ClientStateGetRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*ClientStateGetRequest) + // root_key + switch x := m.RootKey.(type) { + case *ClientStateGetRequest_MerkleRoot: + b.EncodeVarint(1<<3 | proto.WireBytes) + b.EncodeStringBytes(x.MerkleRoot) + case *ClientStateGetRequest_HeadId: + b.EncodeVarint(2<<3 | proto.WireBytes) + b.EncodeStringBytes(x.HeadId) + case nil: + default: + return fmt.Errorf("ClientStateGetRequest.RootKey has unexpected type %T", x) + } + return nil +} + +func _ClientStateGetRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*ClientStateGetRequest) + switch tag { + case 1: // root_key.merkle_root + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.RootKey = &ClientStateGetRequest_MerkleRoot{x} + return true, err + case 2: // root_key.head_id + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeStringBytes() + m.RootKey = &ClientStateGetRequest_HeadId{x} + return true, err + default: + return false, nil + } +} + +func _ClientStateGetRequest_OneofSizer(msg proto.Message) (n int) { + m := msg.(*ClientStateGetRequest) + // root_key + switch x := m.RootKey.(type) { + case *ClientStateGetRequest_MerkleRoot: + n += proto.SizeVarint(1<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.MerkleRoot))) + n += len(x.MerkleRoot) + case *ClientStateGetRequest_HeadId: + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(len(x.HeadId))) + n += len(x.HeadId) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// The response to a State Get Request from the client. Sends back just +// the data stored at the entry, not the address. Also sends back the +// head block id used to facilitate further requests. +// +// Statuses: +// * OK - everything worked as expected +// * INTERNAL_ERROR - general error, such as protobuf failing to deserialize +// * NOT_READY - the validator does not yet have a genesis block +// * NO_ROOT - the head block or merkle_root specified was not found +// * NO_RESOURCE - the address specified doesn't exist +// * INVALID_ADDRESS - address isn't a valid, i.e. it's a subtree (truncated) +type ClientStateGetResponse struct { + Status ClientStateGetResponse_Status `protobuf:"varint,1,opt,name=status,enum=ClientStateGetResponse_Status" json:"status,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + HeadId string `protobuf:"bytes,3,opt,name=head_id,json=headId" json:"head_id,omitempty"` +} + +func (m *ClientStateGetResponse) Reset() { *m = ClientStateGetResponse{} } +func (m *ClientStateGetResponse) String() string { return proto.CompactTextString(m) } +func (*ClientStateGetResponse) ProtoMessage() {} +func (*ClientStateGetResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } + +func (m *ClientStateGetResponse) GetStatus() ClientStateGetResponse_Status { + if m != nil { + return m.Status + } + return ClientStateGetResponse_OK +} + +func (m *ClientStateGetResponse) GetValue() []byte { + if m != nil { + return m.Value + } + return nil +} + +func (m *ClientStateGetResponse) GetHeadId() string { + if m != nil { + return m.HeadId + } + return "" +} + +// A request to return a list of blocks from the validator. May include the id +// of a particular block to be the `head` of the chain being requested. In that +// case the list will include that block (if found), and all blocks previous +// to it on the chain. Can be filtered using specific `block_ids`. +type ClientBlockListRequest struct { + HeadId string `protobuf:"bytes,1,opt,name=head_id,json=headId" json:"head_id,omitempty"` + BlockIds []string `protobuf:"bytes,2,rep,name=block_ids,json=blockIds" json:"block_ids,omitempty"` + Paging *PagingControls `protobuf:"bytes,3,opt,name=paging" json:"paging,omitempty"` + Sorting []*SortControls `protobuf:"bytes,4,rep,name=sorting" json:"sorting,omitempty"` +} + +func (m *ClientBlockListRequest) Reset() { *m = ClientBlockListRequest{} } +func (m *ClientBlockListRequest) String() string { return proto.CompactTextString(m) } +func (*ClientBlockListRequest) ProtoMessage() {} +func (*ClientBlockListRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} } + +func (m *ClientBlockListRequest) GetHeadId() string { + if m != nil { + return m.HeadId + } + return "" +} + +func (m *ClientBlockListRequest) GetBlockIds() []string { + if m != nil { + return m.BlockIds + } + return nil +} + +func (m *ClientBlockListRequest) GetPaging() *PagingControls { + if m != nil { + return m.Paging + } + return nil +} + +func (m *ClientBlockListRequest) GetSorting() []*SortControls { + if m != nil { + return m.Sorting + } + return nil +} + +// A response that lists a chain of blocks with the newest at the beginning, +// and the oldest (genesis) block at the end. +// +// Statuses: +// * OK - everything worked as expected +// * INTERNAL_ERROR - general error, such as protobuf failing to deserialize +// * NOT_READY - the validator does not yet have a genesis block +// * NO_ROOT - the head block specified was not found +// * NO_RESOURCE - no blocks were found with the parameters specified +// * INVALID_PAGING - the paging controls were malformed or out of range +// * INVALID_SORT - the sorting controls were malformed or invalid +type ClientBlockListResponse struct { + Status ClientBlockListResponse_Status `protobuf:"varint,1,opt,name=status,enum=ClientBlockListResponse_Status" json:"status,omitempty"` + Blocks []*block.Block `protobuf:"bytes,2,rep,name=blocks" json:"blocks,omitempty"` + HeadId string `protobuf:"bytes,3,opt,name=head_id,json=headId" json:"head_id,omitempty"` + Paging *PagingResponse `protobuf:"bytes,4,opt,name=paging" json:"paging,omitempty"` +} + +func (m *ClientBlockListResponse) Reset() { *m = ClientBlockListResponse{} } +func (m *ClientBlockListResponse) String() string { return proto.CompactTextString(m) } +func (*ClientBlockListResponse) ProtoMessage() {} +func (*ClientBlockListResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} } + +func (m *ClientBlockListResponse) GetStatus() ClientBlockListResponse_Status { + if m != nil { + return m.Status + } + return ClientBlockListResponse_OK +} + +func (m *ClientBlockListResponse) GetBlocks() []*block.Block { + if m != nil { + return m.Blocks + } + return nil +} + +func (m *ClientBlockListResponse) GetHeadId() string { + if m != nil { + return m.HeadId + } + return "" +} + +func (m *ClientBlockListResponse) GetPaging() *PagingResponse { + if m != nil { + return m.Paging + } + return nil +} + +// A request to return a specific block from the validator. The block must be +// specified by its unique id, in this case the block's header signature +type ClientBlockGetRequest struct { + BlockId string `protobuf:"bytes,1,opt,name=block_id,json=blockId" json:"block_id,omitempty"` + BlockNum uint64 `protobuf:"varint,2,opt,name=block_num,json=blockNum" json:"block_num,omitempty"` +} + +func (m *ClientBlockGetRequest) Reset() { *m = ClientBlockGetRequest{} } +func (m *ClientBlockGetRequest) String() string { return proto.CompactTextString(m) } +func (*ClientBlockGetRequest) ProtoMessage() {} +func (*ClientBlockGetRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{17} } + +func (m *ClientBlockGetRequest) GetBlockId() string { + if m != nil { + return m.BlockId + } + return "" +} + +func (m *ClientBlockGetRequest) GetBlockNum() uint64 { + if m != nil { + return m.BlockNum + } + return 0 +} + +// A response that returns the block specified by a ClientBlockGetRequest. +// +// Statuses: +// * OK - everything worked as expected +// * INTERNAL_ERROR - general error, such as protobuf failing to deserialize +// * NO_RESOURCE - no block with the specified id exists +type ClientBlockGetResponse struct { + Status ClientBlockGetResponse_Status `protobuf:"varint,1,opt,name=status,enum=ClientBlockGetResponse_Status" json:"status,omitempty"` + Block *block.Block `protobuf:"bytes,2,opt,name=block" json:"block,omitempty"` +} + +func (m *ClientBlockGetResponse) Reset() { *m = ClientBlockGetResponse{} } +func (m *ClientBlockGetResponse) String() string { return proto.CompactTextString(m) } +func (*ClientBlockGetResponse) ProtoMessage() {} +func (*ClientBlockGetResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{18} } + +func (m *ClientBlockGetResponse) GetStatus() ClientBlockGetResponse_Status { + if m != nil { + return m.Status + } + return ClientBlockGetResponse_OK +} + +func (m *ClientBlockGetResponse) GetBlock() *block.Block { + if m != nil { + return m.Block + } + return nil +} + +// A request to return a list of batches from the validator. May include the id +// of a particular block to be the `head` of the chain being requested. In that +// case the list will include the batches from that block, and all batches +// previous to that block on the chain. Filter with specific `batch_ids`. +type ClientBatchListRequest struct { + HeadId string `protobuf:"bytes,1,opt,name=head_id,json=headId" json:"head_id,omitempty"` + BatchIds []string `protobuf:"bytes,2,rep,name=batch_ids,json=batchIds" json:"batch_ids,omitempty"` + Paging *PagingControls `protobuf:"bytes,3,opt,name=paging" json:"paging,omitempty"` + Sorting []*SortControls `protobuf:"bytes,4,rep,name=sorting" json:"sorting,omitempty"` +} + +func (m *ClientBatchListRequest) Reset() { *m = ClientBatchListRequest{} } +func (m *ClientBatchListRequest) String() string { return proto.CompactTextString(m) } +func (*ClientBatchListRequest) ProtoMessage() {} +func (*ClientBatchListRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{19} } + +func (m *ClientBatchListRequest) GetHeadId() string { + if m != nil { + return m.HeadId + } + return "" +} + +func (m *ClientBatchListRequest) GetBatchIds() []string { + if m != nil { + return m.BatchIds + } + return nil +} + +func (m *ClientBatchListRequest) GetPaging() *PagingControls { + if m != nil { + return m.Paging + } + return nil +} + +func (m *ClientBatchListRequest) GetSorting() []*SortControls { + if m != nil { + return m.Sorting + } + return nil +} + +// A response that lists batches from newest to oldest. +// +// Statuses: +// * OK - everything worked as expected +// * INTERNAL_ERROR - general error, such as protobuf failing to deserialize +// * NOT_READY - the validator does not yet have a genesis block +// * NO_ROOT - the head block specified was not found +// * NO_RESOURCE - no batches were found with the parameters specified +// * INVALID_PAGING - the paging controls were malformed or out of range +// * INVALID_SORT - the sorting controls were malformed or invalid +type ClientBatchListResponse struct { + Status ClientBatchListResponse_Status `protobuf:"varint,1,opt,name=status,enum=ClientBatchListResponse_Status" json:"status,omitempty"` + Batches []*batch.Batch `protobuf:"bytes,2,rep,name=batches" json:"batches,omitempty"` + HeadId string `protobuf:"bytes,3,opt,name=head_id,json=headId" json:"head_id,omitempty"` + Paging *PagingResponse `protobuf:"bytes,4,opt,name=paging" json:"paging,omitempty"` +} + +func (m *ClientBatchListResponse) Reset() { *m = ClientBatchListResponse{} } +func (m *ClientBatchListResponse) String() string { return proto.CompactTextString(m) } +func (*ClientBatchListResponse) ProtoMessage() {} +func (*ClientBatchListResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20} } + +func (m *ClientBatchListResponse) GetStatus() ClientBatchListResponse_Status { + if m != nil { + return m.Status + } + return ClientBatchListResponse_OK +} + +func (m *ClientBatchListResponse) GetBatches() []*batch.Batch { + if m != nil { + return m.Batches + } + return nil +} + +func (m *ClientBatchListResponse) GetHeadId() string { + if m != nil { + return m.HeadId + } + return "" +} + +func (m *ClientBatchListResponse) GetPaging() *PagingResponse { + if m != nil { + return m.Paging + } + return nil +} + +// Fetches a specific batch by its id (header_signature) from the blockchain. +type ClientBatchGetRequest struct { + BatchId string `protobuf:"bytes,1,opt,name=batch_id,json=batchId" json:"batch_id,omitempty"` +} + +func (m *ClientBatchGetRequest) Reset() { *m = ClientBatchGetRequest{} } +func (m *ClientBatchGetRequest) String() string { return proto.CompactTextString(m) } +func (*ClientBatchGetRequest) ProtoMessage() {} +func (*ClientBatchGetRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{21} } + +func (m *ClientBatchGetRequest) GetBatchId() string { + if m != nil { + return m.BatchId + } + return "" +} + +// A response that returns the batch specified by a ClientBatchGetRequest. +// +// Statuses: +// * OK - everything worked as expected, batch has been fetched +// * INTERNAL_ERROR - general error, such as protobuf failing to deserialize +// * NO_RESOURCE - no batch with the specified id exists +type ClientBatchGetResponse struct { + Status ClientBatchGetResponse_Status `protobuf:"varint,1,opt,name=status,enum=ClientBatchGetResponse_Status" json:"status,omitempty"` + Batch *batch.Batch `protobuf:"bytes,2,opt,name=batch" json:"batch,omitempty"` +} + +func (m *ClientBatchGetResponse) Reset() { *m = ClientBatchGetResponse{} } +func (m *ClientBatchGetResponse) String() string { return proto.CompactTextString(m) } +func (*ClientBatchGetResponse) ProtoMessage() {} +func (*ClientBatchGetResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{22} } + +func (m *ClientBatchGetResponse) GetStatus() ClientBatchGetResponse_Status { + if m != nil { + return m.Status + } + return ClientBatchGetResponse_OK +} + +func (m *ClientBatchGetResponse) GetBatch() *batch.Batch { + if m != nil { + return m.Batch + } + return nil +} + +// A request to return a list of txns from the validator. May include the id +// of a particular block to be the `head` of the chain being requested. In that +// case the list will include the txns from that block, and all txns +// previous to that block on the chain. Filter with specific `transaction_ids`. +type ClientTransactionListRequest struct { + HeadId string `protobuf:"bytes,1,opt,name=head_id,json=headId" json:"head_id,omitempty"` + TransactionIds []string `protobuf:"bytes,2,rep,name=transaction_ids,json=transactionIds" json:"transaction_ids,omitempty"` + Paging *PagingControls `protobuf:"bytes,3,opt,name=paging" json:"paging,omitempty"` + Sorting []*SortControls `protobuf:"bytes,4,rep,name=sorting" json:"sorting,omitempty"` +} + +func (m *ClientTransactionListRequest) Reset() { *m = ClientTransactionListRequest{} } +func (m *ClientTransactionListRequest) String() string { return proto.CompactTextString(m) } +func (*ClientTransactionListRequest) ProtoMessage() {} +func (*ClientTransactionListRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{23} } + +func (m *ClientTransactionListRequest) GetHeadId() string { + if m != nil { + return m.HeadId + } + return "" +} + +func (m *ClientTransactionListRequest) GetTransactionIds() []string { + if m != nil { + return m.TransactionIds + } + return nil +} + +func (m *ClientTransactionListRequest) GetPaging() *PagingControls { + if m != nil { + return m.Paging + } + return nil +} + +func (m *ClientTransactionListRequest) GetSorting() []*SortControls { + if m != nil { + return m.Sorting + } + return nil +} + +// A response that lists transactions from newest to oldest. +// +// Statuses: +// * OK - everything worked as expected +// * INTERNAL_ERROR - general error, such as protobuf failing to deserialize +// * NOT_READY - the validator does not yet have a genesis block +// * NO_ROOT - the head block specified was not found +// * NO_RESOURCE - no txns were found with the parameters specified +// * INVALID_PAGING - the paging controls were malformed or out of range +// * INVALID_SORT - the sorting controls were malformed or invalid +type ClientTransactionListResponse struct { + Status ClientTransactionListResponse_Status `protobuf:"varint,1,opt,name=status,enum=ClientTransactionListResponse_Status" json:"status,omitempty"` + Transactions []*transaction.Transaction `protobuf:"bytes,2,rep,name=transactions" json:"transactions,omitempty"` + HeadId string `protobuf:"bytes,3,opt,name=head_id,json=headId" json:"head_id,omitempty"` + Paging *PagingResponse `protobuf:"bytes,4,opt,name=paging" json:"paging,omitempty"` +} + +func (m *ClientTransactionListResponse) Reset() { *m = ClientTransactionListResponse{} } +func (m *ClientTransactionListResponse) String() string { return proto.CompactTextString(m) } +func (*ClientTransactionListResponse) ProtoMessage() {} +func (*ClientTransactionListResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{24} } + +func (m *ClientTransactionListResponse) GetStatus() ClientTransactionListResponse_Status { + if m != nil { + return m.Status + } + return ClientTransactionListResponse_OK +} + +func (m *ClientTransactionListResponse) GetTransactions() []*transaction.Transaction { + if m != nil { + return m.Transactions + } + return nil +} + +func (m *ClientTransactionListResponse) GetHeadId() string { + if m != nil { + return m.HeadId + } + return "" +} + +func (m *ClientTransactionListResponse) GetPaging() *PagingResponse { + if m != nil { + return m.Paging + } + return nil +} + +// Fetches a specific txn by its id (header_signature) from the blockchain. +type ClientTransactionGetRequest struct { + TransactionId string `protobuf:"bytes,1,opt,name=transaction_id,json=transactionId" json:"transaction_id,omitempty"` +} + +func (m *ClientTransactionGetRequest) Reset() { *m = ClientTransactionGetRequest{} } +func (m *ClientTransactionGetRequest) String() string { return proto.CompactTextString(m) } +func (*ClientTransactionGetRequest) ProtoMessage() {} +func (*ClientTransactionGetRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{25} } + +func (m *ClientTransactionGetRequest) GetTransactionId() string { + if m != nil { + return m.TransactionId + } + return "" +} + +// A response that returns the txn specified by a ClientTransactionGetRequest. +// +// Statuses: +// * OK - everything worked as expected, txn has been fetched +// * INTERNAL_ERROR - general error, such as protobuf failing to deserialize +// * NO_RESOURCE - no txn with the specified id exists +type ClientTransactionGetResponse struct { + Status ClientTransactionGetResponse_Status `protobuf:"varint,1,opt,name=status,enum=ClientTransactionGetResponse_Status" json:"status,omitempty"` + Transaction *transaction.Transaction `protobuf:"bytes,2,opt,name=transaction" json:"transaction,omitempty"` + // Identifier of the block this transaction is in. Not set if the + // transaction is pending. + Block string `protobuf:"bytes,3,opt,name=block" json:"block,omitempty"` +} + +func (m *ClientTransactionGetResponse) Reset() { *m = ClientTransactionGetResponse{} } +func (m *ClientTransactionGetResponse) String() string { return proto.CompactTextString(m) } +func (*ClientTransactionGetResponse) ProtoMessage() {} +func (*ClientTransactionGetResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{26} } + +func (m *ClientTransactionGetResponse) GetStatus() ClientTransactionGetResponse_Status { + if m != nil { + return m.Status + } + return ClientTransactionGetResponse_OK +} + +func (m *ClientTransactionGetResponse) GetTransaction() *transaction.Transaction { + if m != nil { + return m.Transaction + } + return nil +} + +func (m *ClientTransactionGetResponse) GetBlock() string { + if m != nil { + return m.Block + } + return "" +} + +func init() { + proto.RegisterType((*Leaf)(nil), "Leaf") + proto.RegisterType((*BatchStatus)(nil), "BatchStatus") + proto.RegisterType((*BatchStatus_InvalidTransaction)(nil), "BatchStatus.InvalidTransaction") + proto.RegisterType((*PagingControls)(nil), "PagingControls") + proto.RegisterType((*PagingResponse)(nil), "PagingResponse") + proto.RegisterType((*SortControls)(nil), "SortControls") + proto.RegisterType((*ClientBatchSubmitRequest)(nil), "ClientBatchSubmitRequest") + proto.RegisterType((*ClientBatchSubmitResponse)(nil), "ClientBatchSubmitResponse") + proto.RegisterType((*ClientBatchStatusRequest)(nil), "ClientBatchStatusRequest") + proto.RegisterType((*ClientBatchStatusResponse)(nil), "ClientBatchStatusResponse") + proto.RegisterType((*ClientStateCurrentRequest)(nil), "ClientStateCurrentRequest") + proto.RegisterType((*ClientStateCurrentResponse)(nil), "ClientStateCurrentResponse") + proto.RegisterType((*ClientStateListRequest)(nil), "ClientStateListRequest") + proto.RegisterType((*ClientStateListResponse)(nil), "ClientStateListResponse") + proto.RegisterType((*ClientStateGetRequest)(nil), "ClientStateGetRequest") + proto.RegisterType((*ClientStateGetResponse)(nil), "ClientStateGetResponse") + proto.RegisterType((*ClientBlockListRequest)(nil), "ClientBlockListRequest") + proto.RegisterType((*ClientBlockListResponse)(nil), "ClientBlockListResponse") + proto.RegisterType((*ClientBlockGetRequest)(nil), "ClientBlockGetRequest") + proto.RegisterType((*ClientBlockGetResponse)(nil), "ClientBlockGetResponse") + proto.RegisterType((*ClientBatchListRequest)(nil), "ClientBatchListRequest") + proto.RegisterType((*ClientBatchListResponse)(nil), "ClientBatchListResponse") + proto.RegisterType((*ClientBatchGetRequest)(nil), "ClientBatchGetRequest") + proto.RegisterType((*ClientBatchGetResponse)(nil), "ClientBatchGetResponse") + proto.RegisterType((*ClientTransactionListRequest)(nil), "ClientTransactionListRequest") + proto.RegisterType((*ClientTransactionListResponse)(nil), "ClientTransactionListResponse") + proto.RegisterType((*ClientTransactionGetRequest)(nil), "ClientTransactionGetRequest") + proto.RegisterType((*ClientTransactionGetResponse)(nil), "ClientTransactionGetResponse") + proto.RegisterEnum("BatchStatus_Status", BatchStatus_Status_name, BatchStatus_Status_value) + proto.RegisterEnum("ClientBatchSubmitResponse_Status", ClientBatchSubmitResponse_Status_name, ClientBatchSubmitResponse_Status_value) + proto.RegisterEnum("ClientBatchStatusResponse_Status", ClientBatchStatusResponse_Status_name, ClientBatchStatusResponse_Status_value) + proto.RegisterEnum("ClientStateCurrentResponse_Status", ClientStateCurrentResponse_Status_name, ClientStateCurrentResponse_Status_value) + proto.RegisterEnum("ClientStateListResponse_Status", ClientStateListResponse_Status_name, ClientStateListResponse_Status_value) + proto.RegisterEnum("ClientStateGetResponse_Status", ClientStateGetResponse_Status_name, ClientStateGetResponse_Status_value) + proto.RegisterEnum("ClientBlockListResponse_Status", ClientBlockListResponse_Status_name, ClientBlockListResponse_Status_value) + proto.RegisterEnum("ClientBlockGetResponse_Status", ClientBlockGetResponse_Status_name, ClientBlockGetResponse_Status_value) + proto.RegisterEnum("ClientBatchListResponse_Status", ClientBatchListResponse_Status_name, ClientBatchListResponse_Status_value) + proto.RegisterEnum("ClientBatchGetResponse_Status", ClientBatchGetResponse_Status_name, ClientBatchGetResponse_Status_value) + proto.RegisterEnum("ClientTransactionListResponse_Status", ClientTransactionListResponse_Status_name, ClientTransactionListResponse_Status_value) + proto.RegisterEnum("ClientTransactionGetResponse_Status", ClientTransactionGetResponse_Status_name, ClientTransactionGetResponse_Status_value) +} + +func init() { proto.RegisterFile("sawtooth_sdk/protobuf/client_pb2/client.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{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48, + 0xfb, 0x29, 0x68, 0x9c, 0x50, 0x88, 0xc7, 0x34, 0xce, 0x82, 0x65, 0xbc, 0x1c, 0x37, 0x41, 0x61, + 0x21, 0xcb, 0xc6, 0x21, 0xc7, 0x32, 0x15, 0x91, 0xd0, 0x9e, 0xe5, 0xce, 0xe9, 0xc9, 0xce, 0x61, + 0x19, 0x85, 0x3a, 0x87, 0x5e, 0xc8, 0x45, 0xdd, 0x82, 0x0b, 0x39, 0x2f, 0xdb, 0xbc, 0xa4, 0x53, + 0x7f, 0xc2, 0x18, 0x9a, 0x16, 0x25, 0xed, 0xfa, 0x13, 0xed, 0x87, 0x28, 0x47, 0xd6, 0xe9, 0x86, + 0xb8, 0x61, 0x1c, 0xfe, 0xeb, 0x90, 0x61, 0xaf, 0x67, 0xbe, 0xe6, 0xe8, 0x73, 0xe5, 0x49, 0x0f, + 0xc0, 0x10, 0x97, 0xe9, 0x79, 0xba, 0x36, 0x97, 0x83, 0x8b, 0x45, 0x32, 0x76, 0xb1, 0x38, 0x7d, + 0x2e, 0xff, 0x32, 0xe7, 0xf2, 0x3c, 0xc4, 0xe3, 0xb8, 0x1c, 0xb7, 0x8c, 0x83, 0x19, 0xba, 0x63, + 0x26, 0x97, 0xdf, 0x31, 0xcf, 0x30, 0x9b, 0x6b, 0x01, 0x9b, 0x69, 0x2e, 0x31, 0x36, 0x2f, 0xff, + 0xbc, 0x0c, 0x13, 0x36, 0xd8, 0x74, 0x1c, 0x61, 0x63, 0x86, 0xcb, 0x08, 0x4b, 0x4d, 0xe6, 0x84, + 0x65, 0x08, 0x73, 0xe5, 0x49, 0x09, 0xfb, 0x6b, 0x02, 0xae, 0x73, 0xf7, 0xa1, 0xaf, 0xd0, 0xb5, + 0x68, 0x4b, 0x3f, 0x80, 0x22, 0x5f, 0xaa, 0x92, 0xbc, 0xa5, 0xc8, 0xa7, 0xea, 0xeb, 0xa0, 0xf0, + 0x1f, 0x49, 0xb8, 0xb1, 0x22, 0x68, 0x81, 0xf1, 0x47, 0x31, 0x8c, 0xef, 0xea, 0x47, 0xda, 0xc7, + 0xa1, 0x7e, 0x1b, 0x0a, 0x91, 0xef, 0x7c, 0x79, 0x63, 0x0e, 0x7f, 0xd4, 0x47, 0x2c, 0xce, 0x32, + 0xbd, 0x5b, 0xb0, 0xb1, 0x00, 0x4e, 0x88, 0xe4, 0xeb, 0xfd, 0x23, 0xa1, 0xfd, 0xb5, 0x8c, 0x48, + 0x61, 0xda, 0x7f, 0x18, 0x2b, 0xc9, 0x1b, 0xfa, 0x51, 0xe6, 0xf1, 0x8a, 0xe8, 0x90, 0x0f, 0xf9, + 0x13, 0x2d, 0x10, 0x2d, 0x48, 0xd8, 0x80, 0xde, 0x75, 0xf8, 0x74, 0xe7, 0xd5, 0xf8, 0x4f, 0x53, + 0xbd, 0x71, 0x17, 0x2e, 0xcb, 0xff, 0xb1, 0x74, 0x77, 0x24, 0xfe, 0x08, 0x1b, 0xf8, 0x3b, 0x5b, + 0x89, 0x2f, 0x60, 0xfe, 0x9f, 0xda, 0x40, 0x61, 0xfa, 0x47, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, + 0xdf, 0x46, 0x7a, 0x84, 0x7e, 0x13, 0x00, 0x00, +} diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/client_peers_pb2/client_peers.pb.go b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/client_peers_pb2/client_peers.pb.go new file mode 100644 index 00000000..9f83f433 --- /dev/null +++ b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/client_peers_pb2/client_peers.pb.go @@ -0,0 +1,115 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: sawtooth_sdk/protobuf/client_peers_pb2/client_peers.proto + +/* +Package client_peer is a generated protocol buffer package. + +It is generated from these files: + sawtooth_sdk/protobuf/client_peers_pb2/client_peers.proto + +It has these top-level messages: + ClientPeersGetRequest + ClientPeersGetResponse +*/ +package client_peer + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +type ClientPeersGetResponse_Status int32 + +const ( + ClientPeersGetResponse_STATUS_UNSET ClientPeersGetResponse_Status = 0 + ClientPeersGetResponse_OK ClientPeersGetResponse_Status = 1 + ClientPeersGetResponse_ERROR ClientPeersGetResponse_Status = 2 +) + +var ClientPeersGetResponse_Status_name = map[int32]string{ + 0: "STATUS_UNSET", + 1: "OK", + 2: "ERROR", +} +var ClientPeersGetResponse_Status_value = map[string]int32{ + "STATUS_UNSET": 0, + "OK": 1, + "ERROR": 2, +} + +func (x ClientPeersGetResponse_Status) String() string { + return proto.EnumName(ClientPeersGetResponse_Status_name, int32(x)) +} +func (ClientPeersGetResponse_Status) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{1, 0} +} + +type ClientPeersGetRequest struct { +} + +func (m *ClientPeersGetRequest) Reset() { *m = ClientPeersGetRequest{} } +func (m *ClientPeersGetRequest) String() string { return proto.CompactTextString(m) } +func (*ClientPeersGetRequest) ProtoMessage() {} +func (*ClientPeersGetRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +type ClientPeersGetResponse struct { + Status ClientPeersGetResponse_Status `protobuf:"varint,1,opt,name=status,enum=ClientPeersGetResponse_Status" json:"status,omitempty"` + Peers []string `protobuf:"bytes,2,rep,name=peers" json:"peers,omitempty"` +} + +func (m *ClientPeersGetResponse) Reset() { *m = ClientPeersGetResponse{} } +func (m *ClientPeersGetResponse) String() string { return proto.CompactTextString(m) } +func (*ClientPeersGetResponse) ProtoMessage() {} +func (*ClientPeersGetResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *ClientPeersGetResponse) GetStatus() ClientPeersGetResponse_Status { + if m != nil { + return m.Status + } + return ClientPeersGetResponse_STATUS_UNSET +} + +func (m *ClientPeersGetResponse) GetPeers() []string { + if m != nil { + return m.Peers + } + return nil +} + +func init() { + proto.RegisterType((*ClientPeersGetRequest)(nil), "ClientPeersGetRequest") + proto.RegisterType((*ClientPeersGetResponse)(nil), "ClientPeersGetResponse") + proto.RegisterEnum("ClientPeersGetResponse_Status", ClientPeersGetResponse_Status_name, ClientPeersGetResponse_Status_value) +} + +func init() { + proto.RegisterFile("sawtooth_sdk/protobuf/client_peers_pb2/client_peers.proto", fileDescriptor0) +} + +var fileDescriptor0 = []byte{ + // 212 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xb2, 0x2c, 0x4e, 0x2c, 0x2f, + 0xc9, 0xcf, 0x2f, 0xc9, 0x88, 0x2f, 0x4e, 0xc9, 0xd6, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, + 0x4d, 0xd3, 0x4f, 0xce, 0xc9, 0x4c, 0xcd, 0x2b, 0x89, 0x2f, 0x48, 0x4d, 0x2d, 0x2a, 0x8e, 0x2f, + 0x48, 0x32, 0x42, 0x11, 0xd0, 0x03, 0x2b, 0x53, 0x12, 0xe7, 0x12, 0x75, 0x06, 0x8b, 0x06, 0x80, + 0x04, 0xdd, 0x53, 0x4b, 0x82, 0x52, 0x0b, 0x4b, 0x53, 0x8b, 0x4b, 0x94, 0xa6, 0x32, 0x72, 0x89, + 0xa1, 0xcb, 0x14, 0x17, 0xe4, 0xe7, 0x15, 0xa7, 0x0a, 0x99, 0x71, 0xb1, 0x15, 0x97, 0x24, 0x96, + 0x94, 0x16, 0x4b, 0x30, 0x2a, 0x30, 0x6a, 0xf0, 0x19, 0xc9, 0xe9, 0x61, 0x57, 0xa8, 0x17, 0x0c, + 0x56, 0x15, 0x04, 0x55, 0x2d, 0x24, 0xc2, 0xc5, 0x0a, 0xb6, 0x5a, 0x82, 0x49, 0x81, 0x59, 0x83, + 0x33, 0x08, 0xc2, 0x51, 0xd2, 0xe5, 0x62, 0x83, 0xa8, 0x13, 0x12, 0xe0, 0xe2, 0x09, 0x0e, 0x71, + 0x0c, 0x09, 0x0d, 0x8e, 0x0f, 0xf5, 0x0b, 0x76, 0x0d, 0x11, 0x60, 0x10, 0x62, 0xe3, 0x62, 0xf2, + 0xf7, 0x16, 0x60, 0x14, 0xe2, 0xe4, 0x62, 0x75, 0x0d, 0x0a, 0xf2, 0x0f, 0x12, 0x60, 0x72, 0x52, + 0xe3, 0x12, 0x85, 0xf9, 0x56, 0x0f, 0xe8, 0x5b, 0x3d, 0x98, 0x6f, 0x03, 0x18, 0xa3, 0xb8, 0x91, + 0xfc, 0x97, 0xc4, 0x06, 0x96, 0x30, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x7e, 0x44, 0x31, 0xda, + 0x1c, 0x01, 0x00, 0x00, +} diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/events_pb2/events.pb.go b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/events_pb2/events.pb.go new file mode 100644 index 00000000..2c800401 --- /dev/null +++ b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/events_pb2/events.pb.go @@ -0,0 +1,468 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: sawtooth_sdk/protobuf/events_pb2/events.proto + +/* +Package events_pb2 is a generated protocol buffer package. + +It is generated from these files: + sawtooth_sdk/protobuf/events_pb2/events.proto + +It has these top-level messages: + Event + EventList + EventFilter + EventSubscription + ClientEventsSubscribeRequest + ClientEventsSubscribeResponse + ClientEventsUnsubscribeRequest + ClientEventsUnsubscribeResponse + ClientEventsGetRequest + ClientEventsGetResponse +*/ +package events_pb2 + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +type EventFilter_FilterType int32 + +const ( + EventFilter_SIMPLE_ANY EventFilter_FilterType = 0 + EventFilter_SIMPLE_ALL EventFilter_FilterType = 1 + EventFilter_REGEX_ANY EventFilter_FilterType = 2 + EventFilter_REGEX_ALL EventFilter_FilterType = 3 +) + +var EventFilter_FilterType_name = map[int32]string{ + 0: "SIMPLE_ANY", + 1: "SIMPLE_ALL", + 2: "REGEX_ANY", + 3: "REGEX_ALL", +} +var EventFilter_FilterType_value = map[string]int32{ + "SIMPLE_ANY": 0, + "SIMPLE_ALL": 1, + "REGEX_ANY": 2, + "REGEX_ALL": 3, +} + +func (x EventFilter_FilterType) String() string { + return proto.EnumName(EventFilter_FilterType_name, int32(x)) +} +func (EventFilter_FilterType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{2, 0} } + +type ClientEventsSubscribeResponse_Status int32 + +const ( + ClientEventsSubscribeResponse_OK ClientEventsSubscribeResponse_Status = 0 + ClientEventsSubscribeResponse_INVALID_FILTER ClientEventsSubscribeResponse_Status = 1 + ClientEventsSubscribeResponse_UNKNOWN_BLOCK ClientEventsSubscribeResponse_Status = 2 +) + +var ClientEventsSubscribeResponse_Status_name = map[int32]string{ + 0: "OK", + 1: "INVALID_FILTER", + 2: "UNKNOWN_BLOCK", +} +var ClientEventsSubscribeResponse_Status_value = map[string]int32{ + "OK": 0, + "INVALID_FILTER": 1, + "UNKNOWN_BLOCK": 2, +} + +func (x ClientEventsSubscribeResponse_Status) String() string { + return proto.EnumName(ClientEventsSubscribeResponse_Status_name, int32(x)) +} +func (ClientEventsSubscribeResponse_Status) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{5, 0} +} + +type ClientEventsUnsubscribeResponse_Status int32 + +const ( + ClientEventsUnsubscribeResponse_OK ClientEventsUnsubscribeResponse_Status = 0 + ClientEventsUnsubscribeResponse_INTERNAL_ERROR ClientEventsUnsubscribeResponse_Status = 1 +) + +var ClientEventsUnsubscribeResponse_Status_name = map[int32]string{ + 0: "OK", + 1: "INTERNAL_ERROR", +} +var ClientEventsUnsubscribeResponse_Status_value = map[string]int32{ + "OK": 0, + "INTERNAL_ERROR": 1, +} + +func (x ClientEventsUnsubscribeResponse_Status) String() string { + return proto.EnumName(ClientEventsUnsubscribeResponse_Status_name, int32(x)) +} +func (ClientEventsUnsubscribeResponse_Status) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{7, 0} +} + +type ClientEventsGetResponse_Status int32 + +const ( + ClientEventsGetResponse_OK ClientEventsGetResponse_Status = 0 + ClientEventsGetResponse_INTERNAL_ERROR ClientEventsGetResponse_Status = 1 + ClientEventsGetResponse_INVALID_FILTER ClientEventsGetResponse_Status = 2 + ClientEventsGetResponse_UNKNOWN_BLOCK ClientEventsGetResponse_Status = 3 +) + +var ClientEventsGetResponse_Status_name = map[int32]string{ + 0: "OK", + 1: "INTERNAL_ERROR", + 2: "INVALID_FILTER", + 3: "UNKNOWN_BLOCK", +} +var ClientEventsGetResponse_Status_value = map[string]int32{ + "OK": 0, + "INTERNAL_ERROR": 1, + "INVALID_FILTER": 2, + "UNKNOWN_BLOCK": 3, +} + +func (x ClientEventsGetResponse_Status) String() string { + return proto.EnumName(ClientEventsGetResponse_Status_name, int32(x)) +} +func (ClientEventsGetResponse_Status) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{9, 0} +} + +type Event struct { + // Used to subscribe to events and servers as a hint for how to deserialize + // event_data and what pairs to expect in attributes. + EventType string `protobuf:"bytes,1,opt,name=event_type,json=eventType" json:"event_type,omitempty"` + Attributes []*Event_Attribute `protobuf:"bytes,2,rep,name=attributes" json:"attributes,omitempty"` + // Opaque data defined by the event_type. + Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` +} + +func (m *Event) Reset() { *m = Event{} } +func (m *Event) String() string { return proto.CompactTextString(m) } +func (*Event) ProtoMessage() {} +func (*Event) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *Event) GetEventType() string { + if m != nil { + return m.EventType + } + return "" +} + +func (m *Event) GetAttributes() []*Event_Attribute { + if m != nil { + return m.Attributes + } + return nil +} + +func (m *Event) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +// Transparent data defined by the event_type. +type Event_Attribute struct { + Key string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` +} + +func (m *Event_Attribute) Reset() { *m = Event_Attribute{} } +func (m *Event_Attribute) String() string { return proto.CompactTextString(m) } +func (*Event_Attribute) ProtoMessage() {} +func (*Event_Attribute) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 0} } + +func (m *Event_Attribute) GetKey() string { + if m != nil { + return m.Key + } + return "" +} + +func (m *Event_Attribute) GetValue() string { + if m != nil { + return m.Value + } + return "" +} + +type EventList struct { + Events []*Event `protobuf:"bytes,1,rep,name=events" json:"events,omitempty"` +} + +func (m *EventList) Reset() { *m = EventList{} } +func (m *EventList) String() string { return proto.CompactTextString(m) } +func (*EventList) ProtoMessage() {} +func (*EventList) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *EventList) GetEvents() []*Event { + if m != nil { + return m.Events + } + return nil +} + +type EventFilter struct { + // EventFilter is used when subscribing to events to limit the events + // received within a given event type. See + // validator/server/events/subscription.py for further explanation. + Key string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` + MatchString string `protobuf:"bytes,2,opt,name=match_string,json=matchString" json:"match_string,omitempty"` + FilterType EventFilter_FilterType `protobuf:"varint,3,opt,name=filter_type,json=filterType,enum=EventFilter_FilterType" json:"filter_type,omitempty"` +} + +func (m *EventFilter) Reset() { *m = EventFilter{} } +func (m *EventFilter) String() string { return proto.CompactTextString(m) } +func (*EventFilter) ProtoMessage() {} +func (*EventFilter) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *EventFilter) GetKey() string { + if m != nil { + return m.Key + } + return "" +} + +func (m *EventFilter) GetMatchString() string { + if m != nil { + return m.MatchString + } + return "" +} + +func (m *EventFilter) GetFilterType() EventFilter_FilterType { + if m != nil { + return m.FilterType + } + return EventFilter_SIMPLE_ANY +} + +type EventSubscription struct { + // EventSubscription is used when subscribing to events to specify the type + // of events being subscribed to, along with any additional filters. See + // validator/server/events/subscription.py for further explanation. + EventType string `protobuf:"bytes,1,opt,name=event_type,json=eventType" json:"event_type,omitempty"` + Filters []*EventFilter `protobuf:"bytes,2,rep,name=filters" json:"filters,omitempty"` +} + +func (m *EventSubscription) Reset() { *m = EventSubscription{} } +func (m *EventSubscription) String() string { return proto.CompactTextString(m) } +func (*EventSubscription) ProtoMessage() {} +func (*EventSubscription) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *EventSubscription) GetEventType() string { + if m != nil { + return m.EventType + } + return "" +} + +func (m *EventSubscription) GetFilters() []*EventFilter { + if m != nil { + return m.Filters + } + return nil +} + +type ClientEventsSubscribeRequest struct { + Subscriptions []*EventSubscription `protobuf:"bytes,1,rep,name=subscriptions" json:"subscriptions,omitempty"` + // The block id (or ids, if trying to walk back a fork) the subscriber last + // received events on. It can be set to empty if it has not yet received the + // genesis block. + LastKnownBlockIds []string `protobuf:"bytes,2,rep,name=last_known_block_ids,json=lastKnownBlockIds" json:"last_known_block_ids,omitempty"` +} + +func (m *ClientEventsSubscribeRequest) Reset() { *m = ClientEventsSubscribeRequest{} } +func (m *ClientEventsSubscribeRequest) String() string { return proto.CompactTextString(m) } +func (*ClientEventsSubscribeRequest) ProtoMessage() {} +func (*ClientEventsSubscribeRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *ClientEventsSubscribeRequest) GetSubscriptions() []*EventSubscription { + if m != nil { + return m.Subscriptions + } + return nil +} + +func (m *ClientEventsSubscribeRequest) GetLastKnownBlockIds() []string { + if m != nil { + return m.LastKnownBlockIds + } + return nil +} + +type ClientEventsSubscribeResponse struct { + Status ClientEventsSubscribeResponse_Status `protobuf:"varint,1,opt,name=status,enum=ClientEventsSubscribeResponse_Status" json:"status,omitempty"` + // Additional information about the response status + ResponseMessage string `protobuf:"bytes,2,opt,name=response_message,json=responseMessage" json:"response_message,omitempty"` +} + +func (m *ClientEventsSubscribeResponse) Reset() { *m = ClientEventsSubscribeResponse{} } +func (m *ClientEventsSubscribeResponse) String() string { return proto.CompactTextString(m) } +func (*ClientEventsSubscribeResponse) ProtoMessage() {} +func (*ClientEventsSubscribeResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *ClientEventsSubscribeResponse) GetStatus() ClientEventsSubscribeResponse_Status { + if m != nil { + return m.Status + } + return ClientEventsSubscribeResponse_OK +} + +func (m *ClientEventsSubscribeResponse) GetResponseMessage() string { + if m != nil { + return m.ResponseMessage + } + return "" +} + +type ClientEventsUnsubscribeRequest struct { +} + +func (m *ClientEventsUnsubscribeRequest) Reset() { *m = ClientEventsUnsubscribeRequest{} } +func (m *ClientEventsUnsubscribeRequest) String() string { return proto.CompactTextString(m) } +func (*ClientEventsUnsubscribeRequest) ProtoMessage() {} +func (*ClientEventsUnsubscribeRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +type ClientEventsUnsubscribeResponse struct { + Status ClientEventsUnsubscribeResponse_Status `protobuf:"varint,1,opt,name=status,enum=ClientEventsUnsubscribeResponse_Status" json:"status,omitempty"` +} + +func (m *ClientEventsUnsubscribeResponse) Reset() { *m = ClientEventsUnsubscribeResponse{} } +func (m *ClientEventsUnsubscribeResponse) String() string { return proto.CompactTextString(m) } +func (*ClientEventsUnsubscribeResponse) ProtoMessage() {} +func (*ClientEventsUnsubscribeResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *ClientEventsUnsubscribeResponse) GetStatus() ClientEventsUnsubscribeResponse_Status { + if m != nil { + return m.Status + } + return ClientEventsUnsubscribeResponse_OK +} + +type ClientEventsGetRequest struct { + Subscriptions []*EventSubscription `protobuf:"bytes,1,rep,name=subscriptions" json:"subscriptions,omitempty"` + BlockIds []string `protobuf:"bytes,2,rep,name=block_ids,json=blockIds" json:"block_ids,omitempty"` +} + +func (m *ClientEventsGetRequest) Reset() { *m = ClientEventsGetRequest{} } +func (m *ClientEventsGetRequest) String() string { return proto.CompactTextString(m) } +func (*ClientEventsGetRequest) ProtoMessage() {} +func (*ClientEventsGetRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *ClientEventsGetRequest) GetSubscriptions() []*EventSubscription { + if m != nil { + return m.Subscriptions + } + return nil +} + +func (m *ClientEventsGetRequest) GetBlockIds() []string { + if m != nil { + return m.BlockIds + } + return nil +} + +type ClientEventsGetResponse struct { + Status ClientEventsGetResponse_Status `protobuf:"varint,1,opt,name=status,enum=ClientEventsGetResponse_Status" json:"status,omitempty"` + Events []*Event `protobuf:"bytes,2,rep,name=events" json:"events,omitempty"` +} + +func (m *ClientEventsGetResponse) Reset() { *m = ClientEventsGetResponse{} } +func (m *ClientEventsGetResponse) String() string { return proto.CompactTextString(m) } +func (*ClientEventsGetResponse) ProtoMessage() {} +func (*ClientEventsGetResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *ClientEventsGetResponse) GetStatus() ClientEventsGetResponse_Status { + if m != nil { + return m.Status + } + return ClientEventsGetResponse_OK +} + +func (m *ClientEventsGetResponse) GetEvents() []*Event { + if m != nil { + return m.Events + } + return nil +} + +func init() { + proto.RegisterType((*Event)(nil), "Event") + proto.RegisterType((*Event_Attribute)(nil), "Event.Attribute") + proto.RegisterType((*EventList)(nil), "EventList") + proto.RegisterType((*EventFilter)(nil), "EventFilter") + proto.RegisterType((*EventSubscription)(nil), "EventSubscription") + proto.RegisterType((*ClientEventsSubscribeRequest)(nil), "ClientEventsSubscribeRequest") + proto.RegisterType((*ClientEventsSubscribeResponse)(nil), "ClientEventsSubscribeResponse") + proto.RegisterType((*ClientEventsUnsubscribeRequest)(nil), "ClientEventsUnsubscribeRequest") + proto.RegisterType((*ClientEventsUnsubscribeResponse)(nil), "ClientEventsUnsubscribeResponse") + proto.RegisterType((*ClientEventsGetRequest)(nil), "ClientEventsGetRequest") + proto.RegisterType((*ClientEventsGetResponse)(nil), "ClientEventsGetResponse") + proto.RegisterEnum("EventFilter_FilterType", EventFilter_FilterType_name, EventFilter_FilterType_value) + proto.RegisterEnum("ClientEventsSubscribeResponse_Status", ClientEventsSubscribeResponse_Status_name, ClientEventsSubscribeResponse_Status_value) + proto.RegisterEnum("ClientEventsUnsubscribeResponse_Status", ClientEventsUnsubscribeResponse_Status_name, ClientEventsUnsubscribeResponse_Status_value) + proto.RegisterEnum("ClientEventsGetResponse_Status", ClientEventsGetResponse_Status_name, ClientEventsGetResponse_Status_value) +} + +func init() { proto.RegisterFile("sawtooth_sdk/protobuf/events_pb2/events.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 627 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xa4, 0x54, 0x5d, 0x53, 0xd3, 0x4c, + 0x14, 0x7e, 0xd3, 0xbe, 0x54, 0x73, 0x0a, 0x35, 0xec, 0xa0, 0x30, 0x2a, 0x1f, 0xee, 0x88, 0xe2, + 0x38, 0x2e, 0x4e, 0xb9, 0x80, 0x1b, 0xc7, 0x29, 0x18, 0x98, 0xda, 0x90, 0x32, 0x5b, 0xf0, 0x83, + 0x9b, 0x4c, 0x42, 0x17, 0xcc, 0xb4, 0x24, 0xb5, 0xbb, 0x81, 0xe1, 0x1f, 0xe8, 0xcf, 0xf0, 0x97, + 0x38, 0xe3, 0x95, 0x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, 0x7e, 0x05, 0x00, 0x00, 0xff, 0xff, 0x5f, 0x88, 0xe1, 0xcc, 0x87, + 0x05, 0x00, 0x00, +} diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/genesis_pb2/genesis.pb.go b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/genesis_pb2/genesis.pb.go new file mode 100644 index 00000000..cbeaad0d --- /dev/null +++ b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/genesis_pb2/genesis.pb.go @@ -0,0 +1,65 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: sawtooth_sdk/protobuf/genesis_pb2/genesis.proto + +/* +Package genesis_pb2 is a generated protocol buffer package. + +It is generated from these files: + sawtooth_sdk/protobuf/genesis_pb2/genesis.proto + +It has these top-level messages: + GenesisData +*/ +package genesis_pb2 + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import batch "sawtooth_sdk/protobuf/batch_pb2" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +type GenesisData struct { + // The list of batches that will be applied during the genesis process + Batches []*batch.Batch `protobuf:"bytes,1,rep,name=batches" json:"batches,omitempty"` +} + +func (m *GenesisData) Reset() { *m = GenesisData{} } +func (m *GenesisData) String() string { return proto.CompactTextString(m) } +func (*GenesisData) ProtoMessage() {} +func (*GenesisData) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *GenesisData) GetBatches() []*batch.Batch { + if m != nil { + return m.Batches + } + return nil +} + +func init() { + proto.RegisterType((*GenesisData)(nil), "GenesisData") +} + +func init() { proto.RegisterFile("sawtooth_sdk/protobuf/genesis_pb2/genesis.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 136 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xd2, 0x2f, 0x4e, 0x2c, 0x2f, + 0xc9, 0xcf, 0x2f, 0xc9, 0x88, 0x2f, 0x4e, 0xc9, 0xd6, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, + 0x4d, 0xd3, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0x8e, 0x2f, 0x48, 0x32, 0x82, 0xb1, 0xf5, + 0xc0, 0x92, 0x52, 0xda, 0xd8, 0x35, 0x24, 0x25, 0x96, 0x24, 0x67, 0x80, 0x95, 0x83, 0x59, 0x10, + 0xc5, 0x4a, 0xfa, 0x5c, 0xdc, 0xee, 0x10, 0xdd, 0x2e, 0x89, 0x25, 0x89, 0x42, 0x0a, 0x5c, 0xec, + 0x60, 0xd9, 0xd4, 0x62, 0x09, 0x46, 0x05, 0x66, 0x0d, 0x6e, 0x23, 0x36, 0x3d, 0x27, 0x10, 0x3f, + 0x08, 0x26, 0xec, 0xa4, 0xc6, 0x25, 0x0a, 0x33, 0x5f, 0x0f, 0x68, 0xbe, 0x1e, 0xcc, 0xfc, 0x00, + 0xc6, 0x28, 0x6e, 0x24, 0x37, 0x25, 0xb1, 0x81, 0x25, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, + 0x52, 0x92, 0x8a, 0x21, 0xbf, 0x00, 0x00, 0x00, +} diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/identity_pb2/identity.pb.go b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/identity_pb2/identity.pb.go new file mode 100644 index 00000000..d9c525bb --- /dev/null +++ b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/identity_pb2/identity.pb.go @@ -0,0 +1,199 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: sawtooth_sdk/protobuf/identity_pb2/identity.proto + +/* +Package identity is a generated protocol buffer package. + +It is generated from these files: + sawtooth_sdk/protobuf/identity_pb2/identity.proto + +It has these top-level messages: + Policy + PolicyList + Role + RoleList +*/ +package identity + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +type Policy_Type int32 + +const ( + Policy_PERMIT_KEY Policy_Type = 0 + Policy_DENY_KEY Policy_Type = 1 +) + +var Policy_Type_name = map[int32]string{ + 0: "PERMIT_KEY", + 1: "DENY_KEY", +} +var Policy_Type_value = map[string]int32{ + "PERMIT_KEY": 0, + "DENY_KEY": 1, +} + +func (x Policy_Type) String() string { + return proto.EnumName(Policy_Type_name, int32(x)) +} +func (Policy_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 0} } + +type Policy struct { + // name of the policy, this should be unique. + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // list of Entries + // The entries will be processed in order from first to last. + Entries []*Policy_Entry `protobuf:"bytes,2,rep,name=entries" json:"entries,omitempty"` +} + +func (m *Policy) Reset() { *m = Policy{} } +func (m *Policy) String() string { return proto.CompactTextString(m) } +func (*Policy) ProtoMessage() {} +func (*Policy) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *Policy) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Policy) GetEntries() []*Policy_Entry { + if m != nil { + return m.Entries + } + return nil +} + +type Policy_Entry struct { + // Whether this is a Permit_KEY or Deny_KEY entry + Type Policy_Type `protobuf:"varint,1,opt,name=type,enum=Policy_Type" json:"type,omitempty"` + // This should be a list of public keys or * to refer to all participants. + // If using *, it should be the only key in the list. + Key string `protobuf:"bytes,2,opt,name=key" json:"key,omitempty"` +} + +func (m *Policy_Entry) Reset() { *m = Policy_Entry{} } +func (m *Policy_Entry) String() string { return proto.CompactTextString(m) } +func (*Policy_Entry) ProtoMessage() {} +func (*Policy_Entry) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 0} } + +func (m *Policy_Entry) GetType() Policy_Type { + if m != nil { + return m.Type + } + return Policy_PERMIT_KEY +} + +func (m *Policy_Entry) GetKey() string { + if m != nil { + return m.Key + } + return "" +} + +// Policy will be stored in a Policy list to account for state collisions +type PolicyList struct { + Policies []*Policy `protobuf:"bytes,1,rep,name=policies" json:"policies,omitempty"` +} + +func (m *PolicyList) Reset() { *m = PolicyList{} } +func (m *PolicyList) String() string { return proto.CompactTextString(m) } +func (*PolicyList) ProtoMessage() {} +func (*PolicyList) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *PolicyList) GetPolicies() []*Policy { + if m != nil { + return m.Policies + } + return nil +} + +type Role struct { + // Role name + Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` + // Name of corresponding policy + PolicyName string `protobuf:"bytes,2,opt,name=policy_name,json=policyName" json:"policy_name,omitempty"` +} + +func (m *Role) Reset() { *m = Role{} } +func (m *Role) String() string { return proto.CompactTextString(m) } +func (*Role) ProtoMessage() {} +func (*Role) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *Role) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Role) GetPolicyName() string { + if m != nil { + return m.PolicyName + } + return "" +} + +// Roles will be stored in a RoleList to account for state collisions +type RoleList struct { + Roles []*Role `protobuf:"bytes,1,rep,name=roles" json:"roles,omitempty"` +} + +func (m *RoleList) Reset() { *m = RoleList{} } +func (m *RoleList) String() string { return proto.CompactTextString(m) } +func (*RoleList) ProtoMessage() {} +func (*RoleList) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *RoleList) GetRoles() []*Role { + if m != nil { + return m.Roles + } + return nil +} + +func init() { + proto.RegisterType((*Policy)(nil), "Policy") + proto.RegisterType((*Policy_Entry)(nil), "Policy.Entry") + proto.RegisterType((*PolicyList)(nil), "PolicyList") + proto.RegisterType((*Role)(nil), "Role") + proto.RegisterType((*RoleList)(nil), "RoleList") + proto.RegisterEnum("Policy_Type", Policy_Type_name, Policy_Type_value) +} + +func init() { proto.RegisterFile("sawtooth_sdk/protobuf/identity_pb2/identity.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 285 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x6c, 0x90, 0x41, 0x4b, 0xfb, 0x40, + 0x10, 0xc5, 0xff, 0xfb, 0x6f, 0xd2, 0xc6, 0x69, 0x2d, 0x65, 0x4f, 0xa5, 0x82, 0x86, 0x28, 0xb4, + 0xa7, 0x2d, 0x8d, 0xc7, 0xde, 0xc4, 0x1c, 0x44, 0x2d, 0x61, 0xe9, 0xa5, 0xa7, 0xd0, 0xd8, 0x15, + 0x97, 0xd6, 0x6e, 0x48, 0x56, 0x64, 0xbf, 0x91, 0x1f, 0xd3, 0xdd, 0x59, 0x53, 0x10, 0xbc, 0xcd, + 0xbc, 0xdf, 0xdb, 0x79, 0xb3, 0x03, 0x8b, 0x66, 0xfb, 0xa9, 0x95, 0xd2, 0x6f, 0x45, 0xb3, 0xdb, + 0xcf, 0xab, 0x5a, 0x69, 0x55, 0x7e, 0xbc, 0xce, 0xe5, 0x4e, 0x1c, 0xb5, 0xd4, 0xa6, 0xa8, 0xca, + 0xf4, 0xd4, 0x30, 0xc4, 0xc9, 0x17, 0x81, 0x6e, 0xae, 0x0e, 0xf2, 0xc5, 0x50, 0x0a, 0xc1, 0x71, + 0xfb, 0x2e, 0xc6, 0x24, 0x26, 0xb3, 0x33, 0x8e, 0x35, 0x9d, 0x42, 0xcf, 0xda, 0x6b, 0x29, 0x9a, + 0xf1, 0xff, 0xb8, 0x33, 0xeb, 0xa7, 0xe7, 0xcc, 0xbb, 0x59, 0x66, 0x65, 0xc3, 0x5b, 0x3a, 0x59, + 0x42, 0x88, 0x0a, 0x8d, 0x21, 0xd0, 0xa6, 0xf2, 0x53, 0x86, 0xe9, 0xa0, 0xb5, 0xaf, 0xad, 0xc6, + 0x91, 0xd0, 0x11, 0x74, 0xf6, 0xc2, 0xd8, 0x79, 0x2e, 0xc6, 0x95, 0xc9, 0x0d, 0x04, 0x8e, 0xd3, + 0x21, 0x40, 0x9e, 0xf1, 0xe7, 0x87, 0x75, 0xf1, 0x98, 0x6d, 0x46, 0xff, 0xe8, 0x00, 0xa2, 0xfb, + 0x6c, 0xb5, 0xc1, 0x8e, 0x24, 0x0b, 0x4b, 0x71, 0xd8, 0x93, 0x6c, 0x34, 0xbd, 0x86, 0xa8, 0x72, + 0x9d, 0x5b, 0x8d, 0xe0, 0x6a, 0xbd, 0x9f, 0x2c, 0x7e, 0x02, 0xc9, 0x12, 0x02, 0xae, 0x0e, 0xe2, + 0xcf, 0xaf, 0x5d, 0x41, 0x1f, 0x7d, 0xa6, 0x40, 0xe4, 0xd7, 0x01, 0x2f, 0xad, 0xac, 0x92, 0x4c, + 0x21, 0x72, 0x8f, 0x31, 0xed, 0x02, 0xc2, 0xda, 0xd6, 0x6d, 0x54, 0xc8, 0x1c, 0xe1, 0x5e, 0xbb, + 0xbb, 0x84, 0x49, 0x7b, 0x78, 0xf6, 0xfb, 0xbc, 0xf6, 0xfa, 0x39, 0x29, 0xbb, 0x58, 0xdf, 0x7e, + 0x07, 0x00, 0x00, 0xff, 0xff, 0xd5, 0xd5, 0x97, 0xc1, 0x9f, 0x01, 0x00, 0x00, +} diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/jvm_sc_pb2/jvm_sc.pb.go b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/jvm_sc_pb2/jvm_sc.pb.go new file mode 100644 index 00000000..aefe7312 --- /dev/null +++ b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/jvm_sc_pb2/jvm_sc.pb.go @@ -0,0 +1,135 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: sawtooth_sdk/protobuf/jvm_sc_pb2/jvm_sc.proto + +/* +Package jvmsc_pb2 is a generated protocol buffer package. + +It is generated from these files: + sawtooth_sdk/protobuf/jvm_sc_pb2/jvm_sc.proto + +It has these top-level messages: + JVMEntry + JVMPayload +*/ +package jvmsc_pb2 + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +type JVMEntry struct { + Bytecode []byte `protobuf:"bytes,1,opt,name=bytecode,proto3" json:"bytecode,omitempty"` + Methods []string `protobuf:"bytes,2,rep,name=methods" json:"methods,omitempty"` +} + +func (m *JVMEntry) Reset() { *m = JVMEntry{} } +func (m *JVMEntry) String() string { return proto.CompactTextString(m) } +func (*JVMEntry) ProtoMessage() {} +func (*JVMEntry) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *JVMEntry) GetBytecode() []byte { + if m != nil { + return m.Bytecode + } + return nil +} + +func (m *JVMEntry) GetMethods() []string { + if m != nil { + return m.Methods + } + return nil +} + +type JVMPayload struct { + Verb string `protobuf:"bytes,1,opt,name=verb" json:"verb,omitempty"` + Bytecode []byte `protobuf:"bytes,2,opt,name=bytecode,proto3" json:"bytecode,omitempty"` + Methods []string `protobuf:"bytes,3,rep,name=methods" json:"methods,omitempty"` + ByteAddr string `protobuf:"bytes,4,opt,name=byte_addr,json=byteAddr" json:"byte_addr,omitempty"` + Method string `protobuf:"bytes,5,opt,name=method" json:"method,omitempty"` + Parameters []string `protobuf:"bytes,6,rep,name=parameters" json:"parameters,omitempty"` +} + +func (m *JVMPayload) Reset() { *m = JVMPayload{} } +func (m *JVMPayload) String() string { return proto.CompactTextString(m) } +func (*JVMPayload) ProtoMessage() {} +func (*JVMPayload) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *JVMPayload) GetVerb() string { + if m != nil { + return m.Verb + } + return "" +} + +func (m *JVMPayload) GetBytecode() []byte { + if m != nil { + return m.Bytecode + } + return nil +} + +func (m *JVMPayload) GetMethods() []string { + if m != nil { + return m.Methods + } + return nil +} + +func (m *JVMPayload) GetByteAddr() string { + if m != nil { + return m.ByteAddr + } + return "" +} + +func (m *JVMPayload) GetMethod() string { + if m != nil { + return m.Method + } + return "" +} + +func (m *JVMPayload) GetParameters() []string { + if m != nil { + return m.Parameters + } + return nil +} + +func init() { + proto.RegisterType((*JVMEntry)(nil), "JVMEntry") + proto.RegisterType((*JVMPayload)(nil), "JVMPayload") +} + +func init() { proto.RegisterFile("sawtooth_sdk/protobuf/jvm_sc_pb2/jvm_sc.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 237 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xd2, 0x2d, 0x4e, 0x2c, 0x2f, + 0xc9, 0xcf, 0x2f, 0xc9, 0x88, 0x2f, 0x4e, 0xc9, 0xd6, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, + 0x4d, 0xd3, 0xcf, 0x2a, 0xcb, 0x8d, 0x2f, 0x4e, 0x8e, 0x2f, 0x48, 0x32, 0x82, 0x32, 0xf5, 0xc0, + 0x52, 0x4a, 0x0e, 0x5c, 0x1c, 0x5e, 0x61, 0xbe, 0xae, 0x79, 0x25, 0x45, 0x95, 0x42, 0x52, 0x5c, + 0x1c, 0x49, 0x95, 0x25, 0xa9, 0xc9, 0xf9, 0x29, 0xa9, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x3c, 0x41, + 0x70, 0xbe, 0x90, 0x04, 0x17, 0x7b, 0x6e, 0x6a, 0x49, 0x46, 0x7e, 0x4a, 0xb1, 0x04, 0x93, 0x02, + 0xb3, 0x06, 0x67, 0x10, 0x8c, 0xab, 0xb4, 0x9a, 0x91, 0x8b, 0x0b, 0x68, 0x44, 0x40, 0x62, 0x65, + 0x4e, 0x7e, 0x62, 0x8a, 0x90, 0x10, 0x17, 0x4b, 0x59, 0x6a, 0x51, 0x12, 0xd8, 0x00, 0xce, 0x20, + 0x30, 0x1b, 0xc5, 0x60, 0x26, 0xdc, 0x06, 0x33, 0xa3, 0x18, 0x2c, 0x24, 0xcd, 0xc5, 0x09, 0x52, + 0x15, 0x9f, 0x98, 0x92, 0x52, 0x24, 0xc1, 0x02, 0x36, 0x0e, 0xac, 0xcd, 0x11, 0xc8, 0x17, 0x12, + 0xe3, 0x62, 0x83, 0xa8, 0x93, 0x60, 0x05, 0xcb, 0x40, 0x79, 0x42, 0x72, 0x5c, 0x5c, 0x05, 0x89, + 0x45, 0x89, 0x40, 0x5e, 0x6a, 0x51, 0xb1, 0x04, 0x1b, 0xd8, 0x44, 0x24, 0x11, 0x27, 0x35, 0x2e, + 0x71, 0x58, 0x00, 0xe9, 0xa5, 0x56, 0x24, 0xe6, 0x16, 0xe4, 0xa4, 0x16, 0xeb, 0x01, 0x43, 0xa4, + 0x38, 0x39, 0x80, 0x31, 0x8a, 0x13, 0xcc, 0x00, 0x05, 0x52, 0x12, 0x1b, 0x38, 0x78, 0x8c, 0x01, + 0x01, 0x00, 0x00, 0xff, 0xff, 0xcb, 0x24, 0x11, 0x5d, 0x4f, 0x01, 0x00, 0x00, +} diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/network_pb2/network.pb.go b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/network_pb2/network.pb.go new file mode 100644 index 00000000..4b9ed1bd --- /dev/null +++ b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/network_pb2/network.pb.go @@ -0,0 +1,445 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: sawtooth_sdk/protobuf/network_pb2/network.proto + +/* +Package network_pb2 is a generated protocol buffer package. + +It is generated from these files: + sawtooth_sdk/protobuf/network_pb2/network.proto + +It has these top-level messages: + ConnectMessage + DisconnectMessage + PeerRegisterRequest + PeerUnregisterRequest + GetPeersRequest + GetPeersResponse + PingRequest + GossipMessage + NetworkAcknowledgement + GossipBlockRequest + GossipBlockResponse + GossipBatchResponse + GossipBatchByBatchIdRequest + GossipBatchByTransactionIdRequest +*/ +package network_pb2 + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +type NetworkAcknowledgement_Status int32 + +const ( + NetworkAcknowledgement_OK NetworkAcknowledgement_Status = 0 + NetworkAcknowledgement_ERROR NetworkAcknowledgement_Status = 1 +) + +var NetworkAcknowledgement_Status_name = map[int32]string{ + 0: "OK", + 1: "ERROR", +} +var NetworkAcknowledgement_Status_value = map[string]int32{ + "OK": 0, + "ERROR": 1, +} + +func (x NetworkAcknowledgement_Status) String() string { + return proto.EnumName(NetworkAcknowledgement_Status_name, int32(x)) +} +func (NetworkAcknowledgement_Status) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{8, 0} +} + +// The connect message from a client to the server +type ConnectMessage struct { + Identity string `protobuf:"bytes,1,opt,name=identity" json:"identity,omitempty"` + Endpoint string `protobuf:"bytes,2,opt,name=endpoint" json:"endpoint,omitempty"` +} + +func (m *ConnectMessage) Reset() { *m = ConnectMessage{} } +func (m *ConnectMessage) String() string { return proto.CompactTextString(m) } +func (*ConnectMessage) ProtoMessage() {} +func (*ConnectMessage) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *ConnectMessage) GetIdentity() string { + if m != nil { + return m.Identity + } + return "" +} + +func (m *ConnectMessage) GetEndpoint() string { + if m != nil { + return m.Endpoint + } + return "" +} + +// The disconnect message from a client to the server +type DisconnectMessage struct { + Identity string `protobuf:"bytes,1,opt,name=identity" json:"identity,omitempty"` +} + +func (m *DisconnectMessage) Reset() { *m = DisconnectMessage{} } +func (m *DisconnectMessage) String() string { return proto.CompactTextString(m) } +func (*DisconnectMessage) ProtoMessage() {} +func (*DisconnectMessage) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *DisconnectMessage) GetIdentity() string { + if m != nil { + return m.Identity + } + return "" +} + +// The registration request from a peer to the validator +type PeerRegisterRequest struct { + Identity string `protobuf:"bytes,1,opt,name=identity" json:"identity,omitempty"` + Endpoint string `protobuf:"bytes,2,opt,name=endpoint" json:"endpoint,omitempty"` +} + +func (m *PeerRegisterRequest) Reset() { *m = PeerRegisterRequest{} } +func (m *PeerRegisterRequest) String() string { return proto.CompactTextString(m) } +func (*PeerRegisterRequest) ProtoMessage() {} +func (*PeerRegisterRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *PeerRegisterRequest) GetIdentity() string { + if m != nil { + return m.Identity + } + return "" +} + +func (m *PeerRegisterRequest) GetEndpoint() string { + if m != nil { + return m.Endpoint + } + return "" +} + +// The unregistration request from a peer to the validator +type PeerUnregisterRequest struct { + Identity string `protobuf:"bytes,1,opt,name=identity" json:"identity,omitempty"` +} + +func (m *PeerUnregisterRequest) Reset() { *m = PeerUnregisterRequest{} } +func (m *PeerUnregisterRequest) String() string { return proto.CompactTextString(m) } +func (*PeerUnregisterRequest) ProtoMessage() {} +func (*PeerUnregisterRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *PeerUnregisterRequest) GetIdentity() string { + if m != nil { + return m.Identity + } + return "" +} + +type GetPeersRequest struct { + Identity string `protobuf:"bytes,1,opt,name=identity" json:"identity,omitempty"` +} + +func (m *GetPeersRequest) Reset() { *m = GetPeersRequest{} } +func (m *GetPeersRequest) String() string { return proto.CompactTextString(m) } +func (*GetPeersRequest) ProtoMessage() {} +func (*GetPeersRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *GetPeersRequest) GetIdentity() string { + if m != nil { + return m.Identity + } + return "" +} + +type GetPeersResponse struct { + PeerEndpoints []string `protobuf:"bytes,1,rep,name=peer_endpoints,json=peerEndpoints" json:"peer_endpoints,omitempty"` +} + +func (m *GetPeersResponse) Reset() { *m = GetPeersResponse{} } +func (m *GetPeersResponse) String() string { return proto.CompactTextString(m) } +func (*GetPeersResponse) ProtoMessage() {} +func (*GetPeersResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *GetPeersResponse) GetPeerEndpoints() []string { + if m != nil { + return m.PeerEndpoints + } + return nil +} + +type PingRequest struct { +} + +func (m *PingRequest) Reset() { *m = PingRequest{} } +func (m *PingRequest) String() string { return proto.CompactTextString(m) } +func (*PingRequest) ProtoMessage() {} +func (*PingRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +type GossipMessage struct { + Content []byte `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` + ContentType string `protobuf:"bytes,2,opt,name=content_type,json=contentType" json:"content_type,omitempty"` +} + +func (m *GossipMessage) Reset() { *m = GossipMessage{} } +func (m *GossipMessage) String() string { return proto.CompactTextString(m) } +func (*GossipMessage) ProtoMessage() {} +func (*GossipMessage) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *GossipMessage) GetContent() []byte { + if m != nil { + return m.Content + } + return nil +} + +func (m *GossipMessage) GetContentType() string { + if m != nil { + return m.ContentType + } + return "" +} + +// A response sent from the validator to the peer acknowledging message +// receipt +type NetworkAcknowledgement struct { + Status NetworkAcknowledgement_Status `protobuf:"varint,1,opt,name=status,enum=NetworkAcknowledgement_Status" json:"status,omitempty"` +} + +func (m *NetworkAcknowledgement) Reset() { *m = NetworkAcknowledgement{} } +func (m *NetworkAcknowledgement) String() string { return proto.CompactTextString(m) } +func (*NetworkAcknowledgement) ProtoMessage() {} +func (*NetworkAcknowledgement) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *NetworkAcknowledgement) GetStatus() NetworkAcknowledgement_Status { + if m != nil { + return m.Status + } + return NetworkAcknowledgement_OK +} + +type GossipBlockRequest struct { + // The id of the block that is being requested + BlockId string `protobuf:"bytes,1,opt,name=block_id,json=blockId" json:"block_id,omitempty"` + // The identity of the validator that is requesting the block + NodeId []byte `protobuf:"bytes,2,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` + // A random string that provides uniqueness for requests with + // otherwise identical fields. + Nonce string `protobuf:"bytes,3,opt,name=nonce" json:"nonce,omitempty"` +} + +func (m *GossipBlockRequest) Reset() { *m = GossipBlockRequest{} } +func (m *GossipBlockRequest) String() string { return proto.CompactTextString(m) } +func (*GossipBlockRequest) ProtoMessage() {} +func (*GossipBlockRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *GossipBlockRequest) GetBlockId() string { + if m != nil { + return m.BlockId + } + return "" +} + +func (m *GossipBlockRequest) GetNodeId() []byte { + if m != nil { + return m.NodeId + } + return nil +} + +func (m *GossipBlockRequest) GetNonce() string { + if m != nil { + return m.Nonce + } + return "" +} + +type GossipBlockResponse struct { + // The block + Content []byte `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` + // The identity of the validator that requested the block + NodeId []byte `protobuf:"bytes,2,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` +} + +func (m *GossipBlockResponse) Reset() { *m = GossipBlockResponse{} } +func (m *GossipBlockResponse) String() string { return proto.CompactTextString(m) } +func (*GossipBlockResponse) ProtoMessage() {} +func (*GossipBlockResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +func (m *GossipBlockResponse) GetContent() []byte { + if m != nil { + return m.Content + } + return nil +} + +func (m *GossipBlockResponse) GetNodeId() []byte { + if m != nil { + return m.NodeId + } + return nil +} + +type GossipBatchResponse struct { + // The batch + Content []byte `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` + // The identity of the validator that requested the batch + NodeId []byte `protobuf:"bytes,2,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` +} + +func (m *GossipBatchResponse) Reset() { *m = GossipBatchResponse{} } +func (m *GossipBatchResponse) String() string { return proto.CompactTextString(m) } +func (*GossipBatchResponse) ProtoMessage() {} +func (*GossipBatchResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } + +func (m *GossipBatchResponse) GetContent() []byte { + if m != nil { + return m.Content + } + return nil +} + +func (m *GossipBatchResponse) GetNodeId() []byte { + if m != nil { + return m.NodeId + } + return nil +} + +type GossipBatchByBatchIdRequest struct { + // The id of the batch that is being requested + Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + // The identity of the validator that is requesting the batch + NodeId []byte `protobuf:"bytes,2,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` + // A random string that provides uniqueness for requests with + // otherwise identical fields. + Nonce string `protobuf:"bytes,3,opt,name=nonce" json:"nonce,omitempty"` +} + +func (m *GossipBatchByBatchIdRequest) Reset() { *m = GossipBatchByBatchIdRequest{} } +func (m *GossipBatchByBatchIdRequest) String() string { return proto.CompactTextString(m) } +func (*GossipBatchByBatchIdRequest) ProtoMessage() {} +func (*GossipBatchByBatchIdRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } + +func (m *GossipBatchByBatchIdRequest) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *GossipBatchByBatchIdRequest) GetNodeId() []byte { + if m != nil { + return m.NodeId + } + return nil +} + +func (m *GossipBatchByBatchIdRequest) GetNonce() string { + if m != nil { + return m.Nonce + } + return "" +} + +type GossipBatchByTransactionIdRequest struct { + // The id's of the transaction that are in the batches requested + Ids []string `protobuf:"bytes,1,rep,name=ids" json:"ids,omitempty"` + // The identity of the validator that is requesting the batches + NodeId []byte `protobuf:"bytes,2,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` + // A random string that provides uniqueness for requests with + // otherwise identical fields. + Nonce string `protobuf:"bytes,3,opt,name=nonce" json:"nonce,omitempty"` +} + +func (m *GossipBatchByTransactionIdRequest) Reset() { *m = GossipBatchByTransactionIdRequest{} } +func (m *GossipBatchByTransactionIdRequest) String() string { return proto.CompactTextString(m) } +func (*GossipBatchByTransactionIdRequest) ProtoMessage() {} +func (*GossipBatchByTransactionIdRequest) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{13} +} + +func (m *GossipBatchByTransactionIdRequest) GetIds() []string { + if m != nil { + return m.Ids + } + return nil +} + +func (m *GossipBatchByTransactionIdRequest) GetNodeId() []byte { + if m != nil { + return m.NodeId + } + return nil +} + +func (m *GossipBatchByTransactionIdRequest) GetNonce() string { + if m != nil { + return m.Nonce + } + return "" +} + +func init() { + proto.RegisterType((*ConnectMessage)(nil), "ConnectMessage") + proto.RegisterType((*DisconnectMessage)(nil), "DisconnectMessage") + proto.RegisterType((*PeerRegisterRequest)(nil), "PeerRegisterRequest") + proto.RegisterType((*PeerUnregisterRequest)(nil), "PeerUnregisterRequest") + proto.RegisterType((*GetPeersRequest)(nil), "GetPeersRequest") + proto.RegisterType((*GetPeersResponse)(nil), "GetPeersResponse") + proto.RegisterType((*PingRequest)(nil), "PingRequest") + proto.RegisterType((*GossipMessage)(nil), "GossipMessage") + proto.RegisterType((*NetworkAcknowledgement)(nil), "NetworkAcknowledgement") + proto.RegisterType((*GossipBlockRequest)(nil), "GossipBlockRequest") + proto.RegisterType((*GossipBlockResponse)(nil), "GossipBlockResponse") + proto.RegisterType((*GossipBatchResponse)(nil), "GossipBatchResponse") + proto.RegisterType((*GossipBatchByBatchIdRequest)(nil), "GossipBatchByBatchIdRequest") + proto.RegisterType((*GossipBatchByTransactionIdRequest)(nil), "GossipBatchByTransactionIdRequest") + proto.RegisterEnum("NetworkAcknowledgement_Status", NetworkAcknowledgement_Status_name, NetworkAcknowledgement_Status_value) +} + +func init() { proto.RegisterFile("sawtooth_sdk/protobuf/network_pb2/network.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 463 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xa4, 0x54, 0xdf, 0x6b, 0x13, 0x41, + 0x10, 0x36, 0x09, 0xbd, 0xb4, 0x93, 0x26, 0xc6, 0xab, 0xd5, 0x68, 0x41, 0xec, 0x82, 0xe2, 0x8b, + 0x17, 0x68, 0x41, 0xf0, 0xd1, 0x68, 0xa9, 0x45, 0x6b, 0xc3, 0x59, 0x5f, 0x44, 0x3c, 0x2e, 0xb7, + 0x63, 0xba, 0x5c, 0xbb, 0x7b, 0xde, 0x4e, 0x08, 0xf9, 0xef, 0xdd, 0xdd, 0xbb, 0x6d, 0x53, 0xb0, + 0x90, 0xe8, 0xd3, 0xce, 0x37, 0x3f, 0xbe, 0xd9, 0xf9, 0x76, 0x19, 0x18, 0xea, 0x74, 0x4e, 0x4a, + 0xd1, 0x45, 0xa2, 0x79, 0x3e, 0x2c, 0x4a, 0x45, 0x6a, 0x32, 0xfb, 0x35, 0x94, 0x48, 0x73, 0x55, + 0xe6, 0x49, 0x31, 0x39, 0xf0, 0x76, 0xe4, 0x82, 0xec, 0x23, 0xf4, 0xde, 0x2b, 0x29, 0x31, 0xa3, + 0x53, 0xd4, 0x3a, 0x9d, 0x62, 0xf8, 0x14, 0x36, 0x05, 0x47, 0x49, 0x82, 0x16, 0x83, 0xc6, 0xf3, + 0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 0xd8, 0x38, 0x8a, 0xe3, 0xb3, 0xb8, 0xdf, 0x60, 0x3f, 0x21, 0xac, + 0x2e, 0x3f, 0xba, 0x54, 0x59, 0xee, 0x85, 0x7b, 0x02, 0x9b, 0x13, 0x8b, 0x13, 0xc1, 0x6b, 0xe1, + 0xda, 0x0e, 0x9f, 0xf0, 0xf0, 0x31, 0xb4, 0xa5, 0xe2, 0x68, 0x23, 0x4d, 0x37, 0x5c, 0x60, 0xa1, + 0x09, 0x3c, 0x84, 0x0d, 0xa9, 0x64, 0x86, 0x83, 0x96, 0x2b, 0xa8, 0x80, 0xf9, 0x94, 0x3b, 0xb7, + 0xf8, 0x6b, 0xa5, 0xef, 0x96, 0xe8, 0x2e, 0xfe, 0x25, 0xa6, 0x94, 0xb2, 0x8b, 0xff, 0x61, 0xfa, + 0x01, 0x7b, 0x4b, 0x4c, 0xa3, 0x85, 0x3b, 0x4e, 0xb8, 0x1f, 0xbe, 0x07, 0xcd, 0xeb, 0xb1, 0x8d, + 0xb5, 0xee, 0xc4, 0x1c, 0xf6, 0x6f, 0xb1, 0x9f, 0x97, 0xa9, 0xd4, 0x69, 0x46, 0x42, 0xc9, 0x9b, + 0x1e, 0x7d, 0x68, 0x09, 0xee, 0xbf, 0x97, 0x35, 0xd7, 0xec, 0x32, 0x7a, 0x09, 0xbb, 0x7e, 0x3f, + 0x44, 0x66, 0x3f, 0x44, 0x7e, 0x3f, 0x8c, 0x1b, 0xdf, 0x3b, 0x4b, 0x2b, 0x62, 0x12, 0xb8, 0xc0, + 0xe1, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x93, 0xaf, 0x43, 0x31, 0x4e, 0x04, 0x00, 0x00, +} diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/processor_pb2/processor.pb.go b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/processor_pb2/processor.pb.go new file mode 100644 index 00000000..527497a3 --- /dev/null +++ b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/processor_pb2/processor.pb.go @@ -0,0 +1,380 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: sawtooth_sdk/protobuf/processor_pb2/processor.proto + +/* +Package processor_pb2 is a generated protocol buffer package. + +It is generated from these files: + sawtooth_sdk/protobuf/processor_pb2/processor.proto + +It has these top-level messages: + TpRegisterRequest + TpRegisterResponse + TpUnregisterRequest + TpUnregisterResponse + TpProcessRequest + TpProcessResponse + TpPing + TpPingResponse +*/ +package processor_pb2 + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +type TpRegisterResponse_Status int32 + +const ( + TpRegisterResponse_OK TpRegisterResponse_Status = 0 + TpRegisterResponse_ERROR TpRegisterResponse_Status = 1 +) + +var TpRegisterResponse_Status_name = map[int32]string{ + 0: "OK", + 1: "ERROR", +} +var TpRegisterResponse_Status_value = map[string]int32{ + "OK": 0, + "ERROR": 1, +} + +func (x TpRegisterResponse_Status) String() string { + return proto.EnumName(TpRegisterResponse_Status_name, int32(x)) +} +func (TpRegisterResponse_Status) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{1, 0} } + +type TpUnregisterResponse_Status int32 + +const ( + TpUnregisterResponse_OK TpUnregisterResponse_Status = 0 + TpUnregisterResponse_ERROR TpUnregisterResponse_Status = 1 +) + +var TpUnregisterResponse_Status_name = map[int32]string{ + 0: "OK", + 1: "ERROR", +} +var TpUnregisterResponse_Status_value = map[string]int32{ + "OK": 0, + "ERROR": 1, +} + +func (x TpUnregisterResponse_Status) String() string { + return proto.EnumName(TpUnregisterResponse_Status_name, int32(x)) +} +func (TpUnregisterResponse_Status) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{3, 0} +} + +type TpProcessResponse_Status int32 + +const ( + TpProcessResponse_OK TpProcessResponse_Status = 0 + TpProcessResponse_INVALID_TRANSACTION TpProcessResponse_Status = 1 + TpProcessResponse_INTERNAL_ERROR TpProcessResponse_Status = 2 +) + +var TpProcessResponse_Status_name = map[int32]string{ + 0: "OK", + 1: "INVALID_TRANSACTION", + 2: "INTERNAL_ERROR", +} +var TpProcessResponse_Status_value = map[string]int32{ + "OK": 0, + "INVALID_TRANSACTION": 1, + "INTERNAL_ERROR": 2, +} + +func (x TpProcessResponse_Status) String() string { + return proto.EnumName(TpProcessResponse_Status_name, int32(x)) +} +func (TpProcessResponse_Status) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{5, 0} } + +type TpPingResponse_Status int32 + +const ( + TpPingResponse_OK TpPingResponse_Status = 0 + TpPingResponse_ERROR TpPingResponse_Status = 1 +) + +var TpPingResponse_Status_name = map[int32]string{ + 0: "OK", + 1: "ERROR", +} +var TpPingResponse_Status_value = map[string]int32{ + "OK": 0, + "ERROR": 1, +} + +func (x TpPingResponse_Status) String() string { + return proto.EnumName(TpPingResponse_Status_name, int32(x)) +} +func (TpPingResponse_Status) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{7, 0} } + +// The registration request from the transaction processor to the +// validator/executor +type TpRegisterRequest struct { + // A settled upon name for the capabilities of the transaction processor. + // For example: intkey, xo + Family string `protobuf:"bytes,1,opt,name=family" json:"family,omitempty"` + // The version supported. For example: + // 1.0 for version 1.0 + // 2.1 for version 2.1 + Version string `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"` + // The supported encodings. + // 'application/cbor', 'application/protobuf', etc + Encoding string `protobuf:"bytes,3,opt,name=encoding" json:"encoding,omitempty"` + // The namespaces this transaction processor expects to interact with + // when processing transations matching this specification; will be + // enforced by the state API on the validator. + Namespaces []string `protobuf:"bytes,4,rep,name=namespaces" json:"namespaces,omitempty"` +} + +func (m *TpRegisterRequest) Reset() { *m = TpRegisterRequest{} } +func (m *TpRegisterRequest) String() string { return proto.CompactTextString(m) } +func (*TpRegisterRequest) ProtoMessage() {} +func (*TpRegisterRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *TpRegisterRequest) GetFamily() string { + if m != nil { + return m.Family + } + return "" +} + +func (m *TpRegisterRequest) GetVersion() string { + if m != nil { + return m.Version + } + return "" +} + +func (m *TpRegisterRequest) GetEncoding() string { + if m != nil { + return m.Encoding + } + return "" +} + +func (m *TpRegisterRequest) GetNamespaces() []string { + if m != nil { + return m.Namespaces + } + return nil +} + +// A response sent from the validator to the transaction processor +// acknowledging the registration +type TpRegisterResponse struct { + Status TpRegisterResponse_Status `protobuf:"varint,1,opt,name=status,enum=TpRegisterResponse_Status" json:"status,omitempty"` +} + +func (m *TpRegisterResponse) Reset() { *m = TpRegisterResponse{} } +func (m *TpRegisterResponse) String() string { return proto.CompactTextString(m) } +func (*TpRegisterResponse) ProtoMessage() {} +func (*TpRegisterResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *TpRegisterResponse) GetStatus() TpRegisterResponse_Status { + if m != nil { + return m.Status + } + return TpRegisterResponse_OK +} + +// The unregistration request from the transaction processor to the +// validator/executor. The correct handlers are determined from the +// zeromq identity of the tp, on the validator side. +type TpUnregisterRequest struct { +} + +func (m *TpUnregisterRequest) Reset() { *m = TpUnregisterRequest{} } +func (m *TpUnregisterRequest) String() string { return proto.CompactTextString(m) } +func (*TpUnregisterRequest) ProtoMessage() {} +func (*TpUnregisterRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +// A response sent from the validator to the transaction processor +// acknowledging the unregistration +type TpUnregisterResponse struct { + Status TpUnregisterResponse_Status `protobuf:"varint,1,opt,name=status,enum=TpUnregisterResponse_Status" json:"status,omitempty"` +} + +func (m *TpUnregisterResponse) Reset() { *m = TpUnregisterResponse{} } +func (m *TpUnregisterResponse) String() string { return proto.CompactTextString(m) } +func (*TpUnregisterResponse) ProtoMessage() {} +func (*TpUnregisterResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *TpUnregisterResponse) GetStatus() TpUnregisterResponse_Status { + if m != nil { + return m.Status + } + return TpUnregisterResponse_OK +} + +// The request from the validator/executor of the transaction processor +// to verify a transaction. +type TpProcessRequest struct { + Header []byte `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` + Signature string `protobuf:"bytes,3,opt,name=signature" json:"signature,omitempty"` + ContextId string `protobuf:"bytes,4,opt,name=context_id,json=contextId" json:"context_id,omitempty"` +} + +func (m *TpProcessRequest) Reset() { *m = TpProcessRequest{} } +func (m *TpProcessRequest) String() string { return proto.CompactTextString(m) } +func (*TpProcessRequest) ProtoMessage() {} +func (*TpProcessRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *TpProcessRequest) GetHeader() []byte { + if m != nil { + return m.Header + } + return nil +} + +func (m *TpProcessRequest) GetPayload() []byte { + if m != nil { + return m.Payload + } + return nil +} + +func (m *TpProcessRequest) GetSignature() string { + if m != nil { + return m.Signature + } + return "" +} + +func (m *TpProcessRequest) GetContextId() string { + if m != nil { + return m.ContextId + } + return "" +} + +// The response from the transaction processor to the validator/executor +// used to respond about the validity of a transaction +type TpProcessResponse struct { + Status TpProcessResponse_Status `protobuf:"varint,1,opt,name=status,enum=TpProcessResponse_Status" json:"status,omitempty"` + // A message to include on responses in the cases where + // status is either INVALID_TRANSACTION or INTERNAL_ERROR + Message string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"` + // Information that may be included with the response. + // This information is an opaque, application-specific encoded block of + // data that will be propagated back to the transaction submitter. + ExtendedData []byte `protobuf:"bytes,3,opt,name=extended_data,json=extendedData,proto3" json:"extended_data,omitempty"` +} + +func (m *TpProcessResponse) Reset() { *m = TpProcessResponse{} } +func (m *TpProcessResponse) String() string { return proto.CompactTextString(m) } +func (*TpProcessResponse) ProtoMessage() {} +func (*TpProcessResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *TpProcessResponse) GetStatus() TpProcessResponse_Status { + if m != nil { + return m.Status + } + return TpProcessResponse_OK +} + +func (m *TpProcessResponse) GetMessage() string { + if m != nil { + return m.Message + } + return "" +} + +func (m *TpProcessResponse) GetExtendedData() []byte { + if m != nil { + return m.ExtendedData + } + return nil +} + +type TpPing struct { +} + +func (m *TpPing) Reset() { *m = TpPing{} } +func (m *TpPing) String() string { return proto.CompactTextString(m) } +func (*TpPing) ProtoMessage() {} +func (*TpPing) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +type TpPingResponse struct { + Status TpPingResponse_Status `protobuf:"varint,1,opt,name=status,enum=TpPingResponse_Status" json:"status,omitempty"` +} + +func (m *TpPingResponse) Reset() { *m = TpPingResponse{} } +func (m *TpPingResponse) String() string { return proto.CompactTextString(m) } +func (*TpPingResponse) ProtoMessage() {} +func (*TpPingResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *TpPingResponse) GetStatus() TpPingResponse_Status { + if m != nil { + return m.Status + } + return TpPingResponse_OK +} + +func init() { + proto.RegisterType((*TpRegisterRequest)(nil), "TpRegisterRequest") + proto.RegisterType((*TpRegisterResponse)(nil), "TpRegisterResponse") + proto.RegisterType((*TpUnregisterRequest)(nil), "TpUnregisterRequest") + proto.RegisterType((*TpUnregisterResponse)(nil), "TpUnregisterResponse") + proto.RegisterType((*TpProcessRequest)(nil), "TpProcessRequest") + proto.RegisterType((*TpProcessResponse)(nil), "TpProcessResponse") + proto.RegisterType((*TpPing)(nil), "TpPing") + proto.RegisterType((*TpPingResponse)(nil), "TpPingResponse") + proto.RegisterEnum("TpRegisterResponse_Status", TpRegisterResponse_Status_name, TpRegisterResponse_Status_value) + proto.RegisterEnum("TpUnregisterResponse_Status", TpUnregisterResponse_Status_name, TpUnregisterResponse_Status_value) + proto.RegisterEnum("TpProcessResponse_Status", TpProcessResponse_Status_name, TpProcessResponse_Status_value) + proto.RegisterEnum("TpPingResponse_Status", TpPingResponse_Status_name, TpPingResponse_Status_value) +} + +func init() { + proto.RegisterFile("sawtooth_sdk/protobuf/processor_pb2/processor.proto", fileDescriptor0) +} + +var fileDescriptor0 = []byte{ + // 453 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x94, 0x53, 0xc1, 0x6e, 0x13, 0x31, + 0x10, 0x65, 0x53, 0x58, 0x9a, 0x51, 0x1a, 0x05, 0x97, 0x96, 0xa5, 0x14, 0x54, 0x99, 0x4b, 0x4f, + 0x46, 0xa4, 0x5c, 0x39, 0x04, 0xda, 0xc3, 0x8a, 0x6a, 0x53, 0xb9, 0x0b, 0x07, 0x24, 0xb4, 0x72, + 0xe2, 0x69, 0xba, 0xa2, 0xb5, 0x97, 0xb5, 0x03, 0xf4, 0xc8, 0xbf, 0xf1, 0x61, 0x38, 0xce, 0x6e, + 0x9a, 0x6c, 0xb8, 0xe4, 0xe6, 0xf7, 0xe6, 0x49, 0xf3, 0xe6, 0x8d, 0x07, 0x4e, 0x8c, 0xf8, 0x65, + 0xb5, 0xb6, 0xd7, 0x99, 0x91, 0xdf, 0xdf, 0x14, 0xa5, 0xb6, 0x7a, 0x34, 0xbd, 0x9a, 0x3d, 0xc6, + 0x68, 0x8c, 0x2e, 0xb3, 0x62, 0xd4, 0xbf, 0x47, 0xcc, 0x0b, 0xe8, 0x9f, 0x00, 0x9e, 0xa4, 0x05, + 0xc7, 0x49, 0x6e, 0x2c, 0x96, 0x1c, 0x7f, 0x4c, 0xd1, 0x58, 0xb2, 0x0f, 0xe1, 0x95, 0xb8, 0xcd, + 0x6f, 0xee, 0xa2, 0xe0, 0x28, 0x38, 0x6e, 0xf3, 0x0a, 0x91, 0x08, 0x1e, 0xff, 0xc4, 0xd2,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 0x6b, 0x9a, 0xc6, 0xa4, 0x33, 0x7f, 0x6e, 0x83, 0x46, 0x4c, 0xb0, 0xfe, + 0x0b, 0x15, 0x24, 0xaf, 0x61, 0xc7, 0xf5, 0x42, 0x25, 0x51, 0x66, 0x52, 0x58, 0xe1, 0x3d, 0x76, + 0x78, 0xa7, 0x26, 0x4f, 0x1d, 0x47, 0xdf, 0xaf, 0x05, 0xf5, 0x0c, 0x76, 0xe3, 0xe4, 0xcb, 0xe0, + 0x3c, 0x3e, 0xcd, 0x52, 0x3e, 0x48, 0x2e, 0x07, 0x1f, 0xd3, 0x78, 0x98, 0xf4, 0x02, 0x42, 0xa0, + 0x1b, 0x27, 0xe9, 0x19, 0x4f, 0x06, 0xe7, 0xd9, 0x3c, 0xca, 0x16, 0xdd, 0x86, 0xd0, 0x39, 0x74, + 0xbf, 0x8b, 0x7e, 0x83, 0xee, 0xfc, 0xb5, 0x18, 0x86, 0x35, 0x86, 0xd9, 0x67, 0xab, 0x82, 0x4d, + 0x76, 0xf6, 0xe1, 0x18, 0xf6, 0xea, 0xbb, 0x62, 0xee, 0xae, 0x58, 0x7d, 0x57, 0x17, 0xc1, 0xd7, + 0x9d, 0x95, 0xd3, 0x1a, 0x85, 0xbe, 0x74, 0xf2, 0x2f, 0x00, 0x00, 0xff, 0xff, 0xd7, 0xf2, 0x83, + 0x01, 0x88, 0x03, 0x00, 0x00, +} diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/setting_pb2/setting.pb.go b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/setting_pb2/setting.pb.go new file mode 100644 index 00000000..88e60639 --- /dev/null +++ b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/setting_pb2/setting.pb.go @@ -0,0 +1,92 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: sawtooth_sdk/protobuf/setting_pb2/setting.proto + +/* +Package setting_pb2 is a generated protocol buffer package. + +It is generated from these files: + sawtooth_sdk/protobuf/setting_pb2/setting.proto + +It has these top-level messages: + Setting +*/ +package setting_pb2 + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +// Setting Container for on-chain configuration key/value pairs +type Setting struct { + // List of setting entries - more than one implies a state key collision + Entries []*Setting_Entry `protobuf:"bytes,1,rep,name=entries" json:"entries,omitempty"` +} + +func (m *Setting) Reset() { *m = Setting{} } +func (m *Setting) String() string { return proto.CompactTextString(m) } +func (*Setting) ProtoMessage() {} +func (*Setting) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *Setting) GetEntries() []*Setting_Entry { + if m != nil { + return m.Entries + } + return nil +} + +// Contains a setting entry (or entries, in the case of collisions). +type Setting_Entry struct { + Key string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` +} + +func (m *Setting_Entry) Reset() { *m = Setting_Entry{} } +func (m *Setting_Entry) String() string { return proto.CompactTextString(m) } +func (*Setting_Entry) ProtoMessage() {} +func (*Setting_Entry) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 0} } + +func (m *Setting_Entry) GetKey() string { + if m != nil { + return m.Key + } + return "" +} + +func (m *Setting_Entry) GetValue() string { + if m != nil { + return m.Value + } + return "" +} + +func init() { + proto.RegisterType((*Setting)(nil), "Setting") + proto.RegisterType((*Setting_Entry)(nil), "Setting.Entry") +} + +func init() { proto.RegisterFile("sawtooth_sdk/protobuf/setting_pb2/setting.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 159 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xd2, 0x2f, 0x4e, 0x2c, 0x2f, + 0xc9, 0xcf, 0x2f, 0xc9, 0x88, 0x2f, 0x4e, 0xc9, 0xd6, 0x2f, 0x28, 0xca, 0x2f, 0xc9, 0x4f, 0x2a, + 0x4d, 0xd3, 0x2f, 0x4e, 0x2d, 0x29, 0xc9, 0xcc, 0x4b, 0x8f, 0x2f, 0x48, 0x32, 0x82, 0xb1, 0xf5, + 0xc0, 0x92, 0x4a, 0x29, 0x5c, 0xec, 0xc1, 0x10, 0x01, 0x21, 0x0d, 0x2e, 0xf6, 0xd4, 0xbc, 0x92, + 0xa2, 0xcc, 0xd4, 0x62, 0x09, 0x46, 0x05, 0x66, 0x0d, 0x6e, 0x23, 0x3e, 0x3d, 0xa8, 0x94, 0x9e, + 0x2b, 0x50, 0xbc, 0x32, 0x08, 0x26, 0x2d, 0xa5, 0xcf, 0xc5, 0x0a, 0x16, 0x11, 0x12, 0xe0, 0x62, + 0xce, 0x4e, 0xad, 0x04, 0x2a, 0x67, 0xd4, 0xe0, 0x0c, 0x02, 0x31, 0x85, 0x44, 0xb8, 0x58, 0xcb, + 0x12, 0x73, 0x4a, 0x53, 0x25, 0x98, 0xc0, 0x62, 0x10, 0x8e, 0x93, 0x1a, 0x97, 0x28, 0xcc, 0x61, + 0x7a, 0x40, 0x87, 0xe9, 0xc1, 0x1c, 0x16, 0xc0, 0x18, 0xc5, 0x8d, 0xe4, 0xb6, 0x24, 0x36, 0xb0, + 0x84, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x06, 0x0d, 0xef, 0x1f, 0xc7, 0x00, 0x00, 0x00, +} diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/state_context_pb2/state_context.pb.go b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/state_context_pb2/state_context.pb.go new file mode 100644 index 00000000..781d7b15 --- /dev/null +++ b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/state_context_pb2/state_context.pb.go @@ -0,0 +1,476 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: sawtooth_sdk/protobuf/state_context_pb2/state_context.proto + +/* +Package state_context_pb2 is a generated protocol buffer package. + +It is generated from these files: + sawtooth_sdk/protobuf/state_context_pb2/state_context.proto + +It has these top-level messages: + Entry + TpStateGetRequest + TpStateGetResponse + TpStateSetRequest + TpStateSetResponse + TpStateDeleteRequest + TpStateDeleteResponse + TpAddReceiptDataRequest + TpAddReceiptDataResponse + TpAddEventRequest + TpAddEventResponse +*/ +package state_context_pb2 + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import events "sawtooth_sdk/protobuf/events_pb2" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +type TpStateGetResponse_Status int32 + +const ( + TpStateGetResponse_OK TpStateGetResponse_Status = 0 + TpStateGetResponse_AUTHORIZATION_ERROR TpStateGetResponse_Status = 1 +) + +var TpStateGetResponse_Status_name = map[int32]string{ + 0: "OK", + 1: "AUTHORIZATION_ERROR", +} +var TpStateGetResponse_Status_value = map[string]int32{ + "OK": 0, + "AUTHORIZATION_ERROR": 1, +} + +func (x TpStateGetResponse_Status) String() string { + return proto.EnumName(TpStateGetResponse_Status_name, int32(x)) +} +func (TpStateGetResponse_Status) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{2, 0} } + +type TpStateSetResponse_Status int32 + +const ( + TpStateSetResponse_OK TpStateSetResponse_Status = 0 + TpStateSetResponse_AUTHORIZATION_ERROR TpStateSetResponse_Status = 1 +) + +var TpStateSetResponse_Status_name = map[int32]string{ + 0: "OK", + 1: "AUTHORIZATION_ERROR", +} +var TpStateSetResponse_Status_value = map[string]int32{ + "OK": 0, + "AUTHORIZATION_ERROR": 1, +} + +func (x TpStateSetResponse_Status) String() string { + return proto.EnumName(TpStateSetResponse_Status_name, int32(x)) +} +func (TpStateSetResponse_Status) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{4, 0} } + +type TpStateDeleteResponse_Status int32 + +const ( + TpStateDeleteResponse_OK TpStateDeleteResponse_Status = 0 + TpStateDeleteResponse_AUTHORIZATION_ERROR TpStateDeleteResponse_Status = 1 +) + +var TpStateDeleteResponse_Status_name = map[int32]string{ + 0: "OK", + 1: "AUTHORIZATION_ERROR", +} +var TpStateDeleteResponse_Status_value = map[string]int32{ + "OK": 0, + "AUTHORIZATION_ERROR": 1, +} + +func (x TpStateDeleteResponse_Status) String() string { + return proto.EnumName(TpStateDeleteResponse_Status_name, int32(x)) +} +func (TpStateDeleteResponse_Status) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{6, 0} +} + +type TpAddReceiptDataResponse_Status int32 + +const ( + TpAddReceiptDataResponse_OK TpAddReceiptDataResponse_Status = 0 + TpAddReceiptDataResponse_ERROR TpAddReceiptDataResponse_Status = 1 +) + +var TpAddReceiptDataResponse_Status_name = map[int32]string{ + 0: "OK", + 1: "ERROR", +} +var TpAddReceiptDataResponse_Status_value = map[string]int32{ + "OK": 0, + "ERROR": 1, +} + +func (x TpAddReceiptDataResponse_Status) String() string { + return proto.EnumName(TpAddReceiptDataResponse_Status_name, int32(x)) +} +func (TpAddReceiptDataResponse_Status) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{8, 0} +} + +type TpAddEventResponse_Status int32 + +const ( + TpAddEventResponse_OK TpAddEventResponse_Status = 0 + TpAddEventResponse_ERROR TpAddEventResponse_Status = 1 +) + +var TpAddEventResponse_Status_name = map[int32]string{ + 0: "OK", + 1: "ERROR", +} +var TpAddEventResponse_Status_value = map[string]int32{ + "OK": 0, + "ERROR": 1, +} + +func (x TpAddEventResponse_Status) String() string { + return proto.EnumName(TpAddEventResponse_Status_name, int32(x)) +} +func (TpAddEventResponse_Status) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{10, 0} +} + +// An entry in the State +type Entry struct { + Address string `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` +} + +func (m *Entry) Reset() { *m = Entry{} } +func (m *Entry) String() string { return proto.CompactTextString(m) } +func (*Entry) ProtoMessage() {} +func (*Entry) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *Entry) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *Entry) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +// A request from a handler/tp for the values at a series of addresses +type TpStateGetRequest struct { + // The context id that references a context in the contextmanager + ContextId string `protobuf:"bytes,1,opt,name=context_id,json=contextId" json:"context_id,omitempty"` + Addresses []string `protobuf:"bytes,2,rep,name=addresses" json:"addresses,omitempty"` +} + +func (m *TpStateGetRequest) Reset() { *m = TpStateGetRequest{} } +func (m *TpStateGetRequest) String() string { return proto.CompactTextString(m) } +func (*TpStateGetRequest) ProtoMessage() {} +func (*TpStateGetRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *TpStateGetRequest) GetContextId() string { + if m != nil { + return m.ContextId + } + return "" +} + +func (m *TpStateGetRequest) GetAddresses() []string { + if m != nil { + return m.Addresses + } + return nil +} + +// A response from the contextmanager/validator with a series of State entries +type TpStateGetResponse struct { + Entries []*Entry `protobuf:"bytes,1,rep,name=entries" json:"entries,omitempty"` + Status TpStateGetResponse_Status `protobuf:"varint,2,opt,name=status,enum=TpStateGetResponse_Status" json:"status,omitempty"` +} + +func (m *TpStateGetResponse) Reset() { *m = TpStateGetResponse{} } +func (m *TpStateGetResponse) String() string { return proto.CompactTextString(m) } +func (*TpStateGetResponse) ProtoMessage() {} +func (*TpStateGetResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *TpStateGetResponse) GetEntries() []*Entry { + if m != nil { + return m.Entries + } + return nil +} + +func (m *TpStateGetResponse) GetStatus() TpStateGetResponse_Status { + if m != nil { + return m.Status + } + return TpStateGetResponse_OK +} + +// A request from the handler/tp to put entries in the state of a context +type TpStateSetRequest struct { + ContextId string `protobuf:"bytes,1,opt,name=context_id,json=contextId" json:"context_id,omitempty"` + Entries []*Entry `protobuf:"bytes,2,rep,name=entries" json:"entries,omitempty"` +} + +func (m *TpStateSetRequest) Reset() { *m = TpStateSetRequest{} } +func (m *TpStateSetRequest) String() string { return proto.CompactTextString(m) } +func (*TpStateSetRequest) ProtoMessage() {} +func (*TpStateSetRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *TpStateSetRequest) GetContextId() string { + if m != nil { + return m.ContextId + } + return "" +} + +func (m *TpStateSetRequest) GetEntries() []*Entry { + if m != nil { + return m.Entries + } + return nil +} + +// A response from the contextmanager/validator with the addresses that were set +type TpStateSetResponse struct { + Addresses []string `protobuf:"bytes,1,rep,name=addresses" json:"addresses,omitempty"` + Status TpStateSetResponse_Status `protobuf:"varint,2,opt,name=status,enum=TpStateSetResponse_Status" json:"status,omitempty"` +} + +func (m *TpStateSetResponse) Reset() { *m = TpStateSetResponse{} } +func (m *TpStateSetResponse) String() string { return proto.CompactTextString(m) } +func (*TpStateSetResponse) ProtoMessage() {} +func (*TpStateSetResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *TpStateSetResponse) GetAddresses() []string { + if m != nil { + return m.Addresses + } + return nil +} + +func (m *TpStateSetResponse) GetStatus() TpStateSetResponse_Status { + if m != nil { + return m.Status + } + return TpStateSetResponse_OK +} + +// A request from the handler/tp to delete state entries at an collection of addresses +type TpStateDeleteRequest struct { + ContextId string `protobuf:"bytes,1,opt,name=context_id,json=contextId" json:"context_id,omitempty"` + Addresses []string `protobuf:"bytes,2,rep,name=addresses" json:"addresses,omitempty"` +} + +func (m *TpStateDeleteRequest) Reset() { *m = TpStateDeleteRequest{} } +func (m *TpStateDeleteRequest) String() string { return proto.CompactTextString(m) } +func (*TpStateDeleteRequest) ProtoMessage() {} +func (*TpStateDeleteRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *TpStateDeleteRequest) GetContextId() string { + if m != nil { + return m.ContextId + } + return "" +} + +func (m *TpStateDeleteRequest) GetAddresses() []string { + if m != nil { + return m.Addresses + } + return nil +} + +// A response form the contextmanager/validator with the addresses that were deleted +type TpStateDeleteResponse struct { + Addresses []string `protobuf:"bytes,1,rep,name=addresses" json:"addresses,omitempty"` + Status TpStateDeleteResponse_Status `protobuf:"varint,2,opt,name=status,enum=TpStateDeleteResponse_Status" json:"status,omitempty"` +} + +func (m *TpStateDeleteResponse) Reset() { *m = TpStateDeleteResponse{} } +func (m *TpStateDeleteResponse) String() string { return proto.CompactTextString(m) } +func (*TpStateDeleteResponse) ProtoMessage() {} +func (*TpStateDeleteResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *TpStateDeleteResponse) GetAddresses() []string { + if m != nil { + return m.Addresses + } + return nil +} + +func (m *TpStateDeleteResponse) GetStatus() TpStateDeleteResponse_Status { + if m != nil { + return m.Status + } + return TpStateDeleteResponse_OK +} + +// The request from the transaction processor to the validator append data +// to a transaction receipt +type TpAddReceiptDataRequest struct { + // The context id that references a context in the contextmanager + ContextId string `protobuf:"bytes,1,opt,name=context_id,json=contextId" json:"context_id,omitempty"` + DataType string `protobuf:"bytes,2,opt,name=data_type,json=dataType" json:"data_type,omitempty"` + Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` +} + +func (m *TpAddReceiptDataRequest) Reset() { *m = TpAddReceiptDataRequest{} } +func (m *TpAddReceiptDataRequest) String() string { return proto.CompactTextString(m) } +func (*TpAddReceiptDataRequest) ProtoMessage() {} +func (*TpAddReceiptDataRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *TpAddReceiptDataRequest) GetContextId() string { + if m != nil { + return m.ContextId + } + return "" +} + +func (m *TpAddReceiptDataRequest) GetDataType() string { + if m != nil { + return m.DataType + } + return "" +} + +func (m *TpAddReceiptDataRequest) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +// The response from the validator to the transaction processor to verify that +// data has been appended to a transaction receipt +type TpAddReceiptDataResponse struct { + Status TpAddReceiptDataResponse_Status `protobuf:"varint,2,opt,name=status,enum=TpAddReceiptDataResponse_Status" json:"status,omitempty"` +} + +func (m *TpAddReceiptDataResponse) Reset() { *m = TpAddReceiptDataResponse{} } +func (m *TpAddReceiptDataResponse) String() string { return proto.CompactTextString(m) } +func (*TpAddReceiptDataResponse) ProtoMessage() {} +func (*TpAddReceiptDataResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *TpAddReceiptDataResponse) GetStatus() TpAddReceiptDataResponse_Status { + if m != nil { + return m.Status + } + return TpAddReceiptDataResponse_OK +} + +type TpAddEventRequest struct { + ContextId string `protobuf:"bytes,1,opt,name=context_id,json=contextId" json:"context_id,omitempty"` + Event *events.Event `protobuf:"bytes,2,opt,name=event" json:"event,omitempty"` +} + +func (m *TpAddEventRequest) Reset() { *m = TpAddEventRequest{} } +func (m *TpAddEventRequest) String() string { return proto.CompactTextString(m) } +func (*TpAddEventRequest) ProtoMessage() {} +func (*TpAddEventRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *TpAddEventRequest) GetContextId() string { + if m != nil { + return m.ContextId + } + return "" +} + +func (m *TpAddEventRequest) GetEvent() *events.Event { + if m != nil { + return m.Event + } + return nil +} + +type TpAddEventResponse struct { + Status TpAddEventResponse_Status `protobuf:"varint,2,opt,name=status,enum=TpAddEventResponse_Status" json:"status,omitempty"` +} + +func (m *TpAddEventResponse) Reset() { *m = TpAddEventResponse{} } +func (m *TpAddEventResponse) String() string { return proto.CompactTextString(m) } +func (*TpAddEventResponse) ProtoMessage() {} +func (*TpAddEventResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +func (m *TpAddEventResponse) GetStatus() TpAddEventResponse_Status { + if m != nil { + return m.Status + } + return TpAddEventResponse_OK +} + +func init() { + proto.RegisterType((*Entry)(nil), "Entry") + proto.RegisterType((*TpStateGetRequest)(nil), "TpStateGetRequest") + proto.RegisterType((*TpStateGetResponse)(nil), "TpStateGetResponse") + proto.RegisterType((*TpStateSetRequest)(nil), "TpStateSetRequest") + proto.RegisterType((*TpStateSetResponse)(nil), "TpStateSetResponse") + proto.RegisterType((*TpStateDeleteRequest)(nil), "TpStateDeleteRequest") + proto.RegisterType((*TpStateDeleteResponse)(nil), "TpStateDeleteResponse") + proto.RegisterType((*TpAddReceiptDataRequest)(nil), "TpAddReceiptDataRequest") + proto.RegisterType((*TpAddReceiptDataResponse)(nil), "TpAddReceiptDataResponse") + proto.RegisterType((*TpAddEventRequest)(nil), "TpAddEventRequest") + proto.RegisterType((*TpAddEventResponse)(nil), "TpAddEventResponse") + proto.RegisterEnum("TpStateGetResponse_Status", TpStateGetResponse_Status_name, TpStateGetResponse_Status_value) + proto.RegisterEnum("TpStateSetResponse_Status", TpStateSetResponse_Status_name, TpStateSetResponse_Status_value) + proto.RegisterEnum("TpStateDeleteResponse_Status", TpStateDeleteResponse_Status_name, TpStateDeleteResponse_Status_value) + proto.RegisterEnum("TpAddReceiptDataResponse_Status", TpAddReceiptDataResponse_Status_name, TpAddReceiptDataResponse_Status_value) + proto.RegisterEnum("TpAddEventResponse_Status", TpAddEventResponse_Status_name, TpAddEventResponse_Status_value) +} + +func init() { + proto.RegisterFile("sawtooth_sdk/protobuf/state_context_pb2/state_context.proto", fileDescriptor0) +} + +var fileDescriptor0 = []byte{ + // 467 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xac, 0x54, 0x51, 0x6b, 0x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xa6, 0xe1, 0x75, 0xc3, 0xe8, 0x98, + 0xde, 0x15, 0xda, 0xf4, 0x7a, 0xd8, 0xf2, 0xea, 0xa9, 0x66, 0xb6, 0xee, 0x4c, 0x83, 0x2a, 0x9e, + 0x99, 0x6e, 0xf6, 0xde, 0x3f, 0xb9, 0x65, 0x66, 0x83, 0x51, 0x62, 0x8a, 0xd6, 0x5c, 0x2e, 0x41, + 0x1f, 0x75, 0xc5, 0xde, 0x30, 0x5a, 0xf9, 0x5d, 0x35, 0xd9, 0x0c, 0xfa, 0x17, 0xe1, 0x6f, 0x5f, + 0xc0, 0x5e, 0x35, 0xc1, 0xa8, 0x9a, 0x60, 0xb4, 0x9a, 0x60, 0xe7, 0xce, 0xc5, 0x6e, 0x6b, 0x02, + 0x2e, 0x5d, 0x73, 0xfc, 0xea, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x34, 0x2a, 0xb1, 0xfa, 0x33, + 0x05, 0x00, 0x00, +} diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/state_delta_pb2/state_delta.pb.go b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/state_delta_pb2/state_delta.pb.go new file mode 100644 index 00000000..89f74aca --- /dev/null +++ b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/state_delta_pb2/state_delta.pb.go @@ -0,0 +1,454 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: sawtooth_sdk/protobuf/state_delta_pb2/state_delta.proto + +/* +Package state_delta_pb2 is a generated protocol buffer package. + +It is generated from these files: + sawtooth_sdk/protobuf/state_delta_pb2/state_delta.proto + +It has these top-level messages: + StateChange + StateDeltaSet + StateDeltaEvent + StateDeltaSubscribeRequest + StateDeltaSubscribeResponse + StateDeltaUnsubscribeRequest + StateDeltaUnsubscribeResponse + StateDeltaGetEventsRequest + StateDeltaGetEventsResponse +*/ +package state_delta_pb2 + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +type StateChange_Type int32 + +const ( + StateChange_SET StateChange_Type = 0 + StateChange_DELETE StateChange_Type = 1 +) + +var StateChange_Type_name = map[int32]string{ + 0: "SET", + 1: "DELETE", +} +var StateChange_Type_value = map[string]int32{ + "SET": 0, + "DELETE": 1, +} + +func (x StateChange_Type) String() string { + return proto.EnumName(StateChange_Type_name, int32(x)) +} +func (StateChange_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 0} } + +type StateDeltaSubscribeResponse_Status int32 + +const ( + // returned on successful registration + StateDeltaSubscribeResponse_OK StateDeltaSubscribeResponse_Status = 0 + // returned on a failed registration, due to + // an internal validator error + StateDeltaSubscribeResponse_INTERNAL_ERROR StateDeltaSubscribeResponse_Status = 1 + // returned on a failed registration, due to all + // last_known_block_ids being unknown. This could imply + // that a fork had occurred and been resolved since last + // unregistration. + StateDeltaSubscribeResponse_UNKNOWN_BLOCK StateDeltaSubscribeResponse_Status = 2 +) + +var StateDeltaSubscribeResponse_Status_name = map[int32]string{ + 0: "OK", + 1: "INTERNAL_ERROR", + 2: "UNKNOWN_BLOCK", +} +var StateDeltaSubscribeResponse_Status_value = map[string]int32{ + "OK": 0, + "INTERNAL_ERROR": 1, + "UNKNOWN_BLOCK": 2, +} + +func (x StateDeltaSubscribeResponse_Status) String() string { + return proto.EnumName(StateDeltaSubscribeResponse_Status_name, int32(x)) +} +func (StateDeltaSubscribeResponse_Status) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{4, 0} +} + +type StateDeltaUnsubscribeResponse_Status int32 + +const ( + // returned on successful registration + StateDeltaUnsubscribeResponse_OK StateDeltaUnsubscribeResponse_Status = 0 + // returned on a failed registration, due to + // an internal validator error + StateDeltaUnsubscribeResponse_INTERNAL_ERROR StateDeltaUnsubscribeResponse_Status = 1 +) + +var StateDeltaUnsubscribeResponse_Status_name = map[int32]string{ + 0: "OK", + 1: "INTERNAL_ERROR", +} +var StateDeltaUnsubscribeResponse_Status_value = map[string]int32{ + "OK": 0, + "INTERNAL_ERROR": 1, +} + +func (x StateDeltaUnsubscribeResponse_Status) String() string { + return proto.EnumName(StateDeltaUnsubscribeResponse_Status_name, int32(x)) +} +func (StateDeltaUnsubscribeResponse_Status) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{6, 0} +} + +type StateDeltaGetEventsResponse_Status int32 + +const ( + // returned on a successful request + StateDeltaGetEventsResponse_OK StateDeltaGetEventsResponse_Status = 0 + // returned on a failed request, due to an internal validator error. + StateDeltaGetEventsResponse_INTERNAL_ERROR StateDeltaGetEventsResponse_Status = 1 + // return on a bad request, where no block id was provided in the + // request. + StateDeltaGetEventsResponse_NO_VALID_BLOCKS_SPECIFIED StateDeltaGetEventsResponse_Status = 2 +) + +var StateDeltaGetEventsResponse_Status_name = map[int32]string{ + 0: "OK", + 1: "INTERNAL_ERROR", + 2: "NO_VALID_BLOCKS_SPECIFIED", +} +var StateDeltaGetEventsResponse_Status_value = map[string]int32{ + "OK": 0, + "INTERNAL_ERROR": 1, + "NO_VALID_BLOCKS_SPECIFIED": 2, +} + +func (x StateDeltaGetEventsResponse_Status) String() string { + return proto.EnumName(StateDeltaGetEventsResponse_Status_name, int32(x)) +} +func (StateDeltaGetEventsResponse_Status) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{8, 0} +} + +// A state change is an entry in a given delta set. StateChange objects +// have the type of SET, which is either an insert or update, or +// DELETE. Items marked as a DELETE will have no byte value. +type StateChange struct { + Address string `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + Type StateChange_Type `protobuf:"varint,3,opt,name=type,enum=StateChange_Type" json:"type,omitempty"` +} + +func (m *StateChange) Reset() { *m = StateChange{} } +func (m *StateChange) String() string { return proto.CompactTextString(m) } +func (*StateChange) ProtoMessage() {} +func (*StateChange) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *StateChange) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *StateChange) GetValue() []byte { + if m != nil { + return m.Value + } + return nil +} + +func (m *StateChange) GetType() StateChange_Type { + if m != nil { + return m.Type + } + return StateChange_SET +} + +// A collection of state changes. +type StateDeltaSet struct { + StateChanges []*StateChange `protobuf:"bytes,1,rep,name=state_changes,json=stateChanges" json:"state_changes,omitempty"` +} + +func (m *StateDeltaSet) Reset() { *m = StateDeltaSet{} } +func (m *StateDeltaSet) String() string { return proto.CompactTextString(m) } +func (*StateDeltaSet) ProtoMessage() {} +func (*StateDeltaSet) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *StateDeltaSet) GetStateChanges() []*StateChange { + if m != nil { + return m.StateChanges + } + return nil +} + +// A StateDeltaEvent contains the information about the start and +// end of the delta (from a block perspective) and the list of +// changes that have occurred in that time. The list of state +// changes are limited to those in the namespaces specified at +// subscriber registration time. +type StateDeltaEvent struct { + // The block id associated with the changes. + BlockId string `protobuf:"bytes,1,opt,name=block_id,json=blockId" json:"block_id,omitempty"` + // The block number associated with the changes + BlockNum uint64 `protobuf:"varint,2,opt,name=block_num,json=blockNum" json:"block_num,omitempty"` + // The state root hash which resulted from the changes. + StateRootHash string `protobuf:"bytes,3,opt,name=state_root_hash,json=stateRootHash" json:"state_root_hash,omitempty"` + // The previous block id + PreviousBlockId string `protobuf:"bytes,4,opt,name=previous_block_id,json=previousBlockId" json:"previous_block_id,omitempty"` + // The collection of StateChange objects + StateChanges []*StateChange `protobuf:"bytes,5,rep,name=state_changes,json=stateChanges" json:"state_changes,omitempty"` +} + +func (m *StateDeltaEvent) Reset() { *m = StateDeltaEvent{} } +func (m *StateDeltaEvent) String() string { return proto.CompactTextString(m) } +func (*StateDeltaEvent) ProtoMessage() {} +func (*StateDeltaEvent) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *StateDeltaEvent) GetBlockId() string { + if m != nil { + return m.BlockId + } + return "" +} + +func (m *StateDeltaEvent) GetBlockNum() uint64 { + if m != nil { + return m.BlockNum + } + return 0 +} + +func (m *StateDeltaEvent) GetStateRootHash() string { + if m != nil { + return m.StateRootHash + } + return "" +} + +func (m *StateDeltaEvent) GetPreviousBlockId() string { + if m != nil { + return m.PreviousBlockId + } + return "" +} + +func (m *StateDeltaEvent) GetStateChanges() []*StateChange { + if m != nil { + return m.StateChanges + } + return nil +} + +// Registers a subscriber for StateDeltaEvent objects. The +// identity of the subscriber will be based on the ZMQ connection +// id. This is an idempotent request. +type StateDeltaSubscribeRequest struct { + // The block id (or ids, if trying to walk back a fork) the + // subscriber last received deltas on. It can be set to empty + // if it has not yet received the genesis block. + LastKnownBlockIds []string `protobuf:"bytes,1,rep,name=last_known_block_ids,json=lastKnownBlockIds" json:"last_known_block_ids,omitempty"` + // The list of address prefixes of interest. Only state changes + // that occur on values in the given prefixes will be sent to the + // subscriber. + AddressPrefixes []string `protobuf:"bytes,2,rep,name=address_prefixes,json=addressPrefixes" json:"address_prefixes,omitempty"` +} + +func (m *StateDeltaSubscribeRequest) Reset() { *m = StateDeltaSubscribeRequest{} } +func (m *StateDeltaSubscribeRequest) String() string { return proto.CompactTextString(m) } +func (*StateDeltaSubscribeRequest) ProtoMessage() {} +func (*StateDeltaSubscribeRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *StateDeltaSubscribeRequest) GetLastKnownBlockIds() []string { + if m != nil { + return m.LastKnownBlockIds + } + return nil +} + +func (m *StateDeltaSubscribeRequest) GetAddressPrefixes() []string { + if m != nil { + return m.AddressPrefixes + } + return nil +} + +// The response to a StateDeltaSubscribeRequest +type StateDeltaSubscribeResponse struct { + Status StateDeltaSubscribeResponse_Status `protobuf:"varint,1,opt,name=status,enum=StateDeltaSubscribeResponse_Status" json:"status,omitempty"` +} + +func (m *StateDeltaSubscribeResponse) Reset() { *m = StateDeltaSubscribeResponse{} } +func (m *StateDeltaSubscribeResponse) String() string { return proto.CompactTextString(m) } +func (*StateDeltaSubscribeResponse) ProtoMessage() {} +func (*StateDeltaSubscribeResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *StateDeltaSubscribeResponse) GetStatus() StateDeltaSubscribeResponse_Status { + if m != nil { + return m.Status + } + return StateDeltaSubscribeResponse_OK +} + +// Unregisters a subscriber for StateDeltaEvent objects. The +// identity of the subscriber will be based on the ZMQ connection +// id. This is an idempotent request. +type StateDeltaUnsubscribeRequest struct { +} + +func (m *StateDeltaUnsubscribeRequest) Reset() { *m = StateDeltaUnsubscribeRequest{} } +func (m *StateDeltaUnsubscribeRequest) String() string { return proto.CompactTextString(m) } +func (*StateDeltaUnsubscribeRequest) ProtoMessage() {} +func (*StateDeltaUnsubscribeRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +type StateDeltaUnsubscribeResponse struct { + Status StateDeltaUnsubscribeResponse_Status `protobuf:"varint,1,opt,name=status,enum=StateDeltaUnsubscribeResponse_Status" json:"status,omitempty"` +} + +func (m *StateDeltaUnsubscribeResponse) Reset() { *m = StateDeltaUnsubscribeResponse{} } +func (m *StateDeltaUnsubscribeResponse) String() string { return proto.CompactTextString(m) } +func (*StateDeltaUnsubscribeResponse) ProtoMessage() {} +func (*StateDeltaUnsubscribeResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *StateDeltaUnsubscribeResponse) GetStatus() StateDeltaUnsubscribeResponse_Status { + if m != nil { + return m.Status + } + return StateDeltaUnsubscribeResponse_OK +} + +// Request message for a set of StateDeltaEvent objects, based on a given list +// of block_ids and a known filter. The result will include a set of +// StateDeltaEvent objects. +type StateDeltaGetEventsRequest struct { + // The block ids to query + BlockIds []string `protobuf:"bytes,1,rep,name=block_ids,json=blockIds" json:"block_ids,omitempty"` + // The list of address prefixes of interest. Only state changes + // that occur on values in the given prefixes will be sent to the + // subscriber. + AddressPrefixes []string `protobuf:"bytes,2,rep,name=address_prefixes,json=addressPrefixes" json:"address_prefixes,omitempty"` +} + +func (m *StateDeltaGetEventsRequest) Reset() { *m = StateDeltaGetEventsRequest{} } +func (m *StateDeltaGetEventsRequest) String() string { return proto.CompactTextString(m) } +func (*StateDeltaGetEventsRequest) ProtoMessage() {} +func (*StateDeltaGetEventsRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *StateDeltaGetEventsRequest) GetBlockIds() []string { + if m != nil { + return m.BlockIds + } + return nil +} + +func (m *StateDeltaGetEventsRequest) GetAddressPrefixes() []string { + if m != nil { + return m.AddressPrefixes + } + return nil +} + +// Response message for a GetStateDeltasRequest. Returns a list of +// StateDeltaEvent objects for the block_ids requested. Only block_ids known +// to the validator will result in events. +type StateDeltaGetEventsResponse struct { + Status StateDeltaGetEventsResponse_Status `protobuf:"varint,1,opt,name=status,enum=StateDeltaGetEventsResponse_Status" json:"status,omitempty"` + // the events returned for the request. This may contain only a subset of + // events matching the given block ids, as unknown blocks are ignored. + Events []*StateDeltaEvent `protobuf:"bytes,2,rep,name=events" json:"events,omitempty"` +} + +func (m *StateDeltaGetEventsResponse) Reset() { *m = StateDeltaGetEventsResponse{} } +func (m *StateDeltaGetEventsResponse) String() string { return proto.CompactTextString(m) } +func (*StateDeltaGetEventsResponse) ProtoMessage() {} +func (*StateDeltaGetEventsResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *StateDeltaGetEventsResponse) GetStatus() StateDeltaGetEventsResponse_Status { + if m != nil { + return m.Status + } + return StateDeltaGetEventsResponse_OK +} + +func (m *StateDeltaGetEventsResponse) GetEvents() []*StateDeltaEvent { + if m != nil { + return m.Events + } + return nil +} + +func init() { + proto.RegisterType((*StateChange)(nil), "StateChange") + proto.RegisterType((*StateDeltaSet)(nil), "StateDeltaSet") + proto.RegisterType((*StateDeltaEvent)(nil), "StateDeltaEvent") + proto.RegisterType((*StateDeltaSubscribeRequest)(nil), "StateDeltaSubscribeRequest") + proto.RegisterType((*StateDeltaSubscribeResponse)(nil), "StateDeltaSubscribeResponse") + proto.RegisterType((*StateDeltaUnsubscribeRequest)(nil), "StateDeltaUnsubscribeRequest") + proto.RegisterType((*StateDeltaUnsubscribeResponse)(nil), "StateDeltaUnsubscribeResponse") + proto.RegisterType((*StateDeltaGetEventsRequest)(nil), "StateDeltaGetEventsRequest") + proto.RegisterType((*StateDeltaGetEventsResponse)(nil), "StateDeltaGetEventsResponse") + proto.RegisterEnum("StateChange_Type", StateChange_Type_name, StateChange_Type_value) + proto.RegisterEnum("StateDeltaSubscribeResponse_Status", StateDeltaSubscribeResponse_Status_name, StateDeltaSubscribeResponse_Status_value) + proto.RegisterEnum("StateDeltaUnsubscribeResponse_Status", StateDeltaUnsubscribeResponse_Status_name, StateDeltaUnsubscribeResponse_Status_value) + proto.RegisterEnum("StateDeltaGetEventsResponse_Status", StateDeltaGetEventsResponse_Status_name, StateDeltaGetEventsResponse_Status_value) +} + +func init() { + proto.RegisterFile("sawtooth_sdk/protobuf/state_delta_pb2/state_delta.proto", fileDescriptor0) +} + +var fileDescriptor0 = []byte{ + // 585 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x9c, 0x54, 0x5d, 0x73, 0xd2, 0x40, + 0x14, 0x35, 0x94, 0xa6, 0xe5, 0x96, 0x8f, 0xb0, 0x53, 0x67, 0xa8, 0x58, 0xc7, 0x89, 0xd6, 0xc1, + 0x3e, 0x84, 0x11, 0x1f, 0xfa, 0xe0, 0xf8, 0x50, 0x20, 0x2a, 0x03, 0x13, 0x98, 0x85, 0xea, 0x8c, + 0x2f, 0x3b, 0x09, 0xd9, 0x0a, 0x03, 0x4d, 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ea, 0x70, 0x74, 0x04, + 0xfb, 0xd6, 0xdc, 0x1d, 0xcf, 0xc8, 0xd4, 0x8e, 0x87, 0x11, 0x75, 0xc7, 0x46, 0x55, 0xc8, 0x85, + 0x90, 0xe3, 0x5d, 0x89, 0x81, 0xb2, 0x38, 0xe4, 0x1a, 0xde, 0x15, 0x7a, 0x06, 0xa5, 0x50, 0x7e, + 0xe9, 0xdf, 0x28, 0x99, 0x98, 0x6c, 0x22, 0xc6, 0xcb, 0xe1, 0xd0, 0x15, 0xf6, 0xbb, 0xef, 0xfc, + 0x26, 0x3a, 0x85, 0xf2, 0x62, 0x49, 0x57, 0x53, 0xd7, 0x63, 0x64, 0x2d, 0x94, 0x15, 0xcc, 0x52, + 0x0c, 0x34, 0x23, 0xc1, 0x5b, 0x23, 0xed, 0xfe, 0x73, 0xa4, 0x1b, 0x78, 0x90, 0xb8, 0x16, 0xcf, + 0x62, 0xe3, 0xe5, 0xd4, 0xa2, 0x98, 0x7e, 0xf6, 0x28, 0xe3, 0xa8, 0x0e, 0x87, 0x73, 0x93, 0x71, + 0x32, 0x73, 0xdc, 0x6b, 0x67, 0x2d, 0x1f, 0x5e, 0x55, 0x0e, 0x97, 0x03, 0xac, 0x1b, 0x40, 0x91, + 0x01, 0x86, 0x9e, 0x83, 0x12, 0x45, 0x49, 0x7c, 0x73, 0x97, 0xd3, 0x1b, 0xdf, 0x44, 0x46, 0x90, + 0x4b, 0x51, 0x7f, 0x10, 0xb5, 0xd5, 0xef, 0x12, 0x54, 0xff, 0x28, 0xcd, 0x16, 0xae, 0xc3, 0x28, + 0x7a, 0x05, 0x72, 0xe0, 0xd4, 0x0b, 0xdf, 0x48, 0xb1, 0xf1, 0x44, 0xbb, 0x83, 0x2d, 0x30, 0x8f, + 0xe1, 0xe8, 0x13, 0xf5, 0x0c, 0xe4, 0xb0, 0x83, 0x64, 0xc8, 0xf4, 0xbb, 0xfe, 0x5b, 0x40, 0x50, + 0xec, 0x18, 0x23, 0x1d, 0x1b, 0xe7, 0x3d, 0xa2, 0x63, 0xdc, 0xc7, 0x8a, 0x84, 0xca, 0x50, 0xb8, + 0x30, 0xba, 0x46, 0xff, 0x83, 0x41, 0x9a, 0xbd, 0x7e, 0xab, 0xab, 0x64, 0xd4, 0x47, 0xf0, 0x70, + 0x23, 0x73, 0xe1, 0xb0, 0xd4, 0x8d, 0xa8, 0xdf, 0x24, 0x38, 0xfe, 0x0b, 0x21, 0xf2, 0xfd, 0x3a, + 0xe5, 0xfb, 0x44, 0xbb, 0x93, 0x9f, 0x76, 0xfe, 0x74, 0x1b, 0xe7, 0xaa, 0x9d, 0x8c, 0xed, 0x2d, + 0xe5, 0xe2, 0x2d, 0xb2, 0x38, 0xb6, 0xf5, 0xc3, 0xdb, 0x64, 0xb5, 0x6f, 0xfd, 0x47, 0x44, 0x3f, + 0x7e, 0x8b, 0x28, 0x21, 0xb3, 0x45, 0x44, 0xb7, 0xd8, 0xa9, 0x41, 0x51, 0x0d, 0x64, 0x2a, 0x08, + 0x42, 0xfd, 0xa0, 0xa1, 0x68, 0xa9, 0x5f, 0x0b, 0x47, 0xb8, 0xda, 0xda, 0x2a, 0xcc, 0x63, 0x38, + 0x32, 0xfa, 0xe4, 0xfd, 0x79, 0xaf, 0xd3, 0x0e, 0xd3, 0x1c, 0x92, 0xe1, 0x40, 0x6f, 0x75, 0xde, + 0x74, 0xf4, 0xb6, 0x92, 0x69, 0x9e, 0xc2, 0xfd, 0x78, 0x7d, 0x69, 0xfe, 0xfa, 0xd2, 0xe2, 0xf5, + 0x35, 0x90, 0x3e, 0x96, 0x52, 0x1b, 0xcc, 0x92, 0x05, 0xf8, 0xf2, 0x57, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x6c, 0x2a, 0x19, 0xa1, 0xf1, 0x04, 0x00, 0x00, +} diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/transaction_pb2/transaction.pb.go b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/transaction_pb2/transaction.pb.go new file mode 100644 index 00000000..8c1002ed --- /dev/null +++ b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/transaction_pb2/transaction.pb.go @@ -0,0 +1,228 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: sawtooth_sdk/protobuf/transaction_pb2/transaction.proto + +/* +Package transaction_pb2 is a generated protocol buffer package. + +It is generated from these files: + sawtooth_sdk/protobuf/transaction_pb2/transaction.proto + +It has these top-level messages: + TransactionHeader + Transaction + TransactionList +*/ +package transaction_pb2 + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +type TransactionHeader struct { + // Public key for the client who added this transaction to a batch + BatcherPubkey string `protobuf:"bytes,1,opt,name=batcher_pubkey,json=batcherPubkey" json:"batcher_pubkey,omitempty"` + // A list of transaction signatures that describe the transactions that + // must be processed before this transaction can be valid + Dependencies []string `protobuf:"bytes,2,rep,name=dependencies" json:"dependencies,omitempty"` + // The family name correlates to the transaction processor's family name + // that this transaction can be processed on, for example 'intkey' + FamilyName string `protobuf:"bytes,3,opt,name=family_name,json=familyName" json:"family_name,omitempty"` + // The family version correlates to the transaction processor's family + // version that this transaction can be processed on, for example "1.0" + FamilyVersion string `protobuf:"bytes,4,opt,name=family_version,json=familyVersion" json:"family_version,omitempty"` + // A list of addresses that are given to the context manager and control + // what addresses the transaction processor is allowed to read from. + Inputs []string `protobuf:"bytes,5,rep,name=inputs" json:"inputs,omitempty"` + // A random string that provides uniqueness for transactions with + // otherwise identical fields. + Nonce string `protobuf:"bytes,6,opt,name=nonce" json:"nonce,omitempty"` + // A list of addresses that are given to the context manager and control + // what addresses the transaction processor is allowed to write to. + Outputs []string `protobuf:"bytes,7,rep,name=outputs" json:"outputs,omitempty"` + // The payload encoding correlates to the transaction processor's payload + // encoding that this transaction can be processed on, + // for example ""application/cbor"" + PayloadEncoding string `protobuf:"bytes,8,opt,name=payload_encoding,json=payloadEncoding" json:"payload_encoding,omitempty"` + // The sha512 hash of the encoded payload + PayloadSha512 string `protobuf:"bytes,9,opt,name=payload_sha512,json=payloadSha512" json:"payload_sha512,omitempty"` + // Public key for the client that signed the TransactionHeader + SignerPubkey string `protobuf:"bytes,10,opt,name=signer_pubkey,json=signerPubkey" json:"signer_pubkey,omitempty"` +} + +func (m *TransactionHeader) Reset() { *m = TransactionHeader{} } +func (m *TransactionHeader) String() string { return proto.CompactTextString(m) } +func (*TransactionHeader) ProtoMessage() {} +func (*TransactionHeader) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *TransactionHeader) GetBatcherPubkey() string { + if m != nil { + return m.BatcherPubkey + } + return "" +} + +func (m *TransactionHeader) GetDependencies() []string { + if m != nil { + return m.Dependencies + } + return nil +} + +func (m *TransactionHeader) GetFamilyName() string { + if m != nil { + return m.FamilyName + } + return "" +} + +func (m *TransactionHeader) GetFamilyVersion() string { + if m != nil { + return m.FamilyVersion + } + return "" +} + +func (m *TransactionHeader) GetInputs() []string { + if m != nil { + return m.Inputs + } + return nil +} + +func (m *TransactionHeader) GetNonce() string { + if m != nil { + return m.Nonce + } + return "" +} + +func (m *TransactionHeader) GetOutputs() []string { + if m != nil { + return m.Outputs + } + return nil +} + +func (m *TransactionHeader) GetPayloadEncoding() string { + if m != nil { + return m.PayloadEncoding + } + return "" +} + +func (m *TransactionHeader) GetPayloadSha512() string { + if m != nil { + return m.PayloadSha512 + } + return "" +} + +func (m *TransactionHeader) GetSignerPubkey() string { + if m != nil { + return m.SignerPubkey + } + return "" +} + +type Transaction struct { + // The serialized version of the TransactionHeader + Header []byte `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` + // The signature derived from signing the header + HeaderSignature string `protobuf:"bytes,2,opt,name=header_signature,json=headerSignature" json:"header_signature,omitempty"` + // The payload is the encoded family specific information of the + // transaction. Example cbor({'Verb': verb, 'Name': name,'Value': value}) + Payload []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` +} + +func (m *Transaction) Reset() { *m = Transaction{} } +func (m *Transaction) String() string { return proto.CompactTextString(m) } +func (*Transaction) ProtoMessage() {} +func (*Transaction) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *Transaction) GetHeader() []byte { + if m != nil { + return m.Header + } + return nil +} + +func (m *Transaction) GetHeaderSignature() string { + if m != nil { + return m.HeaderSignature + } + return "" +} + +func (m *Transaction) GetPayload() []byte { + if m != nil { + return m.Payload + } + return nil +} + +// A simple list of transactions that needs to be serialized before +// it can be transmitted to a batcher. +type TransactionList struct { + Transactions []*Transaction `protobuf:"bytes,1,rep,name=transactions" json:"transactions,omitempty"` +} + +func (m *TransactionList) Reset() { *m = TransactionList{} } +func (m *TransactionList) String() string { return proto.CompactTextString(m) } +func (*TransactionList) ProtoMessage() {} +func (*TransactionList) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *TransactionList) GetTransactions() []*Transaction { + if m != nil { + return m.Transactions + } + return nil +} + +func init() { + proto.RegisterType((*TransactionHeader)(nil), "TransactionHeader") + proto.RegisterType((*Transaction)(nil), "Transaction") + proto.RegisterType((*TransactionList)(nil), "TransactionList") +} + +func init() { + proto.RegisterFile("sawtooth_sdk/protobuf/transaction_pb2/transaction.proto", fileDescriptor0) +} + +var fileDescriptor0 = []byte{ + // 374 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x5c, 0x92, 0xc1, 0x4f, 0xe2, 0x40, + 0x14, 0xc6, 0x03, 0x2c, 0xb0, 0x3c, 0xca, 0xb2, 0x3b, 0xd9, 0x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0x29, 0x23, 0x08, 0x85, 0xbe, 0x2c, 0x34, 0xda, 0xfb, 0x68, 0xaf, 0x25, 0x39, 0x85, + 0x9f, 0x19, 0xdb, 0x6f, 0x25, 0x8b, 0x83, 0x32, 0xa1, 0x8c, 0x53, 0xb1, 0xa6, 0xdf, 0xf1, 0xe8, + 0xd8, 0xf2, 0x3b, 0x8b, 0xab, 0x64, 0xb5, 0x55, 0x25, 0xec, 0xea, 0x62, 0x4e, 0x07, 0x26, 0x99, + 0xa5, 0x4b, 0x84, 0xe4, 0x3f, 0x8c, 0x54, 0xba, 0x16, 0x87, 0xae, 0x00, 0x5d, 0x8e, 0x81, 0xa6, + 0x2a, 0xf7, 0x15, 0x86, 0x8d, 0x9a, 0xab, 0xdb, 0x24, 0x58, 0x35, 0x16, 0xeb, 0xf8, 0x56, 0x55, + 0xe9, 0xcc, 0x53, 0x50, 0x9d, 0x66, 0xba, 0xc8, 0x79, 0xd9, 0x2a, 0xa6, 0x33, 0x7c, 0x59, 0xe3, + 0xea, 0x8a, 0x36, 0x07, 0x96, 0xea, 0xf8, 0xb5, 0x74, 0x6f, 0x61, 0xdc, 0x98, 0xf5, 0x90, 0x2a, + 0x4d, 0xce, 0xc1, 0x69, 0xfc, 0x7b, 0x55, 0x4e, 0xed, 0x4c, 0x87, 0x73, 0xc7, 0x6b, 0xf8, 0xfc, + 0x23, 0xc7, 0xcd, 0x19, 0xfc, 0xa9, 0x77, 0xca, 0x2b, 0x77, 0xca, 0xab, 0x77, 0x6a, 0xd1, 0x7a, + 0x19, 0x7f, 0x59, 0xab, 0xb0, 0x87, 0x2f, 0x2f, 0x3f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x52, 0xa9, + 0x27, 0x0e, 0x86, 0x02, 0x00, 0x00, +} diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/txn_receipt_pb2/txn_receipt.pb.go b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/txn_receipt_pb2/txn_receipt.pb.go new file mode 100644 index 00000000..94c001c0 --- /dev/null +++ b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/txn_receipt_pb2/txn_receipt.pb.go @@ -0,0 +1,216 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: sawtooth_sdk/protobuf/txn_receipt_pb2/txn_receipt.proto + +/* +Package txn_receipt_pb2 is a generated protocol buffer package. + +It is generated from these files: + sawtooth_sdk/protobuf/txn_receipt_pb2/txn_receipt.proto + +It has these top-level messages: + TransactionReceipt + ClientReceiptGetRequest + ClientReceiptGetResponse +*/ +package txn_receipt_pb2 + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import state_delta "sawtooth_sdk/protobuf/state_delta_pb2" +import events "sawtooth_sdk/protobuf/events_pb2" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +type ClientReceiptGetResponse_Status int32 + +const ( + ClientReceiptGetResponse_OK ClientReceiptGetResponse_Status = 0 + ClientReceiptGetResponse_INTERNAL_ERROR ClientReceiptGetResponse_Status = 1 + ClientReceiptGetResponse_NO_RESOURCE ClientReceiptGetResponse_Status = 4 +) + +var ClientReceiptGetResponse_Status_name = map[int32]string{ + 0: "OK", + 1: "INTERNAL_ERROR", + 4: "NO_RESOURCE", +} +var ClientReceiptGetResponse_Status_value = map[string]int32{ + "OK": 0, + "INTERNAL_ERROR": 1, + "NO_RESOURCE": 4, +} + +func (x ClientReceiptGetResponse_Status) String() string { + return proto.EnumName(ClientReceiptGetResponse_Status_name, int32(x)) +} +func (ClientReceiptGetResponse_Status) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{2, 0} +} + +type TransactionReceipt struct { + // State changes made by this transaction + // StateChange is already defined in protos/state_delta.proto + StateChanges []*state_delta.StateChange `protobuf:"bytes,1,rep,name=state_changes,json=stateChanges" json:"state_changes,omitempty"` + // Events fired by this transaction + Events []*events.Event `protobuf:"bytes,2,rep,name=events" json:"events,omitempty"` + // Transaction family defined data + Data []*TransactionReceipt_Data `protobuf:"bytes,3,rep,name=data" json:"data,omitempty"` + TransactionId string `protobuf:"bytes,4,opt,name=transaction_id,json=transactionId" json:"transaction_id,omitempty"` +} + +func (m *TransactionReceipt) Reset() { *m = TransactionReceipt{} } +func (m *TransactionReceipt) String() string { return proto.CompactTextString(m) } +func (*TransactionReceipt) ProtoMessage() {} +func (*TransactionReceipt) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *TransactionReceipt) GetStateChanges() []*state_delta.StateChange { + if m != nil { + return m.StateChanges + } + return nil +} + +func (m *TransactionReceipt) GetEvents() []*events.Event { + if m != nil { + return m.Events + } + return nil +} + +func (m *TransactionReceipt) GetData() []*TransactionReceipt_Data { + if m != nil { + return m.Data + } + return nil +} + +func (m *TransactionReceipt) GetTransactionId() string { + if m != nil { + return m.TransactionId + } + return "" +} + +type TransactionReceipt_Data struct { + // Interpretation left to transaction family + DataType string `protobuf:"bytes,1,opt,name=data_type,json=dataType" json:"data_type,omitempty"` + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` +} + +func (m *TransactionReceipt_Data) Reset() { *m = TransactionReceipt_Data{} } +func (m *TransactionReceipt_Data) String() string { return proto.CompactTextString(m) } +func (*TransactionReceipt_Data) ProtoMessage() {} +func (*TransactionReceipt_Data) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 0} } + +func (m *TransactionReceipt_Data) GetDataType() string { + if m != nil { + return m.DataType + } + return "" +} + +func (m *TransactionReceipt_Data) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +// Fetches a specific txn by its id (header_signature) from the blockchain. +type ClientReceiptGetRequest struct { + TransactionIds []string `protobuf:"bytes,1,rep,name=transaction_ids,json=transactionIds" json:"transaction_ids,omitempty"` +} + +func (m *ClientReceiptGetRequest) Reset() { *m = ClientReceiptGetRequest{} } +func (m *ClientReceiptGetRequest) String() string { return proto.CompactTextString(m) } +func (*ClientReceiptGetRequest) ProtoMessage() {} +func (*ClientReceiptGetRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *ClientReceiptGetRequest) GetTransactionIds() []string { + if m != nil { + return m.TransactionIds + } + return nil +} + +// A response that returns the txn receipt specified by a +// ClientTransactionReceiptGetRequest. +// +// Statuses: +// * OK - everything worked as expected, txn receipt has been fetched +// * INTERNAL_ERROR - general error, such as protobuf failing to deserialize +// * NO_RESOURCE - no receipt exists for the transaction id specified +type ClientReceiptGetResponse struct { + Status ClientReceiptGetResponse_Status `protobuf:"varint,1,opt,name=status,enum=ClientReceiptGetResponse_Status" json:"status,omitempty"` + Receipts []*TransactionReceipt `protobuf:"bytes,2,rep,name=receipts" json:"receipts,omitempty"` +} + +func (m *ClientReceiptGetResponse) Reset() { *m = ClientReceiptGetResponse{} } +func (m *ClientReceiptGetResponse) String() string { return proto.CompactTextString(m) } +func (*ClientReceiptGetResponse) ProtoMessage() {} +func (*ClientReceiptGetResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *ClientReceiptGetResponse) GetStatus() ClientReceiptGetResponse_Status { + if m != nil { + return m.Status + } + return ClientReceiptGetResponse_OK +} + +func (m *ClientReceiptGetResponse) GetReceipts() []*TransactionReceipt { + if m != nil { + return m.Receipts + } + return nil +} + +func init() { + proto.RegisterType((*TransactionReceipt)(nil), "TransactionReceipt") + proto.RegisterType((*TransactionReceipt_Data)(nil), "TransactionReceipt.Data") + proto.RegisterType((*ClientReceiptGetRequest)(nil), "ClientReceiptGetRequest") + proto.RegisterType((*ClientReceiptGetResponse)(nil), "ClientReceiptGetResponse") + proto.RegisterEnum("ClientReceiptGetResponse_Status", ClientReceiptGetResponse_Status_name, ClientReceiptGetResponse_Status_value) +} + +func init() { + proto.RegisterFile("sawtooth_sdk/protobuf/txn_receipt_pb2/txn_receipt.proto", fileDescriptor0) +} + +var fileDescriptor0 = []byte{ + // 400 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x74, 0x52, 0xd1, 0x8e, 0xd2, 0x40, + 0x14, 0xb5, 0xd0, 0x34, 0x70, 0x81, 0x42, 0xc6, 0x18, 0x1b, 0x4c, 0x0c, 0x69, 0x62, 0x24, 0x46, + 0x87, 0x88, 0x31, 0xf8, 0x2a, 0xd8, 0x18, 0xa2, 0xa1, 0x66, 0xc0, 0x17, 0x5f, 0x26, 0x03, 0x1d, + 0xa5, 0x91, 0xb4, 0x95, 0x99, 0xba, 0xbb, 0xff, 0xb6, 0xbf, 0xb5, 0xef, 0xdb, 0x99, 0x29, 0x0b, + 0x2c, 0xf0, 0x36, 0xf7, 0xdc, 0x73, 0xee, 0xb9, 0x73, 0x73, 0x60, 0x24, 0xd8, 0x95, 0x4c, 0x53, + 0xb9, 0xa6, 0x22, 0xfa, 0x3b, 0xc8, 0xb6, 0xa9, 0x4c, 0x97, 0xf9, 0xef, 0x81, 0xbc, 0x4e, 0xe8, + 0x96, 0xaf, 0x78, 0x9c, 0x49, 0x9a, 0x2d, 0x87, 0x87, 0x35, 0xd6, 0xa4, 0xee, 0x05, 0xa1, 0x90, + 0x4c, 0x72, 0x1a, 0xf1, 0x8d, 0x64, 0x5a, 0x78, 0x50, 0x97, 0xc2, 0x77, 0xe7, 0x85, 0xfc, 0x3f, + 0x4f, 0xa4, 0xd0, 0x1a, 0xf3, 0x34, 0x74, 0xff, 0xce, 0x02, 0xb4, 0xd8, 0xb2, 0x44, 0xb0, 0x95, + 0x8c, 0xd3, 0x84, 0x98, 0x25, 0xd0, 0x7b, 0x68, 0x99, 0xd1, 0xab, 0x35, 0x4b, 0xfe, 0x70, 0xe1, + 0x59, 0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0xbf, 0xd3, 0x80, 0x90, 0x90, 0x74, 0x2c, 0xd4, + 0x86, 0xc6, 0x2c, 0xa4, 0x24, 0x98, 0x87, 0x3f, 0xc9, 0x24, 0xe8, 0xd8, 0xe3, 0x37, 0xf0, 0x6c, + 0x97, 0x15, 0x5c, 0x64, 0x05, 0xef, 0xb2, 0xf2, 0xc3, 0xfa, 0xd5, 0x7e, 0x14, 0xd0, 0xa5, 0xa3, + 0x9b, 0x1f, 0xee, 0x03, 0x00, 0x00, 0xff, 0xff, 0x62, 0x7e, 0xf1, 0x2e, 0xd0, 0x02, 0x00, 0x00, +} diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/validator_pb2/validator.pb.go b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/validator_pb2/validator.pb.go new file mode 100644 index 00000000..c7f3a9ee --- /dev/null +++ b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/src/sawtooth_sdk/protobuf/validator_pb2/validator.pb.go @@ -0,0 +1,469 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: sawtooth_sdk/protobuf/validator_pb2/validator.proto + +/* +Package validator_pb2 is a generated protocol buffer package. + +It is generated from these files: + sawtooth_sdk/protobuf/validator_pb2/validator.proto + +It has these top-level messages: + MessageList + Message +*/ +package validator_pb2 + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +type Message_MessageType int32 + +const ( + Message_DEFAULT Message_MessageType = 0 + // Registration request from the transaction processor to the validator + Message_TP_REGISTER_REQUEST Message_MessageType = 1 + // Registration response from the validator to the + // transaction processor + Message_TP_REGISTER_RESPONSE Message_MessageType = 2 + // Tell the validator that the transaction processor + // won't take any more transactions + Message_TP_UNREGISTER_REQUEST Message_MessageType = 3 + // Response from the validator to the tp that it won't + // send any more transactions + Message_TP_UNREGISTER_RESPONSE Message_MessageType = 4 + // Process Request from the validator/executor to the + // transaction processor + Message_TP_PROCESS_REQUEST Message_MessageType = 5 + // Process response from the transaction processor to the validator/executor + Message_TP_PROCESS_RESPONSE Message_MessageType = 6 + // State get request from the transaction processor to validator/context_manager + Message_TP_STATE_GET_REQUEST Message_MessageType = 7 + // State get response from the validator/context_manager to the transaction processor + Message_TP_STATE_GET_RESPONSE Message_MessageType = 8 + // State set request from the transaction processor to the validator/context_manager + Message_TP_STATE_SET_REQUEST Message_MessageType = 9 + // State set response from the validator/context_manager to the transaction processor + Message_TP_STATE_SET_RESPONSE Message_MessageType = 10 + // State delete request from the transaction processor to the validator/context_manager + Message_TP_STATE_DEL_REQUEST Message_MessageType = 11 + // State delete response from the validator/context_manager to the transaction processor + Message_TP_STATE_DEL_RESPONSE Message_MessageType = 12 + // Message to check if a transaction processor is still connected. + Message_TP_PING Message_MessageType = 13 + // Response from transaction processor to tell the validator it received the ping + Message_TP_PING_RESPONSE Message_MessageType = 14 + // Message to append data to a transaction receipt + Message_TP_ADD_RECEIPT_DATA_REQUEST Message_MessageType = 15 + // Response from validator to tell transaction processor that data has been appended + Message_TP_ADD_RECEIPT_DATA_RESPONSE Message_MessageType = 16 + // Message to add event + Message_TP_ADD_EVENT_REQUEST Message_MessageType = 17 + // Response from validator to tell transaction processor that event has been created + Message_TP_ADD_EVENT_RESPONSE Message_MessageType = 18 + // Submission of a batchlist from the web api or another client to the validator + Message_CLIENT_BATCH_SUBMIT_REQUEST Message_MessageType = 100 + // Response from the validator to the web api/client that the submission was accepted + Message_CLIENT_BATCH_SUBMIT_RESPONSE Message_MessageType = 101 + // A request to list blocks from the web api/client to the validator + Message_CLIENT_BLOCK_LIST_REQUEST Message_MessageType = 102 + Message_CLIENT_BLOCK_LIST_RESPONSE Message_MessageType = 103 + Message_CLIENT_BLOCK_GET_REQUEST Message_MessageType = 104 + Message_CLIENT_BLOCK_GET_RESPONSE Message_MessageType = 105 + Message_CLIENT_BATCH_LIST_REQUEST Message_MessageType = 106 + Message_CLIENT_BATCH_LIST_RESPONSE Message_MessageType = 107 + Message_CLIENT_BATCH_GET_REQUEST Message_MessageType = 108 + Message_CLIENT_BATCH_GET_RESPONSE Message_MessageType = 109 + Message_CLIENT_TRANSACTION_LIST_REQUEST Message_MessageType = 110 + Message_CLIENT_TRANSACTION_LIST_RESPONSE Message_MessageType = 111 + Message_CLIENT_TRANSACTION_GET_REQUEST Message_MessageType = 112 + Message_CLIENT_TRANSACTION_GET_RESPONSE Message_MessageType = 113 + // Client state request of the current state hash to be retrieved from the journal + Message_CLIENT_STATE_CURRENT_REQUEST Message_MessageType = 114 + // Response with the current state hash + Message_CLIENT_STATE_CURRENT_RESPONSE Message_MessageType = 115 + // A request of all the addresses under a particular prefix, for a state hash. + Message_CLIENT_STATE_LIST_REQUEST Message_MessageType = 116 + // The response of the addresses + Message_CLIENT_STATE_LIST_RESPONSE Message_MessageType = 117 + // Get the address:data entry at a particular address + Message_CLIENT_STATE_GET_REQUEST Message_MessageType = 118 + // The response with the entry + Message_CLIENT_STATE_GET_RESPONSE Message_MessageType = 119 + // A request for the status of a batch or batches + Message_CLIENT_BATCH_STATUS_REQUEST Message_MessageType = 120 + // A response with the batch statuses + Message_CLIENT_BATCH_STATUS_RESPONSE Message_MessageType = 121 + // A request for one or more transaction receipts + Message_CLIENT_RECEIPT_GET_REQUEST Message_MessageType = 122 + // A response with the receipts + Message_CLIENT_RECEIPT_GET_RESPONSE Message_MessageType = 123 + // A request for a validator's peers + Message_CLIENT_PEERS_GET_REQUEST Message_MessageType = 125 + // A response with the validator's peers + Message_CLIENT_PEERS_GET_RESPONSE Message_MessageType = 126 + // Message types for events + Message_CLIENT_EVENTS_SUBSCRIBE_REQUEST Message_MessageType = 500 + Message_CLIENT_EVENTS_SUBSCRIBE_RESPONSE Message_MessageType = 501 + Message_CLIENT_EVENTS_UNSUBSCRIBE_REQUEST Message_MessageType = 502 + Message_CLIENT_EVENTS_UNSUBSCRIBE_RESPONSE Message_MessageType = 503 + Message_CLIENT_EVENTS Message_MessageType = 504 + Message_CLIENT_EVENTS_GET_REQUEST Message_MessageType = 505 + Message_CLIENT_EVENTS_GET_RESPONSE Message_MessageType = 506 + // Temp message types until a discussion can be had about gossip msg + Message_GOSSIP_MESSAGE Message_MessageType = 200 + Message_GOSSIP_REGISTER Message_MessageType = 201 + Message_GOSSIP_UNREGISTER Message_MessageType = 202 + Message_GOSSIP_BLOCK_REQUEST Message_MessageType = 205 + Message_GOSSIP_BLOCK_RESPONSE Message_MessageType = 206 + Message_GOSSIP_BATCH_BY_BATCH_ID_REQUEST Message_MessageType = 207 + Message_GOSSIP_BATCH_BY_TRANSACTION_ID_REQUEST Message_MessageType = 208 + Message_GOSSIP_BATCH_RESPONSE Message_MessageType = 209 + Message_GOSSIP_GET_PEERS_REQUEST Message_MessageType = 210 + Message_GOSSIP_GET_PEERS_RESPONSE Message_MessageType = 211 + Message_NETWORK_PING Message_MessageType = 300 + Message_NETWORK_ACK Message_MessageType = 301 + Message_NETWORK_CONNECT Message_MessageType = 302 + Message_NETWORK_DISCONNECT Message_MessageType = 303 + // Message types for State Delta Exports + Message_STATE_DELTA_SUBSCRIBE_REQUEST Message_MessageType = 400 + Message_STATE_DELTA_SUBSCRIBE_RESPONSE Message_MessageType = 401 + Message_STATE_DELTA_UNSUBSCRIBE_REQUEST Message_MessageType = 402 + Message_STATE_DELTA_UNSUBSCRIBE_RESPONSE Message_MessageType = 403 + Message_STATE_DELTA_EVENT Message_MessageType = 404 + Message_STATE_DELTA_GET_EVENTS_REQUEST Message_MessageType = 405 + Message_STATE_DELTA_GET_EVENTS_RESPONSE Message_MessageType = 406 + // Message types for Authorization Types + Message_AUTHORIZATION_CONNECTION_RESPONSE Message_MessageType = 600 + Message_AUTHORIZATION_VIOLATION Message_MessageType = 601 + Message_AUTHORIZATION_TRUST_REQUEST Message_MessageType = 602 + Message_AUTHORIZATION_TRUST_RESPONSE Message_MessageType = 603 + Message_AUTHORIZATION_CHALLENGE_REQUEST Message_MessageType = 604 + Message_AUTHORIZATION_CHALLENGE_RESPONSE Message_MessageType = 605 + Message_AUTHORIZATION_CHALLENGE_SUBMIT Message_MessageType = 606 + Message_AUTHORIZATION_CHALLENGE_RESULT Message_MessageType = 607 +) + +var Message_MessageType_name = map[int32]string{ + 0: "DEFAULT", + 1: "TP_REGISTER_REQUEST", + 2: "TP_REGISTER_RESPONSE", + 3: "TP_UNREGISTER_REQUEST", + 4: "TP_UNREGISTER_RESPONSE", + 5: "TP_PROCESS_REQUEST", + 6: "TP_PROCESS_RESPONSE", + 7: "TP_STATE_GET_REQUEST", + 8: "TP_STATE_GET_RESPONSE", + 9: "TP_STATE_SET_REQUEST", + 10: "TP_STATE_SET_RESPONSE", + 11: "TP_STATE_DEL_REQUEST", + 12: "TP_STATE_DEL_RESPONSE", + 13: "TP_PING", + 14: "TP_PING_RESPONSE", + 15: "TP_ADD_RECEIPT_DATA_REQUEST", + 16: "TP_ADD_RECEIPT_DATA_RESPONSE", + 17: "TP_ADD_EVENT_REQUEST", + 18: "TP_ADD_EVENT_RESPONSE", + 100: "CLIENT_BATCH_SUBMIT_REQUEST", + 101: "CLIENT_BATCH_SUBMIT_RESPONSE", + 102: "CLIENT_BLOCK_LIST_REQUEST", + 103: "CLIENT_BLOCK_LIST_RESPONSE", + 104: "CLIENT_BLOCK_GET_REQUEST", + 105: "CLIENT_BLOCK_GET_RESPONSE", + 106: "CLIENT_BATCH_LIST_REQUEST", + 107: "CLIENT_BATCH_LIST_RESPONSE", + 108: "CLIENT_BATCH_GET_REQUEST", + 109: "CLIENT_BATCH_GET_RESPONSE", + 110: "CLIENT_TRANSACTION_LIST_REQUEST", + 111: "CLIENT_TRANSACTION_LIST_RESPONSE", + 112: "CLIENT_TRANSACTION_GET_REQUEST", + 113: "CLIENT_TRANSACTION_GET_RESPONSE", + 114: "CLIENT_STATE_CURRENT_REQUEST", + 115: "CLIENT_STATE_CURRENT_RESPONSE", + 116: "CLIENT_STATE_LIST_REQUEST", + 117: "CLIENT_STATE_LIST_RESPONSE", + 118: "CLIENT_STATE_GET_REQUEST", + 119: "CLIENT_STATE_GET_RESPONSE", + 120: "CLIENT_BATCH_STATUS_REQUEST", + 121: "CLIENT_BATCH_STATUS_RESPONSE", + 122: "CLIENT_RECEIPT_GET_REQUEST", + 123: "CLIENT_RECEIPT_GET_RESPONSE", + 125: "CLIENT_PEERS_GET_REQUEST", + 126: "CLIENT_PEERS_GET_RESPONSE", + 500: "CLIENT_EVENTS_SUBSCRIBE_REQUEST", + 501: "CLIENT_EVENTS_SUBSCRIBE_RESPONSE", + 502: "CLIENT_EVENTS_UNSUBSCRIBE_REQUEST", + 503: "CLIENT_EVENTS_UNSUBSCRIBE_RESPONSE", + 504: "CLIENT_EVENTS", + 505: "CLIENT_EVENTS_GET_REQUEST", + 506: "CLIENT_EVENTS_GET_RESPONSE", + 200: "GOSSIP_MESSAGE", + 201: "GOSSIP_REGISTER", + 202: "GOSSIP_UNREGISTER", + 205: "GOSSIP_BLOCK_REQUEST", + 206: "GOSSIP_BLOCK_RESPONSE", + 207: "GOSSIP_BATCH_BY_BATCH_ID_REQUEST", + 208: "GOSSIP_BATCH_BY_TRANSACTION_ID_REQUEST", + 209: "GOSSIP_BATCH_RESPONSE", + 210: "GOSSIP_GET_PEERS_REQUEST", + 211: "GOSSIP_GET_PEERS_RESPONSE", + 300: "NETWORK_PING", + 301: "NETWORK_ACK", + 302: "NETWORK_CONNECT", + 303: "NETWORK_DISCONNECT", + 400: "STATE_DELTA_SUBSCRIBE_REQUEST", + 401: "STATE_DELTA_SUBSCRIBE_RESPONSE", + 402: "STATE_DELTA_UNSUBSCRIBE_REQUEST", + 403: "STATE_DELTA_UNSUBSCRIBE_RESPONSE", + 404: "STATE_DELTA_EVENT", + 405: "STATE_DELTA_GET_EVENTS_REQUEST", + 406: "STATE_DELTA_GET_EVENTS_RESPONSE", + 600: "AUTHORIZATION_CONNECTION_RESPONSE", + 601: "AUTHORIZATION_VIOLATION", + 602: "AUTHORIZATION_TRUST_REQUEST", + 603: "AUTHORIZATION_TRUST_RESPONSE", + 604: "AUTHORIZATION_CHALLENGE_REQUEST", + 605: "AUTHORIZATION_CHALLENGE_RESPONSE", + 606: "AUTHORIZATION_CHALLENGE_SUBMIT", + 607: "AUTHORIZATION_CHALLENGE_RESULT", +} +var Message_MessageType_value = map[string]int32{ + "DEFAULT": 0, + "TP_REGISTER_REQUEST": 1, + "TP_REGISTER_RESPONSE": 2, + "TP_UNREGISTER_REQUEST": 3, + "TP_UNREGISTER_RESPONSE": 4, + "TP_PROCESS_REQUEST": 5, + "TP_PROCESS_RESPONSE": 6, + "TP_STATE_GET_REQUEST": 7, + "TP_STATE_GET_RESPONSE": 8, + "TP_STATE_SET_REQUEST": 9, + "TP_STATE_SET_RESPONSE": 10, + "TP_STATE_DEL_REQUEST": 11, + "TP_STATE_DEL_RESPONSE": 12, + "TP_PING": 13, + "TP_PING_RESPONSE": 14, + "TP_ADD_RECEIPT_DATA_REQUEST": 15, + "TP_ADD_RECEIPT_DATA_RESPONSE": 16, + "TP_ADD_EVENT_REQUEST": 17, + "TP_ADD_EVENT_RESPONSE": 18, + "CLIENT_BATCH_SUBMIT_REQUEST": 100, + "CLIENT_BATCH_SUBMIT_RESPONSE": 101, + "CLIENT_BLOCK_LIST_REQUEST": 102, + "CLIENT_BLOCK_LIST_RESPONSE": 103, + "CLIENT_BLOCK_GET_REQUEST": 104, + "CLIENT_BLOCK_GET_RESPONSE": 105, + "CLIENT_BATCH_LIST_REQUEST": 106, + "CLIENT_BATCH_LIST_RESPONSE": 107, + "CLIENT_BATCH_GET_REQUEST": 108, + "CLIENT_BATCH_GET_RESPONSE": 109, + "CLIENT_TRANSACTION_LIST_REQUEST": 110, + "CLIENT_TRANSACTION_LIST_RESPONSE": 111, + "CLIENT_TRANSACTION_GET_REQUEST": 112, + "CLIENT_TRANSACTION_GET_RESPONSE": 113, + "CLIENT_STATE_CURRENT_REQUEST": 114, + "CLIENT_STATE_CURRENT_RESPONSE": 115, + "CLIENT_STATE_LIST_REQUEST": 116, + "CLIENT_STATE_LIST_RESPONSE": 117, + "CLIENT_STATE_GET_REQUEST": 118, + "CLIENT_STATE_GET_RESPONSE": 119, + "CLIENT_BATCH_STATUS_REQUEST": 120, + "CLIENT_BATCH_STATUS_RESPONSE": 121, + "CLIENT_RECEIPT_GET_REQUEST": 122, + "CLIENT_RECEIPT_GET_RESPONSE": 123, + "CLIENT_PEERS_GET_REQUEST": 125, + "CLIENT_PEERS_GET_RESPONSE": 126, + "CLIENT_EVENTS_SUBSCRIBE_REQUEST": 500, + "CLIENT_EVENTS_SUBSCRIBE_RESPONSE": 501, + "CLIENT_EVENTS_UNSUBSCRIBE_REQUEST": 502, + "CLIENT_EVENTS_UNSUBSCRIBE_RESPONSE": 503, + "CLIENT_EVENTS": 504, + "CLIENT_EVENTS_GET_REQUEST": 505, + "CLIENT_EVENTS_GET_RESPONSE": 506, + "GOSSIP_MESSAGE": 200, + "GOSSIP_REGISTER": 201, + "GOSSIP_UNREGISTER": 202, + "GOSSIP_BLOCK_REQUEST": 205, + "GOSSIP_BLOCK_RESPONSE": 206, + "GOSSIP_BATCH_BY_BATCH_ID_REQUEST": 207, + "GOSSIP_BATCH_BY_TRANSACTION_ID_REQUEST": 208, + "GOSSIP_BATCH_RESPONSE": 209, + "GOSSIP_GET_PEERS_REQUEST": 210, + "GOSSIP_GET_PEERS_RESPONSE": 211, + "NETWORK_PING": 300, + "NETWORK_ACK": 301, + "NETWORK_CONNECT": 302, + "NETWORK_DISCONNECT": 303, + "STATE_DELTA_SUBSCRIBE_REQUEST": 400, + "STATE_DELTA_SUBSCRIBE_RESPONSE": 401, + "STATE_DELTA_UNSUBSCRIBE_REQUEST": 402, + "STATE_DELTA_UNSUBSCRIBE_RESPONSE": 403, + "STATE_DELTA_EVENT": 404, + "STATE_DELTA_GET_EVENTS_REQUEST": 405, + "STATE_DELTA_GET_EVENTS_RESPONSE": 406, + "AUTHORIZATION_CONNECTION_RESPONSE": 600, + "AUTHORIZATION_VIOLATION": 601, + "AUTHORIZATION_TRUST_REQUEST": 602, + "AUTHORIZATION_TRUST_RESPONSE": 603, + "AUTHORIZATION_CHALLENGE_REQUEST": 604, + "AUTHORIZATION_CHALLENGE_RESPONSE": 605, + "AUTHORIZATION_CHALLENGE_SUBMIT": 606, + "AUTHORIZATION_CHALLENGE_RESULT": 607, +} + +func (x Message_MessageType) String() string { + return proto.EnumName(Message_MessageType_name, int32(x)) +} +func (Message_MessageType) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{1, 0} } + +// A list of messages to be transmitted together. +type MessageList struct { + Messages []*Message `protobuf:"bytes,1,rep,name=messages" json:"messages,omitempty"` +} + +func (m *MessageList) Reset() { *m = MessageList{} } +func (m *MessageList) String() string { return proto.CompactTextString(m) } +func (*MessageList) ProtoMessage() {} +func (*MessageList) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *MessageList) GetMessages() []*Message { + if m != nil { + return m.Messages + } + return nil +} + +// The message passed between the validator and client, containing the +// header fields and content. +type Message struct { + // The type of message, used to determine how to 'route' the message + // to the appropriate handler as well as how to deserialize the + // content. + MessageType Message_MessageType `protobuf:"varint,1,opt,name=message_type,json=messageType,enum=Message_MessageType" json:"message_type,omitempty"` + // The identifier used to correlate response messages to their related + // request messages. correlation_id should be set to a random string + // for messages which are not responses to previously sent messages. For + // response messages, correlation_id should be set to the same string as + // contained in the request message. + CorrelationId string `protobuf:"bytes,2,opt,name=correlation_id,json=correlationId" json:"correlation_id,omitempty"` + // The content of the message, defined by message_type. In many + // cases, this data has been serialized with Protocol Buffers or + // CBOR. + Content []byte `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"` +} + +func (m *Message) Reset() { *m = Message{} } +func (m *Message) String() string { return proto.CompactTextString(m) } +func (*Message) ProtoMessage() {} +func (*Message) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *Message) GetMessageType() Message_MessageType { + if m != nil { + return m.MessageType + } + return Message_DEFAULT +} + +func (m *Message) GetCorrelationId() string { + if m != nil { + return m.CorrelationId + } + return "" +} + +func (m *Message) GetContent() []byte { + if m != nil { + return m.Content + } + return nil +} + +func init() { + proto.RegisterType((*MessageList)(nil), "MessageList") + proto.RegisterType((*Message)(nil), "Message") + proto.RegisterEnum("Message_MessageType", Message_MessageType_name, Message_MessageType_value) +} + +func init() { + proto.RegisterFile("sawtooth_sdk/protobuf/validator_pb2/validator.proto", fileDescriptor0) +} + +var fileDescriptor0 = []byte{ + // 1032 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x7c, 0x56, 0x5b, 0x73, 0xdb, 0x44, + 0x14, 0x46, 0x96, 0x69, 0xd2, 0x75, 0x92, 0x2a, 0x1b, 0xa7, 0x75, 0xd2, 0x24, 0x4d, 0x0d, 0x94, + 0xcc, 0x30, 0x93, 0xce, 0x24, 0x0f, 0x3c, 0xcb, 0xf2, 0xe2, 0x68, 0xa2, 0x48, 0x46, 0x5a, 0x95, + 0xa1, 0x2f, 0x1a, 0xa7, 0x76, 0x5b, 0xd3, 0x24, 0x0a, 0xb6, 0xda, 0x52, 0x18, 0xf8, 0x0d, 0xdc, + 0x7f, 0x05, 0x97, 0xbf, 0xc1, 0x65, 0xb8, 0x14, 0x5e, 0xb8, 0xf3, 0x27, 0xb8, 0x3f, 0xb1, 0x2b, + 0x9f, 0x95, 0x76, 0x2d, 0x3b, 0x4f, 0xb6, 0xce, 0x77, 0x39, 0x67, 0xcf, 0xee, 0x1e, 0x09, 0xed, + 0x0e, 0x3b, 0x0f, 0x93, 0x38, 0x4e, 0xee, 0x46, 0xc3, 0xee, 0xbd, 0xeb, 0xa7, 0x83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bc, 0x8a, 0x2e, 0x8e, 0x43, 0x20, 0x2b, 0xe3, 0x8b, 0x08, 0x33, 0xac, 0xed, + 0x7b, 0x16, 0x09, 0x82, 0x4c, 0xf3, 0x24, 0x54, 0x90, 0xc7, 0x41, 0x70, 0x0e, 0x2a, 0x08, 0xa8, + 0x49, 0x49, 0xd4, 0x22, 0x34, 0x93, 0xcc, 0x40, 0x05, 0x32, 0x02, 0xa2, 0x59, 0x45, 0x14, 0x48, + 0xa2, 0xf3, 0x8a, 0x28, 0x90, 0x45, 0x48, 0x11, 0x35, 0x89, 0x93, 0x89, 0x2a, 0x8a, 0x68, 0x84, + 0x80, 0x68, 0x8e, 0xb7, 0x91, 0xd7, 0x6d, 0xbb, 0x2d, 0x63, 0x1e, 0x57, 0x91, 0x01, 0x0f, 0x39, + 0x65, 0x01, 0x5f, 0x41, 0x97, 0x59, 0xd4, 0x6c, 0x36, 0x59, 0xd0, 0x22, 0x76, 0x9b, 0x46, 0x4d, + 0x93, 0x9a, 0x99, 0xfd, 0x05, 0xbc, 0x89, 0xd6, 0x26, 0x13, 0xc0, 0xc2, 0x80, 0xd2, 0x38, 0x83, + 0xdc, 0x20, 0x6e, 0xbe, 0x9e, 0x45, 0x28, 0x4d, 0x46, 0x40, 0x84, 0x79, 0x5e, 0xcb, 0xb1, 0x79, + 0xb0, 0x61, 0x52, 0x6b, 0x2f, 0x0a, 0xc2, 0xc6, 0x81, 0x9d, 0x6b, 0xbb, 0x3c, 0xef, 0x64, 0x02, + 0x58, 0xf4, 0xf0, 0x3a, 0x5a, 0x11, 0x0c, 0xc7, 0xb3, 0xf6, 0x23, 0x87, 0xed, 0x67, 0x66, 0x70, + 0x1b, 0x6f, 0xa0, 0xd5, 0x49, 0x30, 0xc8, 0xef, 0xe0, 0x35, 0x54, 0x53, 0x70, 0x79, 0xff, 0xee, + 0x16, 0xcc, 0x95, 0x3d, 0xec, 0xcb, 0x70, 0x5a, 0x9d, 0x92, 0xfb, 0x15, 0x39, 0xb7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, 0x00, 0xff, 0xff, + 0x2b, 0x91, 0x1f, 0xc7, 0xf0, 0x0a, 0x00, 0x00, +} From c853aa4311c2358569198e2e701d2db109ce4d84 Mon Sep 17 00:00:00 2001 From: asettouf Date: Mon, 8 Jan 2018 21:50:51 +0100 Subject: [PATCH 2/2] Add a README for instructions to launch the app Signed-off-by: asettouf --- .../sawtooth-tuna/go-processor/README.md | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LFS171x/sawtooth-material/sawtooth-tuna/go-processor/README.md diff --git a/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/README.md b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/README.md new file mode 100644 index 00000000..16cb38bd --- /dev/null +++ b/LFS171x/sawtooth-material/sawtooth-tuna/go-processor/README.md @@ -0,0 +1,21 @@ +### Setting up the project + +You are going to have to download a few packages: + +* `go get -u github.com/golang/protobuf/proto` +* `go get -u github.com/satori/go.uuid` +* `go get -u github.com/pebbe/zmq4` + +Now since the golang sawtooth_sdk has been commited to this repo (given https://jira.hyperledger.org/browse/STL-974 ), you are ready to go. + +### Launch the project + +* First start the docker with `docker-compose -f sawtooth-default.yaml up` in the folder `sawtooth-material` +* Now go to the folder `sawtooth-material/sawtooth-tuna/go-processor` and in your shell run: `export GOPATH=$PWD` +* Finally run `go run src/processor/main.go` + +The transaction processor should start, and you should see at the end + +``` +2018/01/08 21:49:30.017209 processor.go:351: [INFO] Successfully registered handler (transfer-chain, 0x525b60, application/json, [19d832]) +```