A hook for sails.js which handles parsing and instantiation of contracts on Ethereum based consensus networks via truffle.

Installing the Hook

On existing Sails & Truffle projects:

Copy contracts folder and truffle.js (or truffle-config.js depending on which your project is using) from your truffle project into the sails project. In your sails project, run npm install -s sails-hook-truffle

If your contract's filename is ContractName.sol :

on the server side you can interact with your contract using:

sails . ContractName . deployed ( ) . then ( ( contractName ) => { } )

on the clientSide: