mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 02:42:27 +00:00
clef: rename networkid switch to chainid
This commit is contained in:
parent
65ab280e57
commit
b248bc985f
2 changed files with 13 additions and 5 deletions
|
|
@ -44,6 +44,7 @@ import (
|
|||
"github.com/ethereum/go-ethereum/crypto"
|
||||
"github.com/ethereum/go-ethereum/log"
|
||||
"github.com/ethereum/go-ethereum/node"
|
||||
"github.com/ethereum/go-ethereum/params"
|
||||
"github.com/ethereum/go-ethereum/rlp"
|
||||
"github.com/ethereum/go-ethereum/rpc"
|
||||
"github.com/ethereum/go-ethereum/signer/core"
|
||||
|
|
@ -83,6 +84,11 @@ var (
|
|||
Value: DefaultConfigDir(),
|
||||
Usage: "Directory for Clef configuration",
|
||||
}
|
||||
chainIdFlag = cli.Int64Flag{
|
||||
Name: "chainid",
|
||||
Value: params.MainnetChainConfig.ChainID.Int64(),
|
||||
Usage: "Chain id to use for signing (1=mainnet, 3=ropsten, 4=rinkeby, 5=Goerli)",
|
||||
}
|
||||
rpcPortFlag = cli.IntFlag{
|
||||
Name: "rpcport",
|
||||
Usage: "HTTP-RPC server listening port",
|
||||
|
|
@ -178,7 +184,6 @@ func init() {
|
|||
logLevelFlag,
|
||||
keystoreFlag,
|
||||
configdirFlag,
|
||||
utils.NetworkIdFlag,
|
||||
utils.LightKDFFlag,
|
||||
utils.NoUSBFlag,
|
||||
utils.RPCListenAddrFlag,
|
||||
|
|
@ -402,9 +407,13 @@ func signer(c *cli.Context) error {
|
|||
}
|
||||
}
|
||||
}
|
||||
log.Info("Starting signer", "chainid", c.GlobalInt64(chainIdFlag.Name),
|
||||
"keystore", c.GlobalString(keystoreFlag.Name),
|
||||
"light-kdf", c.GlobalBool(utils.LightKDFFlag.Name),
|
||||
"advanced", c.GlobalBool(advancedMode.Name))
|
||||
|
||||
apiImpl := core.NewSignerAPI(
|
||||
c.GlobalInt64(utils.NetworkIdFlag.Name),
|
||||
c.GlobalInt64(chainIdFlag.Name),
|
||||
c.GlobalString(keystoreFlag.Name),
|
||||
c.GlobalBool(utils.NoUSBFlag.Name),
|
||||
ui, db,
|
||||
|
|
|
|||
|
|
@ -28,8 +28,7 @@ init()
|
|||
function testTx(){
|
||||
if( accts && accts.length > 0) {
|
||||
var a = accts[0]
|
||||
var r = eth.signTransaction({from: a, to: a, value: 1, nonce: 1, gas: 1, gasPrice: 1})
|
||||
console.log("signing response", r)
|
||||
eth.signTransaction({from: a, to: a, value: 1, nonce: 1, gas: 1, gasPrice: 1})
|
||||
}
|
||||
}
|
||||
function testSignText(){
|
||||
|
|
@ -54,7 +53,7 @@ function test(){
|
|||
var tests = [
|
||||
testTx,
|
||||
testSignText,
|
||||
testSignClique,
|
||||
testClique,
|
||||
]
|
||||
for( i in tests){
|
||||
try{
|
||||
|
|
|
|||
Loading…
Reference in a new issue