Skip to content

Instantly share code, notes, and snippets.

View TanjinAlam's full-sized avatar

Md Tanjin Alam TanjinAlam

View GitHub Profile
@TanjinAlam
TanjinAlam / docker-compose.yml
Created February 17, 2024 10:30 — forked from ftmoose/docker-compose.yml
MongoDB ReplicaSet Docker Configuration
version: "3.1"
# Our containers
services:
# Temporary container used to initialize the replica set
mongo-setup:
container_name: mongo-setup
image: mongo
restart: on-failure
networks:
@TanjinAlam
TanjinAlam / bitcoin-merkle-proofs.js
Created December 24, 2022 09:00 — forked from eddmann/bitcoin-merkle-proofs.js
Bitcoin Internals: Verifying Merkle Roots using Merkle Proofs in JavaScript
const fetchLatestBlock = () =>
fetch(`https://blockchain.info/q/latesthash?cors=true`)
.then(r => r.text());
const fetchMerkleRootAndTransactions = block =>
fetch(`https://blockchain.info/rawblock/${block}?cors=true`)
.then(r => r.json())
.then(d => [d.mrkl_root, d.tx.map(t => t.hash)]);
const random = arr =>