Skip to content

Instantly share code, notes, and snippets.

View Bushstar's full-sized avatar

Peter John Bushnell Bushstar

  • Blockchain Developer
  • Oxford, UK
  • X @bushstar
View GitHub Profile
@Bushstar
Bushstar / dfi-blocks-over-target
Last active May 28, 2021 10:49
Blocks over target
C-A = coin-age
Req = Required coin-age
2021-05-28T10:47:54Z ID e56fc0b1586d0dfce3d8b50dc185c9d5588bdec3a293394f1c0a383eb1eb3d80 height 879512 C-A 1 Req 9 time 1622177654
2021-05-28T10:47:54Z ID 54da92c7d361e6148c3509ab5ba46df5da6eb942a1b7dafbda3ae5eb1dc73d2a height 879515 C-A 1 Req 21 time 1622177670
2021-05-28T10:47:55Z ID 5fd3ad528fceec264e35f4017cc83e64abfc8248ef4028cf44122bc661012f56 height 879521 C-A 1 Req 10 time 1622177910
2021-05-28T10:47:56Z ID 56346d47ac0d87bdeb85e1a6614b5d2de66919403795e40bce89b5f9a3e9528d height 879531 C-A 1 Req 2 time 1622178890
2021-05-28T10:47:57Z ID 1c677ad67091a212695ce8c1605fee3aafdd05d32a5b5c9098d0f6125ca8ebf9 height 879536 C-A 1 Req 18 time 1622178982
2021-05-28T10:47:57Z ID 2c900699d743d80252b58bc907be81c034c2090a22294acd8206f9f2d3e60445 height 879538 C-A 1 Req 4 time 1622179051
2021-05-28T10:47:57Z ID bd345cc95d2574208da64e361e0ea420e55534982b658cd91818f7352d575997 height 879542 C-A 1 Req 22 time 1622179195
@Bushstar
Bushstar / test_update_token_rpc
Created June 2, 2021 08:29
Test update token RPC
#!/usr/bin/env python3
# Copyright (c) DeFi Blockchain Developers
# Distributed under the MIT software license, see the accompanying
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
"""Test update token RPC."""
from test_framework.test_framework import DefiTestFramework
from test_framework.authproxy import JSONRPCException
from test_framework.util import assert_equal
Thread 27 (Thread 0x7f5ba03eb700 (LWP 504255)):
#0 __lll_lock_wait (futex=futex@entry=0x5652a26542e0 <cs_main>, private=0) at lowlevellock.c:52
#1 0x00007f5ba6028131 in __GI___pthread_mutex_lock (mutex=0x5652a26542e0 <cs_main>) at ../nptl/pthread_mutex_lock.c:115
#2 0x00005652a1c80052 in CAnchorIndex::CheckActiveAnchor(bool) ()
#3 0x00005652a1e71656 in spv::CSpvWrapper::OnTxStatusUpdate() ()
#4 0x00005652a1e718c8 in spv::txStatusUpdate(void*) ()
#5 0x00005652a2150466 in _peerRelayedBlock(void*, BRMerkleBlockStruct*) ()
#6 0x00005652a21448ea in _BRPeerAcceptMerkleblockMessage(BRPeerStruct*, unsigned char const*, unsigned long) ()
#7 0x00005652a2149bb7 in _BRPeerAcceptMessage(BRPeerStruct*, unsigned char const*, unsigned long, char const*) ()
#8 0x00005652a214c60f in _peerThreadRoutine(void*) ()
Thread 56 (Thread 0x7f2173fd7700 (LWP 52574)):
#0 __lll_lock_wait (futex=futex@entry=0x55d6c3f8a2e0 <cs_main>, private=0) at lowlevellock.c:52
#1 0x00007f223a508131 in __GI___pthread_mutex_lock (mutex=0x55d6c3f8a2e0 <cs_main>) at ../nptl/pthread_mutex_lock.c:115
#2 0x000055d6c36a000c in pos::Staker::stake(CChainParams const&, pos::ThreadStaker::Args const&) ()
#3 0x000055d6c36a19a4 in pos::ThreadStaker::operator()(pos::ThreadStaker::Args, CChainParams) ()
#4 0x000055d6c3573c3f in AppInitMain(InitInterfaces&)::{lambda()#4}::operator()() const ()
#5 0x000055d6c3595fd1 in void TraceThread<std::function<void ()> >(char const*, std::function<void ()>) ()
#6 0x000055d6c3574011 in void std::__invoke_impl<void, void (*&)(char const*, std::function<void ()>), char const*&, AppInitMain(InitInterfaces&)::{lambda()#4}&>(std::__invoke_other, void (*&)(char const*, std::function<void ()>), char const*&, AppInitMain(InitInterfaces&)::{lambda()#4}&) [clone .isra.0] ()
#7 0x000055d6c3b776f6 in thread_proxy ()
#8 0x00
2021-06-07T16:49:29Z ThreadStaker: (b9f5f23125ac0bdc4ea081b9002c84bbfc42f859) Staked, but no kernel found yet.
2021-06-07T16:49:29Z CreateNewBlock: post Eunos logic. Block reward 40504000000 Miner share 13499983200 foundation share 1988746400
2021-06-07T16:49:29Z CreateNewBlock(): block weight: 60193 txs: 69 fees: 1122999 sigops 497
2021-06-07T16:49:30Z Running Staker with 69 common transactions in block (20710 bytes)
2021-06-07T16:49:30Z ThreadStaker: (689bb9d4fac9c99d0b1deb73316972be8a094280) Staked, but no kernel found yet.
2021-06-07T16:49:31Z CreateNewBlock: post Eunos logic. Block reward 40504000000 Miner share 13499983200 foundation share 1988746400
2021-06-07T16:49:31Z CreateNewBlock(): block weight: 61046 txs: 70 fees: 1138407 sigops 498
2021-06-07T16:49:32Z Running Staker with 70 common transactions in block (21005 bytes)
2021-06-07T16:49:32Z ThreadStaker: (1400900e08f2e8e5172f0b17af57c9a2c9a02629) Staked, but no kernel found yet.
2021-06-07T16:49:32Z CreateNewBlock: post Eunos logic. Block reward 4
2021-06-07T16:59:06Z CreateNewBlock: post Eunos logic. Block reward 40504000000 Miner share 13499983200 foundation share 1988746400
2021-06-07T16:59:06Z CreateNewBlock(): block weight: 96235 txs: 112 fees: 1827817 sigops 567
2021-06-07T16:59:07Z Running Staker with 112 common transactions in block (33478 bytes)
2021-06-07T16:59:07Z ThreadStaker: (8ea074aef74c206f0e841ac0efa893da11f1e476) Staked, but no kernel found yet.
2021-06-07T16:59:09Z addPackageTxs: Failed AnyAccountsToAccounts TX ffc77a041ddc37aa92293b156f15037956913cf046f472ab4cd78e68628897f3: AnyAccountsToAccountsTx: amount 136.62954625 is less than 245.29069366
2021-06-07T16:59:09Z CreateNewBlock: post Eunos logic. Block reward 40504000000 Miner share 13499983200 foundation share 1988746400
2021-06-07T16:59:09Z CreateNewBlock(): block weight: 96840 txs: 113 fees: 1844026 sigops 568
2021-06-07T16:59:10Z Running Staker with 113 common transactions in block (33711 bytes)
2021-06-07T16:59:10Z ThreadStaker: (e9fcdc81631243c65ff231e154a25b0b27951699) Stak
2021-06-10T10:06:27Z RANGE 1 LAST TIME 1623319882 FUTURE TIME 1623319881 CURRENT TIME 1623319587
2021-06-10T10:06:27Z RANGE 1 LAST TIME 1623319882 FUTURE TIME 1623319881 CURRENT TIME 1623319587
2021-06-10T10:06:27Z RANGE 1 LAST TIME 1623319882 FUTURE TIME 1623319881 CURRENT TIME 1623319587
2021-06-10T10:06:27Z RANGE 1 LAST TIME 1623319882 FUTURE TIME 1623319881 CURRENT TIME 1623319587
2021-06-10T10:06:28Z RANGE 1 LAST TIME 1623319883 FUTURE TIME 1623319882 CURRENT TIME 1623319588
2021-06-10T10:06:28Z RANGE 1 LAST TIME 1623319883 FUTURE TIME 1623319882 CURRENT TIME 1623319588
2021-06-10T10:06:28Z RANGE 1 LAST TIME 1623319883 FUTURE TIME 1623319882 CURRENT TIME 1623319588
2021-06-10T10:06:28Z RANGE 1 LAST TIME 1623319883 FUTURE TIME 1623319882 CURRENT TIME 1623319588
2021-06-10T10:06:29Z RANGE 1 LAST TIME 1623319884 FUTURE TIME 1623319883 CURRENT TIME 1623319589
2021-06-10T10:06:29Z RANGE 1 LAST TIME 1623319884 FUTURE TIME 1623319883 CURRENT TIME 1623319589
@Bushstar
Bushstar / gist:0312cb6f3533e67f1806596a210ad313
Created August 3, 2021 07:39
Test default loan TX not from foundation
from test_framework.test_framework import DefiTestFramework
from test_framework.authproxy import JSONRPCException
class CreateLoanSchemeTest (DefiTestFramework):
def set_test_params(self):
self.num_nodes = 1
self.setup_clean_chain = True
self.extra_args = [['-txnotokens=0', '-amkheight=1', '-bayfrontheight=1', '-eunosheight=1', '-txindex=1', '-fortcanningheight=110']]
def run_test(self):
@Bushstar
Bushstar / gist:504cef8c5c3cad4f1bd10118172ede88
Created November 1, 2021 12:41
feature_loan_auctions.py
#!/usr/bin/env python3
# Copyright (c) 2014-2019 The Bitcoin Core developers
# Copyright (c) DeFi Blockchain Developers
# Distributed under the MIT software license, see the accompanying
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
"""Test Auctions."""
from decimal import Decimal
from test_framework.test_framework import DefiTestFramework
This file has been truncated, but you can view the full file.
2022-05-16T13:58:10.323382Z [init] DeFi Blockchain version v2.7.0.0-master-8e3a4020d (release build)
2022-05-16T13:58:10.323390Z [init] InitParameterInteraction: parameter interaction: -bind set -> setting -listen=1
2022-05-16T13:58:10.323440Z [init] Validating signatures for all blocks.
2022-05-16T13:58:10.323445Z [init] Setting nMinimumChainWork=0000000000000000000000000000000000000000000000000000000000000000
2022-05-16T13:58:10.323494Z [init] Using the 'sse4(1way),sse41(4way),avx2(8way)' SHA256 implementation