"use strict";(self.webpackChunkgrpc_workshop_doc=self.webpackChunkgrpc_workshop_doc||[]).push([[5077],{3905:(e,t,r)=>{r.d(t,{Zo:()=>s,kt:()=>d});var o=r(7294);function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function l(e,t){if(null==e)return{};var r,o,n=function(e,t){if(null==e)return{};var r,o,n={},a=Object.keys(e);for(o=0;o<a.length;o++)r=a[o],t.indexOf(r)>=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var c=o.createContext({}),p=function(e){var t=o.useContext(c),r=t;return e&&(r="function"==typeof e?e(t):i(i({},t),e)),r},s=function(e){var t=p(e.components);return o.createElement(c.Provider,{value:t},e.children)},u="mdxType",f={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},m=o.forwardRef((function(e,t){var r=e.components,n=e.mdxType,a=e.originalType,c=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),u=p(r),m=n,d=u["".concat(c,".").concat(m)]||u[m]||f[m]||a;return r?o.createElement(d,i(i({ref:t},s),{},{components:r})):o.createElement(d,i({ref:t},s))}));function d(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var a=r.length,i=new Array(a);i[0]=m;var l={};for(var c in t)hasOwnProperty.call(t,c)&&(l[c]=t[c]);l.originalType=e,l[u]="string"==typeof e?e:n,i[1]=l;for(var p=2;p<a;p++)i[p]=r[p];return o.createElement.apply(null,i)}return o.createElement.apply(null,r)}m.displayName="MDXCreateElement"},8270:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>c,contentTitle:()=>i,default:()=>f,frontMatter:()=>a,metadata:()=>l,toc:()=>p});var o=r(7462),n=(r(7294),r(3905));const a={},i="Let's practice",l={unversionedId:"Day 1/proto files/practice/index",id:"Day 1/proto files/practice/index",title:"Let's practice",description:"In this short exercise we will play around with some .proto files, and try to compile them using the protoc compiler.",source:"@site/docs/Day 1/02-proto files/07-practice/index.md",sourceDirName:"Day 1/02-proto files/07-practice",slug:"/Day 1/proto files/practice/",permalink:"/docs/Day 1/proto files/practice/",draft:!1,editUrl:"https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/docs/Day 1/02-proto files/07-practice/index.md",tags:[],version:"current",frontMatter:{},sidebar:"day1",previous:{title:"Best practices - writing .proto files",permalink:"/docs/Day 1/proto files/bestpractices"},next:{title:"Ex 1",permalink:"/docs/Day 1/proto files/practice/Ex1"}},c={},p=[{value:"Resources",id:"resources",level:2}],s={toc:p},u="wrapper";function f(e){let{components:t,...r}=e;return(0,n.kt)(u,(0,o.Z)({},s,r,{components:t,mdxType:"MDXLayout"}),(0,n.kt)("h1",{id:"lets-practice"},"Let's practice"),(0,n.kt)("p",null,"In this short exercise we will play around with some .proto files, and try to compile them using the ",(0,n.kt)("inlineCode",{parentName:"p"},"protoc")," compiler."),(0,n.kt)("p",null,"Our goal is to get familiar with the Protocol buffers syntax by using some of the types we talked about.\nWe will compile the with what the compiler does, and be able to use the output in a small demo."),(0,n.kt)("p",null,"By walking through creating a simple example application, we will learn how to:"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"Define message formats in a .proto file."),(0,n.kt)("li",{parentName:"ul"},"Use the protocol buffer compiler."),(0,n.kt)("li",{parentName:"ul"},"Use the C# protocol buffer API to write and read messages.")),(0,n.kt)("h2",{id:"resources"},"Resources"),(0,n.kt)("ul",null,(0,n.kt)("li",{parentName:"ul"},"compiler : you can get the zip file from ",(0,n.kt)("a",{parentName:"li",href:"https://github.com/protocolbuffers/protobuf/releases/download"},"here")," but I already prepared it for you:"),(0,n.kt)("li",{parentName:"ul"},"the include folder of the compiler\nIn the starting repo, you will find a folder named: ",(0,n.kt)("inlineCode",{parentName:"li"},"BasicSyntax")," that contains a ConsoleApp project. Inside it, you will see the ",(0,n.kt)("inlineCode",{parentName:"li"},"protoc.exe")," and the resources")))}f.isMDXComponent=!0}}]);