ethereum - Geth --dev --datadir 不创建数据库
问题描述
在阅读https://geth.ethereum.org/docs/getting-started/dev-mode上的文档时, 它指出正在运行
geth --http --dev --datadir MyChain
意志等
- 使用测试创世块初始化数据目录
但是在运行命令时,我得到以下输出
C:\bcbootcamp>geth --http --dev --datadir MyChain
INFO [04-14|00:28:40.461] Starting Geth in ephemeral dev mode...
INFO [04-14|00:28:40.537] Maximum peer count ETH=50 LES=0 total=50
INFO [04-14|00:28:40.545] Set global gas cap cap=25000000
INFO [04-14|00:28:43.722] Using developer account address=0x953d79A4681068A8ab07De93b8EaE5dAedd81a7C
INFO [04-14|00:28:43.728] Allocated cache and file handles database=C:\bcbootcamp\MyChain\geth\chaindata cache=512.00MiB handles=8192 readonly=true
Fatal: Could not open database: CreateFile C:\bcbootcamp\MyChain\geth\chaindata: The system cannot find the file specified.
测试表明,当
geth init MyChain\genesis.json --datadir MyChain
预先运行 geth --dev 运行没有问题
有没有办法像文档中描述的那样一起使用--dev和--datadir,当geth在datadir中找不到一个新数据库时,它会创建一个新数据库
Geth
Version: 1.10.2-stable
Git Commit: 97d11b0187b4695ccf44e3b71b54155fe405a36f
Git Commit Date: 20210408
Architecture: amd64
Go Version: go1.16
Operating System: windows
GOPATH=
GOROOT=go
解决方案
推荐阅读
- jsp - 为什么我无法编译 JSP 文件中的类?错误 500
- android - 实现错误 - picasso:2.71828(发现多个文件具有独立于操作系统的路径)
- swift - 在 UITableView 的一个部分中对行进行排序
- java - 我的应用无法发送 GET、OkHttp
- reactjs - React Modal 在标题组件中不起作用
- vba - VLookup multiple values
- ios - Xcode 10 应用程序图标未显示
- angular - Ionic 4 Angular template binding with async pipe to observable
- php - where condition doesn't work
- java - 为什么编译器在包含 2 个类的源文件中找不到我的公共类?