This system is an autonomous NEM account that manages the crowdfunding of NEM supernodes. This project was made for the NEM Global Hackaton 2018.
Access NEM Supernodes Crowdfunding website to use this application.
- Clone this repo
- Run: npm install
- Rename file src/app/config.ts.bkp to src/app/config.ts
- Edit src/app/config.ts:
- Configure the network and active supernode variables
- Configure mongodb connection variables
- Configure app signature key variable
- Run: tsc
- Run: npm run mongo-install
- Open your mongo blocks_service collection and set block.first and block.last to the same block number you want to start tracking
- Create a multisigned account to serve as your supernode account, do some transactions to get a public key.
- Open your mongo supernodes collection and set all variables of your supernode account
After compiling the code with the tsc command, you can run the following services on the ./scripts directory:
Reads every block and adds it to mongo db server. All transactions are analysed on the database, not relying on sockets incoming transactions for now.
Analyses new blocks searching for incoming transactions for the supernode account, and creates payments or messages actions according to each transaction.
Announces each payment to the supernode account, splits transactions if needed, control balances, locks and unlocks supernodes accounts.
Confirms outgoing payments that were waiting to be signed
Map all the accounts holding XSN to distribute profits and for community representative decision.
Sends profits distribution payments to all XSN holders