Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View itzmeanjan's full-sized avatar
😎
Working ...

Anjan Roy itzmeanjan

😎
Working ...
View GitHub Profile
@itzmeanjan
itzmeanjan / index.js
Last active April 9, 2021 10:10
Polygon DA Faucet : Give away test tokens for paying tx fees in Data Availability Chain
const { ApiPromise, WsProvider, Keyring } = require('@polkadot/api')
// ❌ Never use this phrase in production
const PHRASE = process.env.DA_FAUCET_PHRASE || '<get-yourself-one>'
const URL = process.env.DA_URL || 'ws://127.0.0.1:8000'
const AMOUNT = 1_000_000_000
const RECEIVER = '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY'
const transferBalance = (api, faucet, receiver, amount, waitForFinalization = true) => new Promise(async (res, rej) => {
try {
@itzmeanjan
itzmeanjan / catch.py
Last active May 28, 2021 21:57
Polygon ( aka Matic Network ) Mempool Exploration
#!/usr/bin/python3
from python_graphql_client import GraphqlClient
from json import dumps
from asyncio import run
from re import compile as re_compile
from pytimeparse import parse
reg = re_compile(r'^(\d+(\.\d+)?)')
handle = None
@itzmeanjan
itzmeanjan / requirements.txt
Created July 10, 2021 03:01
Random Linear Network Coding - A simulation
numpy==1.20.3
galois==0.0.17
@itzmeanjan
itzmeanjan / decoder.py
Created July 14, 2021 16:09
On the Fly Network Coding: A Protocol Simulation
#!/usr/bin/python3
from typing import List, Tuple
from prime_ring import PrimeRing
from galois import GF
class Decoder:
def __init__(self, target_rank: int) -> None:
self._target_rank = target_rank
@itzmeanjan
itzmeanjan / rlnc_using_ga.ipynb
Last active July 23, 2021 15:20
Using Genetic Algorithm for Random Linear Network Coding ( RLNC )'s cost-over-wire Optimisation
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@itzmeanjan
itzmeanjan / missing_plasma_deposit_finder.py
Created July 27, 2021 14:15
Missing Plasma Deposit Transactions Finder - An attempt to find reportedly missing Plasma State Syncs on Polygon
#!/usr/bin/python3
from requests import post
def find_missing_depositBlockIds():
url = 'https://mainnet.infura.io/v3/<project-id>'
from_ = 10_167_767
to_ = from_ + 1_000
stop_ = 12_908_120
@itzmeanjan
itzmeanjan / recovery.rs
Last active February 25, 2022 12:50
Reed Solomon Erasure Coded Data Recovery with (I)FFT
use dusk_plonk::fft::EvaluationDomain;
use dusk_plonk::prelude::BlsScalar;
mod utils {
use dusk_plonk::fft::EvaluationDomain;
use dusk_plonk::prelude::BlsScalar;
use rand::rngs::StdRng;
use rand::{Rng, SeedableRng};
use std::time::{SystemTime, UNIX_EPOCH};
@itzmeanjan
itzmeanjan / go.mod
Created August 9, 2021 09:58
Erasure Coded Storage Cluster with Random Linear Netork Coding --- simulated using `kodr`
module rlnc_in_storage
go 1.16
require github.com/itzmeanjan/kodr v0.2.0
@itzmeanjan
itzmeanjan / Cargo.toml
Created August 11, 2021 12:07
IPLD + Polygon Avail --- Exploration
[package]
name = "avail-ipld"
version = "0.1.0"
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
libipld = {version = "0.12.0", features = ["unleashed"]}
multihash = "0.14.0"
@itzmeanjan
itzmeanjan / matrix_transpose.glsl
Created August 29, 2021 07:06
😎 Computing Matrix Transpose in Parallel on GPGPU, using Vulkan Compute API 🔥
#version 450
#pragma shader_stage(compute)
layout(local_size_x = 32, local_size_y = 1, local_size_z = 1) in;
layout(set = 0, binding = 0) buffer matrix_block {
int[1024][1024] matrix;
};
void main() {