Bsc_debug

init

./geth --datadir data init genesis.json

  • 文件依赖:
    • genesis.json

启动

1
./geth --config config.toml --datadir ./data --networkid 820014 --rpc --rpcapi eth,net,web3,miner,txpool --rpcaddr 0.0.0.0 --rpcport 9545 --port 3060
  • config.toml
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
[Eth]
#DiscoveryURLs = []
NoPruning = false
NoPrefetch = false
LightPeers = 100
UltraLightFraction = 75
EnablePreimageRecording = false
EWASMInterpreter = ""
EVMInterpreter = ""

[Eth.Miner]
GasFloor = 30000000
GasCeil = 40000000
GasPrice = 1000000000
Recommit = 10000000000
Noverify = false

[Eth.Ethash]
CacheDir = ""
CachesInMem = 0
CachesOnDisk = 0
CachesLockMmap = false
DatasetDir = ""
DatasetsInMem = 0
DatasetsOnDisk = 0
DatasetsLockMmap = false
PowMode = 0

[Eth.TxPool]
Locals = []
NoLocals = true
Journal = "transactions.rlp"
Rejournal = 3600000000000
PriceLimit = 1000000000
PriceBump = 10
AccountSlots = 16
GlobalSlots = 4096
AccountQueue = 64
GlobalQueue = 1024
Lifetime = 10800000000000

[Eth.GPO]
Blocks = 20
Percentile = 60

#[Shh]
#MaxMessageSize = 1048576
#RestrictConnectionBetweenLightClients = true

[Node]
DataDir = "~/data/node1"
#omitempty = ""
InsecureUnlockAllowed = true
NoUSB = true
IPCPath = "geth.ipc"
HTTPHost = "0.0.0.0"
HTTPPort = 8545
HTTPVirtualHosts = ["*"]
HTTPModules = ["debug","eth", "net", "web3", "txpool", "parlia"]
WSPort = 8576
WSModules = ["net", "web3", "eth"]
#GraphQLPort = 8577
GraphQLVirtualHosts = ["*"]

[Node.P2P]
MaxPeers = 50
NoDiscovery = false
StaticNodes = []
BootstrapNodes = []
TrustedNodes = []
ListenAddr = "127.0.0.1:30303"


EnableMsgEvents = false

[Node.HTTPTimeouts]
ReadTimeout = 30000000000
WriteTimeout = 30000000000
IdleTimeout = 120000000000


[Node.LogConfig]
FileRoot = ""
FilePath = "log/bsc.log"
MaxBytesSize = 10485760
Level = "info" 

调试

1
dlv debug . -- --config /Users/k/bsc_test/config.toml --datadir /Users/k/bsc_test/data --networkid 820014 --rpc --rpcapi eth,net,web3,miner,txpool --rpcaddr 0.0.0.0 --rpcport 8545 --port 30303

调试工具

  • (dlv)[https://chai2010.cn/advanced-go-programming-book/ch3-asm/ch3-09-debug.html]
  • (gdb)[https://go.dev/doc/gdb]
Licensed under CC BY-NC-SA 4.0
Built with Hugo
主题 StackJimmy 设计