TAGS

rapid-box

CREATED

UPDATED

STARS

INSTALL

...

REPOSITORY
GitHub Download
Please wait: Fetching readme...

b"# Rapid Box\nA quick start truffle box to host REST APIs interacting with Smart Contracts.\n\n## Key features\nRapid Box allows your to focus on development of your Smart Contracts and exposing them through an API service, without spending time bridging Contract ABIs into your Express project.\n\n- The box takes care of auto-loading Truffle Contract definitions into the `Contracts` helper.\n- The `Contracts` helper also exposes the `web3` object for RPC operations like `getAccounts`.\n- Server start accepts RPC endpoint as a parameter making it easy to switch between environments.\n\n#### Example\nExposing an endpoint to get value from SimpleStorage.\n```\n// Contracts helper\nconst Contracts = require('./app/contracts.js');\n\n...\n// Get storage contract value\napp.get('/storage', function (req, res) {\n Contracts.SimpleStorage.deployed().then(function (instance) {\n instance.get.call().then(function (value) {\n res.json({\n value: value\n });\n });\n });\n});\n```\n\n### Setup\nTo unbox to your workspace.\n```\ntruffle unbox hexeight/rapid-box\n```\n### Development\nContinue to use truffle as usual ;)\n```\n Compile contracts: truffle compile\n Migrate contracts: truffle migrate\n Test contracts: truffle test\n Run server: npm start -- --rpc \n```\n\n### Run\nTo run the API service, the RPC endpoint parameter is required. This allows switching RPC endpoints during development.\n\nFor example:\n```\n# Note that npm start requires the extra -- to different between npm arguments and your script arguments.\nnpm start -- --rpc http://localhost:8545\nOR\nnode server.js --rpc http://localhost:8545\n```\n\n#### Feedback\nFeel free to send in pull-requests and raise issues with any feedback.\n"