Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
BitcoinProcessor.ts
IBitcoinConfig.ts
README.md
RequestError.ts
TransactionNumber.ts
setup.sh

README.md

Sidetree Bitcoin Service

Last Updated: June 18, 2019

A full bitcoin node is required by the the Sidetree Bitcoin microservice implementation. You can run the install script in this repo, which will guide and install bitcoind. The rest of this document details the steps taken by this script.

Bitcoin peer

You will need a trusted bitcoin network peer. You can use any Bitcoin implementation so long as it supports the standard jRPC calls. Below are instructions to install a Satoshi bitcoin client.

Download the tarball

wget https://bitcoincore.org/bin/bitcoin-core-0.18.0/bitcoin-0.18.0-x86_64-linux-gnu.tar.gz

Extract the files

tar -xzf ./bitcoin-0.18.0-x86_64-linux-gnu.tar.gz

Write a configuration file named bitcoin.conf for your node in the root of your data folder:

testnet=1
server=1
rpcuser={{YOUR USERNAME}}
rpcpassword={{YOUR PASSWORD}}

Start bitcoin

./bitcoin-0.18.0/bin/bitcoind -datadir={{YOUR DATA DIRECTORY HERE}}

Configure Sidetree Bitcoin Service

Example bitcoin-config.json

{
  "bitcoinPeerUri": "http://localhost:18332",
  "bitcoinRpcUsername": "{{YOUR USERNAME}}",
  "bitcoinRpcPassword": "{{YOUR PASSWORD}}",
  "bitcoinWalletImportString": "[FILL THIS IN!]",
  "bitcoinFee": 4000,
  "sidetreeTransactionPrefix": "sidetree:",
  "genesisBlockNumber": 1500000,
  "databaseName": "sidetree-bitcoin",
  "transactionFetchPageSize": 100,
  "mongoDbConnectionString": "mongodb://localhost:27017/",
  "port": 3002
}

Specify bitcoin peer URI

Grab the IP or DNS of the machine where you installed your Bitcoin peer:

Windows users:

ipconfig

Linux users:

ifconfig

Update the bitcoinPeerUri parameter in the bitcoin-config.json.

Note: 18332 is the RPC port for bitcoin testnet. If you are running on mainnet, the port should be 8332.

Specify bitcoin wallet private key

Put your private key in Wallet Import Format (WIF) in the bitcoinWalletImportString parameter.

Please ensure that your wallet contain sufficient funds for write operations, else you will see the error:

Please Fund Wallet: my8HhaAqfCiRufQKdT7CBRKUDsArL7ijRT

If you are testing on testnet, you can use a testnet faucet to fund a given wallet address. You will have to perform this action periodically, depending on your wallet funds.

Specify PRC user name and password

Add the RPC user name and password to the bitcoinRpcUsername and bitcoinRpcPassword parameters if your bitcoin peer requires it for RPC communication (Bitcoin Core requires it).

You should now be able to run the Sidetree bictoin service. The bitcoin service will take sometime to syncronize from genesis, during this time it will not respond to requests.

You can’t perform that action at this time.