Git Product home page Git Product logo

steemsmartcontracts's Introduction

Hive Smart Contracts Build StatusCoverage Status

1. What is it?

Hive Smart Contracts is a sidechain powered by Hive, it allows you to perform actions on a decentralized database via the power of Smart Contracts.

2. How does it work?

This is actually pretty easy, you basically need a Hive account and that's it. To interact with the Smart Contracts you simply post a message on the Hive blockchain (formatted in a specific way), the message will then be catched by the sidechain and processed.

3. Sidechain specifications

  • run on node.js
  • database layer powered by MongoDB
  • Smart Contracts developed in Javascript
  • Smart Contracts run in a sandboxed Javascript Virtual Machine called VM2
  • a block on the sidechain is produced only if transactions are being parsed in a Hive block

4. Setup a Hive Smart Contracts node

see wiki: https://github.com/hive-engine/steemsmartcontracts-wiki

In addition, the following is needed to use transaction framework for MongoDB:

Also, if using PM2, you will need to start the process with --no-treekill for proper shutdown. Also consider using --no-autorestart with proper monitoring to minimize noise and potential for problematic looping (though with transactions there is less risk of data corruption). Another oddity with PM2 is that you may need to clear node processes after a stop if the process does not terminate on its own. Otherwise it will interfere with logging.

E.g.

pm2 start app.js --no-treekill --kill-timeout 10000 --no-autorestart

DB Backup and Restore

Backup current state (track current hive blpck in config)

mongodump -d=hsc --gzip --archive=hsc_50287280.archive

Restore state

mongorestore --gzip --archive=hsc_50287280.archive

Edit config.json to match block number of backup.

5. Tests

  • npm run test

6. Usage/docs

steemsmartcontracts's People

Contributors

ali-h avatar bt-cryptomancer avatar donchate avatar eonwarped avatar harpagon210 avatar rishi556 avatar sourovafrin avatar

Watchers

 avatar

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.