我的结构版本是1.1.0预览版,同伴,订购者,configtxgen是新生成的.
当我执行configtxgen工具时:
configtxgen -profile SoloOrdererGenesis -outputBlock genesis.block
configtxgen -profile mych -outputCreateChannelTx channel-artifacts/mych.tx -channelID mych
Run Code Online (Sandbox Code Playgroud)
它生成genesis.block和mych.tx,channelName是mych.
然后orderer以genesis.block开头,执行以下命令:
peer channel create -f mych.tx -o orderer.example.com:7050 -c mych
Run Code Online (Sandbox Code Playgroud)
它抛出错误,
错误:出现意外状态:FORBIDDEN - 无法达到1个子策略的隐含阈值,需要1个剩余:权限被拒绝
哪一步错了?
我的configtx.yaml文件是:
---
Profiles:
SoloOrdererGenesis:
Orderer:
<<: *OrdererDefaults
Organizations:
- *OrdererOrg
Consortiums:
SampleConsortium4:
Organizations:
- *Org1
- *Org2
- *Org3
- *Org4
SampleConsortium3:
Organizations:
- *Org1
- *Org2
- *Org3
SampleConsortium2:
Organizations:
- *Org1
- *Org2
SampleConsortium1:
Organizations:
- *Org1
mych4:
Consortium: SampleConsortium4
Application:
<<: *ApplicationDefaults
Organizations:
- *Org1
- *Org2 …Run Code Online (Sandbox Code Playgroud) 从Fabric文档create-join-channel,当我执行命令时
peer channel create -o orderer.example.com:7050 -c $CHANNEL_NAME -f ./channel-artifacts/channel.tx --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem
Run Code Online (Sandbox Code Playgroud)
它会返回以下消息的错误代码段:
2017-08-16 01:34:13.902 UTC [msp] GetLocalMSP - > DEBU 00c返回现有的本地MSP 2017-08-16 01:34:13.902 UTC [msp] GetDefaultSigningIdentity - > DEBU 00d获取默认签名身份2017-08- 16 01:34:13.902 UTC [msp/identity]签名 - > DEBU 00e标志:明文:0AC3060A1508021A060895C2CECC0522 ... 7E2E59E3CFD14AC765C92FBF36614E79 2017-08-16 01:34:13.902 UTC [msp/identity]签名 - > DEBU 00f签名:摘要:FA75790826EF23E1A7C46AD3B9AE0DB7321DC271B8BE93A29BAC2F6EEACBB8B0错误:出现意外状态:BAD_REQUEST用法:对等通道创建[标志]
标志:
comamands如下:
cryptogen生成--config =./ crypto-config.yaml
export FABRIC_CFG_PATH = $ PWD
configtxgen -profile TwoOrgsOrdererGenesis -outputBlock ./channel-artifacts/genesis.block
导出CHANNEL_NAME = mychannel
configtxgen -profile TwoOrgsChannel -outputCreateChannelTx ./channel-artifacts/channel.tx -channelID $ CHANNEL_NAME
configtxgen …
在kotlin源代码中,我无法理解如何实现String.kt的长度,如下:
package kotlin
public class String : Comparable<String>, CharSequence {
companion object {}
/**
* Returns a string obtained by concatenating this string with the string representation of the given [other] object.
*/
public operator fun plus(other: Any?): String
public override val length: Int
public override fun get(index: Int): Char
public override fun subSequence(startIndex: Int, endIndex: Int): CharSequence
public override fun compareTo(other: String): Int}
Run Code Online (Sandbox Code Playgroud)
var len:Int = "abc".length; // len = 3 where to run the length??
在哪里实现长度函数?
java open-source source-code-protection kotlin kotlin-android-extensions
当我启动orderer,peer node,然后我启动example01.go来实例化链代码,并指定:
peer.address 192.168.120.189:7051
chaincode.id.name simple-token:1.0.0
Run Code Online (Sandbox Code Playgroud)
example01.go的主要代码是:
func main() {
viper.Set("chaincode.id.name","simple-token:1.0.0")
err := shim.Start(new(SimpleChaincode))
if err != nil {
fmt.Printf("Error starting Simple chaincode: %s", err)
}
}
Run Code Online (Sandbox Code Playgroud)
在方法shim.Start()中,错误发生在下面的句子中:
err = chatWithPeer(chaincodename, stream, cc)//causes the error
Run Code Online (Sandbox Code Playgroud)
但它显示错误: 未实现的desc =未知服务protos.ChaincodeSupport进程完成退出代码0
GOROOT=/usr/local/Cellar/go/1.9/libexec #gosetup
GOPATH=/Users/friends/Documents/VirtualMachine/share/gopath #gosetup
/usr/local/Cellar/go/1.9/libexec/bin/go build -i "-ldflags=-linkmode internal" -o /private/var/folders/cg/mwzlhrjs5y55ny553g6xz9tr0000gn/T/___chaincode_example01_cc /Users/friends/Documents/VirtualMachine/share/gopath/src/github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example01/chaincode_example01.go #gosetup
/private/var/folders/cg/mwzlhrjs5y55ny553g6xz9tr0000gn/T/___chaincode_example01_cc -peer.address 192.168.120.189:7051 #gosetup
2017-12-28 20:14:30.124 CST [shim] SetupChaincodeLogging -> INFO 001 Chaincode log level not provided; defaulting to: INFO
2017-12-28 20:14:30.124 CST [shim] SetupChaincodeLogging -> INFO 002 Chaincode …Run Code Online (Sandbox Code Playgroud) 当我使用 Goland 1.0 EAP IDE 调试 Fabric 源代码 orderer 模块时,它可以调试并提示:
GOROOT=/usr/local/Cellar/go/1.8.3/libexec #gosetup
GOPATH=/Users/friends/Documents/VirtualMachine/share/gopath #gosetup
/usr/local/Cellar/go/1.8.3/libexec/bin/go build -i -o /private/var/folders/cg/mwzlhrjs5y55ny553g6xz9tr0000gn/T/___orderer_start -gcflags "-N -l" /Users/friends/Documents/VirtualMachine/share/gopath/src/github.com/hyperledger/fabric/orderer/main.go #gosetup
# command-line-arguments
orderer/main.go:76: undefined: NewServer
orderer/main.go:207: undefined: createLedgerFactory
Run Code Online (Sandbox Code Playgroud)
当我删除 server.go 和 util.go,并将代码移动到 main.go.It 工作。我认为可能是 GoLand 1.0 EAP BUG。
我对goroutine,用户线程和内核线程概念感到困惑
从有效的介绍goroutine,那么os threads本文提到的是什么意思?是用户线程还是内核线程?
我从go-scheduler论文中了解到M G P,为什么的数量P等于CPU的数量?如果所有的cpus用于go程序,但是os系统中的其他程序没有cpu线程要执行?
os系统生成了多少个内核线程?
docker run -v /Users/xx/var/temp:/ -it alpine bash
Run Code Online (Sandbox Code Playgroud)
但它提示:
invalid mount config for type bind: invalid specification: destination can't be /
Run Code Online (Sandbox Code Playgroud)
为什么 alpine 主机目录无法挂载?
从Fabric MSP,admincert:
1.a folder admincerts to include PEM files each corresponding to an administrator certificate
Run Code Online (Sandbox Code Playgroud)
signcerts:
a folder signcerts to include a PEM file with the node’s X.509 certificate
Run Code Online (Sandbox Code Playgroud) 我的shell脚本如下:
#!/bin/bash
account0=0xf2de2e86b9b634f655e441a4e8353c9bf59352d7
passwd=123456
data={"jsonrpc":"2.0","method":"personal_unlockAccount","id":1,"params":[$account0,$passwd]}
echo $data
Run Code Online (Sandbox Code Playgroud)
我的期望是(通知"):
{"jsonrpc":"2.0","method":"personal_unlockAccount","id":1,"params":[0xf2de2e86b9b634f655e441a4e8353c9bf59352d7,123456]}
Run Code Online (Sandbox Code Playgroud)
不
{jsonrpc:2.0,method:personal_unlockAccount,id:1,params:[0xf2de2e86b9b634f655e441a4e8353c9bf59352d7,123456]}
Run Code Online (Sandbox Code Playgroud)
:我不希望使用转义字符,怎么样?像内容插入到xml标签" <![CDATA[..."..]]>"
go ×3
bash ×1
delve ×1
docker ×1
dockerfile ×1
goland ×1
grpc ×1
hyperledger ×1
java ×1
kotlin ×1
linux ×1
open-source ×1
shell ×1