[BTC] network building – btcoin


Download / install


Source download address: https://github.com/bitcoin/bi
Out of the box installation package download address: https://bitcoin.org/zh cn/dow
API documentation: http://chainquery.com/bitcoin


  • Installation directory

    • bitcoin-qt.exe
    • daemon

      • bitcoin-cli.exe
      • bitcoind.exe
      • bitcoin-tx.exe
  • Block directory

    • blocks
    • chainstate
    • testnets It will appear when testing the network synchronously
    • bitcoin.conf configuration file

Basic command


  • Testnet connection test network
  • Server accepts json-rpc commands
  • Conf specifies the configuration file
  • DataDir specifies the data folder
  • deprecatedrpc=accounts Allow to view account function
  • Daemon background start
  • rpcallowip= (::/0)
  • Port = listen for connections on < port > (default: 8333, testnet: 18333)
#GUI BTC start
.\bitcoin-qt.exe -testnet -server -conf='F:\btc\bitcoin.conf' -datadir='F:\btc'
#Command line version launch
.\bitcoind -printtoconsole -conf='F:\btc\bitcoin.conf' -datadir=F:\btc'
. \ bitcoin - testnet - printtoconsole - conf ='f: \ BTC \ bitcoin. Conf '- dataDir = f: \ BTC' ා test environment
#If you start more than one node, you need to specify two ports in front of the port, which are used to specify different ports
./bitcoind.exe -regtest -deprecatedrpc=accounts  -server -conf='F:\btc\regtest.conf' -datadir='F:\btc' --port=8662


./bitcoin-cli -rpcconnect= -rpcuser=userrpc -rpcpassword=userpassword -rpcport=18332 getblockchaininfo
./bitcoin-cli -conf='F:\btc\bitcoin.conf' getblockchaininfo



Regtest network

#Start network
#Regtest.conf is as follows. Rpcport does not take effect. The system automatically enables 18443
# rpcuser=userrpc  
# rpcpassword=userpassword  
# rpcallowip=  
# rpcport=18332
./bitcoind.exe -regtest -deprecatedrpc=accounts  -server -conf='F:\btc\regtest.conf' -datadir='F:\btc'

./bitcoin-cli -rpcconnect= -rpcuser=userrpc -rpcpassword=userpassword -rpcport=18443 getblockchaininfo
./bitcoin-cli -rpcconnect= -rpcuser=userrpc -rpcpassword=userpassword -rpcport=18443 getbalance
#Mining rewards can only be used after 100 blocks 
./bitcoin-cli -rpcconnect= -rpcuser=userrpc -rpcpassword=userpassword -rpcport=18443 generate 101

./bitcoin-cli -rpcconnect= -rpcuser=userrpc -rpcpassword=userpassword -rpcport=18443 getaccountaddress ""

./bitcoin-cli -rpcconnect= -rpcuser=userrpc -rpcpassword=userpassword -rpcport=18443 getbalance

./bitcoin-cli -rpcconnect= -rpcuser=userrpc -rpcpassword=userpassword -rpcport=18443 getnewaddress

./bitcoin-cli -rpcconnect= -rpcuser=userrpc -rpcpassword=userpassword -rpcport=18443 sendtoaddress 2MyifBSafpYEdmQLHomqBPBeZSu4pKPtDaJ 10

./bitcoin-cli -rpcconnect= -rpcuser=userrpc -rpcpassword=userpassword -rpcport=18443 getrawtransaction 2b8968a440dde03591e27f5cff202eaae2c781372ddfd1ab56447a5655de0211

./bitcoin-cli -rpcconnect= -rpcuser=userrpc -rpcpassword=userpassword -rpcport=18443 generate 1

./bitcoin-cli -rpcconnect= -rpcuser=userrpc -rpcpassword=userpassword -rpcport=18443 listreceivedbyaddress


Get recharge test usdt: moneyqman7uh8fqdca2bv5yz8qvrc9iklp
Test BTC to the above address, 1btc = 100usdt, and the propertyid of the main test network is 2