mirror of
				https://source.quilibrium.com/quilibrium/ceremonyclient.git
				synced 2025-10-31 21:47:27 +00:00 
			
		
		
		
	Add CLI flag to print peer id from config (#34)
* Add CLI flag to print peer id from config * Add printing peer id instructions to readme
This commit is contained in:
		
							parent
							
								
									673b815ce8
								
							
						
					
					
						commit
						bb71c38a39
					
				| @ -17,6 +17,14 @@ If you do not, or have already run the above, run: | |||||||
| 
 | 
 | ||||||
|     GOEXPERIMENT=arenas go run ./... |     GOEXPERIMENT=arenas go run ./... | ||||||
| 
 | 
 | ||||||
|  | ## Peer ID | ||||||
|  | 
 | ||||||
|  | In order to find the peer id of a running node, execute the following command from the `node/` folder: | ||||||
|  | 
 | ||||||
|  |     GOEXPERIMENT=arenas go run ./... --peer-id | ||||||
|  | 
 | ||||||
|  | The peer id will be printed to stdout. | ||||||
|  | 
 | ||||||
| ## EXPERIMENTAL – gRPC/REST Support | ## EXPERIMENTAL – gRPC/REST Support | ||||||
| 
 | 
 | ||||||
| If you want to enable gRPC/REST, add the following entries to your config.yml: | If you want to enable gRPC/REST, add the following entries to your config.yml: | ||||||
|  | |||||||
							
								
								
									
										16
									
								
								node/main.go
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								node/main.go
									
									
									
									
									
								
							| @ -38,11 +38,27 @@ var ( | |||||||
| 		false, | 		false, | ||||||
| 		"starts the node in database console mode", | 		"starts the node in database console mode", | ||||||
| 	) | 	) | ||||||
|  | 
 | ||||||
|  | 	peerId = flag.Bool( | ||||||
|  | 		"peer-id", | ||||||
|  | 		false, | ||||||
|  | 		"print the peer id to stdout from the config and exit", | ||||||
|  | 	) | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| func main() { | func main() { | ||||||
| 	flag.Parse() | 	flag.Parse() | ||||||
| 
 | 
 | ||||||
|  | 	if *peerId { | ||||||
|  | 		config, err := config.LoadConfig(*configDirectory, "") | ||||||
|  | 		if err != nil { | ||||||
|  | 			panic(err) | ||||||
|  | 		} | ||||||
|  | 
 | ||||||
|  | 		printPeerID(config.P2P) | ||||||
|  | 		return | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
| 	if *importPrivKey != "" { | 	if *importPrivKey != "" { | ||||||
| 		config, err := config.LoadConfig(*configDirectory, *importPrivKey) | 		config, err := config.LoadConfig(*configDirectory, *importPrivKey) | ||||||
| 		if err != nil { | 		if err != nil { | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Agost Biro
						Agost Biro