18
Quorum Consortium Network in Azure Marketplace Cale Teeter | Senior SDE DX / TED Overview The next phase of support and integration of the Quorum blockchain solution in Microsoft Azure is the release of the Quorum Consortium Network in the Azure Marketplace. The goal of this offering is make it easy for user to create the infrastructure and configuration in order to run Quorum by supplying a few parameters and single client for deployment. While the initial Quorum demo offering was a good way to showcase the fundamentals of how Quorum functions and is different from others in the market, this new offering allows users to build and deploy a full network with multiple underlying virtual machines, virtual network, load balancing, and network security, and simple management via the native Cakeshop tooling. After reading this article, you will Understand what the new offering of Quorum Consortium Network architecture is comprised of and how it can be deployed by simply providing a few parameters. Learn how to deploy the Quorum Consortium Network and activities to do post deployment to get started with using this offering. About Quorum blockchain While there are various types of blockchains on the market today, and more being created every day, Quorum is unique in a few different ways. To start from the core, Quorum is fundamentally, a fork of the go Ethereum client. This means that it is in fact a variant of the Ethereum protocol. This was created by a team at JP Morgan Chase, with the intention of providing a blockchain that can be used by enterprise, addressing some the features that were needed beyond what Ethereum base protocol could provide. Specifically, the modifications were to address the following: Need for a different consensus algorithm and model to avoid the challenges that mining presents in a semi-trusted private Ethereum network. Need for selective privacy of transactions to allow multiple parties to use a single blockchain, but disclose only transactions details to specific participants. Based on feedback from enterprises and in fact requirements that JP Morgan Chase was addressing for their own use, these new features were added via a modified go-ethereum client and the use of constellation, or private transaction managers. These additions are built to be the least intrusive approach to implement, meaning the team did set out to reinvent a new blockchain, and instead modified the existing technologies. The specific implementation is the following: QuorumChain – a new consensus model based on majority voting, this is also raft-based to ensure faster blocktimes, transaction finality, and on-demand block creation Constellation – a peer to peer encrypted messaged exchange Peer Security – node/peer permissioning using smart contracts

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

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

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