Esempio n. 1
0
class CoreLitecoinParams(CoreChainParams):
    NAME = 'litecoin-mainnet'
    GENESIS_BLOCK = CBlock.deserialize(x(
        '0100000000000000000000000000000000000000000000000000000000000000'
        '00000000d9ced4ed1130f7b7faad9be25323ffafa33232a17c3edf6cfd97bee6'
        'bafbdd97b9aa8e4ef0ff0f1ecd513f7c01010000000100000000000000000000'
        '00000000000000000000000000000000000000000000ffffffff4804ffff001d'
        '0104404e592054696d65732030352f4f63742f32303131205374657665204a6f'
        '62732c204170706c65e280997320566973696f6e6172792c2044696573206174'
        '203536ffffffff0100f2052a010000004341040184710fa689ad5023690c80f3'
        'a49c8f13f8d45b8c857fbcbc8bc4a8e4d3eb4b10f4d4604fa08dce601aaf0f47'
        '0216fe1b51850b4acf21b179c45070ac7b03a9ac00000000'))
    SUBSIDY_HALVING_INTERVAL = 840000
    PROOF_OF_WORK_LIMIT = 2 ** 256 - 1 >> 20
    MAX_MONEY = 84000000 * COIN
Esempio n. 2
0
class ChainParams(bitcointx.core.CoreChainParams):
    MAX_MONEY = 69000000 * COIN
    # genesis raw block can be found by `./coind getblock <blockhash>`
    GENESIS_BLOCK = CBlock.deserialize(x('010000000000000000000000000000000000000000000000000000000000000000000000a83a7fe377dd00e035985182cf98158c97b2043d5bd5fa2d18abdcb63db3325fd2315b5af0ff0f1e11630c000101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff6304ffff001d01044c5a4966207468697320706f73742067657473203330303030207570766f74657320492077696c6c206d616b652061206761726c69632062726561642063727970746f63757272656e63792063616c6c6564206761726c69636f696effffffff0100f2052a010000004341696984710fa689ad5023690c80f3a49c8f13f8d45b8c857fbcbc8bc4a8e4d3eb4b10f4d4604fa08dce601aaf0f470216fe1b51850b4acf21b179c45070ac7b03a9ac00000000'))
    PROOF_OF_WORK_LIMIT = None # currently not needed
    SUBSIDY_HALVING_INTERVAL = 469000 # currently not needed
    NAME = 'mainnet' # currently not needed
    RPC_PORT = 42071
    PORT = 42075
    NETMAGIC = b'\xd2\xc6\xb6\xdb'
    BASE58_PREFIXES = {
        'PUBKEY_ADDR':38,
        'SCRIPT_ADDR':50,
        'SECRET_KEY' :176,
        'EXTENDED_PUBKEY': b'\x04\x88\xb2\x1e',
        'EXTENDED_PRIVKEY': b'\x04\x88\xad\xe4'
    }
    BECH32_HRP = 'grlc'
Esempio n. 3
0
    def getblock(self, block_hash):
        """Get block <block_hash>

        Raises IndexError if block_hash is not valid.
        """
        try:
            block_hash = b2lx(block_hash)
        except TypeError:
            raise TypeError(
                '%s.getblock(): block_hash must be bytes; got %r instance' %
                (self.__class__.__name__, block_hash.__class__))
        try:
            r = self._call('getblock', block_hash, False)
        except InvalidAddressOrKeyError as ex:
            raise IndexError('%s.getblock(): %s (%d)' %
                             (self.__class__.__name__, ex.error['message'],
                              ex.error['code']))
        return CBlock.deserialize(unhexlify(r))
Esempio n. 4
0
class ChainParams(bitcointx.core.CoreChainParams):
    MAX_MONEY = 69000000 * COIN
    GENESIS_BLOCK = CBlock.deserialize(
        x('010000000000000000000000000000000000000000000000000000000000000000000000bbd46d60742caabc880e7374621c730cf1b6ddb5c76583fc9b8fad233510ad3e5cb0255bf0ff0f1eeed74e7c0101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4e04ffff001d0104464e6f727468204b6f7265616e2066696c6d206f6e204b696d27732053696e6761706f726520747269702072657665616c73206e657720666f637573206f6e2065636f6e6f6d79ffffffff0100a5459b0100000043410476929ca6904b40d59cc9af2907a050d5b8f332111b83aebfd6258a68dfb771895c96c1eeac808aeb083f5ec54a44dd282a6b34944fce8726c1980c1f06a6b69eac00000000'
          ))
    PROOF_OF_WORK_LIMIT = None  # currently not needed
    SUBSIDY_HALVING_INTERVAL = 469000  # currently not needed
    NAME = 'mainnet'  # currently not needed
    RPC_PORT = 42072
    PORT = 42071
    NETMAGIC = b'\xfc\xc5\xbf\xda'
    BASE58_PREFIXES = {
        'PUBKEY_ADDR': 65,
        'SCRIPT_ADDR': 64,
        'SECRET_KEY': 193,
        'EXTENDED_PUBKEY': b'\x04\x88\xb2\x1e',
        'EXTENDED_PRIVKEY': b'\x04\x88\xad\xe4'
    }
    BECH32_HRP = 'tux'
Esempio n. 5
0
    def create_custom_block(self, reward):
        txid, _ = self.fund_address(self.next_address(), 10)
        tx2 = self.proxy.getrawtransaction(lx(txid))

        coinbase = CMutableTransaction()
        coinbase.vin.append(CMutableTxIn(COutPoint(), CScript([self.proxy.getblockcount() + 1])))
        coinbase.vout.append(CMutableTxOut(reward * COIN, self.next_address().address.to_scriptPubKey()))

        prev_block_hash = self.proxy.getblockhash(self.proxy.getblockcount())

        ts = self._next_timestamp()
        self.proxy.call("setmocktime", ts)

        for nonce in range(1000):
            block = CBlock(nBits=0x207fffff, vtx=[coinbase, tx2], hashPrevBlock=prev_block_hash, nTime=ts, nNonce=nonce)
            result = self.proxy.submitblock(block)
            if not result:
                self.log.debug("Chosen nonce: {}".format(nonce))
                break