Code Monkey home page Code Monkey logo

aergo-protobuf's Introduction

aergo-protobuf

This respository stores the AERGO Protocol Buffer definitions that are used by different server and client implementations.

Change rule

Protobuffer recognizes messages as ordered key-value pairs. You must not remove or reuse already occupied field numbers. For example, you must not change protobuf in a following way:

// from
message sometype {
  bytes hash = 1;
  string name = 2;
}

// to
message sometype {
  string hash = 1; // please DO NOT reuse it
  string name = 2;
}

Rather change like this:

message sometype {
  reserved 1;
  string name = 2;
  string hash = 3; // redefine field with a new field number
}

Follow these rules for backwards compatibility.

Add

Just add a new field (or message). Assing additional fields does not break backwards compatability, as protobuffer parser automatically ignores unknown fields. A client can check if unknown fields exists or not.

Example: somefile.proto

// from
message sometype {
  bytes hash = 1;
  string name = 2;
}

// to
message sometype {
  bytes hash = 1;
  string name = 2;
  bytes payload = 3; // just add it
}

Remove

Please do not just remove a field, as this breaks backwards compatability. You can keep removed fields as "reserved". Remember that you should not reorder the field numbers.

Example: somefile.proto

// from
message sometype {
  bytes hash = 1;
  string name = 2;
  bytes payload = 3;
}

// to
message sometype {
  reserved 1;  // left already occupied field number
  string name = 2;
  bytes payload = 3;
}

Update (Remove + Add)

Just a combination of remove and add.

Example: somefile.proto

// from
message sometype {
  bytes hash = 1;
  string name = 2;
}

// to
message sometype {
  reserved 1;  // left already occupied field number
  string name = 2;
  string hash = 3; // add a field with an new number
}

Dump Diff

> ./make_diff.sh v1.x.x. v1.x.x

See also

aergo-protobuf's People

Contributors

graup avatar kjunu avatar ashen1dev avatar everjs78 avatar hayarobi avatar mlogue76 avatar sg31park avatar paouvrard avatar eve2adam avatar acktsap avatar hanlsin avatar

Stargazers

Kim avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.