edg战队

Hyperledger Fabric1.4 安装

試著忘記壹切 提交于 2019-11-30 18:50:38
Hyperledger Fabric 依赖的软件版本查看官方 github 地址 https://github.com/hyperledger/fabric 目录下文件 /docs/source/prereqs.rst,具体版本根据安装的 Fabric 版本不同而不同。 1 安装依赖工具 为了下载方便,最好将 Ubuntu 的软件镜像源更换为国内,点击 “软件和更新” 将镜像源更换为国内,最好是华为或者阿里的源。更换之后,使用如下命令进行更新: $ sudo apt update 1.1 安装 git 安装 git 工具使用如下命令: $ sudo apt install git 1.2 安装 cURL 安装 cURL 使用如下命令: $ sudo apt install curl 1.3 安装 Docker 查看系统是否已经安装 Docker: $ docker --version 未安装,使用如下命令安装最新版本的 Docker: $ sudo apt install docker.io 安装完之后,查看版本,出现如下字样则安装成功: $ docker --version Docker version 18.09.7, build 2d0083d 设置成非 root 用户也能执行 docker,需要将普通用户加入 docker 组: $ sudo usermod -aG

Hyperledger Caliper Disable TLS

亡梦爱人 提交于 2019-11-30 14:06:45
更多精彩内容请访问我的新博客站点 前言 最近在使用 Hyperledger Caliper 时,想通过 wireshark 抓包来分析 fabric 运行流程中各阶段的数据信息,但是发现 fabric 节点间的通信使用了传输层安全(Transport Layer Security,TLS)协议,使得通信的报文的内容在抓包后无法分析。因此考虑在测试环境中暂时关闭 TLS,从而能够直接查看报文中承载的数据内容。 实现过程 1. 在 docker-compose 的配置文件中修改环境变量 本实验是在 Hyperledger Caliper 的测试环境中进行的,Caliper 测试工具在运行初始阶段会调用 docker-compose 启动 fabric 的网络,启动的 fabric 默认启用了 TLS,可以在其 docker-compose 的启动配置文件 docker-compose.yaml 中看到环境变量: FABRIC_CA_SERVER_TLS_ENABLED=true ORDERER_GENERAL_TLS_ENABLED=true CORE_PEER_TLS_ENABLED=true 以上三个环境变量都设置为 true。如果要 disable TLS,则需在配置文件 docker-compose.yaml 中将这三个环境变量都注释掉,或者将它们设置为 false。即:

Hyperledger caliper 运行环境搭建

只谈情不闲聊 提交于 2019-11-30 14:06:24
前言 Github里caliper的版本应该是最新的,但该版本与 caliper官网 所描述的运行方法 并不适配,simple文件夹下并没有config.json和 fabric.json文件: 因此,最终使用了旧版caliper才跑成功(没有找到正确方法,有人在新版上跑成功了)。 Pre-requisites 按照官网要求,需要安装的基础环境如下: make,g++ NodeJS 8.X node-gyp Docker Docker-compose 注意 :NodeJS版本必须是8.X,否则不会跑通。安装node-gyp的过程中可能会出现 SyntaxError: Block-scoped declarations (let, const, function, class) 这个错误,需要将node-js安装到最新版本。安装完成后再使用nvm把版本切换回来就可以: //切换到指定版本 $ nvm use 8.15 .0 //将该版本设为默认 $ nvm alias default 8.15 .0 //查看当前node版本 $ node - v 安装过程 1.安装 make,g++ 编译工具 sudo apt-get install make g++ 2.安装node.js 这里我使用的nvm安装node.js: //检查可用的node版本 $ nvm ls - remote /

Hyperledger caliper 安装记录

旧街凉风 提交于 2019-11-30 14:03:35
更多精彩内容请访问我的新博客站点 文章目录 Pre-requisites 1. 安装 make,g++ 编译工具 2. 安装node.js 3. 安装 node-gyp 4. 安装 Docker 5. 安装 Docker-compose Clone caliper repository Install fabric SDKs Run benchmark Bugs 运行测试遇到 `REQUEST_TIMEOUT` 的问题: Pre-requisites 需要安装的基础环境如下: make,g++ NodeJS 8.X node-gyp Docker Docker-compose 1. 安装 make,g++ 编译工具 sudo apt-get install make g++ 2. 安装node.js ubuntu 支持 nodesouce 的二进制安装脚本,命令如下: curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - sudo apt-get install -y nodejs 安装完成后查看 node 与 npm 的版本: $ node -v v8.12.0 $ npm -v 6.4.1 3. 安装 node-gyp npm 全局安装 node-gyp: sudo npm install -g node

【爬坑记录】hyperledger caliper 性能测试工具使用的一些问题记录

