Skip to content

Instantly share code, notes, and snippets.

View SaifRehman's full-sized avatar
🎯
Focusing

SaifRehman SaifRehman

🎯
Focusing
  • IBM
  • Dubai
View GitHub Profile
@SaifRehman
SaifRehman / lotion.js
Created March 13, 2018 19:40
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 })
}
@SaifRehman
SaifRehman / config.ts
Created March 13, 2018 20:08
config file
export class config {
public static baseUrl = "http://tendermint-spiteless-oiliness.mybluemix.net";
public constructor() {
}
}
@SaifRehman
SaifRehman / genesis.json
Created March 30, 2018 19:47
Genesis file
{
"genesis_time": "0001-01-01T00:00:00Z",
"chain_id": "name",
"validators": [
],
"app_hash": ""
}
@SaifRehman
SaifRehman / genesis.json
Created April 3, 2018 11:49
genesis file
{
"genesis_time": "0001-01-01T00:00:00Z",
"chain_id": "name",
"validators": [
],
"app_hash": ""
}
{
"address": "48CF851B54FBDB736E32F740CD8ECFCFEAF58E50",
"pub_key": {
"type": "ed25519",
"data": "BD39BBBCC93A9EA63A0E40240FB469CD81A2AE379F446B542AFF074388216CD0"
},
"last_height": 0,
"last_round": 0,
"last_step": 0,
"last_signature": null,
@SaifRehman
SaifRehman / cleanedPrivkey.json
Created April 3, 2018 11:58
cleaned private key
{
"address": "48CF851B54FBDB736E32F740CD8ECFCFEAF58E50",
"pub_key": {
"type": "ed25519",
"data": "BD39BBBCC93A9EA63A0E40240FB469CD81A2AE379F446B542AFF074388216CD0"
},
"priv_key": {
"type": "ed25519",
"data": "3823959590D293D163AA79AD6F7EDEFAC2C46DC9D5A7967C3C2D98A6C030A1C4BD39BBBCC93A9EA63A0E40240FB469CD81A2AE379F446B542AFF074388216CD0"
}
@SaifRehman
SaifRehman / privkey1.json
Created April 3, 2018 12:04
private key 1
{
"address": "00BD81174C79F0F1B758EE31690EAAE0779AC71C",
"pub_key": {
"type": "ed25519",
"data": "68071247D4F63CF84C16B16B6700F34CAA5BB3DECAE0D527827CD1D77D57E1C6"
},
"priv_key": {
"type": "ed25519",
"data": "AC94CAB2A274FAC2862548D08E620DA8C04ED8CAFDA3AEFC9F64EE750D4B23D368071247D4F63CF84C16B16B6700F34CAA5BB3DECAE0D527827CD1D77D57E1C6"
}
{
"genesis_time": "0001-01-01T00:00:00Z",
"chain_id": "name",
"validators": [
{
"pub_key": {
"type": "ed25519",
"data": "BD39BBBCC93A9EA63A0E40240FB469CD81A2AE379F446B542AFF074388216CD0"
},
"power": 10,
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']
@SaifRehman
SaifRehman / Dockerfile
Created April 3, 2018 12:35
dockerfile
FROM node:carbon
WORKDIR /usr/src/app
COPY package*.json ./
COPY privkey0.json ./
COPY .env-node1 ./
RUN npm install
COPY . .
EXPOSE 30090 30092
CMD [ "node", "node1.js" ]