Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

编译后执行example/main.go中testTransfer报错 #19

Open
Ailab666666 opened this issue Aug 5, 2020 · 3 comments
Open

编译后执行example/main.go中testTransfer报错 #19

Ailab666666 opened this issue Aug 5, 2020 · 3 comments

Comments

@Ailab666666
Copy link

账户余额查询正确,执行transfer报错,错误信息如下:

2020/08/05 15:58:44 PreExecWithSelecUTXO EndorserCall failed, err: rpc error: code = DeadlineExceeded desc = context deadline exceeded
2020/08/05 15:58:44 Transfer PreExecWithSelecUTXO failed, err: EndorserCall error! Response is: rpc error: code = DeadlineExceeded desc = context deadline exceeded
Transfer err: EndorserCall error! Response is: rpc error: code = DeadlineExceeded desc = context deadline exceeded
transfer tx:

@qizheng09
Copy link
Contributor

Now TestTransfer can not be used in TestNet and Open NetWork. You can use this function in your own chain.

@Ailab666666
Copy link
Author

@qizheng09 您好,使用BAAS尝试了建立自己网络,建立普通节点后, 使用sdk链接节点列表中显示的IP报错连接超时

@YangEfei
Copy link

在发送交易时会读取 config 文件

xuper-sdk-go/transfer/transfer.go

// InitTrans init a client to transfer
func InitTrans(account *account.Account, node, bcname string) *Trans {
	commConfig := config.GetInstance()

	return &Trans{
		Xchain: xchain.Xchain{
			Cfg:       commConfig,
			Account:   account,
			XchainSer: node,
			ChainName: bcname,
		},
	}
}

在 config 模块中含有 config 文件路径,可按需修改为自己的 config 文件路径

xuper-sdk-go/config/config.go

const confPath = "./conf"
const confName = "sdk.yaml"

const CRYPTO_XCHAIN = "xchain"
const CRYPTO_GM = "gm"

var config *CommConfig

func GetInstance() *CommConfig {
	if config == nil {
		config = GetConfig(confPath, confName)
	}
	return config
}

在 config 文件中需指明背书服务器的地址,如默认本地环境可更换为 127.0.0.1:37101

xuper-sdk-go/conf/sdk.yaml

# endorseService Info
# testNet addrs
endorseServiceHost: "39.156.69.83:37100"  # 默认本地环境 127.0.0.1:37101
complianceCheck:
  # 是否需要进行合规性背书
  isNeedComplianceCheck: true
  # 是否需要支付合规性背书费用
  isNeedComplianceCheckFee: true
  # 合规性背书费用
  complianceCheckEndorseServiceFee: 400
  # 支付合规性背书费用的收款地址
  complianceCheckEndorseServiceFeeAddr: aB2hpHnTBDxko3UoP2BpBZRujwhdcAFoT
  # 如果通过合规性检查,签发认证签名的地址
  complianceCheckEndorseServiceAddr: jknGxa6eyum1JrATWvSJKW3thJ9GKHA9n
#创建平行链所需要的最低费用
minNewChainAmount: "100"
crypto: "xchain"

此外该背书服务器在启动链时需开启背书服务,该服务可通过区块链的配置文件进行修改(编译后在 output/conf/xchain.yaml 下进行修改)

xuperchain/conf/xchain.yaml

# 背书服务相关配置
xendorser:
  # 是否开启默认的XEndorser背书服务
  enable: false  # 交易指向的背书服务器需置为 true
  module: "default"
  #confPath: "./conf/xendorser.yaml"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants