HiveSmartContracts Mirror
Go to file
cryptomancer ccab16bb2c fix totalEnabledApprovalWeight calculation again 2024-03-10 05:56:39 +00:00
.github/workflows Merge branch 'qa' into node-20-support 2024-02-18 22:16:15 -06:00
benchmarks upgraded from dsteem to dhive library to prepare for HF24 2020-09-01 01:26:06 +00:00
contracts fix totalEnabledApprovalWeight calculation again 2024-03-10 05:56:39 +00:00
libs set trigger block number for consensus changes to Hive block 83680408 (Saturday March 16, 2024, 2 am UTC) 2024-02-20 02:35:47 +00:00
plugins Remove error caused by block api fetch fail 2024-02-20 17:44:25 +01: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 Fix tests 2024-03-02 23:40:52 -06: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
README.md 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 fixed example config 2024-02-20 04:59:22 +01:00
find_divergent_block.js Merge pull request #41 from Rishi556/update-to-dual-rpc 2024-02-13 10:09:53 -05:00
package-lock.json bump version number up to 2.0.1 2024-02-24 04:00:50 +00:00
package.json Test suite will fail when it.only present 2024-03-02 23:46:13 -06:00
restore_partial.js add trailing slash to primary hive node 2024-02-13 10:08:59 -05: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 witness register being set to false 2023-07-12 02:37:52 -05:00

README.md

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: https://github.com/hive-engine/hivesmartcontracts-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