Chaincode yog dab tsi?
Chaincode yog dab tsi?

Video: Chaincode yog dab tsi?

Video: Chaincode yog dab tsi?
Video: Franklin Uses Magical Painting To Make Ice God Vs Lava God In Gta V ! GTA 5 new 2024, Tej zaum
Anonim

Chaincode yog ib qho program, sau rau hauv Go, node. js, los yog Java uas siv lub interface tau teem tseg. Chaincode khiav hauv ib lub thawv Docker ruaj ntseg cais tawm los ntawm cov txheej txheem kev pom zoo ntawm cov phooj ywg. Chaincode pib thiab tswj cov ntaub ntawv hauv xeev los ntawm kev xa khoom xa los ntawm daim ntawv thov.

Hauv qhov no, Dab tsi yog Chaincode hauv Blockchain?

Lub hauv paus ntawm ib qho blockchain platform yog daim ntawv teev npe, sib koom, tamper-pov thawj keeb kwm ntawm lub ntiaj teb. Tshwj xeeb, nws yog cov ntaub ntawv ntawm txhua qhov kev hloov pauv hauv nws qhov peev txheej. Chaincode yog lub sij hawm rau cov kev pab cuam uas khiav saum lub blockchain los siv lub lag luam logic ntawm yuav ua li cas cov ntawv thov cuam tshuam nrog daim ntawv teev npe.

Ib yam li ntawd, lub luag haujlwm ntawm Chaincode yog dab tsi? Chaincode yog ib qhov kev pab cuam (smart contract) uas yog sau los nyeem thiab hloov kho cov ntaub ntawv hauv lub xeev. Cov neeg tsim khoom siv chaincode los tsim cov ntawv cog lus ua lag luam, kev txhais cov cuab yeej cuab tam, thiab sib sau ua ke-tswj cov ntawv thov kev ua haujlwm. Cov chaincode tswj lub xeev ledger los ntawm kev lag luam invoked los ntawm daim ntawv thov.

Cov lus nug tseem yog, Chaincode yog dab tsi hauv Hyperledger?

Chaincode yog ib daim code uas sau ua ib hom lus txhawb nqa xws li Go lossis Java. Nws yog ntsia thiab instantiated los ntawm ib tug SDK los yog CLI mus rau ib tug network ntawm Hyperledger Fabric peer nodes, ua kom muaj kev sib cuam tshuam nrog lub network cov ntaub ntawv sib koom.

Qhov twg Chaincode muaj nuj nqi hu ua thaum Chaincode yog thawj zaug xa tawm?

Init yog hu ua thaum chaincode yog xa mus rau cov ua ntej lub sij hawm, los yog upgraded rau ib tug tshiab version. Qhov no muaj nuj nqi tuaj yeem muaj cov logic uas koj xav siv, lossis nws tuaj yeem tso tseg. Piv txwv ntawm ib qho yooj yim init muaj nuj nqi yog cov hauv qab no: func (t *SmartContract) Init(stub shim. ChaincodeStubInterface) phooj ywg.

Pom zoo: