- 
                Notifications
    You must be signed in to change notification settings 
- Fork 394
NOMERGE: [0.17] Signet implementation #433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Closed
      
      
    
  
     Closed
                    Changes from all commits
      Commits
    
    
            Show all changes
          
          
            4 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      ae35360
              
                Chainparams: Introduce consensus.genesis_style for compatibility and …
              
              
                jtimon e195010
              
                Test: Introduce test to check genesis block hashes
              
              
                jtimon 9762579
              
                Signet implementation
              
              
                kallewoof c3f7bab
              
                Test: Introduce test for p2pk signet chains (reusable as param genera…
              
              
                jtimon File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
|  | ||
| chain=signet | ||
|  | ||
| [signet] | ||
| con_genesis_style=signet_old | ||
| signet_blockscript=512103e464a9f3070da4d3e0b34ce971ff36f3e07c47a8f4beadf32e8ea7e2afa8a82451ae | ||
| signet_siglen=77 | ||
| # DG seed node | ||
| seednode=178.128.221.177 | ||
| bech32_hrp=sb | ||
| pchmessagestart=F0C7706A | ||
| pubkeyprefix=125 | ||
| scriptprefix=87 | ||
| secretprefix=217 | ||
| extpubkeyprefix=043587CF | ||
| extprvkeyprefix=04358394 | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| #!/usr/bin/env bash | ||
| # Copyright (c) 2018 The Bitcoin Core developers | ||
| # Distributed under the MIT software license, see the accompanying | ||
| # file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
|  | ||
| export LC_ALL=C | ||
|  | ||
| # | ||
| # Issue blocks using a local node at a given interval. | ||
| # | ||
|  | ||
| if [ $# -lt 3 ]; then | ||
| echo "syntax: $0 <min_time> <max_time> <bitcoin-cli path> [<bitcoin-cli args>]" ; exit 1 | ||
| fi | ||
|  | ||
| function log() | ||
| { | ||
| echo "- $(date +%H:%M:%S): $*" | ||
| } | ||
|  | ||
| min_time=$1 | ||
| shift | ||
| max_time=$1 | ||
| shift | ||
| bcli=$1 | ||
| shift | ||
|  | ||
| # https://stackoverflow.com/questions/806906/how-do-i-test-if-a-variable-is-a-number-in-bash | ||
| re='^[0-9]+$' | ||
| if ! [[ $min_time =~ $re ]] ; then | ||
| echo "error: min_time $min_time is not a number" ; exit 1 | ||
| fi | ||
| if ! [[ $max_time =~ $re ]] ; then | ||
| echo "error: max_time $max_time is not a number" ; exit 1 | ||
| fi | ||
|  | ||
| let randinterval=max_time-min_time | ||
| if [ $randinterval -lt 1 ]; then | ||
| echo "error: interval min..max must be positive and greater than 0" ; exit 1 | ||
| fi | ||
|  | ||
| if ! [ -e "$bcli" ]; then | ||
| which "$bcli" &> /dev/null | ||
| if [ $? -ne 0 ]; then | ||
| echo "error: unable to find bitcoin binary: $bcli" ; exit 1 | ||
| fi | ||
| fi | ||
|  | ||
| echo "- checking node status" | ||
| conns=$($bcli "$@" getconnectioncount) | ||
|  | ||
| if [ $? -ne 0 ]; then | ||
| echo "node error" ; exit 1 | ||
| fi | ||
|  | ||
| if [ $conns -lt 1 ]; then | ||
| echo "warning: node is not connected to any other node" | ||
| fi | ||
|  | ||
| log "node OK with $conns connection(s)" | ||
| log "mining in random intervals between $min_time .. $max_time seconds" | ||
| log "hit ^C to stop" | ||
|  | ||
| while true; do | ||
| let rv=$RANDOM%$randinterval | ||
| echo -n -e "- $(date +%H:%M:%S): next block in $rv seconds..." | ||
| sleep $rv | ||
| echo -n -e " [submit]" | ||
| blockhash=$($bcli "$@" getnewblockhex true) | ||
| if [ $? -ne 0 ]; then | ||
| echo "node error; aborting" ; exit 1 | ||
| fi | ||
| echo "" | ||
| log "broadcasting block $($bcli "$@" getblockcount) $blockhash to $($bcli "$@" getconnectioncount) peer(s)" | ||
| done | ||
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs
+$min_time