Skip to content

Instantly share code, notes, and snippets.

View Vishwas1's full-sized avatar
🎯
Focusing

Vishwas Anand Bhushan Vishwas1

🎯
Focusing
View GitHub Profile
@Vishwas1
Vishwas1 / poll_timer.js
Last active July 8, 2019 04:29
Reactive programming polling
const { from, timer } = require('rxjs');
const fetch = require('node-fetch');
const getTimeFromAPI = () => {
return fetch('http://worldclockapi.com/api/json/est/now')
.then((resp) => resp.json())
}
// Observer timer and subscribe
@Vishwas1
Vishwas1 / introrx.md
Created July 3, 2019 06:14 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@Vishwas1
Vishwas1 / zagg-node-sync-problem.md
Last active June 10, 2019 07:09
Zagg multi node sync problem and possible solutions

Zagg multi node sync problem and possible solutions

Problem :

Zagg multi node sync (for bitcoin blocks) won’t work since we were not making level dbs sync to each other.

  • Setup 2 node zagg network using stellar’s configurations
  • Throw transaction with Account Marker operation (for bitcoin transaction HEX) over one of the node.
  • The operation has to go through validation from Bitcoin code base using doValidate() of the operation.
  • After getting all the operations validated, the transaction goes into mPendingTransaction (which is nothing but memepool for stellar.)

Find unspents

listunspents

[...]

Create Transaction

As you can see network is running

CONTAINER ID        IMAGE                               COMMAND                  CREATED             STATUS              PORTS                                                                    NAMES
b33ee58cff04        hyperledger/fabric-peer:1.4.0       "peer node start --p…"   2 minutes ago       Up 2 minutes        0.0.0.0:7151->7051/tcp, 0.0.0.0:7152->7052/tcp, 0.0.0.0:7153->7053/tcp   peer0.org2.hurley.lab
4e5f88113b8c        hyperledger/fabric-peer:1.4.0       "peer node start --p…"   2 minutes ago       Up 2 minutes        0.0.0.0:7051-7053->7051-7053/tcp                                         peer0.org1.hurley.lab
e486d8bb7d29        hyperledger/fabric-couchdb:0.4.14   "tini -- /docker-ent…"   2 minutes ago       Up 2 minutes        4369/tcp, 9100/tcp, 0.0.0.0:5184->5984/tcp                               couchdb.peer0.org2.hurley.lab
cb3d0de40305        hyperledger/fabric-ca:1.4.0         "fabric-ca-server st…"   2 minutes ago       Up 2 minutes        0.0.0.0

Hurl

  • hurl is a tool create hyperledger easily. Its just a wrapper over native HL fabric.
  • Analogy to hurl could be Ganache.
  • After network creation via hurl, we can see the configurations files in the folder:

Install Hurl

sudo npm install -g @worldsibu/hurley --unsafe-perm=true

Initial setup

Bitcoin setup

sudo apt-get install build-essential libtool autotools-dev automake pkg-config bsdmainutils python3

sudo apt-get install libssl-dev libevent-dev libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev

Setup Zagg-core

#Introduction

Developing Chrome Extensions is REALLY fun if you are a Front End engineer. If you, however, struggle with visualizing the architecture of an application, then developing a Chrome Extension is going to bite your butt multiple times due the amount of excessive components the extension works with. Here are some pointers in how to start, what problems I encounter and how to avoid them.

Note: I'm not covering chrome package apps, which although similar, work in a different way. I also won't cover the page options api neither the new brand event pages. What I explain covers most basic chrome applications and should be enough to get you started.

Table of Contents

  1. Understand the Chrome Architecture
  2. Understand the Tabs-Extension Relationship
  3. Picking the right interface for the job

Paxos

Proposor----+---+---------------^---------------+---+-----------------^----^------------
/Acceptor   |   |               |               |   | ACCEPT(s1,X)    |    |
            |   |PREPARE(s1)    |               |   |                 |    v 
Acceptor ---v---|-----------^---|---------------|---v-----------------|------------------
                |           |   |PROMISE(s1)    |                     |    ^ ACCEPTED(s1,X)
                |           |   |               |                     |    |
Acceptor -------v-----------+---+---------------v---------------------v----v--------------

+++ authors = ["vishwasbhushan"] categories = ["Blockchain"] date = "2019-02-25T10:00:00+05:30" description = "In this blog I am talking about how did we debug and fix build issue when we tried to integrate Stellar and Bitcoind code bases" tags = ["blockchain", "stellar", "bitcoin", "autotools", "c++", "automake", "autoconf", "build"] title = "Debugging Stellar and Bitcoin code bases integration build issue!" +++

Introduction