►
From YouTube: NEAR Certified Demo | Episode 6.2 -- NEAR Analytics
Description
This demonstration was presented by the author(s) after just 1 week of working with the NEAR platform as part of the NEAR Certified Developer program.
You can find the source code to this demo here:
https://github.com/Learn-NEAR/NCD-06--near-analytics
---
Follow the latest from NEAR Protocol on:
Website: https://near.org/
Discord: https://near.chat/
Blog: https://near.org/blog/
Twitter: https://twitter.com/NEARProtocol
GitHub: https://github.com/near https://github.com/nearprotocol
#Blockchain #FutureIsNEAR #NEAR #nearprotocol
A
Okay,
now
maybe.
B
B
A
It
was
always
emphasized
that
data
on
the
near
blockchain
cannot
be
censored
and
is
transparent
and
the
computation
is
handled
in
a
distributed
manner,
and
I
thought
about
this
and
I
reached
the
conclusion
that
it
could
be
applied
to
data
analysis,
because
data
manipulation
is
often
a
really
serious
problem
and
also
there
are
cases
when
certain
resources
are
required
which
are
not
available
at
the
at
the
devices
that
create
the
data.
A
So
all
the
pros
that
I
mentioned
earlier
apply
to
this
application.
The
cons
are
that
the
resources
are
limited
on
the
new
network
and
the
computation
may
be
really
expensive,
as
I
have
already
seen,
and
you
will
also
see
during
my
code
demo,
let
me
show
you
an
example
of
the
application.
I
envisioned
today
these
contracts
that
I
have
created
it's
about
medical
center
and.
A
Okay,
so
this
application
that
I
envisioned
has
the
functionality
you
can
see
on
the
slide.
So
basically
you
can
create
a
data
set.
Actually,
you
can
create
multiple
data
sets.
You
can
view
data
sets
and
get
the
basic,
descriptive
statistics
and
also
can
do
some
basic
prediction
on
these
data
sets
and
if
you
are
the
owner
of
the
data
set,
then
you
can
add
the
data
to
this.
A
A
The
data
set
and
the
analytics
the
analytics
contract
is
creating
and
managing
the
data
sets
and
the
users
can
interact
with
this
analytics
contract
and
do
the
functionality
listed
on
this
slide.
A
If
the
user
is
authorized
as
a
contributor
as
an
owner,
then
he
can
create
a
data
set
and
add
data,
and
if
the
user
is
not
authorized,
then
we
can
just
get
the
statistics
and
the
prediction
for
this
for
the
game
for
the
data
set,
he
specifies
this
was
a
quick
recap
of
what
I
envisioned
and
achieved.
A
Will
be
here,
you
can
see
my
vs
code
right,
okay,
so
the
application
is
already
deployed.
Let
me
show
you
the
tests.
First,
oh
sorry,
that's
the
one.
I
have
written
a
unit
test
for
both
of
the
contracts.
A
And,
as
you
will
see
in
a
minute
that
these
tests
pass,
as
you
can
see
here,
one
contract
passes.
C
A
Let's
create
a
data
set
called
t
with
this
command.
A
B
Can
you
walk
us
through
some
of
the
code
and
and
the
interface
of
the
contract
and
some
of
the
the
details
of
the
implementation
that
would
be
great.
Okay,
looks
like
you
have
two
two
contracts
right.
A
Yes,
I
have
two
contracts.
Let's
start
at
the
data
set
because
that's
the
kind
of
basic
one,
that's
the
simple
one.
So
in
the
model
I
have
this
data
set.
A
A
So
that's
how
this
works
and
the
interface
just
delegates
most
of
these
calls
to
the
dataset
class
and
also
makes
assertions
which
have
to
be
met.
A
A
These
are
pretty
basic
unit
tests
so,
for
instance,
the
unit
test
for
the
creation
is
here.
I
don't
know
if
I
should
explain
anything.
It
just
initializes
an
object
and
then
gets
some
settings
and
checks
that
they
are
correctly
set.
B
B
A
Okay,
so
the
other
contract
is
this
analytics,
which
also
has
a
model.
This
is
somewhat
simpler,
so
there's
no
logic
in
this
models.ts
file.
A
A
Which
has
similar
public
methods
as
the
dataset
contract,
so
the
init
is
quite
similar,
and
also
there
is
the
interesting
part.
Is
this:
create
data
set.
A
So
yeah,
that's
how
we
create
a
data
set
and,
for
instance
later
when
we
add
data,
then
after
the
assertions
we
have
this
data
set
api
class
and
call
its
method
which
which,
which
is
here
and,
for
instance,
the
add
element
method,
looks
like
this.
A
B
A
B
Yeah,
it's
like
a
like
a
validating
proxy
or
permission
proxy,
or
something
like
that.
Yeah
yeah
makes
sense.
That's
great!
Thank
you.
This
is
enough
detail,
I
think,
for
anybody
to
take
a
look
at
the
source
code
and
get
a
good
orientation
and
dig
into
the
details
themselves.
That's
what
I
was
hoping
for
we're
also
at
about
12
minutes
right
now,
so
per
demo.
That's
that's
what
we're
trying
to
keep
it
up.
Thank
you.
C
B
A
Just
that,
if
you
are
interested
in
more
detail,
then
I
have
created
a
in
my
opinion,
pretty
good
documentation
to
this
project.
So
you
can
take
a
look
at
that.
A
B
Yeah,
that's
great.
I
really
appreciate
the
standard
to
which
you've
held
this
presentation
repository.
You
know
compared
with
the
examples
that
we
have.
That's
that's
terrific,
thank
you
so
much
so
any
questions
for
bellas.