什么是hyperledger-fabric chainfile?我在哪里可以得到它?

时间:2018-05-21 09:23:53

标签: hyperledger-fabric blockchain hyperledger

通过执行./byfn.sh -m up,我通过其官方文档提出了hyperledger-fabric网络。

官方文件网站:http://hyperledger-fabric.readthedocs.io/en/release-1.1/build_network.html

该脚本自动与a和b进行了交易。

具体命令为peer chaincode invoke -o orderer.example.com:7050 --tls true --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C mychannel -n mycc -c '{"Args":["invoke","a","b","10"]}'

现在,我想获取包含事务记录的chainfile。但我不知道它在哪里。

操作系统:Ubuntu 16.04 LTS

fabric版本:release-1.1

1 个答案:

答案 0 :(得分:0)

对等体上安装的public function getData(array $query=null){ $findquery=$this->find('all',$query); return $findquery; } public function gettotal() { $this->layout = 'ajax'; $pcbx = $_POST['pcbx']; $pcby = $_POST['pcby']; $pcb_qty = $_POST['pcb_qty']; $smt_pads = $_POST['smt_pads']; $hole_pads = $_POST['hole_pads']; $fine_pitch = $_POST['fine_pitch']; $layers = $_POST['layers']; $pcbper = $_POST['pcbper']; if (!($pcbx > 350) && !($pcbx < 50) && !($pcby > 350) && !($pcby < 50) && !($pcb_qty < 1)) { $sum = ($pcb_qty * $pcby * $pcbx) / 1000000; if (!$layers == '0') { $query = array( 'conditions' => array('layer' => $layers), 'fields' => array('layer_value') ); $check = $this->Layer_setup_pricemaster->getData($query); $layer_price = $check[0]['Layer_setup_pricemaster']['layer_value']; } /* get SMT Pads Point price based on condition the sum of pcbx, pcby and pcb Quantity is greater than or equal to min price and less than or equal to max_price from Per_point_pricemaster table*/ $check101 = $this->Per_point_pricemaster->getData(array('condition' => array('id' => 22))); $end_price = $check101[21]['Per_point_pricemaster']['min_price']; if($smt_pads != 0 && $smt_pads != ''){ if($sum >= $end_price){ $query2 = array( 'conditions' => array('min_price ' => $end_price), 'limit' => 1, 'fields' => array('price') ); }else{ $query2 = array( 'conditions' => array('min_price <=' => $sum, 'max_price >=' => $sum), 'limit' => 1, 'fields' => array('price') ); } $check2 = $this->Per_point_pricemaster->getData($query2); $point_price = $check2[0]['Per_point_pricemaster']['price']; }else { $point_price = 0; } /* get Through Hole Pads Point price based on condition the sum of pcbx, pcby and pcb Quantity is greater than or equal to min price and less than or equal to max_price from through_hole_padsmaster table*/ $check102 = $this->Through_hole_padsmaster->getData(array('condition' => array('id' => 22))); $end_price2 = $check102[21]['Through_hole_padsmaster']['min_price']; if($hole_pads != 0 && $hole_pads != ''){ if ($sum >= $end_price2) { $query3 = array( 'conditions' => array('min_price ' => $end_price2), 'limit' => 1, 'fields' => array('price') ); }else { $query3 = array( 'conditions' => array('min_price <=' => $sum, 'max_price >=' => $sum), 'limit' => 1, 'fields' => array('price') ); } $check3 = $this->Through_hole_padsmaster->getData($query3); $hole_pads_price = $check3[0]['Through_hole_padsmaster']['price']; }else { $hole_pads_price = 0; } /* Get the Stencil Price from stencil_pricemaster table which is by default id=5 */ $query4 = array( 'conditions' => array('id' => 5), 'fields' => array('including_tax') ); $check4 = $this->Stencil_pricemaster->getData($query4); $stencil_price = $check4[0]['Stencil_pricemaster']['including_tax']; if($fine_pitch != 0 && $fine_pitch != ''){ /* Get BGA/QFN/Fine Pitch Point Price from bga_qfnmaster table wich is by default id=1 */ $query5 = array( 'conditions' => array('id' => 1), 'fields' => array('price') ); $check5 = $this->Bga_qfnmaster->getData($query5); $bga_qfn_price = $check5[0]['Bga_qfnmaster']['price']; }else { $bga_qfn_price = 0; } if(!empty($pcbper) && $pcbper != '0'){ $pointsum1 = $smt_pads * $point_price * $pcb_qty * $pcbper; $pointsum2 = $hole_pads * $hole_pads_price * $pcb_qty * $pcbper; $pointsum3 = $fine_pitch * $bga_qfn_price * $pcb_qty * $pcbper; if (!$layers == '0') { $total = $pointsum1+ $pointsum2 + $pointsum3 + $layer_price + $stencil_price; } else { $total = $pointsum1 + $pointsum2 + $pointsum3; } } else{ $pointsum1 = $smt_pads * $point_price * $pcb_qty; $pointsum2 = $hole_pads * $hole_pads_price * $pcb_qty; $pointsum3 = $fine_pitch * $bga_qfn_price * $pcb_qty; if (!$layers == '0') { $total = $pointsum1 + $pointsum2 + $pointsum3 + $layer_price + $stencil_price; } else { $total = $pointsum1 + $pointsum2 + $pointsum3; } } echo $total = number_format($total); } else { echo "Calculating..."; } exit; } 包是protobuf消息的序列化字节。 chaincode消息中的protobuf,在原型文件“https://github.com/hyperledger/fabric/blob/release-1.1/protos/peer/chaincode.proto”中定义

ChainDeploymentSpec源文件存储在chaincode的{​​{1}}字段中存储的序列化存档文件中。