mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 13:21:37 +00:00
all: normalize flag's name
This commit is contained in:
parent
b883b0b593
commit
369d69649f
14 changed files with 257 additions and 200 deletions
|
|
@ -53,10 +53,10 @@ echo "Running a node with wallet: ${wallet} at local"
|
||||||
../../build/bin/XDC --ethstats ${netstats} --gcmode=archive \
|
../../build/bin/XDC --ethstats ${netstats} --gcmode=archive \
|
||||||
--bootnodes ${bootnodes} --syncmode full \
|
--bootnodes ${bootnodes} --syncmode full \
|
||||||
--datadir ./tmp/xdcchain --networkid 551 \
|
--datadir ./tmp/xdcchain --networkid 551 \
|
||||||
-port 30303 --rpc --rpccorsdomain "*" --rpcaddr 0.0.0.0 \
|
--port 30303 --http --http-corsdomain "*" --http-addr 0.0.0.0 \
|
||||||
--rpcport 8545 \
|
--http-port 8545 \
|
||||||
--rpcapi db,eth,debug,miner,net,shh,txpool,personal,web3,XDPoS \
|
--http-api db,eth,debug,miner,net,shh,txpool,personal,web3,XDPoS \
|
||||||
--rpcvhosts "*" --unlock "${wallet}" --password ./tmp/.pwd --mine \
|
--http-vhosts "*" --unlock "${wallet}" --password ./tmp/.pwd --mine \
|
||||||
--gasprice "1" --targetgaslimit "420000000" --verbosity ${log_level} \
|
--miner-gasprice "1" --miner-gaslimit "420000000" --verbosity ${log_level} \
|
||||||
--ws --wsaddr=0.0.0.0 --wsport 8555 \
|
--ws --ws-addr=0.0.0.0 --ws-port 8555 \
|
||||||
--wsorigins "*" 2>&1 >>./tmp/xdc.log
|
--ws-origins "*" 2>&1 >>./tmp/xdc.log
|
||||||
|
|
|
||||||
|
|
@ -75,11 +75,11 @@ XDC --ethstats ${netstats} --gcmode archive \
|
||||||
--nat extip:${INSTANCE_IP} \
|
--nat extip:${INSTANCE_IP} \
|
||||||
--bootnodes ${bootnodes} --syncmode full \
|
--bootnodes ${bootnodes} --syncmode full \
|
||||||
--datadir /work/xdcchain --networkid 551 \
|
--datadir /work/xdcchain --networkid 551 \
|
||||||
-port $port --rpc --rpccorsdomain "*" --rpcaddr 0.0.0.0 \
|
--port $port --http --http-corsdomain "*" --http-addr 0.0.0.0 \
|
||||||
--rpcport $rpc_port \
|
--http-port $rpc_port \
|
||||||
--rpcapi db,eth,debug,net,shh,txpool,personal,web3,XDPoS \
|
--http-api db,eth,debug,net,shh,txpool,personal,web3,XDPoS \
|
||||||
--rpcvhosts "*" --unlock "${wallet}" --password /work/.pwd --mine \
|
--http-vhosts "*" --unlock "${wallet}" --password /work/.pwd --mine \
|
||||||
--gasprice "1" --targetgaslimit "420000000" --verbosity ${log_level} \
|
--miner-gasprice "1" --miner-gaslimit "420000000" --verbosity ${log_level} \
|
||||||
--debugdatadir /work/xdcchain \
|
--debugdatadir /work/xdcchain \
|
||||||
--ws --wsaddr=0.0.0.0 --wsport $ws_port \
|
--ws --ws-addr=0.0.0.0 --ws-port $ws_port \
|
||||||
--wsorigins "*" 2>&1 >>/work/xdcchain/xdc.log | tee -a /work/xdcchain/xdc.log
|
--ws-origins "*" 2>&1 >>/work/xdcchain/xdc.log | tee -a /work/xdcchain/xdc.log
|
||||||
|
|
|
||||||
|
|
@ -74,11 +74,11 @@ XDC --ethstats ${netstats} --gcmode archive \
|
||||||
--nat extip:${INSTANCE_IP} \
|
--nat extip:${INSTANCE_IP} \
|
||||||
--bootnodes ${bootnodes} --syncmode full \
|
--bootnodes ${bootnodes} --syncmode full \
|
||||||
--datadir /work/xdcchain --networkid 50 \
|
--datadir /work/xdcchain --networkid 50 \
|
||||||
-port $port --rpc --rpccorsdomain "*" --rpcaddr 0.0.0.0 \
|
--port $port --http --http-corsdomain "*" --http-addr 0.0.0.0 \
|
||||||
--rpcport $rpc_port \
|
--http-port $rpc_port \
|
||||||
--rpcapi db,eth,debug,net,shh,txpool,personal,web3,XDPoS \
|
--http-api db,eth,debug,net,shh,txpool,personal,web3,XDPoS \
|
||||||
--rpcvhosts "*" --unlock "${wallet}" --password /work/.pwd --mine \
|
--http-vhosts "*" --unlock "${wallet}" --password /work/.pwd --mine \
|
||||||
--gasprice "1" --targetgaslimit "420000000" --verbosity ${log_level} \
|
--miner-gasprice "1" --miner-gaslimit "420000000" --verbosity ${log_level} \
|
||||||
--debugdatadir /work/xdcchain \
|
--debugdatadir /work/xdcchain \
|
||||||
--ws --wsaddr=0.0.0.0 --wsport $ws_port \
|
--ws --ws-addr=0.0.0.0 --ws-port $ws_port \
|
||||||
--wsorigins "*" 2>&1 >>/work/xdcchain/xdc.log | tee -a /work/xdcchain/xdc.log
|
--ws-origins "*" 2>&1 >>/work/xdcchain/xdc.log | tee -a /work/xdcchain/xdc.log
|
||||||
|
|
|
||||||
|
|
@ -76,11 +76,11 @@ XDC --ethstats ${netstats} --gcmode archive \
|
||||||
--nat extip:${INSTANCE_IP} \
|
--nat extip:${INSTANCE_IP} \
|
||||||
--bootnodes ${bootnodes} --syncmode full \
|
--bootnodes ${bootnodes} --syncmode full \
|
||||||
--datadir /work/xdcchain --networkid 51 \
|
--datadir /work/xdcchain --networkid 51 \
|
||||||
-port $port --rpc --rpccorsdomain "*" --rpcaddr 0.0.0.0 \
|
--port $port --http --http-corsdomain "*" --http-addr 0.0.0.0 \
|
||||||
--rpcport $rpc_port \
|
--http-port $rpc_port \
|
||||||
--rpcapi db,eth,debug,net,shh,txpool,personal,web3,XDPoS \
|
--http-api db,eth,debug,net,shh,txpool,personal,web3,XDPoS \
|
||||||
--rpcvhosts "*" --unlock "${wallet}" --password /work/.pwd --mine \
|
--http-vhosts "*" --unlock "${wallet}" --password /work/.pwd --mine \
|
||||||
--gasprice "1" --targetgaslimit "420000000" --verbosity ${log_level} \
|
--miner-gasprice "1" --miner-gaslimit "420000000" --verbosity ${log_level} \
|
||||||
--debugdatadir /work/xdcchain \
|
--debugdatadir /work/xdcchain \
|
||||||
--ws --wsaddr=0.0.0.0 --wsport $ws_port \
|
--ws --ws-addr=0.0.0.0 --ws-port $ws_port \
|
||||||
--wsorigins "*" 2>&1 >>/work/xdcchain/xdc.log | tee -a /work/xdcchain/xdc.log
|
--ws-origins "*" 2>&1 >>/work/xdcchain/xdc.log | tee -a /work/xdcchain/xdc.log
|
||||||
|
|
|
||||||
|
|
@ -138,8 +138,8 @@ func makeConfigNode(ctx *cli.Context) (*node.Node, XDCConfig) {
|
||||||
utils.Fatalf("%v", err)
|
utils.Fatalf("%v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ctx.IsSet(utils.StakingEnabledFlag.Name) {
|
if ctx.IsSet(utils.MiningEnabledFlag.Name) {
|
||||||
cfg.StakeEnable = ctx.Bool(utils.StakingEnabledFlag.Name)
|
cfg.StakeEnable = ctx.Bool(utils.MiningEnabledFlag.Name)
|
||||||
}
|
}
|
||||||
// if !ctx.IsSet(debug.VerbosityFlag.Name) {
|
// if !ctx.IsSet(debug.VerbosityFlag.Name) {
|
||||||
// debug.Verbosity(log.Lvl(cfg.Verbosity))
|
// debug.Verbosity(log.Lvl(cfg.Verbosity))
|
||||||
|
|
@ -175,8 +175,8 @@ func makeConfigNode(ctx *cli.Context) (*node.Node, XDCConfig) {
|
||||||
|
|
||||||
// Check GasPrice
|
// Check GasPrice
|
||||||
common.MinGasPrice = big.NewInt(common.DefaultMinGasPrice)
|
common.MinGasPrice = big.NewInt(common.DefaultMinGasPrice)
|
||||||
if ctx.IsSet(utils.GasPriceFlag.Name) {
|
if ctx.IsSet(utils.MinerGasPriceFlag.Name) {
|
||||||
if gasPrice := int64(ctx.Int(utils.GasPriceFlag.Name)); gasPrice > common.DefaultMinGasPrice {
|
if gasPrice := int64(ctx.Int(utils.MinerGasPriceFlag.Name)); gasPrice > common.DefaultMinGasPrice {
|
||||||
common.MinGasPrice = big.NewInt(gasPrice)
|
common.MinGasPrice = big.NewInt(gasPrice)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,9 +44,9 @@ func TestConsoleWelcome(t *testing.T) {
|
||||||
|
|
||||||
// Start a XDC console, make sure it's cleaned up and terminate the console
|
// Start a XDC console, make sure it's cleaned up and terminate the console
|
||||||
XDC := runXDC(t,
|
XDC := runXDC(t,
|
||||||
"console", "--datadir", datadir, "--XDCx.datadir", datadir+"/XDCx/"+time.Now().String(),
|
"console", "--datadir", datadir, "--XDCx-datadir", datadir+"/XDCx/"+time.Now().String(),
|
||||||
"--port", "0", "--maxpeers", "0", "--nodiscover", "--nat", "none",
|
"--port", "0", "--maxpeers", "0", "--nodiscover", "--nat", "none",
|
||||||
"--etherbase", coinbase)
|
"--miner-etherbase", coinbase)
|
||||||
|
|
||||||
// Gather all the infos the welcome message needs to contain
|
// Gather all the infos the welcome message needs to contain
|
||||||
XDC.SetTemplateFunc("goos", func() string { return runtime.GOOS })
|
XDC.SetTemplateFunc("goos", func() string { return runtime.GOOS })
|
||||||
|
|
@ -86,9 +86,9 @@ func TestIPCAttachWelcome(t *testing.T) {
|
||||||
ipc = filepath.Join(datadir, "XDC.ipc")
|
ipc = filepath.Join(datadir, "XDC.ipc")
|
||||||
}
|
}
|
||||||
XDC := runXDC(t,
|
XDC := runXDC(t,
|
||||||
"--datadir", datadir, "--XDCx.datadir", datadir+"/XDCx/"+time.Now().String(),
|
"--datadir", datadir, "--XDCx-datadir", datadir+"/XDCx/"+time.Now().String(),
|
||||||
"--port", "0", "--maxpeers", "0", "--nodiscover", "--nat", "none",
|
"--port", "0", "--maxpeers", "0", "--nodiscover", "--nat", "none",
|
||||||
"--etherbase", coinbase, "--ipcpath", ipc)
|
"--miner-etherbase", coinbase, "--ipcpath", ipc)
|
||||||
|
|
||||||
time.Sleep(2 * time.Second) // Simple way to wait for the RPC endpoint to open
|
time.Sleep(2 * time.Second) // Simple way to wait for the RPC endpoint to open
|
||||||
testAttachWelcome(t, XDC, "ipc:"+ipc, ipcAPIs)
|
testAttachWelcome(t, XDC, "ipc:"+ipc, ipcAPIs)
|
||||||
|
|
@ -103,9 +103,9 @@ func TestHTTPAttachWelcome(t *testing.T) {
|
||||||
datadir := tmpdir(t)
|
datadir := tmpdir(t)
|
||||||
defer os.RemoveAll(datadir)
|
defer os.RemoveAll(datadir)
|
||||||
XDC := runXDC(t,
|
XDC := runXDC(t,
|
||||||
"--datadir", datadir, "--XDCx.datadir", datadir+"/XDCx/"+time.Now().String(),
|
"--datadir", datadir, "--XDCx-datadir", datadir+"/XDCx/"+time.Now().String(),
|
||||||
"--port", "0", "--maxpeers", "0", "--nodiscover", "--nat", "none",
|
"--port", "0", "--maxpeers", "0", "--nodiscover", "--nat", "none",
|
||||||
"--etherbase", coinbase, "--rpc", "--rpcport", port)
|
"--miner-etherbase", coinbase, "--http", "--http-port", port)
|
||||||
|
|
||||||
time.Sleep(2 * time.Second) // Simple way to wait for the RPC endpoint to open
|
time.Sleep(2 * time.Second) // Simple way to wait for the RPC endpoint to open
|
||||||
testAttachWelcome(t, XDC, "http://localhost:"+port, httpAPIs)
|
testAttachWelcome(t, XDC, "http://localhost:"+port, httpAPIs)
|
||||||
|
|
@ -120,9 +120,9 @@ func TestWSAttachWelcome(t *testing.T) {
|
||||||
datadir := tmpdir(t)
|
datadir := tmpdir(t)
|
||||||
defer os.RemoveAll(datadir)
|
defer os.RemoveAll(datadir)
|
||||||
XDC := runXDC(t,
|
XDC := runXDC(t,
|
||||||
"--datadir", datadir, "--XDCx.datadir", datadir+"/XDCx/"+time.Now().String(),
|
"--datadir", datadir, "--XDCx-datadir", datadir+"/XDCx/"+time.Now().String(),
|
||||||
"--port", "0", "--maxpeers", "0", "--nodiscover", "--nat", "none",
|
"--port", "0", "--maxpeers", "0", "--nodiscover", "--nat", "none",
|
||||||
"--etherbase", coinbase, "--ws", "--wsport", port)
|
"--miner-etherbase", coinbase, "--ws", "--ws-port", port)
|
||||||
|
|
||||||
time.Sleep(2 * time.Second) // Simple way to wait for the RPC endpoint to open
|
time.Sleep(2 * time.Second) // Simple way to wait for the RPC endpoint to open
|
||||||
testAttachWelcome(t, XDC, "ws://localhost:"+port, httpAPIs)
|
testAttachWelcome(t, XDC, "ws://localhost:"+port, httpAPIs)
|
||||||
|
|
|
||||||
|
|
@ -101,11 +101,11 @@ var (
|
||||||
utils.ListenPortFlag,
|
utils.ListenPortFlag,
|
||||||
utils.MaxPeersFlag,
|
utils.MaxPeersFlag,
|
||||||
utils.MaxPendingPeersFlag,
|
utils.MaxPendingPeersFlag,
|
||||||
utils.EtherbaseFlag,
|
utils.MinerEtherbaseFlag,
|
||||||
utils.GasPriceFlag,
|
utils.MinerGasPriceFlag,
|
||||||
utils.StakerThreadsFlag,
|
utils.MinerThreadsFlag,
|
||||||
utils.StakingEnabledFlag,
|
utils.MiningEnabledFlag,
|
||||||
utils.TargetGasLimitFlag,
|
utils.MinerGasLimitFlag,
|
||||||
utils.NATFlag,
|
utils.NATFlag,
|
||||||
utils.NoDiscoverFlag,
|
utils.NoDiscoverFlag,
|
||||||
//utils.DiscoveryV5Flag,
|
//utils.DiscoveryV5Flag,
|
||||||
|
|
@ -122,8 +122,8 @@ var (
|
||||||
utils.EnableXDCPrefixFlag,
|
utils.EnableXDCPrefixFlag,
|
||||||
utils.RewoundFlag,
|
utils.RewoundFlag,
|
||||||
utils.NetworkIdFlag,
|
utils.NetworkIdFlag,
|
||||||
utils.RPCCORSDomainFlag,
|
utils.HTTPCORSDomainFlag,
|
||||||
utils.RPCVirtualHostsFlag,
|
utils.HTTPVirtualHostsFlag,
|
||||||
utils.EthStatsURLFlag,
|
utils.EthStatsURLFlag,
|
||||||
utils.MetricsEnabledFlag,
|
utils.MetricsEnabledFlag,
|
||||||
utils.MetricsHTTPFlag,
|
utils.MetricsHTTPFlag,
|
||||||
|
|
@ -145,14 +145,14 @@ var (
|
||||||
}
|
}
|
||||||
|
|
||||||
rpcFlags = []cli.Flag{
|
rpcFlags = []cli.Flag{
|
||||||
utils.RPCEnabledFlag,
|
utils.HTTPEnabledFlag,
|
||||||
utils.RPCGlobalGasCapFlag,
|
utils.RPCGlobalGasCapFlag,
|
||||||
utils.RPCListenAddrFlag,
|
utils.HTTPListenAddrFlag,
|
||||||
utils.RPCPortFlag,
|
utils.HTTPPortFlag,
|
||||||
utils.RPCHttpReadTimeoutFlag,
|
utils.HTTPReadTimeoutFlag,
|
||||||
utils.RPCHttpWriteTimeoutFlag,
|
utils.HTTPWriteTimeoutFlag,
|
||||||
utils.RPCHttpIdleTimeoutFlag,
|
utils.HTTPIdleTimeoutFlag,
|
||||||
utils.RPCApiFlag,
|
utils.HTTPApiFlag,
|
||||||
utils.WSEnabledFlag,
|
utils.WSEnabledFlag,
|
||||||
utils.WSListenAddrFlag,
|
utils.WSListenAddrFlag,
|
||||||
utils.WSPortFlag,
|
utils.WSPortFlag,
|
||||||
|
|
@ -329,7 +329,7 @@ func startNode(ctx *cli.Context, stack *node.Node, cfg XDCConfig) {
|
||||||
} else {
|
} else {
|
||||||
log.Info("Masternode found. Enabling staking mode...")
|
log.Info("Masternode found. Enabling staking mode...")
|
||||||
// Use a reduced number of threads if requested
|
// Use a reduced number of threads if requested
|
||||||
if threads := ctx.Int(utils.StakerThreadsFlag.Name); threads > 0 {
|
if threads := ctx.Int(utils.MinerThreadsFlag.Name); threads > 0 {
|
||||||
type threaded interface {
|
type threaded interface {
|
||||||
SetThreads(threads int)
|
SetThreads(threads int)
|
||||||
}
|
}
|
||||||
|
|
@ -371,7 +371,7 @@ func startNode(ctx *cli.Context, stack *node.Node, cfg XDCConfig) {
|
||||||
} else {
|
} else {
|
||||||
log.Info("Masternode found. Enabling staking mode...")
|
log.Info("Masternode found. Enabling staking mode...")
|
||||||
// Use a reduced number of threads if requested
|
// Use a reduced number of threads if requested
|
||||||
if threads := ctx.Int(utils.StakerThreadsFlag.Name); threads > 0 {
|
if threads := ctx.Int(utils.MinerThreadsFlag.Name); threads > 0 {
|
||||||
type threaded interface {
|
type threaded interface {
|
||||||
SetThreads(threads int)
|
SetThreads(threads int)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ func runXDC(t *testing.T, args ...string) *testXDC {
|
||||||
if i < len(args)-1 {
|
if i < len(args)-1 {
|
||||||
tt.Datadir = args[i+1]
|
tt.Datadir = args[i+1]
|
||||||
}
|
}
|
||||||
case "--etherbase":
|
case "--miner-etherbase":
|
||||||
if i < len(args)-1 {
|
if i < len(args)-1 {
|
||||||
tt.Etherbase = args[i+1]
|
tt.Etherbase = args[i+1]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
20
cmd/XDC/testdata/config.toml
vendored
20
cmd/XDC/testdata/config.toml
vendored
|
|
@ -5,24 +5,24 @@ NAT = "" # flag --nat
|
||||||
[Eth]
|
[Eth]
|
||||||
NetworkId = 89 # flag --networkid
|
NetworkId = 89 # flag --networkid
|
||||||
SyncMode = "full" # flag --syncmode
|
SyncMode = "full" # flag --syncmode
|
||||||
GasPrice = 1 # flag --gasprice
|
GasPrice = 1 # flag --miner-gasprice
|
||||||
|
|
||||||
[Shh]
|
[Shh]
|
||||||
|
|
||||||
[Node]
|
[Node]
|
||||||
DataDir = "node1/" # flag --datadir
|
DataDir = "node1/" # flag --datadir
|
||||||
HTTPPort = 8501 # flag --rpcport
|
HTTPPort = 8501 # flag --http-port
|
||||||
HTTPHost = "localhost" # flags --rpcaddr & --rpc
|
HTTPHost = "localhost" # flags --http-addr & --http
|
||||||
# in 3 cases :
|
# in 3 cases :
|
||||||
# HTTPHost is "" == --rpc & --rpcaddr is not set
|
# HTTPHost is "" == --http & --http-addr is not set
|
||||||
# HTTPHost is "localhost" or "127.0.0.1" == only set --rpc
|
# HTTPHost is "localhost" or "127.0.0.1" == only set --http
|
||||||
# HTTPHost is other IP (ex : 192.168.1.1) = set 2 flags --rpc & --rpcaddr
|
# HTTPHost is other IP (ex : 192.168.1.1) = set 2 flags --http & --http-addr
|
||||||
WSHost = "localhost" # flags --wsaddr & --ws . same option HTTPHost
|
WSHost = "localhost" # flags --ws-addr & --ws . same option HTTPHost
|
||||||
WSPort = 8546 # flag --wsport
|
WSPort = 8546 # flag --ws-port
|
||||||
WSModules = ["eth","ssh"] #flag --wsapi
|
WSModules = ["eth","ssh"] #flag --ws-api
|
||||||
|
|
||||||
|
|
||||||
HTTPModules = ["personal","db","eth","net","web3","txpool","miner"] # flag --rpcapi
|
HTTPModules = ["personal","db","eth","net","web3","txpool","miner"] # flag --http-api
|
||||||
KeyStoreDir = "" # flag --keystore
|
KeyStoreDir = "" # flag --keystore
|
||||||
UserIdent = "" # flag --identity
|
UserIdent = "" # flag --identity
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ ADD genesis.json /genesis.json
|
||||||
RUN \
|
RUN \
|
||||||
echo 'XDC --cache 512 init /genesis.json' > XDC.sh && \{{if .Unlock}}
|
echo 'XDC --cache 512 init /genesis.json' > XDC.sh && \{{if .Unlock}}
|
||||||
echo 'mkdir -p /root/.ethereum/keystore/ && cp /signer.json /root/.ethereum/keystore/' >> XDC.sh && \{{end}}
|
echo 'mkdir -p /root/.ethereum/keystore/ && cp /signer.json /root/.ethereum/keystore/' >> XDC.sh && \{{end}}
|
||||||
echo $'XDC --networkid {{.NetworkID}} --cache 512 --port {{.Port}} --maxpeers {{.Peers}} {{.LightFlag}} --ethstats \'{{.Ethstats}}\' {{if .Bootnodes}}--bootnodes {{.Bootnodes}}{{end}} {{if .Etherbase}}--etherbase {{.Etherbase}} --mine --minerthreads 1{{end}} {{if .Unlock}}--unlock 0 --password /signer.pass --mine{{end}} --targetgaslimit {{.GasTarget}} --gasprice {{.GasPrice}}' >> XDC.sh
|
echo $'XDC --networkid {{.NetworkID}} --cache 512 --port {{.Port}} --maxpeers {{.Peers}} {{.LightFlag}} --ethstats \'{{.Ethstats}}\' {{if .Bootnodes}}--bootnodes {{.Bootnodes}}{{end}} {{if .Etherbase}}--miner-etherbase {{.Etherbase}} --mine --miner-threads 1{{end}} {{if .Unlock}}--unlock 0 --password /signer.pass --mine{{end}} --miner-gaslimit {{.GasTarget}} --miner-gasprice {{.GasPrice}}' >> XDC.sh
|
||||||
|
|
||||||
ENTRYPOINT ["/bin/sh", "XDC.sh"]
|
ENTRYPOINT ["/bin/sh", "XDC.sh"]
|
||||||
`
|
`
|
||||||
|
|
@ -92,7 +92,7 @@ func deployNode(client *sshClient, network string, bootnodes []string, config *n
|
||||||
|
|
||||||
lightFlag := ""
|
lightFlag := ""
|
||||||
if config.peersLight > 0 {
|
if config.peersLight > 0 {
|
||||||
lightFlag = fmt.Sprintf("--lightpeers=%d --lightserv=50", config.peersLight)
|
lightFlag = fmt.Sprintf("--light-peers=%d --light-serv=50", config.peersLight)
|
||||||
}
|
}
|
||||||
dockerfile := new(bytes.Buffer)
|
dockerfile := new(bytes.Buffer)
|
||||||
template.Must(template.New("").Parse(nodeDockerfile)).Execute(dockerfile, map[string]interface{}{
|
template.Must(template.New("").Parse(nodeDockerfile)).Execute(dockerfile, map[string]interface{}{
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ ADD genesis.json /genesis.json
|
||||||
RUN \
|
RUN \
|
||||||
echo 'node server.js &' > wallet.sh && \
|
echo 'node server.js &' > wallet.sh && \
|
||||||
echo 'XDC --cache 512 init /genesis.json' >> wallet.sh && \
|
echo 'XDC --cache 512 init /genesis.json' >> wallet.sh && \
|
||||||
echo $'XDC --networkid {{.NetworkID}} --port {{.NodePort}} --bootnodes {{.Bootnodes}} --ethstats \'{{.Ethstats}}\' --cache=512 --rpc --rpcaddr=0.0.0.0 --rpccorsdomain "*" --rpcvhosts "*"' >> wallet.sh
|
echo $'XDC --networkid {{.NetworkID}} --port {{.NodePort}} --bootnodes {{.Bootnodes}} --ethstats \'{{.Ethstats}}\' --cache=512 --http --http-addr=0.0.0.0 --http-corsdomain "*" --http-vhosts "*"' >> wallet.sh
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
sed -i 's/PuppethNetworkID/{{.NetworkID}}/g' dist/js/etherwallet-master.js && \
|
sed -i 's/PuppethNetworkID/{{.NetworkID}}/g' dist/js/etherwallet-master.js && \
|
||||||
|
|
|
||||||
|
|
@ -113,6 +113,7 @@ var (
|
||||||
}
|
}
|
||||||
DeveloperPeriodFlag = &cli.IntFlag{
|
DeveloperPeriodFlag = &cli.IntFlag{
|
||||||
Name: "dev-period",
|
Name: "dev-period",
|
||||||
|
Aliases: []string{"dev.period"},
|
||||||
Usage: "Block period to use in developer mode (0 = mine only if transaction pending)",
|
Usage: "Block period to use in developer mode (0 = mine only if transaction pending)",
|
||||||
Category: flags.DevCategory,
|
Category: flags.DevCategory,
|
||||||
}
|
}
|
||||||
|
|
@ -149,13 +150,15 @@ var (
|
||||||
|
|
||||||
// Light server and client settings
|
// Light server and client settings
|
||||||
LightServFlag = &cli.IntFlag{
|
LightServFlag = &cli.IntFlag{
|
||||||
Name: "lightserv",
|
Name: "light-serv",
|
||||||
|
Aliases: []string{"lightserv"},
|
||||||
Usage: "Maximum percentage of time allowed for serving LES requests (0-90)",
|
Usage: "Maximum percentage of time allowed for serving LES requests (0-90)",
|
||||||
Value: ethconfig.Defaults.LightServ,
|
Value: ethconfig.Defaults.LightServ,
|
||||||
Category: flags.LightCategory,
|
Category: flags.LightCategory,
|
||||||
}
|
}
|
||||||
LightPeersFlag = &cli.IntFlag{
|
LightPeersFlag = &cli.IntFlag{
|
||||||
Name: "lightpeers",
|
Name: "light-peers",
|
||||||
|
Aliases: []string{"lightpeers"},
|
||||||
Usage: "Maximum number of LES client peers",
|
Usage: "Maximum number of LES client peers",
|
||||||
Value: ethconfig.Defaults.LightPeers,
|
Value: ethconfig.Defaults.LightPeers,
|
||||||
Category: flags.LightCategory,
|
Category: flags.LightCategory,
|
||||||
|
|
@ -163,36 +166,42 @@ var (
|
||||||
|
|
||||||
// Ethash settings
|
// Ethash settings
|
||||||
EthashCacheDirFlag = &flags.DirectoryFlag{
|
EthashCacheDirFlag = &flags.DirectoryFlag{
|
||||||
Name: "ethash.cachedir",
|
Name: "ethash-cachedir",
|
||||||
|
Aliases: []string{"ethash.cachedir"},
|
||||||
Usage: "Directory to store the ethash verification caches (default = inside the datadir)",
|
Usage: "Directory to store the ethash verification caches (default = inside the datadir)",
|
||||||
Category: flags.EthashCategory,
|
Category: flags.EthashCategory,
|
||||||
}
|
}
|
||||||
EthashCachesInMemoryFlag = &cli.IntFlag{
|
EthashCachesInMemoryFlag = &cli.IntFlag{
|
||||||
Name: "ethash.cachesinmem",
|
Name: "ethash-cachesinmem",
|
||||||
|
Aliases: []string{"ethash.cachesinmem"},
|
||||||
Usage: "Number of recent ethash caches to keep in memory (16MB each)",
|
Usage: "Number of recent ethash caches to keep in memory (16MB each)",
|
||||||
Value: ethconfig.Defaults.Ethash.CachesInMem,
|
Value: ethconfig.Defaults.Ethash.CachesInMem,
|
||||||
Category: flags.EthashCategory,
|
Category: flags.EthashCategory,
|
||||||
}
|
}
|
||||||
EthashCachesOnDiskFlag = &cli.IntFlag{
|
EthashCachesOnDiskFlag = &cli.IntFlag{
|
||||||
Name: "ethash.cachesondisk",
|
Name: "ethash-cachesondisk",
|
||||||
|
Aliases: []string{"ethash.cachesondisk"},
|
||||||
Usage: "Number of recent ethash caches to keep on disk (16MB each)",
|
Usage: "Number of recent ethash caches to keep on disk (16MB each)",
|
||||||
Value: ethconfig.Defaults.Ethash.CachesOnDisk,
|
Value: ethconfig.Defaults.Ethash.CachesOnDisk,
|
||||||
Category: flags.EthashCategory,
|
Category: flags.EthashCategory,
|
||||||
}
|
}
|
||||||
EthashDatasetDirFlag = &flags.DirectoryFlag{
|
EthashDatasetDirFlag = &flags.DirectoryFlag{
|
||||||
Name: "ethash.dagdir",
|
Name: "ethash-dagdir",
|
||||||
|
Aliases: []string{"ethash.dagdir"},
|
||||||
Usage: "Directory to store the ethash mining DAGs (default = inside home folder)",
|
Usage: "Directory to store the ethash mining DAGs (default = inside home folder)",
|
||||||
Value: flags.DirectoryString(ethconfig.Defaults.Ethash.DatasetDir),
|
Value: flags.DirectoryString(ethconfig.Defaults.Ethash.DatasetDir),
|
||||||
Category: flags.EthashCategory,
|
Category: flags.EthashCategory,
|
||||||
}
|
}
|
||||||
EthashDatasetsInMemoryFlag = &cli.IntFlag{
|
EthashDatasetsInMemoryFlag = &cli.IntFlag{
|
||||||
Name: "ethash.dagsinmem",
|
Name: "ethash-dagsinmem",
|
||||||
|
Aliases: []string{"ethash.dagsinmem"},
|
||||||
Usage: "Number of recent ethash mining DAGs to keep in memory (1+GB each)",
|
Usage: "Number of recent ethash mining DAGs to keep in memory (1+GB each)",
|
||||||
Value: ethconfig.Defaults.Ethash.DatasetsInMem,
|
Value: ethconfig.Defaults.Ethash.DatasetsInMem,
|
||||||
Category: flags.EthashCategory,
|
Category: flags.EthashCategory,
|
||||||
}
|
}
|
||||||
EthashDatasetsOnDiskFlag = &cli.IntFlag{
|
EthashDatasetsOnDiskFlag = &cli.IntFlag{
|
||||||
Name: "ethash.dagsondisk",
|
Name: "ethash-dagsondisk",
|
||||||
|
Aliases: []string{"ethash.dagsondisk"},
|
||||||
Usage: "Number of recent ethash mining DAGs to keep on disk (1+GB each)",
|
Usage: "Number of recent ethash mining DAGs to keep on disk (1+GB each)",
|
||||||
Value: ethconfig.Defaults.Ethash.DatasetsOnDisk,
|
Value: ethconfig.Defaults.Ethash.DatasetsOnDisk,
|
||||||
Category: flags.EthashCategory,
|
Category: flags.EthashCategory,
|
||||||
|
|
@ -200,60 +209,70 @@ var (
|
||||||
|
|
||||||
// Transaction pool settings
|
// Transaction pool settings
|
||||||
TxPoolNoLocalsFlag = &cli.BoolFlag{
|
TxPoolNoLocalsFlag = &cli.BoolFlag{
|
||||||
Name: "txpool.nolocals",
|
Name: "txpool-nolocals",
|
||||||
|
Aliases: []string{"txpool.nolocals"},
|
||||||
Usage: "Disables price exemptions for locally submitted transactions",
|
Usage: "Disables price exemptions for locally submitted transactions",
|
||||||
Category: flags.TxPoolCategory,
|
Category: flags.TxPoolCategory,
|
||||||
}
|
}
|
||||||
TxPoolJournalFlag = &cli.StringFlag{
|
TxPoolJournalFlag = &cli.StringFlag{
|
||||||
Name: "txpool.journal",
|
Name: "txpool-journal",
|
||||||
|
Aliases: []string{"txpool.journal"},
|
||||||
Usage: "Disk journal for local transaction to survive node restarts",
|
Usage: "Disk journal for local transaction to survive node restarts",
|
||||||
Value: txpool.DefaultConfig.Journal,
|
Value: txpool.DefaultConfig.Journal,
|
||||||
Category: flags.TxPoolCategory,
|
Category: flags.TxPoolCategory,
|
||||||
}
|
}
|
||||||
TxPoolRejournalFlag = &cli.DurationFlag{
|
TxPoolRejournalFlag = &cli.DurationFlag{
|
||||||
Name: "txpool.rejournal",
|
Name: "txpool-rejournal",
|
||||||
|
Aliases: []string{"txpool.rejournal"},
|
||||||
Usage: "Time interval to regenerate the local transaction journal",
|
Usage: "Time interval to regenerate the local transaction journal",
|
||||||
Value: txpool.DefaultConfig.Rejournal,
|
Value: txpool.DefaultConfig.Rejournal,
|
||||||
Category: flags.TxPoolCategory,
|
Category: flags.TxPoolCategory,
|
||||||
}
|
}
|
||||||
TxPoolPriceLimitFlag = &cli.Uint64Flag{
|
TxPoolPriceLimitFlag = &cli.Uint64Flag{
|
||||||
Name: "txpool.pricelimit",
|
Name: "txpool-pricelimit",
|
||||||
|
Aliases: []string{"txpool.pricelimit"},
|
||||||
Usage: "Minimum gas price limit to enforce for acceptance into the pool",
|
Usage: "Minimum gas price limit to enforce for acceptance into the pool",
|
||||||
Value: ethconfig.Defaults.TxPool.PriceLimit,
|
Value: ethconfig.Defaults.TxPool.PriceLimit,
|
||||||
Category: flags.TxPoolCategory,
|
Category: flags.TxPoolCategory,
|
||||||
}
|
}
|
||||||
TxPoolPriceBumpFlag = &cli.Uint64Flag{
|
TxPoolPriceBumpFlag = &cli.Uint64Flag{
|
||||||
Name: "txpool.pricebump",
|
Name: "txpool-pricebump",
|
||||||
|
Aliases: []string{"txpool.pricebump"},
|
||||||
Usage: "Price bump percentage to replace an already existing transaction",
|
Usage: "Price bump percentage to replace an already existing transaction",
|
||||||
Value: ethconfig.Defaults.TxPool.PriceBump,
|
Value: ethconfig.Defaults.TxPool.PriceBump,
|
||||||
Category: flags.TxPoolCategory,
|
Category: flags.TxPoolCategory,
|
||||||
}
|
}
|
||||||
TxPoolAccountSlotsFlag = &cli.Uint64Flag{
|
TxPoolAccountSlotsFlag = &cli.Uint64Flag{
|
||||||
Name: "txpool.accountslots",
|
Name: "txpool-accountslots",
|
||||||
|
Aliases: []string{"txpool.accountslots"},
|
||||||
Usage: "Minimum number of executable transaction slots guaranteed per account",
|
Usage: "Minimum number of executable transaction slots guaranteed per account",
|
||||||
Value: ethconfig.Defaults.TxPool.AccountSlots,
|
Value: ethconfig.Defaults.TxPool.AccountSlots,
|
||||||
Category: flags.TxPoolCategory,
|
Category: flags.TxPoolCategory,
|
||||||
}
|
}
|
||||||
TxPoolGlobalSlotsFlag = &cli.Uint64Flag{
|
TxPoolGlobalSlotsFlag = &cli.Uint64Flag{
|
||||||
Name: "txpool.globalslots",
|
Name: "txpool-globalslots",
|
||||||
|
Aliases: []string{"txpool.globalslots"},
|
||||||
Usage: "Maximum number of executable transaction slots for all accounts",
|
Usage: "Maximum number of executable transaction slots for all accounts",
|
||||||
Value: ethconfig.Defaults.TxPool.GlobalSlots,
|
Value: ethconfig.Defaults.TxPool.GlobalSlots,
|
||||||
Category: flags.TxPoolCategory,
|
Category: flags.TxPoolCategory,
|
||||||
}
|
}
|
||||||
TxPoolAccountQueueFlag = &cli.Uint64Flag{
|
TxPoolAccountQueueFlag = &cli.Uint64Flag{
|
||||||
Name: "txpool.accountqueue",
|
Name: "txpool-accountqueue",
|
||||||
|
Aliases: []string{"txpool.accountqueue"},
|
||||||
Usage: "Maximum number of non-executable transaction slots permitted per account",
|
Usage: "Maximum number of non-executable transaction slots permitted per account",
|
||||||
Value: ethconfig.Defaults.TxPool.AccountQueue,
|
Value: ethconfig.Defaults.TxPool.AccountQueue,
|
||||||
Category: flags.TxPoolCategory,
|
Category: flags.TxPoolCategory,
|
||||||
}
|
}
|
||||||
TxPoolGlobalQueueFlag = &cli.Uint64Flag{
|
TxPoolGlobalQueueFlag = &cli.Uint64Flag{
|
||||||
Name: "txpool.globalqueue",
|
Name: "txpool-globalqueue",
|
||||||
|
Aliases: []string{"txpool.globalqueue"},
|
||||||
Usage: "Maximum number of non-executable transaction slots for all accounts",
|
Usage: "Maximum number of non-executable transaction slots for all accounts",
|
||||||
Value: ethconfig.Defaults.TxPool.GlobalQueue,
|
Value: ethconfig.Defaults.TxPool.GlobalQueue,
|
||||||
Category: flags.TxPoolCategory,
|
Category: flags.TxPoolCategory,
|
||||||
}
|
}
|
||||||
TxPoolLifetimeFlag = &cli.DurationFlag{
|
TxPoolLifetimeFlag = &cli.DurationFlag{
|
||||||
Name: "txpool.lifetime",
|
Name: "txpool-lifetime",
|
||||||
|
Aliases: []string{"txpool.lifetime"},
|
||||||
Usage: "Maximum amount of time non-executable transaction are queued",
|
Usage: "Maximum amount of time non-executable transaction are queued",
|
||||||
Value: ethconfig.Defaults.TxPool.Lifetime,
|
Value: ethconfig.Defaults.TxPool.Lifetime,
|
||||||
Category: flags.TxPoolCategory,
|
Category: flags.TxPoolCategory,
|
||||||
|
|
@ -267,19 +286,22 @@ var (
|
||||||
Category: flags.PerfCategory,
|
Category: flags.PerfCategory,
|
||||||
}
|
}
|
||||||
CacheDatabaseFlag = &cli.IntFlag{
|
CacheDatabaseFlag = &cli.IntFlag{
|
||||||
Name: "cache.database",
|
Name: "cache-database",
|
||||||
|
Aliases: []string{"cache.database"},
|
||||||
Usage: "Percentage of cache memory allowance to use for database io",
|
Usage: "Percentage of cache memory allowance to use for database io",
|
||||||
Value: 50,
|
Value: 50,
|
||||||
Category: flags.PerfCategory,
|
Category: flags.PerfCategory,
|
||||||
}
|
}
|
||||||
CacheGCFlag = &cli.IntFlag{
|
CacheGCFlag = &cli.IntFlag{
|
||||||
Name: "cache.gc",
|
Name: "cache-gc",
|
||||||
|
Aliases: []string{"cache.gc"},
|
||||||
Usage: "Percentage of cache memory allowance to use for trie pruning",
|
Usage: "Percentage of cache memory allowance to use for trie pruning",
|
||||||
Value: 25,
|
Value: 25,
|
||||||
Category: flags.PerfCategory,
|
Category: flags.PerfCategory,
|
||||||
}
|
}
|
||||||
CacheLogSizeFlag = &cli.IntFlag{
|
CacheLogSizeFlag = &cli.IntFlag{
|
||||||
Name: "cache.blocklogs",
|
Name: "cache-blocklogs",
|
||||||
|
Aliases: []string{"cache.blocklogs"},
|
||||||
Usage: "Size (in number of blocks) of the log cache for filtering",
|
Usage: "Size (in number of blocks) of the log cache for filtering",
|
||||||
Value: ethconfig.Defaults.FilterLogCacheSize,
|
Value: ethconfig.Defaults.FilterLogCacheSize,
|
||||||
Category: flags.PerfCategory,
|
Category: flags.PerfCategory,
|
||||||
|
|
@ -291,37 +313,42 @@ var (
|
||||||
}
|
}
|
||||||
|
|
||||||
// Miner settings
|
// Miner settings
|
||||||
StakingEnabledFlag = &cli.BoolFlag{
|
MiningEnabledFlag = &cli.BoolFlag{
|
||||||
Name: "mine",
|
Name: "mine",
|
||||||
Usage: "Enable staking",
|
Usage: "Enable mining",
|
||||||
Category: flags.MinerCategory,
|
Category: flags.MinerCategory,
|
||||||
}
|
}
|
||||||
StakerThreadsFlag = &cli.IntFlag{
|
MinerThreadsFlag = &cli.IntFlag{
|
||||||
Name: "minerthreads",
|
Name: "miner-threads",
|
||||||
Usage: "Number of CPU threads to use for staking",
|
Aliases: []string{"minerthreads"},
|
||||||
|
Usage: "Number of CPU threads to use for mining",
|
||||||
Value: runtime.NumCPU(),
|
Value: runtime.NumCPU(),
|
||||||
Category: flags.MinerCategory,
|
Category: flags.MinerCategory,
|
||||||
}
|
}
|
||||||
TargetGasLimitFlag = &cli.Uint64Flag{
|
MinerGasLimitFlag = &cli.Uint64Flag{
|
||||||
Name: "targetgaslimit",
|
Name: "miner-gaslimit",
|
||||||
|
Aliases: []string{"targetgaslimit"},
|
||||||
Usage: "Target gas limit sets the artificial target gas floor for the blocks to mine",
|
Usage: "Target gas limit sets the artificial target gas floor for the blocks to mine",
|
||||||
Value: params.XDCGenesisGasLimit,
|
Value: params.XDCGenesisGasLimit,
|
||||||
Category: flags.MinerCategory,
|
Category: flags.MinerCategory,
|
||||||
}
|
}
|
||||||
EtherbaseFlag = &cli.StringFlag{
|
MinerGasPriceFlag = &flags.BigFlag{
|
||||||
Name: "etherbase",
|
Name: "miner-gasprice",
|
||||||
Usage: "Public address for block mining rewards (default = first account created)",
|
Aliases: []string{"gasprice"},
|
||||||
Value: "0",
|
|
||||||
Category: flags.MinerCategory,
|
|
||||||
}
|
|
||||||
GasPriceFlag = &flags.BigFlag{
|
|
||||||
Name: "gasprice",
|
|
||||||
Usage: "Minimal gas price to accept for mining a transactions",
|
Usage: "Minimal gas price to accept for mining a transactions",
|
||||||
Value: ethconfig.Defaults.GasPrice,
|
Value: ethconfig.Defaults.GasPrice,
|
||||||
Category: flags.MinerCategory,
|
Category: flags.MinerCategory,
|
||||||
}
|
}
|
||||||
ExtraDataFlag = &cli.StringFlag{
|
MinerEtherbaseFlag = &cli.StringFlag{
|
||||||
Name: "extradata",
|
Name: "miner-etherbase",
|
||||||
|
Aliases: []string{"etherbase"},
|
||||||
|
Usage: "Public address for block mining rewards (default = first account created)",
|
||||||
|
Value: "0",
|
||||||
|
Category: flags.MinerCategory,
|
||||||
|
}
|
||||||
|
MinerExtraDataFlag = &cli.StringFlag{
|
||||||
|
Name: "miner-extradata",
|
||||||
|
Aliases: []string{"extradata"},
|
||||||
Usage: "Block extra data set by the miner (default = client version)",
|
Usage: "Block extra data set by the miner (default = client version)",
|
||||||
Category: flags.MinerCategory,
|
Category: flags.MinerCategory,
|
||||||
}
|
}
|
||||||
|
|
@ -355,7 +382,8 @@ var (
|
||||||
Category: flags.APICategory,
|
Category: flags.APICategory,
|
||||||
}
|
}
|
||||||
RPCGlobalTxFeeCap = &cli.Float64Flag{
|
RPCGlobalTxFeeCap = &cli.Float64Flag{
|
||||||
Name: "rpc.txfeecap",
|
Name: "rpc-txfeecap",
|
||||||
|
Aliases: []string{"rpc.txfeecap"},
|
||||||
Usage: "Sets a cap on transaction fee (in ether) that can be sent via the RPC APIs (0 = no cap)",
|
Usage: "Sets a cap on transaction fee (in ether) that can be sent via the RPC APIs (0 = no cap)",
|
||||||
Value: ethconfig.Defaults.RPCTxFeeCap,
|
Value: ethconfig.Defaults.RPCTxFeeCap,
|
||||||
Category: flags.APICategory,
|
Category: flags.APICategory,
|
||||||
|
|
@ -389,66 +417,97 @@ var (
|
||||||
Usage: "Filename for IPC socket/pipe within the datadir (explicit paths escape it)",
|
Usage: "Filename for IPC socket/pipe within the datadir (explicit paths escape it)",
|
||||||
Category: flags.APICategory,
|
Category: flags.APICategory,
|
||||||
}
|
}
|
||||||
RPCEnabledFlag = &cli.BoolFlag{
|
HTTPEnabledFlag = &cli.BoolFlag{
|
||||||
Name: "rpc",
|
Name: "http",
|
||||||
|
Aliases: []string{"rpc"},
|
||||||
Usage: "Enable the HTTP-RPC server",
|
Usage: "Enable the HTTP-RPC server",
|
||||||
Category: flags.APICategory,
|
Category: flags.APICategory,
|
||||||
}
|
}
|
||||||
RPCListenAddrFlag = &cli.StringFlag{
|
HTTPListenAddrFlag = &cli.StringFlag{
|
||||||
Name: "rpcaddr",
|
Name: "http-addr",
|
||||||
|
Aliases: []string{"rpcaddr"},
|
||||||
Usage: "HTTP-RPC server listening interface",
|
Usage: "HTTP-RPC server listening interface",
|
||||||
Value: node.DefaultHTTPHost,
|
Value: node.DefaultHTTPHost,
|
||||||
Category: flags.APICategory,
|
Category: flags.APICategory,
|
||||||
}
|
}
|
||||||
RPCPortFlag = &cli.IntFlag{
|
HTTPPortFlag = &cli.IntFlag{
|
||||||
Name: "rpcport",
|
Name: "http-port",
|
||||||
|
Aliases: []string{"rpcport"},
|
||||||
Usage: "HTTP-RPC server listening port",
|
Usage: "HTTP-RPC server listening port",
|
||||||
Value: node.DefaultHTTPPort,
|
Value: node.DefaultHTTPPort,
|
||||||
Category: flags.APICategory,
|
Category: flags.APICategory,
|
||||||
}
|
}
|
||||||
RPCCORSDomainFlag = &cli.StringFlag{
|
HTTPCORSDomainFlag = &cli.StringFlag{
|
||||||
Name: "rpccorsdomain",
|
Name: "http-corsdomain",
|
||||||
|
Aliases: []string{"rpccorsdomain"},
|
||||||
Usage: "Comma separated list of domains from which to accept cross origin requests (browser enforced)",
|
Usage: "Comma separated list of domains from which to accept cross origin requests (browser enforced)",
|
||||||
Value: "",
|
Value: "",
|
||||||
Category: flags.APICategory,
|
Category: flags.APICategory,
|
||||||
}
|
}
|
||||||
RPCVirtualHostsFlag = &cli.StringFlag{
|
HTTPVirtualHostsFlag = &cli.StringFlag{
|
||||||
Name: "rpcvhosts",
|
Name: "http-vhosts",
|
||||||
|
Aliases: []string{"rpcvhosts"},
|
||||||
Usage: "Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard.",
|
Usage: "Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard.",
|
||||||
Value: strings.Join(node.DefaultConfig.HTTPVirtualHosts, ","),
|
Value: strings.Join(node.DefaultConfig.HTTPVirtualHosts, ","),
|
||||||
Category: flags.APICategory,
|
Category: flags.APICategory,
|
||||||
}
|
}
|
||||||
RPCApiFlag = &cli.StringFlag{
|
HTTPApiFlag = &cli.StringFlag{
|
||||||
Name: "rpcapi",
|
Name: "http-api",
|
||||||
|
Aliases: []string{"rpcapi"},
|
||||||
Usage: "API's offered over the HTTP-RPC interface",
|
Usage: "API's offered over the HTTP-RPC interface",
|
||||||
Value: "",
|
Value: "",
|
||||||
Category: flags.APICategory,
|
Category: flags.APICategory,
|
||||||
}
|
}
|
||||||
|
HTTPReadTimeoutFlag = &cli.DurationFlag{
|
||||||
|
Name: "http-readtimeout",
|
||||||
|
Aliases: []string{"rpcreadtimeout"},
|
||||||
|
Usage: "HTTP-RPC server read timeout",
|
||||||
|
Value: rpc.DefaultHTTPTimeouts.ReadTimeout,
|
||||||
|
Category: flags.APICategory,
|
||||||
|
}
|
||||||
|
HTTPWriteTimeoutFlag = &cli.DurationFlag{
|
||||||
|
Name: "http-writetimeout",
|
||||||
|
Aliases: []string{"rpcwritetimeout"},
|
||||||
|
Usage: "HTTP-RPC server write timeout",
|
||||||
|
Value: rpc.DefaultHTTPTimeouts.WriteTimeout,
|
||||||
|
Category: flags.APICategory,
|
||||||
|
}
|
||||||
|
HTTPIdleTimeoutFlag = &cli.DurationFlag{
|
||||||
|
Name: "http-idletimeout",
|
||||||
|
Aliases: []string{"rpcidletimeout"},
|
||||||
|
Usage: "HTTP-RPC server idle timeout",
|
||||||
|
Value: rpc.DefaultHTTPTimeouts.IdleTimeout,
|
||||||
|
Category: flags.APICategory,
|
||||||
|
}
|
||||||
WSEnabledFlag = &cli.BoolFlag{
|
WSEnabledFlag = &cli.BoolFlag{
|
||||||
Name: "ws",
|
Name: "ws",
|
||||||
Usage: "Enable the WS-RPC server",
|
Usage: "Enable the WS-RPC server",
|
||||||
Category: flags.APICategory,
|
Category: flags.APICategory,
|
||||||
}
|
}
|
||||||
WSListenAddrFlag = &cli.StringFlag{
|
WSListenAddrFlag = &cli.StringFlag{
|
||||||
Name: "wsaddr",
|
Name: "ws-addr",
|
||||||
|
Aliases: []string{"wsaddr"},
|
||||||
Usage: "WS-RPC server listening interface",
|
Usage: "WS-RPC server listening interface",
|
||||||
Value: node.DefaultWSHost,
|
Value: node.DefaultWSHost,
|
||||||
Category: flags.APICategory,
|
Category: flags.APICategory,
|
||||||
}
|
}
|
||||||
WSPortFlag = &cli.IntFlag{
|
WSPortFlag = &cli.IntFlag{
|
||||||
Name: "wsport",
|
Name: "ws-port",
|
||||||
|
Aliases: []string{"wsport"},
|
||||||
Usage: "WS-RPC server listening port",
|
Usage: "WS-RPC server listening port",
|
||||||
Value: node.DefaultWSPort,
|
Value: node.DefaultWSPort,
|
||||||
Category: flags.APICategory,
|
Category: flags.APICategory,
|
||||||
}
|
}
|
||||||
WSApiFlag = &cli.StringFlag{
|
WSApiFlag = &cli.StringFlag{
|
||||||
Name: "wsapi",
|
Name: "ws-api",
|
||||||
|
Aliases: []string{"wsapi"},
|
||||||
Usage: "API's offered over the WS-RPC interface",
|
Usage: "API's offered over the WS-RPC interface",
|
||||||
Value: "",
|
Value: "",
|
||||||
Category: flags.APICategory,
|
Category: flags.APICategory,
|
||||||
}
|
}
|
||||||
WSAllowedOriginsFlag = &cli.StringFlag{
|
WSAllowedOriginsFlag = &cli.StringFlag{
|
||||||
Name: "wsorigins",
|
Name: "ws-origins",
|
||||||
|
Aliases: []string{"wsorigins"},
|
||||||
Usage: "Origins from which to accept websockets requests",
|
Usage: "Origins from which to accept websockets requests",
|
||||||
Value: "",
|
Value: "",
|
||||||
Category: flags.APICategory,
|
Category: flags.APICategory,
|
||||||
|
|
@ -463,24 +522,6 @@ var (
|
||||||
Usage: "Comma separated list of JavaScript files to preload into the console",
|
Usage: "Comma separated list of JavaScript files to preload into the console",
|
||||||
Category: flags.APICategory,
|
Category: flags.APICategory,
|
||||||
}
|
}
|
||||||
RPCHttpReadTimeoutFlag = &cli.DurationFlag{
|
|
||||||
Name: "rpcreadtimeout",
|
|
||||||
Usage: "HTTP-RPC server read timeout",
|
|
||||||
Value: rpc.DefaultHTTPTimeouts.ReadTimeout,
|
|
||||||
Category: flags.APICategory,
|
|
||||||
}
|
|
||||||
RPCHttpWriteTimeoutFlag = &cli.DurationFlag{
|
|
||||||
Name: "rpcwritetimeout",
|
|
||||||
Usage: "HTTP-RPC server write timeout",
|
|
||||||
Value: rpc.DefaultHTTPTimeouts.WriteTimeout,
|
|
||||||
Category: flags.APICategory,
|
|
||||||
}
|
|
||||||
RPCHttpIdleTimeoutFlag = &cli.DurationFlag{
|
|
||||||
Name: "rpcidletimeout",
|
|
||||||
Usage: "HTTP-RPC server idle timeout",
|
|
||||||
Value: rpc.DefaultHTTPTimeouts.IdleTimeout,
|
|
||||||
Category: flags.APICategory,
|
|
||||||
}
|
|
||||||
|
|
||||||
// Network Settings
|
// Network Settings
|
||||||
MaxPeersFlag = &cli.IntFlag{
|
MaxPeersFlag = &cli.IntFlag{
|
||||||
|
|
@ -561,25 +602,29 @@ var (
|
||||||
|
|
||||||
// Gas price oracle settings
|
// Gas price oracle settings
|
||||||
GpoBlocksFlag = &cli.IntFlag{
|
GpoBlocksFlag = &cli.IntFlag{
|
||||||
Name: "gpoblocks",
|
Name: "gpo-blocks",
|
||||||
|
Aliases: []string{"gpoblocks"},
|
||||||
Usage: "Number of recent blocks to check for gas prices",
|
Usage: "Number of recent blocks to check for gas prices",
|
||||||
Value: ethconfig.Defaults.GPO.Blocks,
|
Value: ethconfig.Defaults.GPO.Blocks,
|
||||||
Category: flags.GasPriceCategory,
|
Category: flags.GasPriceCategory,
|
||||||
}
|
}
|
||||||
GpoPercentileFlag = &cli.IntFlag{
|
GpoPercentileFlag = &cli.IntFlag{
|
||||||
Name: "gpopercentile",
|
Name: "gpo-percentile",
|
||||||
|
Aliases: []string{"gpopercentile"},
|
||||||
Usage: "Suggested gas price is the given percentile of a set of recent transaction gas prices",
|
Usage: "Suggested gas price is the given percentile of a set of recent transaction gas prices",
|
||||||
Value: ethconfig.Defaults.GPO.Percentile,
|
Value: ethconfig.Defaults.GPO.Percentile,
|
||||||
Category: flags.GasPriceCategory,
|
Category: flags.GasPriceCategory,
|
||||||
}
|
}
|
||||||
GpoMaxGasPriceFlag = &cli.Int64Flag{
|
GpoMaxGasPriceFlag = &cli.Int64Flag{
|
||||||
Name: "gpo.maxprice",
|
Name: "gpo-maxprice",
|
||||||
|
Aliases: []string{"gpo.maxprice"},
|
||||||
Usage: "Maximum gas price will be recommended by gpo",
|
Usage: "Maximum gas price will be recommended by gpo",
|
||||||
Value: ethconfig.Defaults.GPO.MaxPrice.Int64(),
|
Value: ethconfig.Defaults.GPO.MaxPrice.Int64(),
|
||||||
Category: flags.GasPriceCategory,
|
Category: flags.GasPriceCategory,
|
||||||
}
|
}
|
||||||
GpoIgnoreGasPriceFlag = &cli.Int64Flag{
|
GpoIgnoreGasPriceFlag = &cli.Int64Flag{
|
||||||
Name: "gpo.ignoreprice",
|
Name: "gpo-ignoreprice",
|
||||||
|
Aliases: []string{"gpo.ignoreprice"},
|
||||||
Usage: "Gas price below which gpo will ignore transactions",
|
Usage: "Gas price below which gpo will ignore transactions",
|
||||||
Value: ethconfig.Defaults.GPO.IgnorePrice.Int64(),
|
Value: ethconfig.Defaults.GPO.IgnorePrice.Int64(),
|
||||||
Category: flags.GasPriceCategory,
|
Category: flags.GasPriceCategory,
|
||||||
|
|
@ -597,13 +642,15 @@ var (
|
||||||
// to enable a public-OK metrics endpoint without having to worry about ALSO exposing
|
// to enable a public-OK metrics endpoint without having to worry about ALSO exposing
|
||||||
// other profiling behavior or information.
|
// other profiling behavior or information.
|
||||||
MetricsHTTPFlag = &cli.StringFlag{
|
MetricsHTTPFlag = &cli.StringFlag{
|
||||||
Name: "metrics.addr",
|
Name: "metrics-addr",
|
||||||
|
Aliases: []string{"metrics.addr"},
|
||||||
Usage: "Enable stand-alone metrics HTTP server listening interface",
|
Usage: "Enable stand-alone metrics HTTP server listening interface",
|
||||||
Value: metrics.DefaultConfig.HTTP,
|
Value: metrics.DefaultConfig.HTTP,
|
||||||
Category: flags.MetricsCategory,
|
Category: flags.MetricsCategory,
|
||||||
}
|
}
|
||||||
MetricsPortFlag = &cli.IntFlag{
|
MetricsPortFlag = &cli.IntFlag{
|
||||||
Name: "metrics.port",
|
Name: "metrics-port",
|
||||||
|
Aliases: []string{"metrics.port"},
|
||||||
Usage: "Metrics HTTP server listening port",
|
Usage: "Metrics HTTP server listening port",
|
||||||
Value: metrics.DefaultConfig.Port,
|
Value: metrics.DefaultConfig.Port,
|
||||||
Category: flags.MetricsCategory,
|
Category: flags.MetricsCategory,
|
||||||
|
|
@ -661,31 +708,36 @@ var (
|
||||||
Category: flags.XdcxCategory,
|
Category: flags.XdcxCategory,
|
||||||
}
|
}
|
||||||
XDCXDataDirFlag = &flags.DirectoryFlag{
|
XDCXDataDirFlag = &flags.DirectoryFlag{
|
||||||
Name: "XDCx.datadir",
|
Name: "XDCx-datadir",
|
||||||
|
Aliases: []string{"XDCx.datadir"},
|
||||||
Usage: "Data directory for the XDCX databases",
|
Usage: "Data directory for the XDCX databases",
|
||||||
Value: flags.DirectoryString(filepath.Join(DataDirFlag.Value.String(), "XDCx")),
|
Value: flags.DirectoryString(filepath.Join(DataDirFlag.Value.String(), "XDCx")),
|
||||||
Category: flags.XdcxCategory,
|
Category: flags.XdcxCategory,
|
||||||
}
|
}
|
||||||
XDCXDBEngineFlag = &cli.StringFlag{
|
XDCXDBEngineFlag = &cli.StringFlag{
|
||||||
Name: "XDCx.dbengine",
|
Name: "XDCx-dbengine",
|
||||||
|
Aliases: []string{"XDCx.dbengine"},
|
||||||
Usage: "Database engine for XDCX (leveldb, mongodb)",
|
Usage: "Database engine for XDCX (leveldb, mongodb)",
|
||||||
Value: "leveldb",
|
Value: "leveldb",
|
||||||
Category: flags.XdcxCategory,
|
Category: flags.XdcxCategory,
|
||||||
}
|
}
|
||||||
XDCXDBNameFlag = &cli.StringFlag{
|
XDCXDBNameFlag = &cli.StringFlag{
|
||||||
Name: "XDCx.dbName",
|
Name: "XDCx-dbName",
|
||||||
|
Aliases: []string{"XDCx.dbName"},
|
||||||
Usage: "Database name for XDCX",
|
Usage: "Database name for XDCX",
|
||||||
Value: "XDCdex",
|
Value: "XDCdex",
|
||||||
Category: flags.XdcxCategory,
|
Category: flags.XdcxCategory,
|
||||||
}
|
}
|
||||||
XDCXDBConnectionUrlFlag = &cli.StringFlag{
|
XDCXDBConnectionUrlFlag = &cli.StringFlag{
|
||||||
Name: "XDCx.dbConnectionUrl",
|
Name: "XDCx-dbConnectionUrl",
|
||||||
|
Aliases: []string{"XDCx.dbConnectionUrl"},
|
||||||
Usage: "ConnectionUrl to database if dbEngine is mongodb. Host:port. If there are multiple instances, separated by comma. Eg: localhost:27017,localhost:27018",
|
Usage: "ConnectionUrl to database if dbEngine is mongodb. Host:port. If there are multiple instances, separated by comma. Eg: localhost:27017,localhost:27018",
|
||||||
Value: "localhost:27017",
|
Value: "localhost:27017",
|
||||||
Category: flags.XdcxCategory,
|
Category: flags.XdcxCategory,
|
||||||
}
|
}
|
||||||
XDCXDBReplicaSetNameFlag = &cli.StringFlag{
|
XDCXDBReplicaSetNameFlag = &cli.StringFlag{
|
||||||
Name: "XDCx.dbReplicaSetName",
|
Name: "XDCx-dbReplicaSetName",
|
||||||
|
Aliases: []string{"XDCx.dbReplicaSetName"},
|
||||||
Usage: "ReplicaSetName if Master-Slave is setup",
|
Usage: "ReplicaSetName if Master-Slave is setup",
|
||||||
Category: flags.XdcxCategory,
|
Category: flags.XdcxCategory,
|
||||||
}
|
}
|
||||||
|
|
@ -847,33 +899,33 @@ func splitAndTrim(input string) (ret []string) {
|
||||||
// setHTTP creates the HTTP RPC listener interface string from the set
|
// setHTTP creates the HTTP RPC listener interface string from the set
|
||||||
// command line flags, returning empty if the HTTP endpoint is disabled.
|
// command line flags, returning empty if the HTTP endpoint is disabled.
|
||||||
func setHTTP(ctx *cli.Context, cfg *node.Config) {
|
func setHTTP(ctx *cli.Context, cfg *node.Config) {
|
||||||
if ctx.Bool(RPCEnabledFlag.Name) && cfg.HTTPHost == "" {
|
if ctx.Bool(HTTPEnabledFlag.Name) && cfg.HTTPHost == "" {
|
||||||
cfg.HTTPHost = "127.0.0.1"
|
cfg.HTTPHost = "127.0.0.1"
|
||||||
if ctx.IsSet(RPCListenAddrFlag.Name) {
|
if ctx.IsSet(HTTPListenAddrFlag.Name) {
|
||||||
cfg.HTTPHost = ctx.String(RPCListenAddrFlag.Name)
|
cfg.HTTPHost = ctx.String(HTTPListenAddrFlag.Name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ctx.IsSet(RPCPortFlag.Name) {
|
if ctx.IsSet(HTTPPortFlag.Name) {
|
||||||
cfg.HTTPPort = ctx.Int(RPCPortFlag.Name)
|
cfg.HTTPPort = ctx.Int(HTTPPortFlag.Name)
|
||||||
}
|
}
|
||||||
if ctx.IsSet(RPCHttpReadTimeoutFlag.Name) {
|
if ctx.IsSet(HTTPReadTimeoutFlag.Name) {
|
||||||
cfg.HTTPTimeouts.ReadTimeout = ctx.Duration(RPCHttpReadTimeoutFlag.Name)
|
cfg.HTTPTimeouts.ReadTimeout = ctx.Duration(HTTPReadTimeoutFlag.Name)
|
||||||
}
|
}
|
||||||
if ctx.IsSet(RPCHttpWriteTimeoutFlag.Name) {
|
if ctx.IsSet(HTTPWriteTimeoutFlag.Name) {
|
||||||
cfg.HTTPTimeouts.WriteTimeout = ctx.Duration(RPCHttpWriteTimeoutFlag.Name)
|
cfg.HTTPTimeouts.WriteTimeout = ctx.Duration(HTTPWriteTimeoutFlag.Name)
|
||||||
}
|
}
|
||||||
if ctx.IsSet(RPCHttpIdleTimeoutFlag.Name) {
|
if ctx.IsSet(HTTPIdleTimeoutFlag.Name) {
|
||||||
cfg.HTTPTimeouts.IdleTimeout = ctx.Duration(RPCHttpIdleTimeoutFlag.Name)
|
cfg.HTTPTimeouts.IdleTimeout = ctx.Duration(HTTPIdleTimeoutFlag.Name)
|
||||||
}
|
}
|
||||||
if ctx.IsSet(RPCCORSDomainFlag.Name) {
|
if ctx.IsSet(HTTPCORSDomainFlag.Name) {
|
||||||
cfg.HTTPCors = splitAndTrim(ctx.String(RPCCORSDomainFlag.Name))
|
cfg.HTTPCors = splitAndTrim(ctx.String(HTTPCORSDomainFlag.Name))
|
||||||
}
|
}
|
||||||
if ctx.IsSet(RPCApiFlag.Name) {
|
if ctx.IsSet(HTTPApiFlag.Name) {
|
||||||
cfg.HTTPModules = splitAndTrim(ctx.String(RPCApiFlag.Name))
|
cfg.HTTPModules = splitAndTrim(ctx.String(HTTPApiFlag.Name))
|
||||||
}
|
}
|
||||||
if ctx.IsSet(RPCVirtualHostsFlag.Name) {
|
if ctx.IsSet(HTTPVirtualHostsFlag.Name) {
|
||||||
cfg.HTTPVirtualHosts = splitAndTrim(ctx.String(RPCVirtualHostsFlag.Name))
|
cfg.HTTPVirtualHosts = splitAndTrim(ctx.String(HTTPVirtualHostsFlag.Name))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -969,10 +1021,10 @@ func MakeAddress(ks *keystore.KeyStore, account string) (accounts.Account, error
|
||||||
// setEtherbase retrieves the etherbase either from the directly specified
|
// setEtherbase retrieves the etherbase either from the directly specified
|
||||||
// command line flags or from the keystore if CLI indexed.
|
// command line flags or from the keystore if CLI indexed.
|
||||||
func setEtherbase(ctx *cli.Context, ks *keystore.KeyStore, cfg *ethconfig.Config) {
|
func setEtherbase(ctx *cli.Context, ks *keystore.KeyStore, cfg *ethconfig.Config) {
|
||||||
if ctx.IsSet(EtherbaseFlag.Name) {
|
if ctx.IsSet(MinerEtherbaseFlag.Name) {
|
||||||
account, err := MakeAddress(ks, ctx.String(EtherbaseFlag.Name))
|
account, err := MakeAddress(ks, ctx.String(MinerEtherbaseFlag.Name))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
Fatalf("Option %q: %v", EtherbaseFlag.Name, err)
|
Fatalf("Option %q: %v", MinerEtherbaseFlag.Name, err)
|
||||||
}
|
}
|
||||||
cfg.Etherbase = account.Address
|
cfg.Etherbase = account.Address
|
||||||
}
|
}
|
||||||
|
|
@ -1317,8 +1369,8 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
|
||||||
if ctx.IsSet(CacheFlag.Name) || ctx.IsSet(CacheGCFlag.Name) {
|
if ctx.IsSet(CacheFlag.Name) || ctx.IsSet(CacheGCFlag.Name) {
|
||||||
cfg.TrieCache = ctx.Int(CacheFlag.Name) * ctx.Int(CacheGCFlag.Name) / 100
|
cfg.TrieCache = ctx.Int(CacheFlag.Name) * ctx.Int(CacheGCFlag.Name) / 100
|
||||||
}
|
}
|
||||||
if ctx.IsSet(StakerThreadsFlag.Name) {
|
if ctx.IsSet(MinerThreadsFlag.Name) {
|
||||||
cfg.MinerThreads = ctx.Int(StakerThreadsFlag.Name)
|
cfg.MinerThreads = ctx.Int(MinerThreadsFlag.Name)
|
||||||
}
|
}
|
||||||
if ctx.IsSet(DocRootFlag.Name) {
|
if ctx.IsSet(DocRootFlag.Name) {
|
||||||
cfg.DocRoot = ctx.String(DocRootFlag.Name)
|
cfg.DocRoot = ctx.String(DocRootFlag.Name)
|
||||||
|
|
@ -1332,11 +1384,11 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
|
||||||
if ctx.IsSet(RPCGlobalGasCapFlag.Name) {
|
if ctx.IsSet(RPCGlobalGasCapFlag.Name) {
|
||||||
cfg.RPCGasCap = ctx.Uint64(RPCGlobalGasCapFlag.Name)
|
cfg.RPCGasCap = ctx.Uint64(RPCGlobalGasCapFlag.Name)
|
||||||
}
|
}
|
||||||
if ctx.IsSet(ExtraDataFlag.Name) {
|
if ctx.IsSet(MinerExtraDataFlag.Name) {
|
||||||
cfg.ExtraData = []byte(ctx.String(ExtraDataFlag.Name))
|
cfg.ExtraData = []byte(ctx.String(MinerExtraDataFlag.Name))
|
||||||
}
|
}
|
||||||
if ctx.IsSet(GasPriceFlag.Name) {
|
if ctx.IsSet(MinerGasPriceFlag.Name) {
|
||||||
cfg.GasPrice = flags.GlobalBig(ctx, GasPriceFlag.Name)
|
cfg.GasPrice = flags.GlobalBig(ctx, MinerGasPriceFlag.Name)
|
||||||
}
|
}
|
||||||
if ctx.IsSet(CacheLogSizeFlag.Name) {
|
if ctx.IsSet(CacheLogSizeFlag.Name) {
|
||||||
cfg.FilterLogCacheSize = ctx.Int(CacheLogSizeFlag.Name)
|
cfg.FilterLogCacheSize = ctx.Int(CacheLogSizeFlag.Name)
|
||||||
|
|
@ -1388,7 +1440,7 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
|
||||||
log.Info("Using developer account", "address", developer.Address)
|
log.Info("Using developer account", "address", developer.Address)
|
||||||
|
|
||||||
cfg.Genesis = core.DeveloperGenesisBlock(uint64(ctx.Int(DeveloperPeriodFlag.Name)), developer.Address)
|
cfg.Genesis = core.DeveloperGenesisBlock(uint64(ctx.Int(DeveloperPeriodFlag.Name)), developer.Address)
|
||||||
if !ctx.IsSet(GasPriceFlag.Name) {
|
if !ctx.IsSet(MinerGasPriceFlag.Name) {
|
||||||
cfg.GasPrice = big.NewInt(1)
|
cfg.GasPrice = big.NewInt(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1398,7 +1450,7 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
|
||||||
// SetupNetwork configures the system for either the main net or some test network.
|
// SetupNetwork configures the system for either the main net or some test network.
|
||||||
func SetupNetwork(ctx *cli.Context) {
|
func SetupNetwork(ctx *cli.Context) {
|
||||||
// TODO(fjl): move target gas limit into config
|
// TODO(fjl): move target gas limit into config
|
||||||
params.TargetGasLimit = ctx.Uint64(TargetGasLimitFlag.Name)
|
params.TargetGasLimit = ctx.Uint64(MinerGasLimitFlag.Name)
|
||||||
}
|
}
|
||||||
|
|
||||||
// MakeChainDatabase open an LevelDB using the flags passed to the client and will hard crash if it fails.
|
// MakeChainDatabase open an LevelDB using the flags passed to the client and will hard crash if it fails.
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ if [[ ! -z $NETWORK_ID ]]; then
|
||||||
;;
|
;;
|
||||||
89 )
|
89 )
|
||||||
genesisPath="testnet.json"
|
genesisPath="testnet.json"
|
||||||
params="$params --apothem --gcmode archive --rpcapi db,eth,net,web3,debug,XDPoS"
|
params="$params --apothem --gcmode archive --http-api db,eth,net,web3,debug,XDPoS"
|
||||||
;;
|
;;
|
||||||
90 )
|
90 )
|
||||||
genesisPath="devnet.json"
|
genesisPath="devnet.json"
|
||||||
|
|
@ -158,7 +158,7 @@ fi
|
||||||
|
|
||||||
# debug mode
|
# debug mode
|
||||||
if [[ ! -z $DEBUG_MODE ]]; then
|
if [[ ! -z $DEBUG_MODE ]]; then
|
||||||
params="$params --gcmode archive --rpcapi db,eth,net,web3,debug,XDPoS"
|
params="$params --gcmode archive --http-api db,eth,net,web3,debug,XDPoS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# maxpeers
|
# maxpeers
|
||||||
|
|
@ -179,18 +179,18 @@ exec XDC $params \
|
||||||
--maxpeers $MAXPEERS \
|
--maxpeers $MAXPEERS \
|
||||||
--password ./password \
|
--password ./password \
|
||||||
--port 30303 \
|
--port 30303 \
|
||||||
--txpool.globalqueue 5000 \
|
--txpool-globalqueue 5000 \
|
||||||
--txpool.globalslots 5000 \
|
--txpool-globalslots 5000 \
|
||||||
--rpc \
|
--http \
|
||||||
--rpccorsdomain "*" \
|
--http-corsdomain "*" \
|
||||||
--rpcaddr 0.0.0.0 \
|
--http-addr 0.0.0.0 \
|
||||||
--rpcport 8545 \
|
--http-port 8545 \
|
||||||
--rpcvhosts "*" \
|
--http-vhosts "*" \
|
||||||
--ws \
|
--ws \
|
||||||
--wsaddr 0.0.0.0 \
|
--ws-addr 0.0.0.0 \
|
||||||
--wsport 8546 \
|
--ws-port 8546 \
|
||||||
--wsorigins "*" \
|
--ws-origins "*" \
|
||||||
--mine \
|
--mine \
|
||||||
--gasprice "250000000" \
|
--gasprice "250000000" \
|
||||||
--targetgaslimit "84000000" \
|
--miner-gaslimit "84000000" \
|
||||||
"$@"
|
"$@"
|
||||||
|
|
|
||||||
|
|
@ -106,30 +106,35 @@ var (
|
||||||
Category: flags.LoggingCategory,
|
Category: flags.LoggingCategory,
|
||||||
}
|
}
|
||||||
pprofPortFlag = &cli.IntFlag{
|
pprofPortFlag = &cli.IntFlag{
|
||||||
Name: "pprofport",
|
Name: "pprof-port",
|
||||||
|
Aliases: []string{"pprofport"},
|
||||||
Usage: "pprof HTTP server listening port",
|
Usage: "pprof HTTP server listening port",
|
||||||
Value: 6060,
|
Value: 6060,
|
||||||
Category: flags.LoggingCategory,
|
Category: flags.LoggingCategory,
|
||||||
}
|
}
|
||||||
pprofAddrFlag = &cli.StringFlag{
|
pprofAddrFlag = &cli.StringFlag{
|
||||||
Name: "pprofaddr",
|
Name: "pprof-addr",
|
||||||
|
Aliases: []string{"pprofaddr"},
|
||||||
Usage: "pprof HTTP server listening interface",
|
Usage: "pprof HTTP server listening interface",
|
||||||
Value: "127.0.0.1",
|
Value: "127.0.0.1",
|
||||||
Category: flags.LoggingCategory,
|
Category: flags.LoggingCategory,
|
||||||
}
|
}
|
||||||
memprofilerateFlag = &cli.IntFlag{
|
memprofilerateFlag = &cli.IntFlag{
|
||||||
Name: "memprofilerate",
|
Name: "pprof-memprofilerate",
|
||||||
|
Aliases: []string{"memprofilerate"},
|
||||||
Usage: "Turn on memory profiling with the given rate",
|
Usage: "Turn on memory profiling with the given rate",
|
||||||
Value: runtime.MemProfileRate,
|
Value: runtime.MemProfileRate,
|
||||||
Category: flags.LoggingCategory,
|
Category: flags.LoggingCategory,
|
||||||
}
|
}
|
||||||
blockprofilerateFlag = &cli.IntFlag{
|
blockprofilerateFlag = &cli.IntFlag{
|
||||||
Name: "blockprofilerate",
|
Name: "pprof-blockprofilerate",
|
||||||
|
Aliases: []string{"blockprofilerate"},
|
||||||
Usage: "Turn on block profiling with the given rate",
|
Usage: "Turn on block profiling with the given rate",
|
||||||
Category: flags.LoggingCategory,
|
Category: flags.LoggingCategory,
|
||||||
}
|
}
|
||||||
cpuprofileFlag = &cli.StringFlag{
|
cpuprofileFlag = &cli.StringFlag{
|
||||||
Name: "cpuprofile",
|
Name: "pprof-cpuprofile",
|
||||||
|
Aliases: []string{"cpuprofile"},
|
||||||
Usage: "Write CPU profile to the given file",
|
Usage: "Write CPU profile to the given file",
|
||||||
Category: flags.LoggingCategory,
|
Category: flags.LoggingCategory,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue