Skip to content

Instantly share code, notes, and snippets.

View cculianu's full-sized avatar

Calin Culianu cculianu

View GitHub Profile
{
"version": {
"major": 0,
"minor": 1,
"patch": 0
},
"latestRevision": "2023-03-02T13:18:32.912Z",
"registryIdentity": {
"name": "Calin Cash",
"description": "This token represents Calin",
@cculianu
cculianu / bench_hashing.py
Last active December 16, 2020 21:24
Benchmark recursive hashing vs current E-X approach
#!/usr/bin/env python3
import hashlib
import random
import time
from typing import List
def make_random_history(count: int) -> List[bytes]:
@cculianu
cculianu / namespace_example.cpp
Last active September 8, 2020 06:17
Example for namespaces for discussion in cppreference.com wiki
namespace A {
constexpr int i = 2;
}
namespace B {
constexpr int i = 3;
int j;
namespace C {
namespace D {
using namespace A; // all names from A injected into D
int j;
@cculianu
cculianu / quick_dirty_bench_bchn_abc.md
Last active May 5, 2020 08:53
How to run the BCHN vs ABC benchmarks quick and dirty guide

Quick and Dirty Guide to Running the ABC vs BCHN Mining Benchmarks

This is in reference to the results published here: https://old.reddit.com/r/btc/comments/gdlapl/bchn_now_40_faster_at_mining_than_abc/

The benchmarks were thrown together quickly for me to characterize our progress. As such, these instructions are for advanced users. I am posting these instructions in the interests of transparency and so you can "see for yourself". These instructions assume Linux or OSX and do not work on Windows, as far as I know.

Requires: python3, cmake, ninja, boost, and libbdbdev. I forget what these are called on Linux packages -- consult our docs about how to build and requirements.

  1. Clone my BCHN repo:
@cculianu
cculianu / gbtl-presser.md
Last active May 4, 2020 19:24
Bitcoin Cash Node Technical Bulletin May 4, 2020

Bitcoin Cash Node Technical Bulletin

Date: May 4, 2020 Author: Calin Culianu calin.culianu@gmail.com


GetBlockTemplate Light

In order to provide the most efficient mining RPCs, we have implemented the getblocktemplatelight RPC which is popular amongst various mining pools such as BTC.COM and others.

#include <vector>
#include <iostream>
#include <iomanip>
#include <thread>
#include <atomic>
#include <mutex>
#include <condition_variable>
#include <memory>
int main(int argc, char *argv[])
@cculianu
cculianu / gist:97659fe38ba0b5c91a928e9ca28d8e82
Last active June 17, 2019 18:42
Protocol commands/features needed by Electron Cash if it were to switch to bchd

Protocol Commands bchd Needs to Implement for Electron Cash to Switch

Hi, Calin here. I noticed bchd is almost there with respect to featureset.

I'd very much like to switch Electron Cash over to bchd as its wallet service/backend/data provider and move away from ElectrumX for basically two reasons:

  • The maintainer is antagonistic towards BCH
  • ElectrumX (and the version we maintain, Electron X) has serious performance and scaling issues because it is written in Python
#!/usr/bin/env python3
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
def _(x): return x
# taken from qt/util.py
class MessageBoxMixin(object):