HiveSmartContracts Mirror
Go to file
Evan Chou 2d4fea05a4 fix linter 2021-01-27 15:44:43 +01:00
benchmarks upgraded from dsteem to dhive library to prepare for HF24 2020-09-01 01:26:06 +00:00
contracts linter fix 2021-01-25 05:36:08 +00:00
libs fix linter 2021-01-27 15:44:43 +01:00
plugins fix linter 2021-01-27 15:44:43 +01:00
scripts moving to mongodb storage 2019-06-03 18:36:11 -05:00
snapshot added snapshots for Blurt 2020-05-20 06:06:00 +00:00
test fix witness approval when staking to different user 2021-01-25 05:34:53 +00:00
.env.example fixes to witness contract amd tests 2021-01-10 13:34:23 +00:00
.eslintignore hive engine prep 2020-03-24 19:33:45 -05:00
.eslintrc initial commit 2018-06-27 16:40:05 -05:00
.gitignore improving p2p security 2019-07-04 15:35:06 -05:00
.npmrc fix tests, enforce node/npm version 2020-03-21 15:47:03 -05:00
.travis.yml run eslint on commit 2019-11-14 16:09:10 -06:00
LICENSE initial commit 2018-06-27 16:42:30 -05:00
README.md Update README.md 2021-01-15 09:20:11 +08:00
app.js fix witness stake approvals habdling unstake 2021-01-19 09:43:28 +00:00
app.pm2.json hive engine prep 2020-03-24 19:33:45 -05:00
compare_data.js revert local changes to compare script 2021-01-18 05:12:57 +00:00
config.json Merge origin/replayTweaksCompare and move logging of average node time to one place. 2021-01-23 13:43:56 +01:00
find_divergent_block.js fix linter 2021-01-27 15:44:43 +01:00
package-lock.json bump version number up to 1.0.0 2021-01-17 23:43:17 +00:00
package.json bump version number up to 1.0.0 2021-01-17 23:43:17 +00:00
sync_hashes.js fix linter 2021-01-27 15:44:43 +01:00
update_node.sh adding steempegged contract, fixing some bugs, reinforcing tokens' security 2019-02-12 09:54:12 -06:00
witness_action.js fix linter 2021-01-27 15:44:43 +01:00

README.md

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