Skip to content

Instantly share code, notes, and snippets.

View pawanjay176's full-sized avatar

Pawan Dhananjay pawanjay176

  • India
  • 16:59 (UTC +05:30)
View GitHub Profile
@pawanjay176
pawanjay176 / keybase.md
Created September 12, 2019 05:57
Keybase

Keybase proof

I hereby claim:

  • I am pawanjay176 on github.

  • I am noahsark (https://keybase.io/noahsark) on keybase.

  • I have a public key ASBC8YnULgaWzCG6bh7FsBwHfHeCOYdfcH_YPH8hKd5wPQo

use futures::future::Future;
use libp2p_core::identity;
use libp2p_core::transport::Transport;
use libp2p_core::upgrade::{self};
use libp2p_core::Multiaddr;
use libp2p_noise::{Keypair, NoiseConfig, X25519};
use libp2p_tcp::TcpConfig;
use tokio::{self, io};
fn main() {
current block #2777296 | current block #2777361
Eth1Block(block_hash=HexBytes('0xb4b2435e3362b4c2203078e03237 | Eth1Block(block_hash=HexBytes('0x24dc90b71bc965177afdfd93968c
current deposit count: 578 current deposit count: 578
deposit count 7 at block #2759090 deposit count 7 at block #2759090
fetched 7 logs from block 2758066 to 2759090 fetched 7 logs from block 2758066 to 2759090
deposit count 7 at block #2760114 deposit count 7 at block #2760114
fetched 0 logs from block 2759090 to 2760114 fetched 0 logs from block 2759090 to 2760114
deposit count 8 at block #2761138 deposit count 8 at block #2761138
fetched 1 logs from block 2760114 to 2761138 fetched 1 logs from block 2760114 to 2761138
deposit count 10 at block #2762162 deposit count 10 at block #2762162
use eth1::http::get_deposit_logs_in_range;
use std::ops::Range;
use std::time::Duration;
const START_BLOCK: u64 = 2758066;
const END_BLOCK: u64 = 2783329;
const DEPOSIT_CONTRACT: &'static str = "0x42cc0FcEB02015F145105Cf6f19F90e9BEa76558";
const ENDPOINT: &'static str = "http://localhost:8545/";
#[tokio::main]
@pawanjay176
pawanjay176 / analysis.ipynb
Last active August 31, 2020 17:41
Missed attestation analysis
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
use ethabi::{param_type::Reader, Contract, Event, EventParam, Function, Param, ParamType};
fn parse_line(line: &str, abi: &mut Contract) {
if line.starts_with("function") {
parse_function(&line[9..], abi); // Exclude space after function
} else if line.starts_with("event") {
parse_event(&line[6..], abi); // Exclude space after event
} else {
panic!("Invalid signature");
}
@pawanjay176
pawanjay176 / apartment.py
Created March 4, 2023 15:13
Scrapes apartment listings on craigslist
# Usage: python3 apartment.py <RADIUS-FROM-YALETOWN>
import requests
DB_FILE = "db.txt"
# Because craigslist is dumb
def get_name(a, b, c):
if isinstance(a, list) and len(a) == 2 and a[0] == 6:
return a[1]
@pawanjay176
pawanjay176 / deposit.yaml
Last active May 16, 2024 14:09
deposit.yaml
id: pectra-massive-deposit1
name: "Massive deposit test deposits 1"
timeout: 672h
config:
#walletPrivkey: ""
depositContract: "0x4242424242424242424242424242424242424242"
slot: 34
tasks:
- name: check_clients_are_healthy
id: pectra-massive-deposit
name: "Massive deposit test"
timeout: 672h
config:
#walletPrivkey: ""
depositContract: "0x4242424242424242424242424242424242424242"
slot: 44
tasks:
- name: check_clients_are_healthy