Skip to content

Instantly share code, notes, and snippets.

@kallewoof
Last active January 20, 2021 20:24
  • Star 7 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save kallewoof/98b6d8dbe126d2b6f47da0ddccd2aa5a to your computer and use it in GitHub Desktop.

Signet

This is a description of how to get started with Signet. This document assumes you are capable of using git, and that you are able to compile Bitcoin. (If you have not yet done so, you should begin by doing that now.)

Fetch and compile signet

$ git clone https://github.com/kallewoof/bitcoin.git signet
$ cd signet
$ git checkout 2003-signet-consensus
$ ./autogen.sh
$ ./configure
$ make -j5

Create bitcoin.conf file and start up the daemon

cd src
mkdir signet
echo "signet=1
daemon=1" > signet/bitcoin.conf
./bitcoind -datadir=signet

Verify that you're connected

./bitcoin-cli -datadir=signet getconnectioncount
***SHOULD BE MORE THAN ZERO***
./bitcoin-cli -datadir=signet getblockcount
***SHOULD BE MORE THAN ZERO***

Get some coins

There is a command line tool you can use to get coins directly to your instance of Signet, assuming you are on the default network. You can also use the faucet online with an address of yours.

Using online faucet

You first need an address

./bitcoin-cli -datadir=signet getnewaddress

Then go to a faucet, e.g. https://signet.bc-2.jp and enter your address.

You can also just DM @kallewoof on Twitter or on IRC with "Signet coins plz: PASTEADDRESSHERE" and I'll try to send you some asap. (It's manual tho so may take awhile if I'm not near a computer.)

Using the command line tool

The tool is in contrib/signet and is called getcoins.sh. It takes the path to bitcoin-cli and an optional --faucet=[url] followed by any number of arguments to bitcoin-cli.

cd ../contrib/signet
./getcoins.sh ../../src/bitcoin-cli -datadir=../../src/signet
Payment of 10.00000000 BTC sent with txid c0bfa...

Check that you received the coins

Check your faucet transaction confirming at e.g. https://explorer.bc-2.jp and then send coins around to people and/or use signet for testing your wallet/etc.

You can immediately see the amount using getunconfirmedbalance i.e.

cd ../../src # if you were in contrib/signet
./bitcoin-cli -datadir=signet getunconfirmedbalance

You can also see info about the transaction that the faucet gave you.

./bitcoin-cli -datadir=signet gettransaction THETXID

Once it has confirmed, you should see it in getbalance.

./bitcoin-cli -datadir=signet getbalance
@jonatack
Copy link

Worked perfectly the first try! 💯

Suggestion: replace both getbalance and getunconfirmedbalance with getbalances.

@kallewoof
Copy link
Author

Thanks for testing! I do believe the signet-0.18 branch is outdated, though, so surprised this actually worked. The current branch is either just 'signet' or (the PR) 2004-signet-consensus (which lacks the get-coins etc. scripts).

-Kalle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment