Skip to content

Commit

Permalink
Merged in coinplugin/go-metadium (pull request #19)
Browse files Browse the repository at this point in the history
Master

Approved-by: Uh Sado <sadoc@metadium.com>
  • Loading branch information
sadoci committed Mar 21, 2019
2 parents 1d84c5a + 9127e91 commit ebca4c9
Show file tree
Hide file tree
Showing 14 changed files with 614 additions and 289 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -215,15 +215,17 @@ ifeq ($(shell uname), Linux)
-v /etc/group:/etc/group:ro \
-v ~/src:/home/$${USER}/src \
-v $(shell pwd):/data -u $$(id -u):$$(id -g) \
-w /data metadium/bobthe:latest make; \
-w /data metadium/bobthe:latest \
make USE_ROCKSDB=$(USE_ROCKSDB); \
fi
else
@docker --version > /dev/null 2>&1; \
if [ ! $$? = 0 ]; then \
echo "Docker not found."; \
else \
docker run -e HOME=/tmp -it --rm -v $(shell pwd):/data \
-w /data metadium/bobthe:latest make; \
-w /data metadium/bobthe:latest \
make USE_ROCKSDB=$(USE_ROCKSDB); \
fi
endif

Expand Down
9 changes: 5 additions & 4 deletions cmd/geth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ import (
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/internal/debug"
"github.com/ethereum/go-ethereum/log"
metadium "github.com/ethereum/go-ethereum/metadium"
"github.com/ethereum/go-ethereum/metrics"
"github.com/ethereum/go-ethereum/node"
metadium "github.com/ethereum/go-ethereum/metadium"
cli "gopkg.in/urfave/cli.v1"
)

const (
clientIdentifier = "geth" // Client identifier to advertise over the network
clientIdentifier = "gmet" // Client identifier to advertise over the network
)

var (
Expand Down Expand Up @@ -182,14 +182,15 @@ var (
utils.UseRocksDb,
utils.PrefetchCount,
utils.LogFlag,
utils.MaxTxsPerBlock,
}
)

func init() {
// Initialize the CLI app and start Geth
app.Action = geth
app.HideVersion = true // we have a command to print the version
app.Copyright = "Copyright 2013-2018 The go-ethereum Authors"
app.Copyright = "Copyright 2013-2019 The go-ethereum / go-metadium Authors"
app.Commands = []cli.Command{
// See chaincmd.go:
initCommand,
Expand Down Expand Up @@ -412,7 +413,7 @@ func limitMaxRss(max int64) {
if err != nil {
log.Error("Getrusage() failed:", "reason", err)
} else {
if (rusage.Maxrss > max) {
if rusage.Maxrss > max {
log.Info("Calling FreeOSMemory()", "Max", max, "Rusage.Maxrss", rusage.Maxrss)
godebug.FreeOSMemory()
}
Expand Down
1 change: 1 addition & 0 deletions cmd/geth/usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ var AppHelpFlagGroups = []flagGroup{
utils.UseRocksDb,
utils.PrefetchCount,
utils.LogFlag,
utils.MaxTxsPerBlock,
},
},
{
Expand Down
8 changes: 8 additions & 0 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,11 @@ var (
Usage: "Rotating log file: <file-name>,<count>,<size>",
Value: "log,5,10M",
}
MaxTxsPerBlock = cli.IntFlag{
Name: "maxtxsperblock",
Usage: "Max # of transactions in a block",
Value: params.MaxTxsPerBlock,
}
)

// MakeDataDir retrieves the currently requested data directory, terminating
Expand Down Expand Up @@ -1377,6 +1382,9 @@ func SetMetadiumConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
if ctx.GlobalIsSet(UseRocksDb.Name) {
params.UseRocksDb = ctx.GlobalInt(UseRocksDb.Name)
}
if ctx.GlobalIsSet(MaxTxsPerBlock.Name) {
params.MaxTxsPerBlock = ctx.GlobalInt(MaxTxsPerBlock.Name)
}

if params.ConsensusMethod == params.ConsensusInvalid {
params.ConsensusMethod = params.ConsensusPoW
Expand Down
Loading

0 comments on commit ebca4c9

Please sign in to comment.