►
Description
During this workshop, we will demonstrate how to work with key-value storage.
To attend the next workshop, visit: https://bit.ly/2TQnXfM
Follow Us: https://twitter.com/meetCasperLabs
General Discussion: https://t.me/CasperLabs
Technical Discussion: https://discordapp.com/invite/Q38s3Vh
A
A
Realize
the
functionality
of
key
value
storage:
this
is
a
work
in
progress,
but
I
I
was
thinking
that
this
is
like
nice
to
show,
rather
than
showing
another
smart
contract
built
in
the
same
way.
I'll
show
you
how
the
how
you
can
build
clients
for
your
smart
contracts,
so
you
can
actually
interact
with
the
blockchain
in
this
repository.
A
A
I'll
show
you
first
how
the
contract
looks
like
and
then
we
will
go
through
the
installation,
steps
for
the
Python
environment
and
if,
after
we
have
it,
we'll
get
the
opportunity
to
I'll
show
you
the
code
and
you
will
see
how
easy
it
is
to
create
a
Python
client
for
your
smart
contract.
Okay.
So,
let's
start
from.
A
B
B
E
F
G
C
A
Okay,
so
the
contract
is
just
9
RS.
This
is
the
whole
contract.
This
contract
is
much
simpler
than
what
we
previously
worked
on
so
the
best
in
contract
in
the
year
20.
In
the
voting
this,
the
goal
of
this
smart
contract
is
to
to
deploy
another
smart
contract
that
will
have
the
ability
to
save
a
value
of
particular
type
to
the
to
the
accounts,
accounts
ties,
and
so
what
you
can
find
here,
you
can
find
a
set
key.
A
A
Has
two
parts
and
Cl
typed
right
and
then
first
I
check
I
use,
run
time,
get
key
to
see
if
this
key
is
already
existing
in
this
system.
If
the
keeps
existing
I
use,
I
extract
the
reference
to
this
key
and
update
the
reference
with
the
new
value.
If
he
doesn't
exist,
I
create
I,
put
a
value
to
the
blockchain,
so
I
use
new
URF
on
top,
and
this
key
will
be
the
reference
to
the
and
I
put
it
on
the
door
thing
I
was
put
key
okay.
A
Actually,
that's
not
the
contract.
We
call
it
session
code
because
it's
gonna
run
in
this
session
of
the
account
and
not
as
a
smart
contract
with
its
own
context.
So
this
session
code
is
now
saved
under
Ricky
and
now,
if
the
same
account
we
use
it,
I
will
execute
this
key
storage.
And,
let's
see
what
happens
here.
First,
the
there
is
the
first
argument
unwrapping.
F
A
A
There
is
also
a
type
name.
The
type
name
is
a
second
element
of
the
blockchain.
The
second
argument
that
we
are
passing-
and
this
is
also
a
string
type-
it
could
be
a
type
string
type
music
star,
but
these
are
strings
defined
here,
so
user
accessible
to
that
I
want
to
star
value
like
special
value,
name
of
type
string
and
then
give
a
type.
A
Okay,
that's
pretty
simple,
just
take
the
value
and
store
it
on
the
blog
thing,
all
right.
So
having
that,
let's
see
if
we
have
a
contract
after
abilities,
it
have
under
wasn't
target,
wasn't
32
release.
You
should
have
contract
that
wasn't
there
wasn't
that
we're
gonna
use,
and
now
we
will
install
the
Python
client.
A
E
A
A
A
G
A
Then
if
we
know
the
hash
of
the
of
the
session
code,
we
can
use
one
of
four
inserts
and
each
of
these
insert
is
typed,
so
insert
264,
inserts
drink
and
so
on
and
after
we
save
it,
you
can
read
it
and
I'll
show
you
how
I
enter,
how
I
insert
and
deploy
it.
And
then
you
could
do
this
on
your
own
and
I'll.
Do
sending
every
comment
that
I
use
to
you?
Okay,.
A
Okay,
so
we
start
with
deploy
key
value
storage.
What
do
we
need?
We
type
help,
help
and
I
need
from
address
so
that,
with
the
time
the
buying
from
I
need
the
private
key
I
need
the
contract,
wasn't
location,
and
so
the
the
contract
to
deploy
there
wasn't
file
to
deploy
and
I
can
tell
whether
it
should
be
blocking
or
not.
If
it's
blocking,
then
the
system,
we
will
wait
for
the
contract
to
be
executed
and
we
will
return
the
latest
block
hash
and
the
latest
and
their
hash
of
this.
A
If
it's
not
King
and
it
just,
it
will
descend
the
deploy
to
the
network,
and
that's
it
also.
It's
worth
mentioning
that
the
house
house,
the
default
house,
is
set
to
to
our
public
public
test
net
I.
So
if
we
could
do
something
here
without
specifying
the
house
we
did
against
public
does
not
so
deploy
key
value.
I'm.
Putting
the
first
comment
here
and
then
minus
F,
that's
from.
A
A
A
A
E
A
E
A
E
E
A
Then
I
show
you
how
to
run
the
CL
ID
by
and
we
saved
a
value
on
it.
We
use
one
of
the
insert
method
to
save
the
value
and
now
I
show
you
how
to
read
it
and
now,
let's
dive
into
the
code
friend
and
so
I'll,
give
you
the
overview,
and
the
main
element
here
is
key
value:
storage,
client
to
pipe.
It
holds
all
of
the
logic
to
in
to
talk
to
the
blockchain.
A
It's
built
on
top
of
Casper
labs
clients.
It
has.
It
is
a
class
when
we
initialize
it
as
a
client,
you're
ready
initialized
for
you
and
if
you
do,
for
example,
deploy
key
value
storage
contract,
it's
gonna
use,
client
deploy
and
you
need
to
pass
the
basic
arguments.
So
this
is
the
same
as
using
CLI
client,
but
not
the
one.
With
the
Casper
lapse
underscore
client
in
CLI.
It
takes
the
same
arguments.
A
A
A
Okay,
so
now
we
have
the
argument
and
then
instant
value,
we
type
from
address
private
key
session
hash
name
typed
over.
We
are
inserting
the
argument
and
if
it's
blocking
or
not-
and
this
is
the
whole
client
and
then
have
to
build
a
CLI
to
the
best
way
to
be
to
do
it
in
Python-
is
of
course,
to
use
our
first
best
argument,
parsing
library,
ever
in
any
language
and
an
ecosystem.
A
Allows
you
to
easily
add
arguments
like
this
parser
that
adds
arcs.
First,
what
is
the
arc
health
message?
What
is
the
default?
Behavior
I'm,
sorry,
the
action
name,
which
is
what
we
were
doing
here,
for
example
different,
like
a
setting
a
house,
would
look
like
this,
so
it
could
be
minus
eight
minus.
My
entire
house
is
required,
which
is
the
default
with
the
type.
So
this
will
do
everything
for
you
and
this
house
and
part
is
reused
across
the
Commons.
A
Okay
and
here
this
loops,
inter
iterates
over
the
commands
from
the
comments
directory
I
recently
Joe
from
Casper
labs
figure
it
out
how
to
do
it
best
way,
I
really
loved
it.
So
looked
at.
It
reads,
for
example,
insert
you
64
as
a
comment
command
here,
and
then
you
use
the
name,
the
method,
help
and
options,
and
if
we
go
to
the
insert
for
it,
will
it
actually
defines
this
name
help
options?
A
A
So
this
is
definitely
something
that
you
can
quickly
iterate
over.
Someone
will
tell
you
that
you
need
a
smart
contract
with
API
or
with
the
CLI
tool
that
for
your
day,
use
cases-
and
this
is
very
database
like
system,
so
you
don't
need
a
complex
logic
inside
the
smart
contract.
You
can
just
use
this
one.
You
could
deploy
it
if
you
have
it
installed
and
set
up
key
value
sturgis
and
then
build
your
application
on
top
of
these
values.