Composer Business Network Connection无法使用NodeJS App

时间:2017-10-29 06:16:39

标签: ibm-cloud hyperledger hyperledger-composer

我正在尝试将我的IBM Bluemix NodeJS App与composer-client@0.13.2连接到正在运行的Composer业务网络,运行时间为runtime@0.13.2。但是,我收到以下错误:

expr = [col(c).cast("Double").alias(c) for c in feat_cols]
df2 = asset_info_df1.select(*expr)`

#Create 'features' vector
from pyspark.ml.feature import VectorAssembler
assembler = VectorAssembler(inputCols=feat_cols, outputCol="features")
df3 = assembler.transform(df2).select('features')


#Scale 'feature' so mean ~ 0 and stdev ~ 1
from pyspark.ml.feature import StandardScaler
scaler = StandardScaler(inputCol="features", outputCol="scaledFeatures",
            withStd=True, withMean=False)
scalerModel = scaler.fit(df3)
df4 = scalerModel.transform(df3).drop('features')\
             .withColumnRenamed('scaledFeatures', 'features')

#This is the data transformation key to Kmeans
from pyspark.mllib.linalg import Vectors
data5 = df4.rdd.map(lambda row: Vectors.dense([x for x in row['features']]))

clusters = KMeans.train(data5, k=3, maxIterations=10)

我在项目目录下手动创建了2017-10-29T01:55:26.36-0400 [APP/PROC/WEB/0] ERR (node:60) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Failed to load connector module "composer-connector-hlfv1" for connection profile "ibm-bc-org1". /home/vcap/app/node_modules/fabric- client/node_modules/grpc/src/node/extension_binary/grpc_node.node: invalid ELF header-/home/vcap/app/node_modules/fabric- client/node_modules/grpc/src/node/extension_binary/grpc_node.node: invalid ELF header-/home/vcap/app/node_modules/fabric- client/node_modules/grpc/src/node/extension_binary/grpc_node.node: invalid ELF header-/home/vcap/app/node_modules/fabric- client/node_modules/grpc/src/node/extension_binary/grpc_node.node: invalid ELF header-/home/vcap/app/node_modules/fabric- client/node_modules/grpc/src/node/extension_binary/grpc_node.node: invalid ELF header-/home/vcap/app/node_modules/fabric- client/node_modules/grpc/src/node/extension_binary/grpc_node.node: invalid ELF header-/home/vcap/app/node_modules/fabric- client/node_modules/grpc/src/node/extension_binary/grpc_node.node: invalid ELF header-/home/vcap/app/node_modules/fabric- client/node_modules/grpc/src/node/extension_binary/grpc_node.node: invalid ELF header-/home/vcap/app/node_modules/fabric- client/node_modules/grpc/src/node/extension_binary/grpc_node.node: invalid ELF header 文件和.composer-credentials/ibm-bc-org1/connection.json目录,用于密钥存储。这个设置在本地工作,我可以看到我的连接的结果,我可以在我的本地机器上获取事件等。有谁知道这种事情的程序是什么?

1 个答案:

答案 0 :(得分:1)

该错误意味着您以某种方式将grpc二进制文件(这是作曲家的依赖关系)从您的计算机放到bluemix上,并且该二进制文件与它尝试运行的位置不兼容。 您需要确保只将应用程序推送到bluemix(不要推送node_modules目录)并让它执行npm安装以下载正在运行的特定平台的正确依赖项和二进制文件(或编译二进制文件)