mirror of
				https://github.com/cerc-io/watcher-ts
				synced 2025-10-31 12:24:07 +00:00 
			
		
		
		
	* Use watch-contract CLI from cli package in codegen * Use reset CLIs from cli package in codegen * Use create checkpoint CLI from cli package in codegen * Use inspect-cid CLI from cli package in codegen * Use import state CLI from cli package in codegen * Use export-state and verify-checkpoint CLI from cli package in codegen * Use server CLI from cli package in codegen * Use job-runner CLI from cli package in codegen * Use index-block CLI from cli package in codegen * Use fill CLI from cli package in codegen * Minor codegen fixes * Update watcher instructions to run job-runner before server
		
			
				
	
	
		
			22 lines
		
	
	
		
			670 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			670 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| //
 | |
| // Copyright 2021 Vulcanize, Inc.
 | |
| //
 | |
| 
 | |
| import fs from 'fs';
 | |
| import path from 'path';
 | |
| import Handlebars from 'handlebars';
 | |
| import { Writable } from 'stream';
 | |
| 
 | |
| const TEMPLATE_FILE = './templates/watch-contract-template.handlebars';
 | |
| 
 | |
| /**
 | |
|  * Writes the watch-contract file generated from a template to a stream.
 | |
|  * @param outStream A writable output stream to write the watch-contract file to.
 | |
|  */
 | |
| export function exportWatchContract (outStream: Writable): void {
 | |
|   const templateString = fs.readFileSync(path.resolve(__dirname, TEMPLATE_FILE)).toString();
 | |
|   const template = Handlebars.compile(templateString);
 | |
|   const events = template({});
 | |
|   outStream.write(events);
 | |
| }
 |