人盡茶涼 提交于 2019-11-30 14:03:18
安装方法详见: https://github.com/hyperledger/caliper hyperledger caliper 使用过程的一些坑以及解决办法 not ok 2 Failed to join peers, TypeError: Cannot read property ‘getConnectivityState’ of undefined at EventHub._checkConnection # create mychannel...... ok 1 created mychannel successfully # Sleep 5s...... # Join channel...... # join mychannel not ok 2 Failed to join peers, TypeError: Cannot read property 'getConnectivityState' of undefined at EventHub._checkConnection (/Users/rjj/go/src/github.com/hyperledger/caliper/node_modules/fabric-client/lib/EventHub.js:479:39) at EventHub.registerBlockEvent (/Users/rjj/go

Hyperledger fabric性能测试及分析

旧城冷巷雨未停 提交于 2019-11-30 14:03:05
1 Go语言性能测试 写性能测试在Go语言中是很便捷的,go自带的标准工具链就有完善的支持。 1.1 benchmark 写benchmark测试有如下约定: benchmark也是测试,因此也是以 _test.go 结尾的文件; 需要 import testing ; 测试方法以 Benchmark 开始,并且拥有一个 *testing.B 参数。 *testing.B 参数提供了大多数和 *testing.T 类似的方法,同时也额外增加了一些性能测试相关的方法。此外,还提供了一个整型成员 N ,用来指定被检测操作的执行次数。 举个例子,下边是一个连接字符串的操作: bench_test.go : package main import "testing" import "strings" func BenchmarkStringJoin1(b *testing.B) { input := [] string { "Hello" , "World" } for i := 0 ; i < b.N; i++ { result := strings.Join(input, " " ) if result != "Hello World" { b.Error( "Unexpected result: " + result) } } } 然后执行benchmark测试: $ go test

Winform中实现ZedGraph不显示y=0这条刻度线

久未见 提交于 2019-11-30 13:23:40
场景 Winforn中设置ZedGraph曲线图的属性、坐标轴属性、刻度属性: https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/100112573 Winform中实现ZedGraph的多条Y轴(附源码下载): https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/100132245 在上面实现显示多条自定义Y轴的效果上,发现每增加一条Y轴就会在曲线图上增加一条y=0的曲线图。 怎样在新增YAxis时不显示y=0这条曲线。 注: 博客主页: https://blog.csdn.net/badao_liumang_qizhi 关注公众号 霸道的程序猿 获取编程相关电子书、教程推送与免费下载。 实现 在生成YAxis以及Y2AXis时设置其IsZeroLine属性为false。 mypane.YAxis.MajorGrid.IsZeroLine = false; mypane.Y2Axis.MajorGrid.IsZeroLine = false; 如果说设置了之后不起作用,看一下有没有设置这条代码: myPane.YAxis.MajorGrid.IsVisible = false; 其默认值是true,将其删掉或者注释掉,否则不起作用。 效果 来源:

POJ-3237:Tree(树链剖分)

人走茶凉 提交于 2019-11-30 10:04:17
Tree Time Limit: 5000MS Memory Limit: 131072K Total Submissions: 10785 Accepted: 2800 Description You are given a tree with N nodes. The tree’s nodes are numbered 1 through N and its edges are numbered 1 through N − 1. Each edge is associated with a weight. Then you are to execute a series of instructions on the tree. The instructions can be one of the following forms: CHANGE i v Change the weight of the i th edge to v NEGATE a b Negate the weight of every edge on the path from a to b QUERY a b Find the maximum weight of edges on the path from a to b Input The input contains multiple test

cf 1217D Coloring Edges

不打扰是莪最后的温柔 提交于 2019-11-30 04:40:01
http://codeforces.com/problemset/problem/1217/D 这题的思路是构造,我们可以知道颜色最多只需要两种,然后按照dfs的顺序。 1 #include<bits/stdc++.h> 2 using namespace std; 3 int const N=5000+10; 4 struct edge{ 5 int to,nt,id; 6 }e[N]; 7 int cnt,h[N],c[N],check,n,m,ans[N]; 8 void add(int a,int b,int c){ 9 e[++cnt].to=b; e[cnt].id=c; e[cnt].nt=h[a]; h[a]=cnt; 10 } 11 void dfs(int x){ 12 c[x]=1; 13 for(int i=h[x];i;i=e[i].nt){ 14 int v=e[i].to; 15 if(!c[v]){ 16 dfs(v); 17 ans[e[i].id]=1; 18 }else if(c[v]==2){ 19 ans[e[i].id]=1; 20 }else { 21 ans[e[i].id]=2; 22 check=1; 23 } 24 } 25 c[x]=2; 26 } 27 int main(){ 28 scanf("%d%d",&n,&m);

Javascript interview knowledge pints

十年热恋 提交于 2019-11-30 04:20:46
1、variable hoist Q:What's the output? function sayHi() { console.log(name); console.log(age); var name = "Lydia"; let age = 21; } sayHi(); A: Lydia and undefined B: Lydia and ReferenceError C: ReferenceError and 21 D: undefined and ReferenceError Answer: find yourself Within the function, we first declare the name variable with the var keyword. This means that the variable gets hoisted (memory space is set up during the creation phase) with the default value of undefined , until we actually get to the line where we define the variable. We haven't defined the variable yet on the line where we