Skip to content

Instantly share code, notes, and snippets.

Dave Collins davecgh

Block or report user

Report or block davecgh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View dcr_vs_btc_new_coins_by_year.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@davecgh
davecgh / dcr_offline_multisig_p2sh_example.go
Created Jan 15, 2019
Sample code to create and sign an offline p2sh 2-of-3 multisig transaction given WIF-encoded private keys
View dcr_offline_multisig_p2sh_example.go
package main
import (
"bytes"
"encoding/hex"
"fmt"
"github.com/decred/dcrd/chaincfg"
"github.com/decred/dcrd/dcrec/secp256k1"
"github.com/decred/dcrd/dcrutil"
View keybase.md

Keybase proof

I hereby claim:

  • I am davecgh on github.
  • I am davecgh (https://keybase.io/davecgh) on keybase.
  • I have a public key ASBSTkEPsWT6fRYfeh8WTlJPI9PKZPklV8mH6nK9YIVjpwo

To claim this, I am signing this object:

View dcr_tmux_simnet_setup.sh
#!/bin/sh
# Tmux script to create 2 dcrd nodes connected in series.
# Network layout:
# master <-> 1
# 19555 19665
set -e
SESSION="dcrd-simnet-nodes"
NODES_ROOT=~/dcrdsimnetnodes
View dcrd_pull_request_management.md

Initial Preparation

The first step is to read the Code Contribution Guidelines documentation to get a good understanding of policies used by the project.

Once that is done, the following commands illustrate a straight forward setup for submitting pull requests to the project:

One time setup

  • Fork dcrd on github
  • Run the following commands to obtain dcrd, all dependencies, and install it (this has probably already been done):
@davecgh
davecgh / dcrdsimnetsetup8nodes.sh
Last active Nov 13, 2018
Script to create a sample 8 node Decred simnet network
View dcrdsimnetsetup8nodes.sh
#!/bin/sh
set -e
SIMNET_NODES_ROOT=~/dcrdsimnetnodes
MASTERNODE_ADDR=127.0.0.1:19555
NODE1_ADDR=127.0.0.1:19501
NODE2_ADDR=127.0.0.1:19502
NODE3_ADDR=127.0.0.1:19503
NODE4_ADDR=127.0.0.1:19504
@davecgh
davecgh / decred_example_txscript_step.go
Last active Jul 29, 2019
Example of stepping through a Decred script using the txscript API.
View decred_example_txscript_step.go
package main
import (
"encoding/hex"
"fmt"
"os"
"github.com/decred/dcrd/chaincfg/chainhash"
"github.com/decred/dcrd/txscript"
"github.com/decred/dcrd/wire"
@davecgh
davecgh / mainnet_v4votebits.md
Last active May 5, 2017
Decred votebit combinations for mainnet v4 agendas.
View mainnet_v4votebits.md

The following table shows all of the valid combinations of votebits for the version 4 agendas on mainnet.

Vote Version 4

--votebits explorer OP_RETURN lnsupport sdiffalgo Previous Block Valid?
0 (0x00) OP_RETURN 000004000000 ABSTAIN ABSTAIN NO
1 (0x01) OP_RETURN 010004000000 ABSTAIN ABSTAIN YES
2 (0x02) OP_RETURN 020004000000 ABSTAIN NO NO
@davecgh
davecgh / masternode.conf
Created Feb 25, 2016
Example btcd config files for 8 node simnet network
View masternode.conf
rpcuser=youruser
rpcpass=SomeDecentp4ssw0rd
simnet=1
logdir=~/btcdsimnetnodes/master/log
datadir=~/btcdsimnetnodes/master/data
listen=127.0.0.1:18555
connect=127.0.0.1:18501
connect=127.0.0.1:18502
connect=127.0.0.1:18503
connect=127.0.0.1:18504
@davecgh
davecgh / blocknotifybridge.go
Created Feb 20, 2016
Naive bridge to listen for blockconnected notifications and invoke an executable.
View blocknotifybridge.go
// Copyright (c) 2016 The btcsuite developers
// Copyright (c) 2015-2016 The Decred developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package main
import (
"io/ioutil"
"log"
You can’t perform that action at this time.