so I'm Victor Wang one of the founders
of block apps and I'm here to introduce
to the world block apps Trudeau on
Microsoft Azure the easiest way to build
blockchain applications you've seen this
comparison made countless times Bitcoin
as a blockchain we know is limited in
functionality and thanks to Vitalik and
the work of the etherium foundation and
eat them
we now have a completely new global
computing platform but because of that
the success or failure of almost any
computing platform is actually based on
the number of applications that are
being delivered on it so black ops has a
simple mission we want to be the easiest
way to build and deploy blockchain
applications and businesses on the
etherium platform were the team behind
the etherium Pascal implementation and
we want to be able to provide the
facility to easily deploy private
blockchains
but also have these block chains be able
to communicate with the public
blockchain lastly we want to make sure
that applications built on our on our
platform can communicate with existing
systems and devices in a sense what we
want to provide is a bridge to the
existing world with ethereal but here's
the challenge now many of you know all
these terms you know what this entire
ecosystem is about but I can tell you
when you show this slide to regular
people they are terrified they have no
idea about where to begin because truly
the etherium ecosystem is not just one
tool but a series of interconnected
technologies and tools and you have to
understand the entire picture to really
be able to maximize the use of it so
many people come to us and they say
well where do I start where do I begin
and that's where black ops Jurado comes
in basically what black ops Jurado is a
full aetherium blotching as a service
framework that gives you everything you
need to start building blockchain
applications today that goes all the way
from spinning up your bone blockchain a
bit aware API connector wallets faucets
everything you need to build and deploy
applications and we're going to show you
a live coding demo by one by co-founders
Karen James Logan our chief data
scientist thanks Victor
okay there we go let me maximize this so
first thing I'm gonna do is actually
launch a live instance of Strato
it takes a minute to spin up and we've
got Network latency then I'm gonna go
into one of our demos so we have to pick
exactly what I'm gonna code
I've got about five minutes to do it
sure so Karen since we're partners with
Microsoft now I'd like you to change our
revenue sharing agreement so I'd
Microsoft into our company and let them
share part of the revenue and I'd also
like to make sure you have five minutes
right yeah make sure everything you
write can run on any internet-connected
device including a mobile phone and any
browser okay got it we fire up the
instance all right start in the deploy
here so this all get listed on the
marketplace soon but this is the block
apps login for the moment it's called
this Strato dev
we're firing up all right looks good let
me go go into the contract so I'm about
to show you a command line tool called
block these are the commands and
supports and what I've set up here is a
scaffolded blockchain application kind
of looks like a web app you can see
we've got HTML Javascript CSS and a pas
to run a web server even get a contracts
folder and in the contracts folder we've
got some standard solidity contracts to
get you up and running quickly so let's
take a look at what's there it's a
couple samples the payout contract is
the contract that block Apps has been
working on this encodes the revenue
split or they be the ownership split
between Victor Jim and I and we're gonna
cut Microsoft in in a moment let's look
at our instance looks like it's almost
ready and show you the code
okay very simple solidity contract three
dresses Victor Jim and I ownership
distribution a setup function in which
we split the equity and a dividend see
how we're doing here
it's almost ready
okay good so now what I'm gonna do I'm
gonna cut marleah
let's give Marley the address with
foursie's
and because he's been so kind to us
we're doing Marley 70% of block ups
gotta add a line here
normally I don't roll over like that in
negotiations okay it looks like we're
good to go I've set the URL up already
so what we're gonna do now is compile
this contract it's a command called
block compile okay that looks good and
let's go visit our web server so if I
type block start this launches a local
web server and we'll just see what our
contract looks like so that's at
localhost 3000 and p.m. so what block is
done here is scaffolded a user interface
for this contract it's automatically
generated and we can see that hey we've
compiled the contract but I don't have a
wallet yet and I still need to upload
the contractors make it bigger yes so
block is here to guide you through the
process of creating an application it'll
remind you about things like deploying
contracts or when you need to upload a
new version of your contract after it's
been uploaded up updated excuse me
okay so I'm gonna go ahead and generate
a key
got a network there we go now I'm gonna
go upload this contract
all right and i refresh this page you
see it as an address now checking the
password in we've got some data in
storage you can see these addresses have
not been filled in cuz we haven't called
the setup function just yet
I have about a thousand ether in the
bank the contract has zero ether so and
assume the contract some ether and do
the setup okay you can see that Marley
now is an address as this Victor Jim and
I and the contract doesn't any
so here's Marley's address there's
nothing at it this is actually what we
want and I'm about to carry out the
dividend
there we go all right so if I check this
Marley should have a balance now
and there it is it's in a way you can
see you got 70% we should label those
units a little bit better but there we
go we didn't need any lawyers we stood
up the the revenue split there the back
in the back ah well we let him in for
this conference not the next one anyway
so that's how you can get up and running
in five minutes and build your first app
with block on block ups ryan later will
so block is a wrapper around block apps
jas which is our every purpose
JavaScript API so blocked takes care of
the scaffolding and the onboarding but
block XJS you can drop into any project
that you already have so maybe when you
do something more complicated do you
want to use block XJS thanks Victor so
as you can see black ops trudeau is
designed for very very rapid deployment
and development some of the key features
are that it's designed for building
customizable private a theorem
compatible networks you do rapid
deployment and interest on existing
infrastructure like asura as Marly
mentioned coming suits in the
marketplace will be one-click deployment
it has a restful api which is designed
for integration with existing services
and devices and one thing is it scales
easily from small private sandbox
deployments into multiple consortium
deployments and even elements of the
public of your in blockchain it's
write-once use on any network that you
want and all of this is built on the
technology we developed for the etherium
haskell implementation and to talk about
that I'm going troduce my other
co-founder James for Mazda your PhD and
creator of SSL VPN
Thank You Victor so about a year ago I
Karen actually contacted me and I
learned a little bit about
etherium and I became fascinated right
away with the theorem and I went out and
started reading everything about it and
I immediately wanted to dig in and
understand how it worked and for me the
natural choice of a language to use to
work with aetherium was tasco I've been
using Haskell for about five years now
and it's over that time become my
favorite language it's got a lot of
features that are extremely nice first
of all as you heard yesterday Haskell is
a functional programming language and
the thing about a functional programming
language is that the specification is
the executable the code that you write
with Haskell looks a lot like the
description of the code that you are
writing
second of all it's one of the most
strongly statically typed languages that
exists so generally speaking if it
compiles it's correct and I've had many
experiences over the last year where
I've had to make changes to the code and
I've spent hours ripping it apart
rewriting it and and I'm generally very
surprised at the end of the day once it
compiles it tends to come up and it just
works without bugs so and third of all
it's very performant language so when
you compile Haskell it compiles to
Native executables and if you write your
Haskell code properly it can run as fast
as C so generally speaking if you want
to write something and you just want to
make sure that it works and it works
fast Haskell is your language and it's
been as you can see here we put a few
examples of companies that have been
using it in the last few years
let me talk just a moment about the
architecture of Strato so Strato as you
can see it's from the beginning we wrote
strata to be fully modular eyes and in
the center we have a sequel database and
around that sequel database we have many
pluggable modules for instance the VM
itself is just one process that runs and
it connects grabs the data out of the
database and processes it we have all of
our communication to the outside world
are separate pluggable modules we have
analytics that are occurring so forth
but the important thing here was we put
sequel in the middle and we chose that
deliberately because we wanted Strato to
be a an architecture that would plug
right into existing enterprise
environments today so thank you very
much
so what one thing about Strato and the
etherium architecture that we've chosen
that Jim has created is because of its
modular nature it's actually completely
compatible with many of the existing
aetherium tools you can spin up a
private network and also connected to a
deaf node or C++ node you can use
front-end tools that are being developed
all over by the community such as ether
camp truffle and embark so really what
what when you use straddle you're not
restricted to only articles that now the
one thing is in order to really get a
theorem applications created simply
having the technology is not enough
education is a big piece of the puzzle
and in order to accomplish that we've
been holding a bunch of workshops we
call them zero to barge a nap where you
come in for a couple hours you start
playing around with the tools and you
walk out having built your first
blockchain now in addition we've been
actively involved in a series of
hackathons co-sponsored by consensus in
the ether camp and without our prompting
it seems that our tools have now gotten
picked up by other developers who found
it's a very easy way to build a
blockchain application in fact the
recent winner of the rise Barclays
hackathon one using block app straddle
and here's the thing he had never looked
at a single line of solidity before that
akka phone so what we're trying to do is
essentially provide a complete solution
with Microsoft
we now have one-click deployment on the
Microsoft Azure cloud we're providing
hands-on workshops and education efforts
to make sure people can use these tools
and lastly with our parent company
consensus enterprise we're helping
companies figure out how to build and
use these technologies in long term this
is our team come look for this teacher
we are very friendly and open we'd love
to talk to you about how to use our
tools
on how to make our tools interoperate
with whatever you're doing so the key
message of all of this is this isn't
about the future this is about today
what can we start building right now
thank you very much
wait
so my Google Calendar wants me to know
that I have a yes thank you google okay
so I'm Ryan rice I'm the author of the
block apps j/s JavaScript library block
upstairs connects aetherium to the web
block apps itself as Jim just told you
exposes aetherium as a database using
our restful api you can query any number
of aspects of aetherium both by native
metadata and by metadata that you can
only extract by having run those
transactions you can query blocks
transactions accounts or accounts
storage and you can query things those
transactions by such such features as
what accounts have changed in them and
other such things that might be of
interest as analytics block eps j/s
builds upon this api by wrapping in
high-level javascript in fact it
supports solidity very transparently a
trap solidity contracts in JavaScript
objects thus realizing the the
programmatic structure of a solidity
program as the programmatic structure in
javascript so that you can easily
integrate it into an application since
any network communication necessarily is
asynchronous Java apps uses a popular
promise library Bluebird to make to make
these your interaction with this
asynchronous activity powerful and
uncomfortable nope
there we go not done yet so let us now
take a look at something that you might
write with lockup J s so this is a
little bit too expanded here we are
still large enough to say hopefully the
color scheme isn't too dark mmm is it
too dark all right well I'm going to
just attempt to power through this
anyway because select what ah very good
okay so this is the HTML portion of the
DAP that you might write with lockup yes
it's very simple and it just produces a
little interface that looks like that
just a box with a couple a couple fields
you can fill in you'll notice that it's
fetching it's it's JavaScript from the
Strato dev address this is a Azhar
instance that we started up for
ourselves where Strato is always running
and this library is available all that
happens when you open this this page is
that it runs a function and waits for
you to push the button all right so
the code the solidity contracts that is
behind this behind this application is a
simple crowdsourcing thing basically
people can submit their names a little
bit of ether and they can get
contributed to the contract and after a
certain point they are you can just
decide to pay it out so this is not
intended to be clever it's just intended
to be instructive you'll notice that a
little way down I have this set profile
option this is one of the features of
block fjs that makes it easy to use
different block chains or or different
strata nodes we have at the very least a
straddle live node in addition to
straddle dev node and that is running
rather than a sandbox blockchain a live
etherion blockchain and by simply
changing the word let me just in dev to
live I could make it run on the live
Network now it wouldn't be wise because
I have decided to use an address it has
no ether and I've also put his public
key up on the screen so it had better
not have any ether but if I darka tected
this just a little bit more carefully
than just by making that one change it
would in fact be a real a real dab so
block fgs is a number of modules it has
a it has a solidity module for one thing
and that's the module you're going to be
using the most often it has some some
basic support for for aetherium concepts
below solidity but in fact solidity just
abstracts all of them to a higher level
so for the most part you're just going
to be using that however as you'll
notice in Kieran's contract you can
sometimes find yourself submitting eval
use in way when you really meant the
submit them in ether so you can in fact
convert them back and forth pretty
easily with the unit's model
this faucet thing is a testing facility
like I said this address has no real
ether on it but on the test net Strato
dev it doesn't need either it or rather
it doesn't either but it doesn't need to
real ether but we need to give it
something so that the VM will work the
faucet just supplies any address they
want with a thousand fake ether so let's
change that back to Strato dev so that I
don't accidentally try to spend
something I don't have all right so
let's go down and look at this code so
what's going on here is that it
remembers the address of the of the
individual who you are benefiting with
your contributions as well as various
information about the people who have
paid as you can see this is a fairly
complex solidity structure it's a
mapping from addresses to a user-defined
struct and the Java sir the block XJS
library actually does support
interpreting the values of even such a
complex object it reads the storage it
interprets the structure of this
solidity code and it figures out what of
the hexadecimal nonsense that lives in
the etherium storage corresponds to the
values you meant to put in there and it
converts them into JavaScript types so
you don't have to worry about any of the
implementation details of aetherium when
you are working with lockups yes it does
as much as possible to to take care of
them for you so when you create this
contract all it will do is store the
store the name of the or the address
rather of the person who's supposed to
get the money
it also initializes that array of
contributors and then when you
contribute
oops alright so when you contribute it
well does a little check to see if you
haven't given anything but otherwise it
simply adds the contributor to the end
of the array and adds the value to the
to the struct the corresponding to that
contributor which lives in the mapping
then then it tells you that the
transaction succeeded so if I were to if
I were to try to give some ether to that
right now
say myself 10 ether then you would
expect to see something pop up and it
does in fact pop up I have I've been
thanked generously for giving 10 ether
to this person so how did that happen
exactly this is where lockups jeaious
actually does its work so at the
beginning of the mmm at the beginning of
this this app before I even came here I
loaded this page and it created that
contract all I did was it took that code
I plugged it into the solidity module
and I called the new contract method
since most of these operations are
asynchronous the call looks a little
strange you would expect it to be a
member function and it is but as a
member function of the return value of a
promise so I'm using some promise syntax
for that and all it does is it creates a
contract and saves that contract in the
in the in the page for for later
reference and it also activates that
button since there was no error I don't
care about the other function now when I
push that button it went through a long
chain of promise operations the
beginning of which was to run this
function which I've called patronize
maybe I should have called it contribute
so let's look at how that works that's
based on these three functions so the
core the core piece of functionality is
the second function there patronize
which takes a name and a value the
things that appeared in those boxes so
all it does is it takes that contract
object which is
perhaps not creatively called contract
looks in its state which is a sub-sub
object which is automatically created by
the library and in there it finds a
method called contribute and if you
remember back at the solidity code that
was the method in the solidity code it's
named the same thing and it's only
natural that it should in fact be a
function object in JavaScript so that
thing takes a variable which is the same
argument as it would take in solidity
and I can also specify that it sends
some other stuff in the transaction
parameters DX params I can specify a
value which you'll notice that I've
specified in ether and it's pretty clear
that I meant to specify an ether from
the syntax I could also set gas price to
gas limit if I wanted to but I don't
particularly because those are
implementation details and the profile
back up at the top which was set to
Strato dev also has some somewhat
permissive defaults in the case of
Strato dev and in the case of shadow
lives somewhat less permissive default
that it seemed compatible with the other
with the existing aetherium clients get
in C++ so that the transaction will
likely be accepted and you don't have to
worry about it unless you're really
concerned with the fine the fine print
after I've set all that up I just call
it from well something I need a private
key and the private key in this case is
just being created on the fly from a
library from a a wallet that I have I
have spun up in the page this is not a
very secure wallet it just every name it
takes it randomly generates an address
for it and then with the fund function
at the top of the screen it applies the
faucet to that address and gives it a
thousand ether once it has the address
it has the private key also and it just
sends that into the patronised function
and and and to miss the transaction and
that was what you saw happen here of
course what you haven't seen yet is
actually pretty obtaining the values
that are printed aren't very many values
but something had to be done to get them
so this is where the placard is printed
this is where the contents of the
contracts are interpreted by l'a caps
Jas if you remember the contract had a
recipient who was the creator of the
contract a number of contributors and a
array of contributor addresses as well
as a mapping of a mapping of contributor
data so I've done a little bit of
functional style coding to extract the
information from the from the
contributors there what I did was I yeah
I happen to know that the contribute
info member of the contract remember
that was a mapping in the solidity
contract and a mapping is nothing other
than a function from its keys to its
values and that's how mappings are
represented in in block fjs so I just
took this function and I applied it to
each member of the contributors array
whose elements or addresses and that
turns the array of addresses into array
of objects containing two contributor
information that was put in there when
the when the contract was invoked and
after I've obtained all of those things
I joined the contracts with with the
function that that uses their values and
in this case just takes the recipient
the contributor know the number of
contributions and the information of all
the contributors and prints out a number
of lines explaining what exactly was in
all of that and well you can see the
results up here I don't need to go
through the the user interface
formatting that goes into that
easily the least interesting part of any
program writing writing writing text to
output something I could give more turns
out that I really like this guy I'm
gonna give five more ether so I
contribute once again and now I've given
15 my brother Doug who makes more money
than I do wants to give 20 he makes more
money because he works at a bank
for now yeah soon I hope I won't be the
one making more money so Doug is given
20 and so let's close off this this
little round of crowdsourcing and pay
the guy whoever that guy is so pay the
recipient turns out he raised thirty
five and what actually happens when I
did that is I had a final method in the
contract let me just sort of scroll back
up to the source code so I can point
that out to you because it was very
small payout suicides the contract it
closes it out and pays all the money to
the recipient and way down here
the payout button just invokes the
payout function calls it from the
private key and that function invocation
returns a value but in this case it
doesn't return anything so in contract
language I just replaced the return
value with what I want to see which is
the balance of the contract and then I
format a line that displays it so as you
can see this is the same basic operation
that you witnessed with with Kieran's
example in Strato but more customized
miss Trudeau has your scaffolded page
already for you with with block EPS j/s
you'll want to write your HTML yourself
or if you start with your Strato if you
start with your shadow page you can
tweak it a little bit and knowing how
block fjs works you can add more
functionality than simply than simply
showing the storage contents of the
address you're working with lockups GS
is the power users is the power users
inroads to connecting aetherium to the
web anything you can do with solidity
you can you can benefit from in your
application by running this library
so let's go back to this slide and press
spacebar again
thank you for receiving this
presentation we're happy to give this
technology to you to enjoy to and to
build wonderful wonderful aetherium apps
with