►
Description
In this video, we discuss session code, which is the simplest piece of logic you can execute on a Casper network.
It requires only one entry point, the call function, and it runs within the context of the account executing the session code.
o Sample session code that configures an account on a Casper network to require two-party multi-signature deploys: https://github.com/casper-ecosystem/two-party-multi-sig/
o Reference documentation: https://docs.casperlabs.io/dapp-dev-guide/writing-contracts/session-code/
A
In
this
video,
we
will
discuss
session
code
on
a
Casper
Network.
So
what
is
session
code
session
code
is
the
simplest
logic
you
can
execute
on
a
Casper
Network.
It
requires
only
one
entry
point,
which
is
the
call
function
and
it
runs
within
the
context
of
the
account
executing
it.
This
means
that
the
session
code
will
run
with
the
permissions
of
the
account
to
understand
session
code.
A
We
will
work
with
the
repository
that
contains
sample
session
code
for
configuring,
an
account
for
a
little
background
accounts
on
a
Casper
Network
can
associate
other
accounts
to
require
multiple
signatures
when
sending
a
deploy.
Let's
start
by
cloning,
the
repository
this
sample
session
code
will
add
a
new
Associated
key
and
require
multiple
signatures
for
deploys.
Note
that
you
can
also
modify
the
sample
project
we
created
in
the
first
video.
A
Let's
review
the
dependencies
we
have
listed
in
the
cargo.toml
file.
We
have
Casper
contract,
which
provides
the
SDK
for
the
execution
engine.
We
also
have
Casper
types,
and
this
import
includes
the
types
the
node
uses
necessary
for
the
execution
engine
to
understand
and
interpret
the
session
code.
You
may
need
to
specify
newer
versions
for
disk
grades
within
the
contract
package
and
Source
folder
we'll
find
the
main.rs
file
containing
session
code.
The
session
code
in
this
example
adds
an
Associated
key
to
the
account
running
it
at
the
top
of
the
file.
A
We
see
the
following
attributes:
no
STD
indicates
not
to
import
the
standard.
Library
no
main
indicates
that
the
main
function
is
not
required.
Since
the
session
code
has
only
one
entry
point
as
the
call
function
we
import
the
Casper
contract
API
and
some
account
related
Casper
types.
You
will
need
to
import
other
crates
relevant
to
your
session
code.