accounts, eth, clique, signer: support for external signer API (#18079)
* accounts, eth, clique: implement external backend + move sighash calc to backend * signer: implement account_Version on external API * accounts/external: enable ipc, add copyright * accounts, internal, signer: formatting * node: go fmt * flags: disallow --dev in combo with --externalsigner * accounts: remove clique-specific signing method, replace with more generic * accounts, consensus: formatting + fix error in tests * signer/core: remove (test-) import cycle * clique: remove unused import * accounts: remove CliqueHash and avoid dependency on package crypto * consensus/clique: unduplicate header encoding
This commit is contained in:
		
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							520024dfd6
						
					
				
				
					commit
					43e8efe895
				
			| @@ -427,7 +427,11 @@ var ( | ||||
| 		Usage: "Password file to use for non-interactive password input", | ||||
| 		Value: "", | ||||
| 	} | ||||
|  | ||||
| 	ExternalSignerFlag = cli.StringFlag{ | ||||
| 		Name:  "signer", | ||||
| 		Usage: "External signer (url or path to ipc file)", | ||||
| 		Value: "", | ||||
| 	} | ||||
| 	VMEnableDebugFlag = cli.BoolFlag{ | ||||
| 		Name:  "vmdebug", | ||||
| 		Usage: "Record information useful for VM and contract debugging", | ||||
| @@ -990,11 +994,15 @@ func setEtherbase(ctx *cli.Context, ks *keystore.KeyStore, cfg *eth.Config) { | ||||
| 	} | ||||
| 	// Convert the etherbase into an address and configure it | ||||
| 	if etherbase != "" { | ||||
| 		account, err := MakeAddress(ks, etherbase) | ||||
| 		if err != nil { | ||||
| 			Fatalf("Invalid miner etherbase: %v", err) | ||||
| 		if ks != nil { | ||||
| 			account, err := MakeAddress(ks, etherbase) | ||||
| 			if err != nil { | ||||
| 				Fatalf("Invalid miner etherbase: %v", err) | ||||
| 			} | ||||
| 			cfg.Etherbase = account.Address | ||||
| 		} else { | ||||
| 			Fatalf("No etherbase configured") | ||||
| 		} | ||||
| 		cfg.Etherbase = account.Address | ||||
| 	} | ||||
| } | ||||
|  | ||||
| @@ -1093,6 +1101,10 @@ func SetNodeConfig(ctx *cli.Context, cfg *node.Config) { | ||||
| 	setNodeUserIdent(ctx, cfg) | ||||
| 	setDataDir(ctx, cfg) | ||||
|  | ||||
| 	if ctx.GlobalIsSet(ExternalSignerFlag.Name) { | ||||
| 		cfg.ExternalSigner = ctx.GlobalString(ExternalSignerFlag.Name) | ||||
| 	} | ||||
|  | ||||
| 	if ctx.GlobalIsSet(KeyStoreDirFlag.Name) { | ||||
| 		cfg.KeyStoreDir = ctx.GlobalString(KeyStoreDirFlag.Name) | ||||
| 	} | ||||
| @@ -1274,8 +1286,12 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) { | ||||
| 	// Avoid conflicting network flags | ||||
| 	checkExclusive(ctx, DeveloperFlag, TestnetFlag, RinkebyFlag, GoerliFlag) | ||||
| 	checkExclusive(ctx, LightServFlag, SyncModeFlag, "light") | ||||
|  | ||||
| 	ks := stack.AccountManager().Backends(keystore.KeyStoreType)[0].(*keystore.KeyStore) | ||||
| 	// Can't use both ephemeral unlocked and external signer | ||||
| 	checkExclusive(ctx, DeveloperFlag, ExternalSignerFlag) | ||||
| 	var ks *keystore.KeyStore | ||||
| 	if keystores := stack.AccountManager().Backends(keystore.KeyStoreType); len(keystores) > 0 { | ||||
| 		ks = keystores[0].(*keystore.KeyStore) | ||||
| 	} | ||||
| 	setEtherbase(ctx, ks, cfg) | ||||
| 	setGPO(ctx, &cfg.GPO) | ||||
| 	setTxPool(ctx, &cfg.TxPool) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user