Hyperledger fabric 应用程序-javascript 在 app.js 中使用客户端服务器模型时出错

Hyperledger fabric application-javascript error using client server model in app.js

https://github.com/hyperledger/fabric-samples 在目录 asset-transfer-basic->application-javascript 的文件 app.js 中,当我插入服务器代码以侦听端口并尝试调用合约时,它会给出如下错误。 enter image description here

                connection.write(data.toString());
                console.log('Sent response to client');
                connection.end();
                console.log('Disconnected the client.');
           });
        
        });
        
        
        server.listen(port, function () {
            console.log('server is listening');
        }); 
        console.log('\n--> Evaluate Transaction: GetSignedRank, function returns signed rank');
        var result = await contract.evaluateTransaction('GetSignedRank', '123');
        console.log(result.toString());
        //console.log(`*** Result: ${prettyJSONString(result.toString())}`);
    } finally {
        // Disconnect from the gateway when the application is closing
        // This will close all connections to the network
        gateway.disconnect();
    }
} catch (error) {
    console.error(`******** FAILED to run the application: ${error}`);
}

}

问题出在这一行 var result = await contract.evaluateTransaction('GetSignedRank', '123');

我通过制作一个单独的 nodejs 文件并调用文件的副本 app.js 来解决它,它允许调用 evaluateTransaction method.I 认为错误是连接在我之前在服务器代码中结束称为 evaluateTransaction