github.com/muhammedhassanm/blockchain@v0.0.0-20200120143007-697261defd4d/sawtooth-core-master/families/settings/protos/settings.proto (about)

     1  // Copyright 2017 Intel Corporation
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  // -----------------------------------------------------------------------------
    15  
    16  syntax = "proto3";
    17  
    18  option java_multiple_files = true;
    19  option java_package = "sawtooth.settings.protobuf";
    20  
    21  // Setting Payload
    22  // - Contains either a proposal or a vote.
    23  message SettingsPayload {
    24      // The action indicates data is contained within this payload
    25      enum Action {
    26          ACTION_UNSET = 0;
    27  
    28          // A proposal action - data will be a SettingProposal
    29          PROPOSE = 1;
    30  
    31          // A vote action - data will be a SettingVote
    32          VOTE = 2;
    33      }
    34      // The action of this payload
    35      Action action = 1;
    36  
    37      // The content of this payload
    38      bytes data = 2;
    39  }
    40  
    41  // Setting Proposal
    42  //
    43  // This message proposes a change in a setting value.
    44  message SettingProposal {
    45      // The setting key.  E.g. sawtooth.config.authorization_type
    46      string setting = 1;
    47  
    48      // The setting value. E.g. 'ballot'
    49      string value = 2;
    50  
    51      // allow duplicate proposals with different hashes
    52      // randomly created by the client
    53      string nonce = 3;
    54  }
    55  
    56  // Setting Vote
    57  //
    58  // In ballot mode, a proposal must be voted on.  This message indicates an
    59  // acceptance or rejection of a proposal, where the proposal is identified
    60  // by its id.
    61  message SettingVote {
    62      enum Vote {
    63          VOTE_UNSET = 0;
    64          ACCEPT = 1;
    65          REJECT = 2;
    66      }
    67  
    68      // The id of the proposal, as found in the
    69      // sawtooth.config.vote.proposals setting field
    70      string proposal_id = 1;
    71  
    72      Vote vote = 2;
    73  }
    74  
    75  // Contains the vote counts for a given proposal.
    76  message SettingCandidate {
    77      // An individual vote record
    78      message VoteRecord {
    79          // The public key of the voter
    80          string public_key = 1;
    81  
    82          // The voter's actual vote
    83          SettingVote.Vote vote = 2;
    84  
    85      }
    86  
    87      // The proposal id, a hash of the original proposal
    88      string proposal_id = 1;
    89  
    90      // The active proposal
    91      SettingProposal proposal = 2;
    92  
    93      // list of votes
    94      repeated VoteRecord votes = 3;
    95  }
    96  
    97  // Contains all the setting candiates up for vote.
    98  message SettingCandidates {
    99      repeated SettingCandidate candidates = 1;
   100  }