Skip to content

Instantly share code, notes, and snippets.

View nodech's full-sized avatar

Nodar Chkuaselidze nodech

  • Tbilisi, Georgia
View GitHub Profile

Keybase proof

I hereby claim:

  • I am nodar-chkuaselidze on github.
  • I am nodech (https://keybase.io/nodech) on keybase.
  • I have a public key ASDzV1EkeecSAKDssAKgkQBg6-mSKKFyV5xwWxMpqnKtcAo

To claim this, I am signing this object:

@nodech
nodech / config.toml
Created August 3, 2017 15:59
Ethermint Config flags to TOML
[Eth]
NetworkId = 1 #
SyncMode = "fast" #
LightPeers = 20 #
DatabaseCache = 128 # --cache
GasPrice = 18000000000 # --gasprice
EthashCacheDir = "ethash" #
EthashCachesInMem = 2 #
EthashCachesOnDisk = 3 #
EthashDatasetDir = "/Users/nd/.ethash" #
@nodech
nodech / index.js
Last active February 13, 2022 18:48
BCOIN - Example: Get Entry, Block, Tx from chain
'use strict';
const bcoin = require('bcoin');
const Chain = bcoin.chain;
const Logger = bcoin.logger;
const util = bcoin.util;
let logger = new Logger({
level: 'debug',
});
@nodech
nodech / simulate.js
Created September 4, 2017 22:53
Monty Hall Problem (Paradox)
const percent = (a, b) => {
return (a / b * 100).toFixed(2);
}
const getRandomIndex = (n) => {
return Math.floor(Math.random() * n);
};
const getRandomNumbers = (n) => {
const arr = new Array(n);
const Leveldown = require('leveldown');
const async = require('async');
const KEYS = 10000;
const options = {
createIfMissing : true,
errorIfExists : false,
compression : true,
cacheSize : 8 << 20,
'use strict';
const fs = require('fs');
const bcoin = require('bcoin');
const secp256k1 = bcoin.secp256k1;
const KeyRing = bcoin.keyring;
const PublicKey = bcoin.hd.PublicKey;
const HID = require('node-hid');
@nodech
nodech / Mine-Max-Block.js
Created May 16, 2018 22:09
Mine maximum block
it('should mine a big block', async () => {
const OPRETURN = Script.fromNulldata(Buffer.alloc(70, 1));
const start = chain.height - 2000;
const end = chain.height - 200;
const job = await cpu.createJob();
const maxSigops = consensus.maxBlockSigops(consensus.MAX_FORK_BLOCK_SIZE);
const perTxSigops = Math.floor((maxSigops - 1000) / 1801) - 2;
const perTxSize = Math.floor(consensus.MAX_FORK_BLOCK_SIZE / 1801);
// fill max tx
// copyright (c) 2018 the bitcoin developers
// distributed under the mit software license, see the accompanying
// file copying or http://www.opensource.org/licenses/mit-license.php.
#include "test/test_bitcoin.h"
#include "policy/policy.h"
#include "script/interpreter.h"
#include <boost/test/unit_test.hpp>
@nodech
nodech / tx-less100bytes.js
Created October 18, 2018 10:54
Create transaction less than 100 bytes.
'use strict';
const assert = require('assert');
const bcash = require('..');
const {Stack, Script, Address} = bcash;
const {MTX, Outpoint, Input} = bcash;
const network = 'regtest';
// fill after receive receiving