GithubHelp home page GithubHelp logo

tick-tock-example's Introduction

Tick-Tock

This project is an example of how to use a permissioned asset in CodeChain.

How to run

  • Create dev/production.json
  • and
NODE_ENV=production yarn start

What Tick-Tock needs

  • Tick-Tock needs a platform address.
    • This address is a payer. So it should have enough CCC to executes transactions.
  • Tick-Tock needs a CodeChain node to use RPC.

What Tick-Tock creates

  • Tick-Tock creates 60 asset addresses.
    • They will be used to represent the time. In other words, the user[4] would be the user who represents 4 hours, 4 minutes, 4 seconds.
  • Tick-Tock creates 3 platform addresses.
    • These addresses are used as an approver of hands.
  • Tick-Tock creates a shard.
    • The assets are minted on this shard.
  • Tick-Tock mints 3 assets.
    • They are clock hands. Each asset means an hour hand, minute hand and second hand.
    • The platform addresses created in the previous step will be used as an approver of the hands.
  • The addresses and the shard id are saved on files(.users, .shard, .approvers), but the minted assets are not back up.
  • So Tick-Tock mints new assets every time it starts.

What Tick-Tock does

  • Every second, Tick-Tock moves the second hand to the current second user.
  • If the minute has changed, Tick-Tock also moves the minute hand.
  • The same way works for the hour hand.
  • Tick-Tock creates a transaction with insufficient approvals randomly. This transaction will not move the clock hands.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.