5757type  serveOptions  struct  {
5858	forceReset  bool 
5959	resetOnce   bool 
60+ 	skipProto   bool 
6061}
6162
6263func  newServeOption () serveOptions  {
@@ -83,6 +84,13 @@ func ServeResetOnce() ServeOption {
8384	}
8485}
8586
87+ // ServeSkipProto allows to serve the app without generate Go from proto 
88+ func  ServeSkipProto () ServeOption  {
89+ 	return  func (c  * serveOptions ) {
90+ 		c .skipProto  =  true 
91+ 	}
92+ }
93+ 
8694// Serve serves an app. 
8795func  (c  * Chain ) Serve (ctx  context.Context , cacheStorage  cache.Storage , options  ... ServeOption ) error  {
8896	serveOptions  :=  newServeOption ()
@@ -138,7 +146,7 @@ func (c *Chain) Serve(ctx context.Context, cacheStorage cache.Storage, options .
138146				shouldReset  :=  serveOptions .forceReset  ||  serveOptions .resetOnce 
139147
140148				// serve the app. 
141- 				err  =  c .serve (serveCtx , cacheStorage , shouldReset )
149+ 				err  =  c .serve (serveCtx , cacheStorage , shouldReset ,  serveOptions . skipProto )
142150				serveOptions .resetOnce  =  false 
143151
144152				switch  {
@@ -247,7 +255,7 @@ func (c *Chain) watchAppBackend(ctx context.Context) error {
247255// serve performs the operations to serve the blockchain: build, init and start 
248256// if the chain is already initialized and the file didn't changed, the app is directly started 
249257// if the files changed, the state is imported 
250- func  (c  * Chain ) serve (ctx  context.Context , cacheStorage  cache.Storage , forceReset  bool ) error  {
258+ func  (c  * Chain ) serve (ctx  context.Context , cacheStorage  cache.Storage , forceReset ,  skipProto  bool ) error  {
251259	conf , err  :=  c .Config ()
252260	if  err  !=  nil  {
253261		return  & CannotBuildAppError {err }
@@ -328,7 +336,7 @@ func (c *Chain) serve(ctx context.Context, cacheStorage cache.Storage, forceRese
328336	// build phase 
329337	if  ! isInit  ||  appModified  {
330338		// build the blockchain app 
331- 		if  err  :=  c .build (ctx , cacheStorage , "" ); err  !=  nil  {
339+ 		if  err  :=  c .build (ctx , cacheStorage , "" ,  skipProto ); err  !=  nil  {
332340			return  err 
333341		}
334342	}
0 commit comments