Merge branch 'master' into mononaut/batch-address-outspend-lookup
This commit is contained in:
		
						commit
						36e1777b96
					
				@ -171,52 +171,58 @@ Helpful link: https://gist.github.com/System-Glitch/cb4e87bf1ae3fec9925725bb3ebe
 | 
			
		||||
 | 
			
		||||
Run bitcoind on regtest:
 | 
			
		||||
   ```
 | 
			
		||||
   bitcoind -regtest -rpcport=8332
 | 
			
		||||
   bitcoind -regtest
 | 
			
		||||
   ```
 | 
			
		||||
 | 
			
		||||
Create a new wallet, if needed:
 | 
			
		||||
   ```
 | 
			
		||||
   bitcoin-cli -regtest -rpcport=8332 createwallet test
 | 
			
		||||
   bitcoin-cli -regtest createwallet test
 | 
			
		||||
   ```
 | 
			
		||||
 | 
			
		||||
Load wallet (this command may take a while if you have lot of UTXOs):
 | 
			
		||||
   ```
 | 
			
		||||
   bitcoin-cli -regtest -rpcport=8332 loadwallet test
 | 
			
		||||
   bitcoin-cli -regtest loadwallet test
 | 
			
		||||
   ```
 | 
			
		||||
 | 
			
		||||
Get a new address:
 | 
			
		||||
   ```
 | 
			
		||||
   address=$(./src/bitcoin-cli -regtest -rpcport=8332 getnewaddress)
 | 
			
		||||
   address=$(bitcoin-cli -regtest getnewaddress)
 | 
			
		||||
   ```
 | 
			
		||||
 | 
			
		||||
Mine blocks to the previously generated address. You need at least 101 blocks before you can spend. This will take some time to execute (~1 min):
 | 
			
		||||
   ```
 | 
			
		||||
   bitcoin-cli -regtest -rpcport=8332 generatetoaddress 101 $address
 | 
			
		||||
   bitcoin-cli -regtest generatetoaddress 101 $address
 | 
			
		||||
   ```
 | 
			
		||||
 | 
			
		||||
Send 0.1 BTC at 5 sat/vB to another address:
 | 
			
		||||
   ```
 | 
			
		||||
   ./src/bitcoin-cli -named -regtest -rpcport=8332 sendtoaddress address=$(./src/bitcoin-cli -regtest -rpcport=8332 getnewaddress) amount=0.1 fee_rate=5
 | 
			
		||||
   bitcoin-cli -named -regtest sendtoaddress address=$(bitcoin-cli -regtest getnewaddress) amount=0.1 fee_rate=5
 | 
			
		||||
   ```
 | 
			
		||||
 | 
			
		||||
See more example of `sendtoaddress`:
 | 
			
		||||
   ```
 | 
			
		||||
   ./src/bitcoin-cli sendtoaddress # will print the help
 | 
			
		||||
   bitcoin-cli sendtoaddress # will print the help
 | 
			
		||||
   ```
 | 
			
		||||
 | 
			
		||||
Mini script to generate transactions with random TX fee-rate (between 1 to 100 sat/vB). It's slow so don't expect to use this to test mempool spam, except if you let it run for a long time, or maybe with multiple regtest nodes connected to each other.
 | 
			
		||||
Mini script to generate random network activity (random TX count with random tx fee-rate). It's slow so don't expect to use this to test mempool spam, except if you let it run for a long time, or maybe with multiple regtest nodes connected to each other.
 | 
			
		||||
   ```
 | 
			
		||||
   #!/bin/bash
 | 
			
		||||
   address=$(./src/bitcoin-cli -regtest -rpcport=8332 getnewaddress)
 | 
			
		||||
   address=$(bitcoin-cli -regtest getnewaddress)
 | 
			
		||||
   bitcoin-cli -regtest generatetoaddress 101 $address
 | 
			
		||||
   for i in {1..1000000}
 | 
			
		||||
   do
 | 
			
		||||
     ./src/bitcoin-cli -regtest -rpcport=8332 -named sendtoaddress address=$address amount=0.01 fee_rate=$(jot -r 1  1 100)
 | 
			
		||||
      for y in $(seq 1 "$(jot -r 1 1 1000)")
 | 
			
		||||
      do
 | 
			
		||||
         bitcoin-cli -regtest -named sendtoaddress address=$address amount=0.01 fee_rate=$(jot -r 1 1 100)
 | 
			
		||||
      done
 | 
			
		||||
      bitcoin-cli -regtest generatetoaddress 1 $address
 | 
			
		||||
      sleep 5
 | 
			
		||||
   done
 | 
			
		||||
   ```
 | 
			
		||||
 | 
			
		||||
Generate block at regular interval (every 10 seconds in this example):
 | 
			
		||||
   ```
 | 
			
		||||
   watch -n 10 "./src/bitcoin-cli -regtest -rpcport=8332 generatetoaddress 1 $address"
 | 
			
		||||
   watch -n 10 "bitcoin-cli -regtest generatetoaddress 1 $address"
 | 
			
		||||
   ```
 | 
			
		||||
 | 
			
		||||
### Mining pools update
 | 
			
		||||
 | 
			
		||||
@ -107,7 +107,7 @@ export class BlockchainBlocksComponent implements OnInit, OnChanges, OnDestroy {
 | 
			
		||||
          this.blocks.unshift(block);
 | 
			
		||||
          this.blocks = this.blocks.slice(0, this.dynamicBlocksAmount);
 | 
			
		||||
 | 
			
		||||
          if (txConfirmed) {
 | 
			
		||||
          if (txConfirmed && this.height === block.height) {
 | 
			
		||||
            this.markHeight = block.height;
 | 
			
		||||
            this.moveArrowToPosition(true, true);
 | 
			
		||||
          } else {
 | 
			
		||||
 | 
			
		||||
@ -53,3 +53,8 @@ form {
 | 
			
		||||
  margin-top: 1px;
 | 
			
		||||
  margin-right: 2px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
input:focus {
 | 
			
		||||
  box-shadow: none;
 | 
			
		||||
  border-color: #1b1f2c;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -347,7 +347,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
 | 
			
		||||
    this.blocksSubscription = this.stateService.blocks$.subscribe(([block, txConfirmed]) => {
 | 
			
		||||
      this.latestBlock = block;
 | 
			
		||||
 | 
			
		||||
      if (txConfirmed && this.tx) {
 | 
			
		||||
      if (txConfirmed && this.tx && !this.tx.status.confirmed) {
 | 
			
		||||
        this.tx.status = {
 | 
			
		||||
          confirmed: true,
 | 
			
		||||
          block_height: block.height,
 | 
			
		||||
@ -496,7 +496,9 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
 | 
			
		||||
  @HostListener('window:resize', ['$event'])
 | 
			
		||||
  setGraphSize(): void {
 | 
			
		||||
    if (this.graphContainer) {
 | 
			
		||||
      this.graphWidth = this.graphContainer.nativeElement.clientWidth;
 | 
			
		||||
      setTimeout(() => {
 | 
			
		||||
        this.graphWidth = this.graphContainer.nativeElement.clientWidth;
 | 
			
		||||
      }, 1);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user