Blockchain-specific code for the Sidetree-based DID Method implementation on Bitcoin
Our reference implementation of the blockchain service is based on bitcored. Here is the list of instructions to deploy Sidetree's extension code along with the bitcored service:
Install a Bitcored full node using instructions at this link. We reproduce their instructions below since we run bitcored with node v9 rather than v4:
- Install node version manager (NVM) by following instructions at this link.
- Install node v9 by using:
nvm install v9
- Install Python, ZeroMQ, and Tools. On GNU/Debian distributions, do:
apt-get install python libzmq3-dev build-essential
- Install bitcore:
npm install -g bitcore
- Start bitcore (ignore --testnet for mainnet):
bitcore create mynode --testnet
Clone this repository to folder
$(SIDETREE_BITCOIN_REPO)and run the following:
cd $(SIDETREE_BITCOIN_REPO)/bitcored-services/sidetree npm install bitcore-lib
Install insight UI:
cd $(BITCORE_DIR) bitcore install insight-api insight-ui
Add a private key from a Bitcoin wallet to
Suppose that we install bitcored to
$(NODE_IP), use the following instructions to add Sidetree's blockchain service:
cd $(BITCORE_DIR)/node_modules ln -s $(SIDETREE_BITCOIN_REPO)/bitcored-services/sidetree add the string "sidetree" to the services array in $BITCORE_DIR/bitcore-node.json
bitcoreddaemon by running:
cd $(BITCORE_DIR) bitcored
Verify that the bitcored installation was successful by pointing the browser to:
Once Sidetree extension is running in bitcored correctly, we can now build and run the Sidetree blockchain service that will be talking to our Sidetree extension running in bitcored:
- Clone this repo and go to the root folder.
npm ito install dependencies.
json/config.jsonaccordingly. Some parameters of interest:
bitcoreSidetreeServiceUrito point to the bitcored service configured earlier: e.g. 'http://127.0.0.1:3002/SidetreeBlockchainService/'
npm run buildto build the service.
- Run 'npm start` to start the service.