HiveSmartContracts Mirror
Go to file
cryptomancer 4ff5d28100
Merge pull request #51 from Rishi556/fix-wa
Fix witness register being set to false
2023-07-12 16:42:58 +09:00
.github/workflows Remove Ubuntu 20 2023-06-25 02:15:18 -05:00
benchmarks upgraded from dsteem to dhive library to prepare for HF24 2020-09-01 01:26:06 +00:00
contracts Rename emit 2023-07-10 01:58:16 -05:00
libs Merge Fixes 2023-07-08 22:20:21 -05:00
plugins Merge Fixes 2023-07-08 22:20:21 -05:00
scripts moving to mongodb storage 2019-06-03 18:36:11 -05:00
snapshot remove steem references 2021-08-31 17:26:01 +00:00
test Rename emit 2023-07-10 01:58:16 -05:00
.env.example Adds domain to witness_action 2023-04-24 10:27:15 -05:00
.eslintignore Automated lint fixes 2023-06-01 16:45:16 -05:00
.eslintrc initial commit 2018-06-27 16:40:05 -05:00
.gitignore Move config to example file 2023-04-23 21:51:59 -05:00
.npmrc fix tests, enforce node/npm version 2020-03-21 15:47:03 -05:00
.travis.yml Use LTS nodejs on travis test 2021-10-25 12:24:36 -04:00
LICENSE initial commit 2018-06-27 16:42:30 -05:00 update build status 2021-08-31 17:27:56 +00:00
app.js adapt startup message when switching from light to full node 2022-11-16 17:19:59 +01: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.example.json Merge remote-tracking branch 'upstream/qa' into add-project 2023-05-16 19:52:54 -05:00
find_divergent_block.js Automated lint fixes 2023-06-01 16:45:16 -05:00
package-lock.json bump version number up to 1.10.0 2023-07-12 01:50:58 +00:00
package.json bump version number up to 1.10.0 2023-07-12 01:50:58 +00:00
restore_partial.js move light node config to own json node 2022-11-09 22:14:55 +01:00
sync_hashes.js fix linter 2021-01-27 15:44:43 +01:00 adding steempegged contract, fixing some bugs, reinforcing tokens' security 2019-02-12 09:54:12 -06:00
witness_action.js Fix witness register being set to false 2023-07-12 02:37:52 -05:00

Hive Smart Contracts Build 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:

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.


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