Setup
Tendermint and ABCI app
There are several options to install Tendermint and ABCI app bundle.
- Build from source
- Build Docker image locally from source
- Use Docker image provided on Docker Hub
Build from source
- Make sure you meet the prerequisites. 
- Clone smart-contract repository. - mkdir -p $GOPATH/src/github.com/ndidplatform/smart-contract git clone https://github.com/ndidplatform/smart-contract.git $GOPATH/src/github.com/ndidplatform/smart-contract
- (Optional) Checkout desired branch or tag. - Example: - cd $GOPATH/src/github.com/ndidplatform/smart-contract git checkout development
- Get dependencies. - cd $GOPATH/src/github.com/ndidplatform/smart-contract dep ensure
- (Optional) Patch Tendermint LevelDB adapters - git apply $GOPATH/src/github.com/ndidplatform/smart-contract/patches/tm_goleveldb_bloom_filter.patch && \ git apply $GOPATH/src/github.com/ndidplatform/smart-contract/patches/tm_cleveldb_cache_and_bloom_filter.patch
- Build from source. 
- Init Tendermint - ./did-tendermint --home ./ndid_tm_home init
- Configure Tendermint - Change the following configuration in - ./ndid_tm_home/config/config.toml.- recheck = false create_empty_blocks = false- If you run on a local network, additional configuration should be changed. - addr_book_strict = false allow_duplicate_ip = true
Build Docker image locally from source
Install Docker and Docker Compose if you haven't already.
- Clone smart-contract repository. 
- (Optional) Checkout desired branch or tag. - Example: - git checkout development
- Build an image. - cd ./smart-contract/docker ./build.sh
- Init Tendermint - docker run --rm --volume $PWD/ndid_tm_home:/tendermint ndidplatform/did-tendermint init
- Configure Tendermint - Change the following configuration in - ./ndid_tm_home/config/config.toml.- recheck = false create_empty_blocks = false- If you run on a local network, additional configuration should be changed. - addr_book_strict = false allow_duplicate_ip = true
Use Docker image provided on Docker Hub
Install Docker if you haven't already.
- Pull an image from Docker Hub. - docker pull ndidplatform/did-tendermint
- Init Tendermint - docker run --rm --volume $PWD/ndid_tm_home:/tendermint ndidplatform/did-tendermint init
- Configure Tendermint - Change the following configuration in - ./ndid_tm_home/config/config.toml.- recheck = false create_empty_blocks = false- If you run on a local network, additional configuration should be changed. - addr_book_strict = false allow_duplicate_ip = true
Setup more Tendermint nodes
You can setup as many Tendermint node as you like. For example, setting up Tendermint node for RP (rp1).
- Init Tendermint - ./did-tendermint --home ./rp1_tm_home init- or with Docker - docker run --rm --volume $PWD/rp1_tm_home:/tendermint ndidplatform/did-tendermint init
- Copy and replace - genesis.jsonin- ./rp1_tm_home/config/with the one from NDID node config directory- ./ndid_tm_home/config/genesis.json
- Repeat the same process as above (Configure Tendermint step) but with - ./rp1_tm_home/config/config.tomland change additional configurations.- Get NDID Tendermint node ID - ./did-tendermint --home ./ndid_tm_home show_node_id- or with Docker - docker run --rm --volume $PWD/ndid_tm_home:/tendermint ndidplatform/did-tendermint show_node_id
- Copy node ID from an output of above command in place of <TM_NODE_ID> in config. - seeds="<TM_NODE_ID>@127.0.0.1:26656"
 
API Server
There are several options to install API server.
- Build from source
- Build Docker image locally from source
- Use Docker image provided on Docker Hub
Build from source
- Make sure you meet the prerequisites. 
- Clone api repository. 
- Go to cloned directory. - cd ./api
- Install dependencies - cd ./main-server npm install cd ../mq-server npm install cd ../ndid-logger npm install
Build Docker image locally from source
Install Docker and Docker Compose if you haven't already.
- Clone api repository. 
- (Optional) Checkout desired branch or tag. - Example: - git checkout development
- Build an image. - cd ./api/docker ./build.sh
Use Docker image provided on Docker Hub
Install Docker if you haven't already.
- Pull an image (API main) from Docker Hub. - docker pull ndidplatform/api
- Pull an image (MQ service server) from Docker Hub. - docker pull ndidplatform/mq