erigon-pulse/cmd/devnet/models/model.go
Leonard Chinonso 9d172ae125
Devnet Remake (#5532)
* Rebuilding the devnet tool for better quality

* Added README

* deleted former devnettest folder

* Correction changes

* Implementation node connection through enode for two nodes

* synced two nodes, moving to logging

* Fixed lint
2022-09-30 21:04:34 +01:00

60 lines
1.7 KiB
Go

package models
import (
"fmt"
"github.com/ledgerwatch/erigon/cmd/rpctest/rpctest"
"github.com/ledgerwatch/erigon/p2p"
)
const (
// BuildDirArg is the build directory for the devnet executable
BuildDirArg = "./build/bin/devnet"
// DataDirArg is the datadir flag
DataDirArg = "--datadir"
// ChainArg is the chain flag
ChainArg = "--chain"
// DevPeriodArg is the dev.period flag
DevPeriodArg = "--dev.period"
// VerbosityArg is the verbosity flag
VerbosityArg = "--verbosity"
// Mine is the mine flag
Mine = "--mine"
// NoDiscover is the nodiscover flag
NoDiscover = "--nodiscover"
// PrivateApiAddrArg is the private.api.addr flag
PrivateApiAddrArg = "--private.api.addr"
// StaticPeersArg is the staticpeers flag
StaticPeersArg = "--staticpeers"
// HttpApiArg is the http.api flag
HttpApiArg = "--http.api"
// DataDirParam is the datadir parameter
DataDirParam = "./dev"
// ChainParam is the chain parameter
ChainParam = "dev"
// DevPeriodParam is the dev.period parameter
DevPeriodParam = "30"
// VerbosityParam is the verbosity parameter
VerbosityParam = "0"
// PrivateApiParamMine is the private.api.addr parameter for the mining node
PrivateApiParamMine = "localhost:9090"
// PrivateApiParamNoMine is the private.api.addr parameter for the non-mining node
PrivateApiParamNoMine = "localhost:9091"
// ErigonUrl is the default url for rpc connections
ErigonUrl = "http://localhost:8545"
)
type AdminNodeInfoResponse struct {
rpctest.CommonResponse
Result p2p.NodeInfo `json:"result"`
}
// ParameterFromArgument merges the argument and parameter and returns a flag input string
func ParameterFromArgument(arg, param string) (string, error) {
if arg == "" {
return "", ErrInvalidArgument
}
return fmt.Sprintf("%s=%s", arg, param), nil
}