Skip to content

Instantly share code, notes, and snippets.

View bogatyy's full-sized avatar
🚀

Ivan Bogatyy bogatyy

🚀
View GitHub Profile
@bogatyy
bogatyy / ethereum_pool.json
Created July 6, 2021 21:59
Example miningcore Ethereum pool config
{
"logging": {
"level": "info",
"enableConsoleLog": true,
"enableConsoleColors": true,
"logFile": "",
"logBaseDirectory": "",
"perPoolLogFile": false
},
"banning": {
@bogatyy
bogatyy / extract_top_peers.py
Created June 30, 2021 22:46
Extract top peers
from collections import defaultdict
GETH_LOGFILE = 'geth-log.txt'
def extract_parameter(source_str, before_str, after_str):
start_pos = source_str.find(before_str) + len(before_str)
return source_str[start_pos:source_str.find(after_str, start_pos)]
@bogatyy
bogatyy / geth_p2p.patch
Created June 30, 2021 22:26
geth_p2p.patch
diff --git a/eth/fetcher/block_fetcher.go b/eth/fetcher/block_fetcher.go
index 3177a877e..6b77b3e58 100644
--- a/eth/fetcher/block_fetcher.go
+++ b/eth/fetcher/block_fetcher.go
@@ -97,6 +97,9 @@ type chainInsertFn func(types.Blocks) (int, error)
// peerDropFn is a callback type for dropping a peer detected as malicious.
type peerDropFn func(id string)
+// peerStatsUpdateFn is a callback type for reporting peer events for stats update.
+type peerStatsUpdateFn func(peer string, event string)

Keybase proof

I hereby claim:

  • I am bogatyy on github.
  • I am bogatyy (https://keybase.io/bogatyy) on keybase.
  • I have a public key ASDGBlJ6ivkzQFAtjKcvQ7nUuj3gQdR83LolcBxVXfkGaQo

To claim this, I am signing this object:

def handle_transaction(tx):
# if(tx[u'to'] == KITTY_AUCTION):
# kitty_frontrun(tx)
if (tx[u'to'] == KITTY_CORE_CONTRACT):
kitty_instabid(tx)
def kitty_instabid(tx):
if (get_tx_method(tx) == CREATE_SALE_AUCTION):
@bogatyy
bogatyy / get_transaction.py
Created August 17, 2017 19:41
Downloads transaction info using Ethereum client API in Python
$ pip install requests
$ python
import json
import requests
def get_transaction(tx_hash):
url = 'http://localhost:8545'
headers = {'content-type': 'application/json'}
request = {
@bogatyy
bogatyy / bash_curl
Last active August 17, 2017 13:16
Using curl to inspect transactions
$ curl -X POST --data \
'{"jsonrpc":"2.0","method":"eth_getTransactionByHash", \
"params":["0x314e0246cfc55bc0882cbf165145c168834e99924e3ff7619ebd8290e713386d"], \
"id":123}' localhost:8545
{"jsonrpc":"2.0","id":123, "result":{
"blockHash":"0x42ea1578c23b159186853961dfbdfcdec6b40d23d8f1d971827412bc6948386b",
"blockNumber":"0x3dfb88",
"From":"0xcaf82fcb3a0323566c0f306684376e3e66d6284b",
# this is the Bancor Purchase contract address
@bogatyy
bogatyy / gist:ff38f2623de5eba67ae20f0703c8f09f
Created July 13, 2017 19:56
UberToken ERC-20, lost 1 ETH forever
pragma solidity 0.4.13;
contract UberToken {
string public constant name = "IC3 2017 bootcamp UberToken";
string public constant symbol = "UT3";
uint8 public constant decimals = 18;
uint256 public total_supply;
mapping(address => uint256) public balances;