a docker image for the Doichain environment http://www.doichain.org
- Web Project owners
- I want run a node and a dApp in order to request "Double-Opt-In" email permissions from my user
- Mail Server provider / Sysadmins
- we want to be part of the project and allow our users to confirm their email permissions directly over our mail host without any third party
- Investors
- run my own node in order to simply send/receive Doi (Doichain coins)
- Developers
git clone https://github.com/Doichain/docker.git doichain-docker; cd doichain-docker- run a testnet node
make testnet-[my-doichain] HTTP_PORT=81 PORT=18338 RPC_PORT=18339 - run a testnet network
make test_testnet - run a regtest node run
make regtest-[my-doichain] HTTP_PORT=81 PORT=18338 RPC_PORT=18339 - run a regtest network wiht alice and bob ```make test_regtest``
- run
docker attach testnet-[my-doichain]in order to connect to your docker container - run inside the docker container:
tail -f /home/doichain/.doichain/testnet/debug.login order to watch blockchain download - run
doichain-cli getnewaddressand send your testnet address to testnet@doichain.org with subject "send me money"
- If you want to register one or more "double-opt-in" for your customer email adresses install a SEND_DAPP
- If you want to protect your email server from unwanted spam install CONFIRM_DAPP and VERIFY_APP (experimental)
- Checkout this repository with:
git clone https://github.com/Doichain/docker.git docker-doichain - Build docker container with
cd docker-doichain; docker build -t mydocker/doichain:latest .
Install from docker hub https://hub.docker.com/r/doichain/dapp/
replace mydocker/doichain:latestwith doichain/dapp:latest
-
Install
docker run -it --rm -e DAPP_SEND='true' -p 3000:3000 mydocker/doichain:latest -
Get auth token with:
curl -H "Content-Type: application/json" -X POST -d '{"username":"admin","password":"password"}' http://localhost:3000/api/v1/loginOutput should be something like:
{ "status": "success", "data": { "authToken": "Y1z8vzJMo1qqLjr1pxZV8m0vKESSUxmRvbEBLAe8FV3", "userId": "a7Rzs7KdNmGwj64Eq" } -
Give your Send - dAPP some funding: (during alpha test, please send your doichain address to funding@doichain.org)
-
DOI-Request
Take the authToken and userId from above and paste it into the appropriate header fields below.
curl -X POST -H 'X-User-Id: a7Rzs7KdNmGwj64Eq' -H 'X-Auth-Token: Y1z8vzJMo1qqLjr1pxZV8m0vKESSUxmRvbEBLAe8FV3' -i 'http://SEND_DAPP_HOST:3000/api/v1/opt-in?recipient_mail=<your-customer-email@example.com>&sender_mail=info@doichain.org'
Output should be:
```
{
"status": "success",
"data": {
"message": "Opt-In added. ID: SyXPehQz6utWnacRa"
}
```
-
Install
docker run --name=doichain-<your-host> --hostname=doichain-<your-host> -it --rm -e DAPP_CONFIRM='true' -e DAPP_VERIFY='true' -e DAPP_SEND='true' -e RPC_USER='admin' -e RPC_PASSWORD='<your-password>' -e RPC_HOST=localhost -e DAPP_HOST=<dAppHostFromTheInternet:Port> -e DAPP_SMTP_HOST=<smtp-host> -e DAPP_SMTP_USER=<smtp-username> -e DAPP_SMTP_PASS=<smtp-password> -e DAPP_SMTP_PORT=25 -p 3000:3000 -p 8338:8338 -v doichain.org:/home/doichain/data doichain/dapp:latest -
Update the DNS of your mail domain(s) :
- Connect to your running docker container via
docker psanddocker attach <your-cointainer> - list your accounts with
doichain-cli listaccounts - get the account address of your account
doichain-cli getaccountaddress ""or use:doichain-cli getaddressesbyaccount "" - get the
pubkeyfromdoichain-cli validateaddress <your-address> - add a TXT field
doichain-opt-in-provider:<your-email-domain e.g. doichain.org> - add a TXT field
doichain-opt-in-key:<your pubkey from above> - exit your docker cointainer
- start docker container again with an additional environment variable
-e CONFIRM_ADDRESS=<your-address>(or modify `/home/doichain/data/dapp/settings.json ``) which is the address of you found under 2.3
- Connect to your running docker container via
-
check if your blockchain receive blocks with:
doichain-cli getblockcount -
check your balance with
doichain-cli getbalance(send some coins withdoichain-cli sendtoaddress)
docker run --name=doichain-<your-host> --hostname=doichain-<your-host> -it --rm -e DAPP_CONFIRM='true' -e DAPP_VERIFY='true' -e DAPP_SEND='true' -e RPC_USER='admin' -e RPC_PASSWORD='<rpc-password>' -e RPC_HOST=localhost -e DAPP_HOST=<dAppHostFromTheInternet:Port> -e DAPP_SMTP_HOST=<smtp-host> -e DAPP_SMTP_USER=<smtp-username> -e DAPP_SMTP_PASS=<smtp-password> -e DAPP_SMTP_PORT=25 -p 3000:3000 -p 8338:8338 -v doichain.org:/home/doichain/data doichain/dapp:latest
- Authentication of dApp (REST-API) needs correct auth token and user id. Get it and correct authentication!
- Doi gets successful accepted by REST interface and appears in the dapps web frontend but nothing else happens. (connect to the docker container and check for errors) 2.2 no coins in the wallet - get some fund and send to an address of your dApp in send mode 2.3 configure mail account (mail server, username, password) server for confirm dapp
- confirmation link shows localhost and not correct url of dapp (e.g. http://dapp.doichain.org)
- DOI-Request Email doesn't loook beatiful or should look differently. Please change template and data in server/api/rest/imports/debug.js
- DOI-Request Email has wrong sender email address. Please change template and data in server/api/rest/imports/debug.js
- Confirmation email is not send out. Enable type 'confirm' (and maybe 'verify') in /home/doichain/data/dapp/settings.json
- make a backup of your meteor mongo db. (```docker exec -it mongodump -h 127.0.0.1 --port 3001 -d meteor````
- shutdown your old docker container (docker stop )
- create doinet on docker ``docker network create doinet```
- start mongo (see: https://hub.docker.com/_/mongo) (change the password!)
docker run -d --network doinet --name mongo
-e MONGO_INITDB_ROOT_USERNAME=doichain
-e MONGO_INITDB_ROOT_PASSWORD=secret
mongo - start a new docker container based on version 0.0.9 (e.g. use makefile provided
make mainnet_<your-new-doichain-node-name>