diff --git a/cmd/tomo/accountcmd.go b/cmd/tomo/accountcmd.go index f8d098ac51..2fef14e446 100644 --- a/cmd/tomo/accountcmd.go +++ b/cmd/tomo/accountcmd.go @@ -32,7 +32,7 @@ import ( var ( walletCommand = cli.Command{ Name: "wallet", - Usage: "Manage Ethereum presale wallets", + Usage: "Manage Tomochain presale wallets", ArgsUsage: "", Category: "ACCOUNT COMMANDS", Description: ` @@ -45,7 +45,7 @@ passwordfile as argument containing the wallet password in plaintext.`, { Name: "import", - Usage: "Import Ethereum presale wallet", + Usage: "Import Tomochain presale wallet", ArgsUsage: "", Action: utils.MigrateFlags(importWallet), Category: "ACCOUNT COMMANDS", diff --git a/cmd/tomo/consolecmd_test.go b/cmd/tomo/consolecmd_test.go index a1e46a736d..b6d3caef6d 100644 --- a/cmd/tomo/consolecmd_test.go +++ b/cmd/tomo/consolecmd_test.go @@ -31,7 +31,7 @@ import ( ) const ( - ipcAPIs = "admin:1.0 debug:1.0 eth:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 shh:1.0 txpool:1.0 web3:1.0" + ipcAPIs = "admin:1.0 debug:1.0 eth:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 txpool:1.0 web3:1.0" httpAPIs = "eth:1.0 net:1.0 rpc:1.0 web3:1.0" ) @@ -43,7 +43,7 @@ func TestConsoleWelcome(t *testing.T) { // Start a tomo console, make sure it's cleaned up and terminate the console tomo := runTomo(t, "--port", "0", "--maxpeers", "0", "--nodiscover", "--nat", "none", - "--etherbase", coinbase, "--shh", + "--etherbase", coinbase, "console") // Gather all the infos the welcome message needs to contain @@ -81,11 +81,9 @@ func TestIPCAttachWelcome(t *testing.T) { defer os.RemoveAll(ws) ipc = filepath.Join(ws, "tomo.ipc") } - // Note: we need --shh because testAttachWelcome checks for default - // list of ipc modules and shh is included there. tomo := runTomo(t, "--port", "0", "--maxpeers", "0", "--nodiscover", "--nat", "none", - "--etherbase", coinbase, "--shh", "--ipcpath", ipc) + "--etherbase", coinbase, "--ipcpath", ipc) time.Sleep(2 * time.Second) // Simple way to wait for the RPC endpoint to open testAttachWelcome(t, tomo, "ipc:"+ipc, ipcAPIs) diff --git a/cmd/tomo/main.go b/cmd/tomo/main.go index ecf4df5725..d21ef9dce1 100644 --- a/cmd/tomo/main.go +++ b/cmd/tomo/main.go @@ -58,38 +58,38 @@ var ( utils.BootnodesV5Flag, utils.DataDirFlag, utils.KeyStoreDirFlag, - utils.NoUSBFlag, - utils.DashboardEnabledFlag, - utils.DashboardAddrFlag, - utils.DashboardPortFlag, - utils.DashboardRefreshFlag, - utils.EthashCacheDirFlag, - utils.EthashCachesInMemoryFlag, - utils.EthashCachesOnDiskFlag, - utils.EthashDatasetDirFlag, - utils.EthashDatasetsInMemoryFlag, - utils.EthashDatasetsOnDiskFlag, - utils.TxPoolNoLocalsFlag, - utils.TxPoolJournalFlag, - utils.TxPoolRejournalFlag, - utils.TxPoolPriceLimitFlag, - utils.TxPoolPriceBumpFlag, - utils.TxPoolAccountSlotsFlag, - utils.TxPoolGlobalSlotsFlag, - utils.TxPoolAccountQueueFlag, - utils.TxPoolGlobalQueueFlag, - utils.TxPoolLifetimeFlag, + //utils.NoUSBFlag, + //utils.DashboardEnabledFlag, + //utils.DashboardAddrFlag, + //utils.DashboardPortFlag, + //utils.DashboardRefreshFlag, + //utils.EthashCacheDirFlag, + //utils.EthashCachesInMemoryFlag, + //utils.EthashCachesOnDiskFlag, + //utils.EthashDatasetDirFlag, + //utils.EthashDatasetsInMemoryFlag, + //utils.EthashDatasetsOnDiskFlag, + //utils.TxPoolNoLocalsFlag, + //utils.TxPoolJournalFlag, + //utils.TxPoolRejournalFlag, + //utils.TxPoolPriceLimitFlag, + //utils.TxPoolPriceBumpFlag, + //utils.TxPoolAccountSlotsFlag, + //utils.TxPoolGlobalSlotsFlag, + //utils.TxPoolAccountQueueFlag, + //utils.TxPoolGlobalQueueFlag, + //utils.TxPoolLifetimeFlag, utils.FastSyncFlag, utils.LightModeFlag, utils.SyncModeFlag, utils.GCModeFlag, - utils.LightServFlag, - utils.LightPeersFlag, - utils.LightKDFFlag, - utils.CacheFlag, - utils.CacheDatabaseFlag, - utils.CacheGCFlag, - utils.TrieCacheGenFlag, + //utils.LightServFlag, + //utils.LightPeersFlag, + //utils.LightKDFFlag, + //utils.CacheFlag, + //utils.CacheDatabaseFlag, + //utils.CacheGCFlag, + //utils.TrieCacheGenFlag, utils.ListenPortFlag, utils.MaxPeersFlag, utils.MaxPendingPeersFlag, @@ -100,25 +100,25 @@ var ( utils.TargetGasLimitFlag, utils.NATFlag, utils.NoDiscoverFlag, - utils.DiscoveryV5Flag, - utils.NetrestrictFlag, + //utils.DiscoveryV5Flag, + //utils.NetrestrictFlag, utils.NodeKeyFileFlag, utils.NodeKeyHexFlag, - utils.DeveloperFlag, - utils.DeveloperPeriodFlag, - utils.TestnetFlag, - utils.RinkebyFlag, - utils.VMEnableDebugFlag, + //utils.DeveloperFlag, + //utils.DeveloperPeriodFlag, + //utils.TestnetFlag, + //utils.RinkebyFlag, + //utils.VMEnableDebugFlag, utils.NetworkIdFlag, utils.RPCCORSDomainFlag, utils.RPCVirtualHostsFlag, utils.EthStatsURLFlag, utils.MetricsEnabledFlag, - utils.FakePoWFlag, - utils.NoCompactionFlag, - utils.GpoBlocksFlag, - utils.GpoPercentileFlag, - utils.ExtraDataFlag, + //utils.FakePoWFlag, + //utils.NoCompactionFlag, + //utils.GpoBlocksFlag, + //utils.GpoPercentileFlag, + //utils.ExtraDataFlag, configFileFlag, } @@ -153,13 +153,8 @@ func init() { initCommand, importCommand, exportCommand, - importPreimagesCommand, - exportPreimagesCommand, - copydbCommand, removedbCommand, dumpCommand, - // See monitorcmd.go: - monitorCommand, // See accountcmd.go: accountCommand, walletCommand, @@ -168,11 +163,7 @@ func init() { attachCommand, javascriptCommand, // See misccmd.go: - makecacheCommand, - makedagCommand, versionCommand, - bugCommand, - licenseCommand, // See config.go dumpConfigCommand, } @@ -182,7 +173,7 @@ func init() { app.Flags = append(app.Flags, rpcFlags...) app.Flags = append(app.Flags, consoleFlags...) app.Flags = append(app.Flags, debug.Flags...) - app.Flags = append(app.Flags, whisperFlags...) + //app.Flags = append(app.Flags, whisperFlags...) app.Before = func(ctx *cli.Context) error { runtime.GOMAXPROCS(runtime.NumCPU()) diff --git a/cmd/tomo/usage.go b/cmd/tomo/usage.go index 77e753f905..3342682fa9 100644 --- a/cmd/tomo/usage.go +++ b/cmd/tomo/usage.go @@ -65,41 +65,41 @@ type flagGroup struct { // AppHelpFlagGroups is the application flags, grouped by functionality. var AppHelpFlagGroups = []flagGroup{ { - Name: "ETHEREUM", + Name: "TOMOCHAIN", Flags: []cli.Flag{ configFileFlag, utils.DataDirFlag, utils.KeyStoreDirFlag, - utils.NoUSBFlag, + //utils.NoUSBFlag, utils.NetworkIdFlag, - utils.TestnetFlag, - utils.RinkebyFlag, + //utils.TestnetFlag, + //utils.RinkebyFlag, utils.SyncModeFlag, utils.GCModeFlag, utils.EthStatsURLFlag, utils.IdentityFlag, - utils.LightServFlag, - utils.LightPeersFlag, - utils.LightKDFFlag, - }, - }, - {Name: "DEVELOPER CHAIN", - Flags: []cli.Flag{ - utils.DeveloperFlag, - utils.DeveloperPeriodFlag, - }, - }, - { - Name: "ETHASH", - Flags: []cli.Flag{ - utils.EthashCacheDirFlag, - utils.EthashCachesInMemoryFlag, - utils.EthashCachesOnDiskFlag, - utils.EthashDatasetDirFlag, - utils.EthashDatasetsInMemoryFlag, - utils.EthashDatasetsOnDiskFlag, + //utils.LightServFlag, + //utils.LightPeersFlag, + //utils.LightKDFFlag, }, }, + //{Name: "DEVELOPER CHAIN", + // Flags: []cli.Flag{ + // utils.DeveloperFlag, + // utils.DeveloperPeriodFlag, + // }, + //}, + //{ + // Name: "ETHASH", + // Flags: []cli.Flag{ + // utils.EthashCacheDirFlag, + // utils.EthashCachesInMemoryFlag, + // utils.EthashCachesOnDiskFlag, + // utils.EthashDatasetDirFlag, + // utils.EthashDatasetsInMemoryFlag, + // utils.EthashDatasetsOnDiskFlag, + // }, + //}, //{ // Name: "DASHBOARD", // Flags: []cli.Flag{ @@ -110,30 +110,30 @@ var AppHelpFlagGroups = []flagGroup{ // utils.DashboardAssetsFlag, // }, //}, - { - Name: "TRANSACTION POOL", - Flags: []cli.Flag{ - utils.TxPoolNoLocalsFlag, - utils.TxPoolJournalFlag, - utils.TxPoolRejournalFlag, - utils.TxPoolPriceLimitFlag, - utils.TxPoolPriceBumpFlag, - utils.TxPoolAccountSlotsFlag, - utils.TxPoolGlobalSlotsFlag, - utils.TxPoolAccountQueueFlag, - utils.TxPoolGlobalQueueFlag, - utils.TxPoolLifetimeFlag, - }, - }, - { - Name: "PERFORMANCE TUNING", - Flags: []cli.Flag{ - utils.CacheFlag, - utils.CacheDatabaseFlag, - utils.CacheGCFlag, - utils.TrieCacheGenFlag, - }, - }, + //{ + // Name: "TRANSACTION POOL", + // Flags: []cli.Flag{ + // utils.TxPoolNoLocalsFlag, + // utils.TxPoolJournalFlag, + // utils.TxPoolRejournalFlag, + // utils.TxPoolPriceLimitFlag, + // utils.TxPoolPriceBumpFlag, + // utils.TxPoolAccountSlotsFlag, + // utils.TxPoolGlobalSlotsFlag, + // utils.TxPoolAccountQueueFlag, + // utils.TxPoolGlobalQueueFlag, + // utils.TxPoolLifetimeFlag, + // }, + //}, + //{ + // Name: "PERFORMANCE TUNING", + // Flags: []cli.Flag{ + // utils.CacheFlag, + // utils.CacheDatabaseFlag, + // utils.CacheGCFlag, + // utils.TrieCacheGenFlag, + // }, + //}, { Name: "ACCOUNT", Flags: []cli.Flag{ @@ -173,14 +173,14 @@ var AppHelpFlagGroups = []flagGroup{ utils.MaxPendingPeersFlag, utils.NATFlag, utils.NoDiscoverFlag, - utils.DiscoveryV5Flag, - utils.NetrestrictFlag, + //utils.DiscoveryV5Flag, + //utils.NetrestrictFlag, utils.NodeKeyFileFlag, utils.NodeKeyHexFlag, }, }, { - Name: "MINER", + Name: "STAKER", Flags: []cli.Flag{ utils.StakingEnabledFlag, utils.StakerThreadsFlag, @@ -190,31 +190,31 @@ var AppHelpFlagGroups = []flagGroup{ utils.ExtraDataFlag, }, }, - { - Name: "GAS PRICE ORACLE", - Flags: []cli.Flag{ - utils.GpoBlocksFlag, - utils.GpoPercentileFlag, - }, - }, - { - Name: "VIRTUAL MACHINE", - Flags: []cli.Flag{ - utils.VMEnableDebugFlag, - }, - }, + //{ + // Name: "GAS PRICE ORACLE", + // Flags: []cli.Flag{ + // utils.GpoBlocksFlag, + // utils.GpoPercentileFlag, + // }, + //}, + //{ + // Name: "VIRTUAL MACHINE", + // Flags: []cli.Flag{ + // utils.VMEnableDebugFlag, + // }, + //}, { Name: "LOGGING AND DEBUGGING", Flags: append([]cli.Flag{ utils.MetricsEnabledFlag, - utils.FakePoWFlag, - utils.NoCompactionFlag, + //utils.FakePoWFlag, + //utils.NoCompactionFlag, }, debug.Flags...), }, - { - Name: "WHISPER (EXPERIMENTAL)", - Flags: whisperFlags, - }, + //{ + // Name: "WHISPER (EXPERIMENTAL)", + // Flags: whisperFlags, + //}, { Name: "DEPRECATED", Flags: []cli.Flag{ diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 5f038750e2..27c3077242 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -128,7 +128,7 @@ var ( } NetworkIdFlag = cli.Uint64Flag{ Name: "networkid", - Usage: "Network identifier (integer, 1=Frontier, 2=Morden (disused), 3=Ropsten, 4=Rinkeby)", + Usage: "Network identifier (integer, 89=Tomochain)", Value: eth.DefaultConfig.NetworkId, } TestnetFlag = cli.BoolFlag{ diff --git a/eth/config.go b/eth/config.go index dd7f42c7d9..dbfe973913 100644 --- a/eth/config.go +++ b/eth/config.go @@ -43,7 +43,7 @@ var DefaultConfig = Config{ DatasetsInMem: 1, DatasetsOnDisk: 2, }, - NetworkId: 1, + NetworkId: 89, LightPeers: 100, DatabaseCache: 768, TrieCache: 256, diff --git a/eth/protocol_test.go b/eth/protocol_test.go index b2f93d8dd1..ed30f35bf6 100644 --- a/eth/protocol_test.go +++ b/eth/protocol_test.go @@ -63,8 +63,8 @@ func testStatusMsgErrors(t *testing.T, protocol int) { wantError: errResp(ErrProtocolVersionMismatch, "10 (!= %d)", protocol), }, { - code: StatusMsg, data: statusData{uint32(protocol), 999, td, head.Hash(), genesis.Hash()}, - wantError: errResp(ErrNetworkIdMismatch, "999 (!= 1)"), + code: StatusMsg, data: statusData{uint32(protocol), 89, td, head.Hash(), genesis.Hash()}, + wantError: errResp(ErrNetworkIdMismatch, "89 (!= 1)"), }, { code: StatusMsg, data: statusData{uint32(protocol), DefaultConfig.NetworkId, td, head.Hash(), common.Hash{3}}, @@ -85,7 +85,7 @@ func testStatusMsgErrors(t *testing.T, protocol int) { } else if err.Error() != test.wantError.Error() { t.Errorf("test %d: wrong error: got %q, want %q", i, err, test.wantError) } - case <-time.After(2 * time.Second): + case <-time.After(5 * time.Second): t.Errorf("protocol did not shut down within 2 seconds") } p.close() diff --git a/internal/debug/flags.go b/internal/debug/flags.go index 8d7972947d..956e4e3fa3 100644 --- a/internal/debug/flags.go +++ b/internal/debug/flags.go @@ -87,9 +87,17 @@ var ( // Flags holds all command-line flags required for debugging. var Flags = []cli.Flag{ - VerbosityFlag, vmoduleFlag, backtraceAtFlag, debugFlag, - pprofFlag, pprofAddrFlag, pprofPortFlag, - memprofilerateFlag, blockprofilerateFlag, cpuprofileFlag, traceFlag, + VerbosityFlag, + //vmoduleFlag, + //backtraceAtFlag, + //debugFlag, + //pprofFlag, + //pprofAddrFlag, + //pprofPortFlag, + //memprofilerateFlag, + //blockprofilerateFlag, + //cpuprofileFlag, + //traceFlag, } var Glogger *log.GlogHandler diff --git a/node/defaults.go b/node/defaults.go index 8875605807..fb61288b87 100644 --- a/node/defaults.go +++ b/node/defaults.go @@ -55,11 +55,11 @@ func DefaultDataDir() string { home := homeDir() if home != "" { if runtime.GOOS == "darwin" { - return filepath.Join(home, "Library", "Ethereum") + return filepath.Join(home, "Library", "Tomochain") } else if runtime.GOOS == "windows" { - return filepath.Join(home, "AppData", "Roaming", "Ethereum") + return filepath.Join(home, "AppData", "Roaming", "Tomochain") } else { - return filepath.Join(home, ".ethereum") + return filepath.Join(home, ".tomo") } } // As we cannot guess a stable location, return empty and handle later