Bitcoin Transaction using API with Custom Fees

I want to transfer Bitcoin from one individual address to another using API. But I want to set Transaction fees as per my requirement. So How can I do it ?

Right now I am using blockchain-transaction – npm api for transfer bitcoin from one address to another. So please shade some lights on this.

var bitcoinTransaction = require('bitcoin-transaction');
//Send all my money from wallet1 to wallet2 on the bitcoin testnet
var from = "mm3gdVh8n6YtcNyaTKYkveB6yTME7aDWNJ";
var to = "mgPUfqJk4X6gE4P5Do5RfpkTFsYmsSjCya";
var privKeyWIF = "cNZi8iySqBToXMpcsQaHKD5uv7HExBQJBSi4dTg3ZPaEzeNAzvbj";    //Private key in WIF form (Can generate this from bitcoinlib-js)
bitcoinTransaction.getBalance(from, { network: "testnet" }).then((balanceInBTC) => {
    return bitcoinTransaction.sendTransaction({
from: from,
to: to,
privKeyWIF: privKeyWIF,
btc: balanceInBTC,
network: "testnet"
});
});

Debugging Bitcoin Unit Tests

I am running the unit tests from bitcoin source using make check, and would like to debug the tests using LogPrint in the bitcoin source files. I read in the Test Docs that logs are only output to test_framework.log, but I’m unable to locate this file. Where should I be able to find it? Or perhaps there is a better approach?

How to recover wallet by importing private key on testnet?

I want to test the functionality of wallet recovery via private key import on the testnet. Preferably thru an online service.

I only want to test the functionality so that I can verify that it’s basically working since I’m working on some Python code that I want to use on the mainnet later.

So for that, I don’t want to download the whole blockchain but instead, want to verify that my private key is generated correctly and I can access the funds that way. But I can’t find any possibility to do that on testnet…

EDIT: I did not use mainnet for anything yet. I’m exclusively used testnet to create the wallet and get some coins and want to verify on testnet the wallet recovery thru private key

Not able to use bitcoin/bitcoin.hpp

the libbitcoin library seems to have been installed just fine.
but the following code can’t seem to include bitcoin/bitcoin.hpp

#include<bitcoin/bitcoin.hpp>
#include<iostream>
using namespace bc;
int main() {
    block_type blk = genesis_block();
    std::cout<<encode_hex(hash_block_header(blk.header))<<std::endl;
    return 0;
}

Error:

g++ -o test test.cpp $(pkg-config --cflags --libs libbitcoin)
test.cpp: In function ‘int main()’:
test.cpp:5:5: error: ‘block_type’ was not declared in this scope
     block_type blk = genesis_block();
     ^~~~~~~~~~
test.cpp:5:5: note: suggested alternative: ‘clock_t’
     block_type blk = genesis_block();
     ^~~~~~~~~~
     clock_t
test.cpp:6:45: error: ‘blk’ was not declared in this scope
     std::cout<<encode_hex(hash_block_header(blk.header))<<std::endl;
                                             ^~~
test.cpp:6:45: note: suggested alternative: ‘brk’
     std::cout<<encode_hex(hash_block_header(blk.header))<<std::endl;
                                             ^~~
                                             brk
test.cpp:6:27: error: ‘hash_block_header’ was not declared in this scope
     std::cout<<encode_hex(hash_block_header(blk.header))<<std::endl;
                           ^~~~~~~~~~~~~~~~~
test.cpp:6:16: error: ‘encode_hex’ was not declared in this scope
     std::cout<<encode_hex(hash_block_header(blk.header))<<std::endl;
                ^~~~~~~~~~

Bitcoin.org developer reference outdated?

i just can’t understand if bitcoin.org developer reference is outdated or not. for example here (https://bitcoin.org/en/developer-reference#raw-transaction-format) we can see: “As of Bitcoin Core 0.9.3 (October 2014), all transactions use the version 1 format described below. (Note: transactions in the block chain are allowed to list a higher version number to permit soft forks, but they are treated as version 1 transactions by current software.)” it’s right or it’s an old reality?
or here (https://bitcoin.org/en/developer-reference#serialized-blocks) we can read on the first 2 line that blocks must be serialized under 1MB size or less but i know on the current version blocks can be up to 2MB so i can’t understand which one is the right answer. Thanks for the help