Transcript
Page 1: Quorum Consortium Network in Azure Marketplace...0-15 0 Number of block makers Quantity of block maker nodes which will create and propose blocks to the network. (Currently limited

Quorum Consortium Network in Azure Marketplace CaleTeeter|SeniorSDEDX/TED

Overview ThenextphaseofsupportandintegrationoftheQuorumblockchainsolutioninMicrosoftAzureisthereleaseoftheQuorumConsortiumNetworkintheAzureMarketplace.ThegoalofthisofferingismakeiteasyforusertocreatetheinfrastructureandconfigurationinordertorunQuorumbysupplyingafewparametersandsingleclientfordeployment.WhiletheinitialQuorumdemoofferingwasagoodwaytoshowcasethefundamentalsofhowQuorumfunctionsandisdifferentfromothersinthemarket,thisnewofferingallowsuserstobuildanddeployafullnetworkwithmultipleunderlyingvirtualmachines,virtualnetwork,loadbalancing,andnetworksecurity,andsimplemanagementviathenativeCakeshoptooling.

Afterreadingthisarticle,youwill

• UnderstandwhatthenewofferingofQuorumConsortiumNetworkarchitectureiscomprisedofandhowitcanbedeployedbysimplyprovidingafewparameters.

• LearnhowtodeploytheQuorumConsortiumNetworkandactivitiestodopostdeploymenttogetstartedwithusingthisoffering.

About Quorum blockchain Whiletherearevarioustypesofblockchainsonthemarkettoday,andmorebeingcreatedeveryday,Quorumisuniqueinafewdifferentways.Tostartfromthecore,Quorumisfundamentally,aforkofthegoEthereumclient.ThismeansthatitisinfactavariantoftheEthereumprotocol.ThiswascreatedbyateamatJPMorganChase,withtheintentionofprovidingablockchainthatcanbeusedbyenterprise,addressingsomethefeaturesthatwereneededbeyondwhatEthereumbaseprotocolcouldprovide.Specifically,themodificationsweretoaddressthefollowing:

• Needforadifferentconsensusalgorithmandmodeltoavoidthechallengesthatminingpresentsinasemi-trustedprivateEthereumnetwork.

• Needforselectiveprivacyoftransactionstoallowmultiplepartiestouseasingleblockchain,butdiscloseonlytransactionsdetailstospecificparticipants.

BasedonfeedbackfromenterprisesandinfactrequirementsthatJPMorganChasewasaddressingfortheirownuse,thesenewfeatureswereaddedviaamodifiedgo-ethereumclientandtheuseofconstellation,orprivatetransactionmanagers.Theseadditionsarebuilttobetheleastintrusiveapproachtoimplement,meaningtheteamdidsetouttoreinventanewblockchain,andinsteadmodifiedtheexistingtechnologies.Thespecificimplementationisthefollowing:

• QuorumChain–anewconsensusmodelbasedonmajorityvoting,thisisalsoraft-basedtoensurefasterblocktimes,transactionfinality,andon-demandblockcreation

• Constellation–apeertopeerencryptedmessagedexchange• PeerSecurity–node/peerpermissioningusingsmartcontracts

Page 2: Quorum Consortium Network in Azure Marketplace...0-15 0 Number of block makers Quantity of block maker nodes which will create and propose blocks to the network. (Currently limited

Architecture TogetabitdeeperintothearchitectureofhowQuorumfunctionsaswellashowthisdeployedinanoptimalwaytoAzure.AsmentionedaboveQuorumisanEthereumbasedblockchainwithsomespecificnewfeatures.

Consensus

Whiletheultimategoalispluggableconsensusmodels,thecurrentimplementationisamodelnamedQuorumChain,whichisatime-based,majorityvotingalgorithm.Thisiscomprisedofafewdifferentpieces.

• Smartcontractbasedmodeltogovernconsensusandmanagethenodesthatcanparticipateasvoters.

• Ethereumtransactionstopropagatevotesthroughthenetwork.• EthereumsignaturevalidationtovalidatesignaturesreceivedfromMakerandVoternodes

ThenodesintheQuorumnetwork,canbedesignatedasaVoterrole,whichallowsthemtovoteonwhichblockshouldbethecanonicalheadataparticularheight.Themostrecentblockwiththemostvotesisconsideredthecanonicalheadoftheblockchain.Ablockisconsideredvalidonceishasenoughvotestoovercomethethresholddefinedforvotes.

BlocksarecreatedonlybynodeswiththeroleofMakerrole.NodesthatholdthisrolecancreateblocksandsignthembysettingtheirsignatureintheExtraDatafieldontheblock.Whentheblockinimportedtothenetwork/chain,theysignatureisvalidatedbyothernodestoensurethesigner’saddressinpresentintheMarkerlist(whitelist)inthevotingcontract.

TodelveabitdeeperthesmartcontracttogoverntheVotersandMakersisnamedBlockVotingandisdeployedtoaddress0x0000000000000000000000000000000000000020withinthegenesisblock.ThecontractishardcodedintotheQuorumclientviatheaddressandtheABIforthecontract.Thismeansiftheconsensusrulesforvotingneedstochange,thisQuorumclientwillneedtobeupdatedinconcertwiththesmartcontractthatdrivesthis.

Thereexistfunctionsinthisvotingcontracttoadd/removeVoterandMakernodesaswellasthethresholdforhowmanyvotesareneededtoconfirmablock.Italsovalidatesthatvotesfromvotersarefromvalidvotersinthesamewayasvalidationofmakersisvalidated.

MakernodesareresponsibleformintingnewblocksandtheiraddressesontheEthereumnetworkarewhitelistedinthissmartcontract.Theremustbeataminimum1Makerdefinedforthesystemtowork.TheinitialMakernodesarecreated/definedinthegenesisblock,buttheadditionandremovalcanbedonepostblockchaincreation.

Thereisathirdnodetype/roleinthenetwork,whichistheObserverrole.ThesearesimplynodesthatarenotofroleVoterorMaker,andwillnotmintblocksorvote,butsimplyreceiveandvalidateblocks.

Blocksaremadebymakers,andtoavoidmultipleMakerscreatingablockatthesametime,eachmakerwillusearandomvalueinsideathresholddefineforthemakerof(min/max)timetocreateablock.Thisrandomizationwilleventuallymeanamakerwillrecognizeitistimeforthemtocreateanewblock.WhenaMakermakesablock,otherMakerswillbenotifiedandresettheirtimersforwhentheywill

Page 3: Quorum Consortium Network in Azure Marketplace...0-15 0 Number of block makers Quantity of block maker nodes which will create and propose blocks to the network. (Currently limited

createablock.ThisisdefinedintheVotingsmartcontractdefinedaboveandcanbesetatgethstartupviacommandlineparameters,minblocktimeandmaxblocktimetimeinseconds.

NOTE:Inthecurrentimplementation,theMakerisalsoaVotertoavoidasituationwherelimitedonlineVoters,couldcausechain-halting.

Transaction Processing AnotherkeydifferentiatorwithQuorumisthefactthatthechaincanincludetransactionprivacyrules.Toexplainthisfurther,transactionscanbethoughtofaspublicorprivate.ItsimportanttounderstandthatQuoruminnotintroductionanewtransactiontypetoEthereumbutusingtheexistingtransactionmodelforpublictransactions,andextendingEthereumtosupportanew(optional)parameternamedprivateFor,whichwillbeusedtodesignatewhomshouldbeabletoviewthistransaction.

FirstpublictransactionsaretransactionsinwhichthepayloadisvisibletoallparticipantsoftheblockchainorQuorumnetwork.TheseareexactlythesameastransactionsusedinEthereumonothernetworks,nochanges.

NOTE:Thecontexthereandname“public”transactionsdoesnotimplythatthesetransactionsareonthepublicEthereumnetwork(network1).ThesetransactionsareonlyontheprivateQuorumnetwork,thenameisusedsimplytomeanthatthepayloadsofthesetransactionsarenotprivateandcanbeviewedbyallparticipants.

Theothertypeoftransactionisprivatetransactions,andtheseexposetheirpayloadsonlytotheparticipantsonthenetworkwhosepublickeysarespecifiedintheprivateForparameterofthetransaction.

Page 4: Quorum Consortium Network in Azure Marketplace...0-15 0 Number of block makers Quantity of block maker nodes which will create and propose blocks to the network. (Currently limited

NOTE:TheprivateForparameterisanarrayandcancontainalistofcommaseparatedkeysthatshouldbeabletoviewthetransaction.

Executionofthesetypesoftransactionsaredifferentaswell.PublictransactionsareexecutedinthesamewaystandardEthereumtransactions,eachnodewillexecutethecontractcodeandupdatethestateofthecontract.Forprivatetransactions,thingsarehandledabitdifferently.PriortotheQuorumnodepropagatingthetransactiontotherestofthenetwork,itreplacesthepayloadwithahashoftheencryptedpayloadthatisreceivesfromconstellation.Participantsonthenetworkthathavetheirpublickeyincludedinthetransaction,willbeabletoreplacethehashwiththeactualpayload(unencrypted)viatheirinstanceofconstellation,whileparticipantswhomarenotincludedinthetransaction,willonlyseethehash.Thisresultsinparticipantswhoarenotpartytoseethetransactiontojustskipit,andnotperformanoperation,thosewhomareinvolvedwillreplacethehashwiththeoriginalpayloadandhavetheEVMexecuteit,andupdatetheirstate.

Thiscouldresultintwodifferentstatesbasedonwhethertheparticipantispartytothetransactionornot,andtoaddressthisQuorummaintainsyncfromthepublic“trie”ofstatetotheprivate“trie”.Thepublictrieisgloballysynced,butprivatetrieisnot.

Page 5: Quorum Consortium Network in Azure Marketplace...0-15 0 Number of block makers Quantity of block maker nodes which will create and propose blocks to the network. (Currently limited

Getting Started Tobegin,youwillneedanAzuresubscriptionthatwillbeusedtodeploythevirtualmachine.IfyoudonothaveanAzuresubscription,youcancreateafreeAzureaccounttobegin.Becausethisdeploymentwillonlyrequireasinglevirtualmachine,thereisnoneedtoincreasequotasforyoursubscription.

Onceyouhaveasubscription,gototheAzureportal.Selectthe‘+’symbolinthetopleftoftheportal,andinthepanethatappears,inthesearchbox,enter‘QuorumConsortiumNetwork’.

SelectthetemplatethatisreturnedinthesearchresultstotakeyoutotheQuorumConsortiumNetworkdeploymentwizardandthenclick‘Create’.Thiswillopenthe‘Basics’bladeinthewizard.

Page 6: Quorum Consortium Network in Azure Marketplace...0-15 0 Number of block makers Quantity of block maker nodes which will create and propose blocks to the network. (Currently limited

Thetemplatedeploymentwillpromptyouforasetofsimpleinputstoconfigurethedeploymentproperly.Onthefirststep,the‘Basics’blade,specifythevaluesforstandardparameterssuchassubscription,resourcegroup,andbasicvirtualmachineproperties.

Adetaileddescriptionofeachparameterfollows:

Basics ParameterName Description AllowedValues DefaultValueResourcePrefix Aprefixvaluethat

prependedtoresourcenamestoensureuniqueness.

Thevalueis6orlessalphanumericcharacters

NA

VMusername Theusernameoftheadministratorforthedeployedvirtualmachine.

Thevaluemustbebetween1and64charactersinlength.

NA

AuthenticationType Themethodusedtoauthenticatetothevirtualmachine.Usernameandpasswordorusername/sshkey.

PasswordorSSHpublickey SSHpublickey

RestrictaccessbyIPaddress

UsedtorestrictaccesstoallendpointsfromaspecificIPaddressorsubnet

YesorNo No

Subscription Thesubscriptioninwhichtodeploy.

Validsubscription Currentsubscription

ResourceGroup Theresourcegroupinwhichtodeploy.

Createneworuseexisting.Fornew,thevaluemustbe1and90charactersinlength.

NA

Page 7: Quorum Consortium Network in Azure Marketplace...0-15 0 Number of block makers Quantity of block maker nodes which will create and propose blocks to the network. (Currently limited

Location TheAzureregioninwhichtodeploy.

ListofvalidAzureregions. Currentregion.

Asampledeploymentisshownbelow:

Network Size and Performance ParameterName Description AllowedValues DefaultValueConsortiumMemberId

Setthememberidfortheparticipant.Inamulti-membernetwork,eachmembershouldhaveauniqueid

0-15 0

Numberofblockmakers

Quantityofblockmakernodeswhichwillcreateandproposeblockstothenetwork.(Currentlylimitedto1)

1 1

Numberofvoters Quantityofvoternodeswhichwillvalidateandvoteonblockconfirmations.

1-9 1

Numberofobservers Quantityofobservernodeswhichwillvalidatetransactionsonly.

0-9 0

Storageperformance Performanceofunderlyingstorage(StandardisHDDbackedandPremiumisSSD)

StandardorPremium Standard

VirtualMachineSize Choosetheappropriatesizeofvirtualmachine.

NA Recommendedsizesaredisplayed.

Page 8: Quorum Consortium Network in Azure Marketplace...0-15 0 Number of block makers Quantity of block maker nodes which will create and propose blocks to the network. (Currently limited

Quorum Specific Settings ParameterName Description AllowedValues DefaultValueNetworkID IDoftheunderlying

Ethereumnetwork.Peerscanonlycommunicateinthesamenetwork.

Numericvalueupto9digits

10101010

Ethereumaccountpassword

PasswordusedtosecurethedefaultEthereumaccountthatwillbegenerated

12charactersormorewithaminimumof1lowercase,1uppercase,and1number.Doublequotesnotallowed.

N/A

ConfirmPassword ConfirmationofpasswordforEthereumaccount

12charactersormorewithaminimumof1lowercase,1uppercase,and1number.Doublequotesnotallowed.

N/A

Passphraseforkeygeneration

PassphraseusedtogeneratetheprivatekeyassociatedwiththedefaultEthereumaccountthatisgenerated.

12charactersormorewithaminimumof1lowercase,1uppercase,and1number.Doublequotesnotallowed.

N/A

ConfirmPassword Confirmationofpassphraseforkeygeneration

12charactersormorewithaminimumof1lowercase,1uppercase,and1number.Doublequotesnotallowed.

N/A

Page 9: Quorum Consortium Network in Azure Marketplace...0-15 0 Number of block makers Quantity of block maker nodes which will create and propose blocks to the network. (Currently limited

Asampleofthisbladeisbelow:

Clickthroughthesummaryblade,whichdisplaystheinputsthathavebeenprovidedforthedeploymentofthevirtualmachine.Thisalsovalidatesthesubscriptionandtheinputstoensurethedeploymentvalueswillnotcauseanexceptioninprovisioning.

Finally,reviewthelegalandprivacytermsandclick‘Purchase’todeploy.Thistypicallytakesafewminutestocomplete.

Page 10: Quorum Consortium Network in Azure Marketplace...0-15 0 Number of block makers Quantity of block maker nodes which will create and propose blocks to the network. (Currently limited

Post Deployment Quorum Consortium Network AfterthedeploymentoftheQuorumConsortiumNetwork,theassetscreatedduringthedeploymentwillbefullyconfiguredandreadyforuse.Asdescribedabove,theinfrastructuredeployedinAzurewilldeployallvirtualmachinesasinglevirtualnetworkandasinglesubnetinsidethatnetwork.Anetworksecuritygroupwillbeprovisionedthatwillprovidethefollowingrules:

• BlockoutboundpeertopeertrafficforEthereumnodes.Thisisolatedthenodesfromthepublicblockchains.

• AllowSSH,administrativewebsiteandcakeshopsitesaccessfrompublicinternet.

Asingleloadbalancerwillbedeployedwhichwillbetheonlyendpointexposedtotheinternetbydefaultandwillroundrobindirecttraffictheblockmakers,votersandobservers.

Connect to the Administrative Web Site for the Quorum Network Toviewthenetworknodesthathavebeencreated,afterdeploymenttheadministrativewebsitewillsurfacetheinformationaboutthestatusofthesenodes.Thiscanbeaccessedbynavigatingtoyourpublicipaddressforthenetwork.Thiscanbefoundbyreadingtheoutputparametersthatweregeneratedwhenthenetworkwascreated.

Navigatetothesitehere,whichwillbenamedbasedontheparameterspassedatdeploymenttime.

Page 11: Quorum Consortium Network in Azure Marketplace...0-15 0 Number of block makers Quantity of block maker nodes which will create and propose blocks to the network. (Currently limited

Thereareseveralimportantpiecesofinformationherethatshouldbenotedforuselater.Allnodesarelistedontheuppersection,alongwiththeirhostname,alinktothemanagementinterfaceofcakeshopforthenode,thetotalpeersthenodeiscommunicatingwith,thelatestblocknumberandthepublickeyforthenode(usedforprivatetransactions).

Onthebottomhalfoftheinterface,youwillseeafieldthatwillacceptarecipientaddressofanaccountintheEthereumnetwork.Thisisprimarilyusedto“fund”newaccountsthatarecreatedinthenetwork.ThisavoidstheneedtoSSHtothenodesandattachtothegethprocessinordertocreate/fundnewaccounts.

Deploying a smart contract and creating private transactions Bydefault,thereareseveralaccountscreated(Ethereumexternalaccounts).Thesecanbeusedtointeractwiththeblockchain.Toviewtheseaccounts,clickontheurlforcakeshopfortheblockmakernode.

Page 12: Quorum Consortium Network in Azure Marketplace...0-15 0 Number of block makers Quantity of block maker nodes which will create and propose blocks to the network. (Currently limited

ThiswillopenCakeshop,whichisanIDE/monitoringtoolcreatedbyJPMorganChasetoviewthenetworkbasedonthenodeyouhaveclickedon.Itdisplaysavarietyofinformationaboutthenetwork,peers,etc.First,wecanviewtheaccountsthatexistonournetworkbyclickingonwalletsontheleftnavigationbar.

Nextwecandeployasmartcontractandorchestrateatransaction.First,navigatebacktotheadminpageandcopythepublickeyforanode.Inthenodesdisplayedhere,wewillcopythepublickeyforthevotingnodetoyourclipboardbyrightclickandcopy.

Page 13: Quorum Consortium Network in Azure Marketplace...0-15 0 Number of block makers Quantity of block maker nodes which will create and propose blocks to the network. (Currently limited

NextnavigatetotheCakeshopinstanceontheblockmaker.

NextnavigatetotheSandboxarea,whichisfoundontheleftnavigationpane.

Whenthistabopens,theinterfacewilldisplayanexamplesmartcontractontheleftsideofthescreenandsomecontrolsontherightside.Wewilldeployanewsmartcontract,usingthepublickeythatwe

Page 14: Quorum Consortium Network in Azure Marketplace...0-15 0 Number of block makers Quantity of block maker nodes which will create and propose blocks to the network. (Currently limited

copiedinthepreviousstep.OntherightsideofscreenselectthedropdownforFromDeployedContracts

SelecttheSimpleStoragecontractthere,andatthebottomfillinanintegerforthesetfunctionandclicktransact.Thiswillcreateatransaction,targetingtheSimpleStoragesmartcontractwhichwaspre-deployedtotheblockchain,andtheresultswillbedisplayedinthePaperTapesection.AfterafewsecondsthetransactionshouldclearandtheContractstatewillbeupdated.

Page 15: Quorum Consortium Network in Azure Marketplace...0-15 0 Number of block makers Quantity of block maker nodes which will create and propose blocks to the network. (Currently limited

ThisdemonstratescreatingapublictransactiontoanexistingsmartcontractontheQuorumnetwork.Nextwecandemonstratedeployinganewsmartcontractandusingaprivatetransaction.Tostartthis,ontheleftsideofthescreenchangethenameofthesmartcontractandconstructor.

Page 16: Quorum Consortium Network in Azure Marketplace...0-15 0 Number of block makers Quantity of block maker nodes which will create and propose blocks to the network. (Currently limited

Nextontherightsideofthescreen,selectthedropdownnamedOrDeployFromEditor:.Thenameofyournewsmartcontractwillbeshownhere.

Page 17: Quorum Consortium Network in Azure Marketplace...0-15 0 Number of block makers Quantity of block maker nodes which will create and propose blocks to the network. (Currently limited

Directlyunderthisdropdown,2textboxesaretheretoaddavaluetoinitializethestateofthesmartcontractaswellasthearrayofpublickeystoattachtothis.EnteravalueintheinitValfield(integer)andthepublickeycopiedinpreviousstepandclickdeploy.

Page 18: Quorum Consortium Network in Azure Marketplace...0-15 0 Number of block makers Quantity of block maker nodes which will create and propose blocks to the network. (Currently limited

Recommended