Skip to content

Instantly share code, notes, and snippets.

@adyshimony
adyshimony / gist:da18f715c1007e05471a8db82e3c273d
Last active September 11, 2018 00:05
Fetch transactions receipt results with geth
getBlockTransactionsAsync waiting for blocks 4832000 - 4832099 requests
getBlockTransactionsAsync got blocks, duration in sec:, 1.464
wait for 252 transactions receipt requests .
getTransactionsFromBlockAsync for block: 4832000, txs: 252, duration in sec:, 0.292
wait for 103 transactions receipt requests .
getTransactionsFromBlockAsync for block: 4832001, txs: 103, duration in sec:, 0.057
wait for 79 transactions receipt requests .
getTransactionsFromBlockAsync for block: 4832002, txs: 79, duration in sec:, 0.046
wait for 64 transactions receipt requests .
getTransactionsFromBlockAsync for block: 4832003, txs: 64, duration in sec:, 0.029
@adyshimony
adyshimony / gist:db79064867ff7f05b7fce90e38a56563
Created August 29, 2018 21:17
Fetch transactions receipt results
getBlockTransactionsAsync waiting for blocks 4832000 - 4832099 requests
getBlockTransactionsAsync got blocks, duration in sec:, 9.399
wait for 252 transactions receipt requests .
getTransactionsFromBlockAsync for block: 4832000, txs: 252, duration in sec:, 2.011
wait for 103 transactions receipt requests .
getTransactionsFromBlockAsync for block: 4832001, txs: 103, duration in sec:, 0.292
wait for 79 transactions receipt requests .
getTransactionsFromBlockAsync for block: 4832002, txs: 79, duration in sec:, 0.153
wait for 64 transactions receipt requests .
getTransactionsFromBlockAsync for block: 4832003, txs: 64, duration in sec:, 0.120
@adyshimony
adyshimony / gist.js
Created August 29, 2018 21:14
Fetch transactions receipt
const ipcPath = process.env['HOME'] + '/.local/share/io.parity.ethereum/jsonrpc.ipc'
const net = require('net')
const Web3 = require('web3')
const web3 = new Web3()
web3.setProvider(new web3.providers.IpcProvider(ipcPath, net))
function parseHrtimeToSeconds (hrtime) {
var seconds = (hrtime[0] + (hrtime[1] / 1e9)).toFixed(3)
{
"blockHash": "0xb3c4b4042f34b4d406e449e047c2b90c4295f1ddf9a3825c4ac6306dc113e8bf",
"blockNumber": 2209075,
"confirmations": 0,
"contractAddress": null,
"cumulativeGasUsed": 909763,
"data": null,
"destination": null,
"from": "0x2a65aca4d5fc5b5c859090a6c34d164135398226",
"gas": 90000,
@adyshimony
adyshimony / gist:96dcbb79ba3382afa1bbebc1edc7dee9
Created June 26, 2018 22:01
new indy transaction structure
{
status: 1,
message: "OK",
result: {
_id: "0x1ef9fa50d42c10a4ad93f476004c774f742b7ae0ed836cad37653ca671239e9f",
blockNumber: 5859531,
timeStamp: 1530047359,
blockHash: "0x7e740cd393fea196d81b0832fbb36714791694c690accb7a2a522c5c2c52a93f",
confirmations: 0,
hash: "0x1ef9fa50d42c10a4ad93f476004c774f742b7ae0ed836cad37653ca671239e9f",
info: getAccountFromTransactionsAsync dbName: supernodedb-3400000-3499999 for address 0x0017a3Cbe2d1F1Fedcd5DA2b31C3dc6f9B0216f6, endBlock 5191049
info: getAccountTransactionsAsync result count: 0 for address 0x0017a3Cbe2d1F1Fedcd5DA2b31C3dc6f9B0216f6
info: **********************************************************************************
info: getAccountToTransactionsAsync dbName: supernodedb-3400000-3499999 for address 0x0017a3Cbe2d1F1Fedcd5DA2b31C3dc6f9B0216f6, endBlock 5191049
info: getAccountTransactionsAsync result count: 0 for address 0x0017a3Cbe2d1F1Fedcd5DA2b31C3dc6f9B0216f6
info: **********************************************************************************
info: getAccountFromTransactionsAsync dbName: supernodedb-3500000-3599999 for address 0x0017a3Cbe2d1F1Fedcd5DA2b31C3dc6f9B0216f6, endBlock 5191049
error: Error: {error,emfile}
at Request._callback (/home/adys/Sources/ether-super-node/node_modules/nano/lib/nano.js:248:15)
at Request.self.callback (/home/adys/Sources/ether-super-node/n
info: fetching settings for # settingsid
info: settings for indexer settingsid found, {"_id":"settingsid","_rev":"2834-fcc0c8df536a4297cb3e3e988dff4681","id":"settingsid","lastBlock":5186188,"startBlock":5186188,"endBlock":5186200,"lastBlockToIndex":0}
info: getAccountFromTransactionsAsync dbName: supernodedb-0-99999 for address 0xF7e66D2622220807d8696064E94ca24b1dC6e7Da, endBlock 5186201
info: getAccountTransactionsAsync result count: 15 for address 0xF7e66D2622220807d8696064E94ca24b1dC6e7Da
info: **********************************************************************************
info: getAccountToTransactionsAsync dbName: supernodedb-0-99999 for address 0xF7e66D2622220807d8696064E94ca24b1dC6e7Da, endBlock 5186201
info: getAccountTransactionsAsync result count: 7 for address 0xF7e66D2622220807d8696064E94ca24b1dC6e7Da
info: **********************************************************************************
info: getAccountFromTransactionsAsync dbName: supernodedb-100000-199999 for address 0xF7e66D2622220807d869
// management tool, see all docs
http://127.0.0.1:5984/_utils/#/_all_dbs
// DB compact where supernode is db name (minor improvement, can ignore)
curl -H "Content-Type: application/json" -X POST http://admin:123456@localhost:5984/supernodedb/_compact
// get info on specific view
@adyshimony
adyshimony / gist:f82c8d33ab628a0afd749d1247531543
Last active February 16, 2018 17:42
couchdb views info
14'792'755 tx
DB size 12 gig
from view:
Update sequence on DB:14792756
Processed purge sequence:0
Actual data size (bytes):2,273,303,085
Data size on disk (bytes):72,833,344,618
@adyshimony
adyshimony / gist:03420917ec8e8f2382da7688f2dbd990
Last active February 15, 2018 06:26
Basic install instructions
install parity
bash <(curl https://get.parity.io -Lk) -r stable
run parity
parity --no-warp --cache-size 2048
install couchdb. Make sure to create admin user on installation.
couchdb installation, "xenial" is for ubuntu.