Hyperledger Fabric 101

Hyperledger Fabric 101


in this session we’re going to talk
about Hyperledger Fabric and specifically the open source distributed
ledger technology that the Hyperledger Fabric foundation and the Linux
Foundation has been contributing to we’re going to talk through some of the
core architecture of what makes up Hyperledger why it’s important in the space
what are some of the nuances or differences between it and some of the
other popular offerings like ethereum in kurta and such and then we’re going
to talk a little bit about the data flow and then I’ll walk through a short demo
to show you spending up a network we’ll share the code so you can go through
this yourself at your leisure but I wanted to actually show how this
actually function is where we’ll actually do a transaction by a chain
code on there as well so to start off the core architecture for hyperledger
is a quite a bit different from some of the other technologies that exist out
there it’s very much focused on a need to know for transaction so up here up
here type model particularly for chain code and so the nodes are essentially
two different types there’s peers that exist on this network these peers can be
what we call endorsing peers or just regular peers and when I say endorsing
peer it means someone who can make changes to ledger so peers have to be
elevated to that right they have to be granted that right specifically and
explicitly and so this is part of the permissioning that exists in hyperledger to control access to the network this is not a trustless network this is
something very focused on enterprise and very focused on security and a need to
know on transaction basis and so basically after we have our endorsing
peers we also have the orders now the orders are essentially form the
consensus model that hyper ledger employees now currently for production
type workloads we use a Kafka based cluster so if
you’re familiar with that open source technology that is actually used and we
basically build a network of ordering nodes which you know based on the name
it essentially means they’re ordering the transactions that are going to exist
and if you can control the ordering of transactions in a ledger you can control
the ledger so this is essentially the point that is a central point for this
whole network to run this Kafka cluster the peers must be on board
as I mentioned through this permissioning and they can be endorsed
or not endorsed now if we talk about the data flow a little bit if you look at
this diagram basically what we’re showing here is that piers themselves
are basically going to be signing transactions from the application
there’s going to be an inspection that happens in the middle here and that’s
our verification and then there’ll be the ordering service which is going to
order those transactions so you know there’s a there’s a different data flow
here as opposed to some of the other chains but it’s still a structured
around the notion that we have this peer-to-peer network that is using
digital signatures a very strong kyc on these people so anybody who’s existing
in this network and who is signing things has a essentially a CA behind it
a CA is a certificate authority which generates certificates and this is how
we build trust in this network so participant a will say here’s my
certificate the validates who my identity is on the other participants
will agree on that he can then be used to sign transactions endorse peers
depending on his permissions in the network perform those type of operations
now to go through this and show a little bit of a demo what I did was set up a
box over here and you can do this yourself we’ll share the code
essentially what I have in Azure here is a box and you know I was gonna walk
through setting this up manually and here’s just part of the set up so you
can see there’s quite a many commands that you have to run here to set this up
there’s some baked in tools that they have for crypto generation for
certificate generation for the transaction generation setting up all
these different peers and orders but what we’re going to use is one of the
scripts provided by the by the fabric guys who basically have created this
bootstrapper here and this will help you get started as you first get it getting
used to how you run these kind of networks so in this case I’m basically
gonna run this command to go ahead and spin this up now what I have here is an
Ubuntu box that’s basically running docker that’s pretty much all that’s
been installed on here a few of the binaries from fabric have
been installed on here as well for the crypto Jan and the certificate self but
basically that’s what I have and you’ll see the screen scroll and well I’ll
scroll up here in a second once it’s completed but what’s happening here
is basically we’re setting up multiple org organization here and what our orgs
orbs are the participants in the system so anybody who joins into the system as
a separate participant will call it and it’s what we traditionally call them
they’re called orgs in hyper ledger so when you see org think about that MSP
is the the service provider for the identities so just keep that in mind
when you see MSP peers or obviously these things that are going to
orchestrate these transactions and endorse transactions or verify them and
any ordering is is what we mentioned before now this is still going through
in instantiated some chain code here it’s going to complete the transaction
here as I mentioned will will scroll through this but the idea is like it’s a
little overwhelming when you first get started with this to look at you know
kind of how the setup actually happens we actually have templates in the
marketplace azure marketplace to help you spin these up as well to make this
as easy as possible I’m kind of pulling away some of the infrastructure because
a lot of this code is infrastructure now the code that gets specifically
executed as like a smart contract traditionally it’s called chain code in
a hyper ledger and chain code again is specifically targeted to peers so we
don’t have like a kind of global broadcasts happening here like we would
have with something like aetherium and so in this case basically this is
attempting the chain code right Tara will let that complete it looks like it
is completed and will basically jump up here and take a look at what happened
really quickly so when this thing bootstrap basically created two orgs
here you can see it generated the Genesis block it created channels now
channels are basically those relationships between the peers so
that’s how we’re gonna orchestrate our transactions that’s what we’re gonna
target chain code with we’re gonna say hey we have some chain code we wanted to
run on this channel that channel defines what peers have access to it so again
need-to-know basis of who has access to the data that’s being orchestrated the
state that exists on the chain and whatnot anchor peers are these guys who
basically are going to help run the network so as we mentioned before and
then basically what we did as you can see it was spinning up the docker
containers after that we’re basically going to kind of initialize our peers
and you’ll see down here basically peer one
pr0 was being joined into the network and then the anchoring was happening
here they’re being approved and then we see chain code is actually being run on
here so we installed some chain code which basically can be written in Java
go or node right now so you can set these up in different forms and then we
can see that we actually ran a transaction down here so we queried the
channel down here again to see what was going on we invoked a transaction
successfully and you can see the output here
in a short time we couldn’t drop through everything that’s happening there but we
will have these scripts available so you can go out there and take a look at how
this stuff actually what’s happening behind the scenes in detail but this
kind of just gives you a taste for how hyperledger works how to get running
with it again we’ll share the code and the
pointers to the tutorials but I hope that you learned a little bit of a hyper
ledger in this and I think

Leave a Reply

Your email address will not be published. Required fields are marked *