Skip to content

Instantly share code, notes, and snippets.

@SaifRehman
Created March 13, 2018 19:40
Show Gist options
  • Save SaifRehman/64f9f54fa00e3d5683c435ed89b88806 to your computer and use it in GitHub Desktop.
Save SaifRehman/64f9f54fa00e3d5683c435ed89b88806 to your computer and use it in GitHub Desktop.
Lotion/tendermint Blockchain server
let app = require('lotion')({
lotioPort: 3000,
tendermintPort: 46657,
initialState: { messages: [] },
devMode: true
})
app.use((state, tx) => {
if (typeof tx.sender === 'string' && typeof tx.message === 'string') {
state.messages.push({ sender: tx.sender, message: tx.message })
}
})
app.listen(3000).then(function (data) {
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment