Skip to content

Instantly share code, notes, and snippets.

@SaifRehman
Created April 3, 2018 13:21
Show Gist options
  • Save SaifRehman/09fb90b8ae2d37b5bc0b95a85f75908f to your computer and use it in GitHub Desktop.
Save SaifRehman/09fb90b8ae2d37b5bc0b95a85f75908f to your computer and use it in GitHub Desktop.
frontendNode.ts
let app = require('lotion')({
genesis: './genesis.json',
initialState: { messages: [] },
tendermintPort: 46657,
logTendermint: true,
peers: ['ws://159.122.175.154:30092','ws://184.173.1.108:30092']
})
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(({ GCI }) => {
console.log(GCI)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment