win10下btcd的安装和简单配置
btcd
1. 安装
1) 安装go的包管理工具glide
$ go get -u github.com/Masterminds/glide
出现的问题
[ERROR] Unable to export dependencies to vendor directory: Error moving files: exit status 1. output: Access is denied. 0 dir(s) moved
解决方法
修改%GOPATH%/src/github.com/Masterminds/glide/path/winbug.go中的CustomRename函数的75行
修改前:
cmd := exec.Command("cmd.exe", "/c", "move", o, n)
修改后:
cmd := exec.Command("cmd.exe", "/c", "xcopy /s/y", o, n+"\\")
修改完成后需要重新编译生成glide.exe
go install github.com/Masterminds/glide
2) 安装btcd
git clone https://github.com/btcsuite/btcd %GOPATH%\src\github.com\btcsuite\btcd
cd %GOPATH%\src\github.com\btcsuite\btcd
glide install
go install . ./cmd/...
附: linux下对应操作:
$ git clone https://github.com/btcsuite/btcd $GOPATH/src/github.com/btcsuite/btcd
$ cd $GOPATH/src/github.com/btcsuite/btcd
$ glide install
$ go install . ./cmd/...
遇到的问题
由于墙的原因,go get可能无法安装需要的golang.org/x/crypto等包
解决方法
可参考go get golang.org/x 包失败解决方法
有条件的话,建议使用代理下载,方便很多,避免安装过程中手动解决依赖问题
安装成功的话会在%GOPATH%/bin 目录下生成以下可执行程序:
addblock btcctl btcd findcheckpoint gencerts glide
3)安装btcwallet [可选]
git clone https://github.com/btcsuite/btcwallet %GOPATH%\src\github.com\btcsuite\btcwallet
cd %GOPATH%\src\github.com\btcsuite\btcwallet
glide install
go install . ./cmd/...
附: linux下对应操作:
$ git clone https://github.com/btcsuite/btcwallet $GOPATH/src/github.com/btcsuite/btcwallet
$ cd $GOPATH/src/github.com/btcsuite/btcwallet
$ glide install
$ go install . ./cmd/...
安装btcwallet之后
$ ls ~/go/bin/
addblock btcctl btcd btcwallet dropwtxmgr findcheckpoint gencerts glide sweepaccount
2. 配置
配置btcd.conf
在%GOPATH%/bin下创建sample-btcd.conf
完整版参考: sample-btcd.conf
内容如下:
[Application Options]
rpcuser=+9AqUHnIIJIAmYt7Et+jpwxOci8=
rpcpass=7sMYDaq4K8hRxUsCsTs1tJoaw/Q=
#rpclimituser=mylimituser
#rpclimitpass=Limitedp4ssw0rd
#configfile=H:/btcd/btcd.conf # 貌似修改无效,为了使用方便,直接放在默认位置(C:\Users\你的用户名\AppData\Local\Btcd\btcd.conf)好了
datadir=H:/btcd/data
logdir=H:/btcd/logs
rpccert=H:/btcd/rpc.cert
rpckey=H:/btcd/rpc.key
debuglevel=debug
#maxpeers=50
其中#开头的都是注释内容
默认配置文件路径:
#切换中%GOPATH%目录
E:\>cd %GOPATH%\bin
E:\>F:
# 执行btcd.exe,第一次初始化的时候会加载相同目录下的sample-btcd.conf文件,之后使用如果不用-C指定配置文件则加载默认配置C:\Users\你的用户名\AppData\Local\Btcd\btcd.conf
F:\Go\bin>btcd.exe
配置btcct.conf
在%GOPATH%\bin目录下创建btcctl.conf
内容如下:
[Application Options]
rpcuser=+9AqUHnIIJIAmYt7Et+jpwxOci8=
rpcpass=7sMYDaq4K8hRxUsCsTs1tJoaw/Q=
rpccert=H:/btcd/rpc.cert
注意
这里的rpcuser
和rpcpass
是btcd随机生成
的
,在C:\Users\你的用户名\AppData\Local\Btcd\btcd.conf中
测试访问
F:\Go\bin>btcctl ping
open C:\Users\hupeng\AppData\Local\Btcd\rpc.cert: The system cannot find the file specified.
和btcd.exe相同,如果不指定-C,会加载默认配置
,默认配置文件在C:\Users\你的用户名\AppData\Local\Btcctl\btcctl.conf
查看默认配置文件,内容如下:
[Application Options]
rpcuser=+9AqUHnIIJIAmYt7Et+jpwxOci8=
rpcpass=7sMYDaq4K8hRxUsCsTs1tJoaw/Q=
发现缺少rpccert,加入:
rpccert=H:/btcd/rpc.cert
再次尝试
F:\Go\bin>btcctl.exe ping
# 打开新的cmd命令终端
C:\Users\hupeng>btcctl.exe getblockcount
141953
C:\Users\hupeng>btcctl.exe getblockhash 0
000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f
访问网站(如:https://blockexplorer.com)验证hash。发现hash相同,至此环境搭建完毕
默认端口
Name | Port |
---|---|
Default Bitcoin peer-to-peer port | TCP 8333 |
Default RPC port | TCP 8334 |
其他
By default, the rpc server now uses certs to protect the connection by default.
You can also check out https://github.com/conformal/btcd/tree/master/util/btcctl for an example of making an rpc connection using the cert btcd generates on initial startup.
When running btcd, if no configuration file is found, the sample-btcd.conf file is copied to the default path,
with the rpcuser and rpcpass lines populated with random base64 encoded values.
When running btcctl, if no configuration file is found, it attempts to read the btcd.conf file at its default path,
and create a basic btcctl.conf file by copying the rpcuser and rpcpass.
参考:
win10下btcd的安装和简单配置的更多相关文章
- Linux下的GitHub安装与简单配置教程 ~ 转载
Linux下的GitHub安装与简单配置教程 1.GitHub简介 Git是一个分布式版本控制系统,与其相对的是CVS.SVN等集中式的版本控制系统. 2.Git的安装 1)安装Git a.查看与 ...
- win10下Ubuntu18.04安装的简单教程
win10下Ubuntu18.04安装的简单教程 操作系统:windows 软件:Vmware15. 一.下载 Ubuntu18.04镜像 Ubuntu18.04镜像下载 ...
- Linux下的GitHub安装与简单配置教程
1.GitHub简介 Git是一个分布式版本控制系统,与其相对的是CVS.SVN等集中式的版本控制系统. 2.Git的安装 1)安装Git a.查看与使用 在ubuntu下可以使用如下命令进行查看系统 ...
- ECS centos6.8系统下从nginx安装到简单网站上线配置操作的完整记录
1.准备工作 1.1已购买阿里云云服务器ECS 1.2域名已购买并解析成功 1.3安装有远程链接工具Xshell和文件传输工具Xftf,并链接上ECS实例 2.安装nginx(在Xshell操作) 2 ...
- win10下使用nodejs安装及webstorm创建express项目的指导
title: win10下使用nodejs安装 win10下使用nodejs安装及webstorm创建express项目的指导 windows下nvm的安装 熟悉linux下nodejs开发的朋友应该 ...
- docker的安装和简单配置
docker的安装和简单配置 docker是balabalabala...懒得介绍. 国内安装docker很蛋疼,按照官方配置好了软件源之后,几十MB的安装文件下载要半天,没办法,docker默认的软 ...
- Windows下Anaconda的安装和简单使用
Windows下Anaconda的安装和简单使用 Anaconda is a completely free Python distribution (including for commercial ...
- <转载> FreeNAS的安装和简单配置 http://freenas.cn/?p=342
前些日子在公司搭了一个模拟生产环境的平台.由于是测试环境,资源有限只能使用虚拟机实现,所以存储这块就想到了使用FreeNAS.很早以前玩儿过几次,当时是生产环境需要上存储设备,经过对比还是选择的更可靠 ...
- 大自然的搬运工:Ubuntu环境下gedit的一些个简单配置
gedit是Ubuntu默认的文本编辑器,个人觉得还是不错的,用它来编程写一些小的demo也很方便,原谅我比较菜,vim用起来感觉打字速度真的很慢呀. 下面对gedit做一些简单配置,方便编程. 一. ...
随机推荐
- MVC实战之排球计分(五)—— Controller的设计与实现
控制器 控制器接受用户的输入并调用模型和视图去完成用户的需求.所以当单击Web页面中的超链接和发送HTML表单时, 控制器本身不输出任何东西和做任何处理.它只是接收请求并决定调用哪个模型构件去处理请求 ...
- two week summary
from collections import Iteratorfrom collections import Iterabl dic = {'a':"a","91a&q ...
- or 的判断
NeedCompact := NeedCompact or (AdoQ.ExecSQL > 0)
- 第三组 通信一班 030 OSPFv2、OSPFv3综合实验
一. 实验目的 掌握 OSPFv2. OSPFv3 的配置方法 掌握在帧中继环境下OSPFv2. OSPFv3 的配置方法 掌握 OSPFv2. OSPFv3 NSSA 的配置方法 ...
- 四:(之八_Linux压力测试工具stress)Dockerfile语法梳理和实践
8.1 安装stress stress目前是在该目录下的可执行文件 --vm 创建几个进程 --vm-bytes 为每个进程分配多少内存 8.2 debug输出stress创建进程的过程 一直在创建有 ...
- day_7
r 读w 写a 追加写 f = open('s.txt',mode='r',encoding='utf-8') ff = f.readline() #读取时一行一行的时候末尾会跟着\nprint(ff ...
- Invalid demension,shape[-1,40,40,1]
代码里定一个了没有用的placeholder, 或者说没有给这个placeholder 传值
- RockeMq源码之Client
Client中既有producer,也有consumer,先看前者 org.apache.rocketmq.client.producer.DefaultMQProducer.class 一般都是调用 ...
- python基础之centos6.5 升级 python2.7, 安装pip, MySQLdb
这个仅仅是为了运行脚本需求, 将centos6.5中的 python 2.6.6升级到了 2.7 并且安装和了 pip 和 MySQLdb 1.先装依赖 yum install zlib-devel ...
- 在Power BI报表和仪表板中显示刷新日期\时间
有人最近问我:“如何在报告和仪表板中显示最后刷新数据的日期和时间?”这里有两个简单的技巧在这分享下,也许可以帮助到你. 显示上次刷新日期\时间 要想显示刷新的日期和时间,我们需要在模型本身中存储时间刷 ...