dir : cmd/geth/config.go
load defaults
cfg := gethConfig{
Eth: ethconfig.Defaults,
Node: defaultNodeConfig(),
Metrics: metrics.DefaultConfig,
}
load config file - flag를 file로 넣어줬다면 이를 가져옴
if file := ctx.String(configFileFlag.Name); file != "" {...}
flag 적용
// config에 node 관련 cli flag를 적용시킴
// e.g. unlock, http, graphql, IPC 등..
utils.SetNodeConfig(ctx, &cfg.Node)
// dir : cmd/utils/flags.go
새로운 node 인스턴스 생성
// 새로운 p2p node 생성, 프로토콜 등록 준비
stack, err := node.New(&cfg.Node)
// dir : node/node.go
지갑, 서명 관련 설정 (external, local, hard wallet address 추가)
if err := setAccountManagerBackends(stack); ...
eth 연관 cli flag 추가 (대부분의 config를 여기서 설정함)
// 서로 충돌하는 flag들이 없는지, 어떤 네트워크에 연결했는지 등
utils.SetEthConfig(ctx, stack, &cfg.Eth)
// dir : cmd/utils/flags.go
기타 설정 마무리 후 리턴
return stack, cfg