You can use the dumpconfig option together with the command line parameters you would like use. geth will then create a config file for you which you can use, rather than creating it yourself.
In your case, that would be
geth --networkid 3 --rpcport 8555 dumpconfig
(you would probably add some more parameters, but I just used the ones you supplied in your question).
You will then get something like this:
[Eth]
NetworkId = 3
SyncMode = "fast"
LightPeers = 20
DatabaseCache = 128
GasPrice = 18000000000
EthashCacheDir = "ethash"
EthashCachesInMem = 2
EthashCachesOnDisk = 3
EthashDatasetDir = "..."
EthashDatasetsInMem = 1
EthashDatasetsOnDisk = 2
EnablePreimageRecording = false
[Eth.TxPool]
NoLocals = false
Journal = "transactions.rlp"
Rejournal = 3600000000000
PriceLimit = 1
PriceBump = 10
AccountSlots = 16
GlobalSlots = 4096
AccountQueue = 64
GlobalQueue = 1024
Lifetime = 10800000000000
[Eth.GPO]
Blocks = 10
Percentile = 50
[Shh]
MaxMessageSize = 1048576
MinimumAcceptedPOW = 2e-01
[Node]
DataDir = ...
IPCPath = "geth.ipc"
HTTPPort = 8555
HTTPModules = ["net", "web3", "eth", "shh"]
WSPort = 8546
WSModules = ["net", "web3", "eth", "shh"]
[Node.P2P]
MaxPeers = 25
NoDiscovery = false
DiscoveryV5Addr = ":30304"
BootstrapNodes = [...]
BootstrapNodesV5 = [...]
StaticNodes = []
TrustedNodes = []
ListenAddr = ":30303"
EnableMsgEvents = false
You can find networkid in section [Eth] and rpcport in section [Node] as HTTPPort. Store this output to a file, which you can use as config file:
geth --networkid 3 --rpcport 8555 dumpconfig > config.toml
geth --config config.toml
Just a note: when I tried this, adding the networkid as number did not work, geth always connected to main net (I was using version 1.7.2). Identifying the network by its name (--testnet, --rinkeby), however, worked well for me.
dumpconfiggenerates a rather big file, is there a way to remove all settings that where dumped into the file even when their values are the default ones? – rraallvv Oct 31 '18 at 17:44