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 developmentGet 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.patchBuild from source.
Init Tendermint
./did-tendermint --home ./ndid_tm_home initConfigure Tendermint
Change the following configuration in
./ndid_tm_home/config/config.toml.recheck = false create_empty_blocks = falseIf 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 developmentBuild an image.
cd ./smart-contract/docker ./build.shInit Tendermint
docker run --rm --volume $PWD/ndid_tm_home:/tendermint ndidplatform/did-tendermint initConfigure Tendermint
Change the following configuration in
./ndid_tm_home/config/config.toml.recheck = false create_empty_blocks = falseIf 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-tendermintInit Tendermint
docker run --rm --volume $PWD/ndid_tm_home:/tendermint ndidplatform/did-tendermint initConfigure Tendermint
Change the following configuration in
./ndid_tm_home/config/config.toml.recheck = false create_empty_blocks = falseIf 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 initor with Docker
docker run --rm --volume $PWD/rp1_tm_home:/tendermint ndidplatform/did-tendermint initCopy and replace
genesis.jsonin./rp1_tm_home/config/with the one from NDID node config directory./ndid_tm_home/config/genesis.jsonRepeat 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_idor with Docker
docker run --rm --volume $PWD/ndid_tm_home:/tendermint ndidplatform/did-tendermint show_node_idCopy 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 ./apiInstall 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 developmentBuild 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/apiPull an image (MQ service server) from Docker Hub.
docker pull ndidplatform/mq