一、启动test_network时报的错误
`
1. C:\Program Files\Docker\Docker\resources\bin\docker.exe: error during connect: Post http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.40/containers/create: open //./pipe/docker_engine: The system cannot find the file specified. In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running. 2. See 'C:\Program Files\Docker\Docker\resources\bin\docker.exe run --help'. 3. error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.40/containers/json?all=1: open //./pipe/docker_engine: The system cannot find the file specified. In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running.
`
需要先启动Hyper-V
再启动Docker Desktop,这在重启电脑后容易忘记的两个步骤
二、部署链码时遇到golang.org官网国内不能访问的问题
解决方法:https://zhuanlan.zhihu.com/p/31402004
文中第一个方法手工下载已经试过,还是会报以下错误
`
google.golang.org/grpc/credentials: google.golang.org/[email protected]: Get "https://proxy.golang.org/google.golang.org/grpc/@v/v1.23.0.zip": dial tcp 172.217.160.81:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
`
无奈只能试第三个方法,首先要安装glide,但由于glide 本身也有BUG,不适合国内的特殊情况,只能使用作者推荐的库:https://github.com/xkeyideal/glide,先下载
`
go get github.com/xkeyideal/glide
`
但使用这个库需要自行编译(make install),安装make install提示
`
bash: make: command not found
`
只能先安装GNU make:https://chocolatey.org/packages/make,但按说明直接安装的话还会choco不存在
choco : 无法将“choco”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正
确,然后再试一次。
所在位置 行:1 字符: 1
choco install make
CategoryInfo : ObjectNotFound: (choco:String) [], CommandNotFoundException
FullyQualifiedErrorId : CommandNotFoundException
一层套一层的,还是要先安装choco,以管理员身份打开PoserShell,执行以下命令
`
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::Sec
`
测试是否安装成功,输入 choco
接着在powershell里安装make并测试是否安装成功
choco install make
make --v
最后把git base关闭再重新启动,进入$GOPATH/src/github.com/xkeyideal/glide 目录,执行
`
make install
`
测试是否正常
`
glide list
`
不报错说明已经安装成功
接着回到开头说的第三种方法,直接执行还是报错误
$ glide mirror set https://golang.org/x/net/http2 https://github.com/golang/net --base golang.org/x/net --vcs git
[INFO] No mirrors.yaml file exists. Creating new one
[INFO] https://golang.org/x/net/http2 being set to https://github.com/golang/net
[ERROR] Error writing mirrors.yaml file: open C:\Users\Administrator.glide\mirrors.yaml: The system cannot find the path specified.
An Error has occurred
只能继续填坑,按报错信息在C:\Users\Administrator.glide目录下增加mirrors.yaml文件,内容为
注:.glide目录无法直接使用手工创建,只能先在cmd里使用 mkdir .glide 的命令来创建
repos:
original: https://golang.org/x/crypto
repo: https://github.com/golang/crypto
original: https://golang.org/x/crypto/acme/autocert
repo: https://github.com/golang/crypto
base: golang.org/x/crypto
original: https://golang.org/x/sys/unix
repo: https://github.com/golang/sys
base: golang.org/x/sys
然后再测试下:glide mirror list
[INFO] Mirrors...
[INFO] --> https://golang.org/x/crypto replaced by https://github.com/golang/crypto
[INFO] --> https://golang.org/x/crypto/acme/autocert replaced by https://github.com/golang/crypto, base: golang.org/x/crypto
[INFO] --> https://golang.org/x/sys/unix replaced by https://github.com/golang/sys, base: golang.org/x/sys
上面的信息说明配置成功
最后执行
glide mirror set https://golang.org/x/net/http2 https://github.com/golang/net --base golang.org/x/net --vcs git
成功后输出
[INFO] https://golang.org/x/net/http2 being set to https://github.com/golang/net
[INFO] mirrors.yaml written with changes
本文由小韦云原创,转载请注明出处:https://www.bctos.cn/doc/4/1803,否则追究其法律责任