Skip to content

Instantly share code, notes, and snippets.

@SaifRehman
Created April 3, 2018 12:32
Show Gist options
  • Save SaifRehman/f969375445686bee95a9a7dee7811230 to your computer and use it in GitHub Desktop.
Save SaifRehman/f969375445686bee95a9a7dee7811230 to your computer and use it in GitHub Desktop.
node0
require('dotenv').config({path: ".env-node1"});
let lotion = require('lotion')
let app = lotion({
genesis: './genesis.json',
tendermintPort: 30090,
initialState: { messages: [] },
p2pPort: 30092,
logTendermint: true,
keys: 'privkey0.json',
peers: ['159.122.175.154:30092']
})
app.use((state, tx,chainInfo) => {
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