tokenbridge/deployment/EXECUTION.md
Przemyslaw Rzad 59564bd600
Deployment structure and documentation (#113)
* Moved rollback and logs into main deployment readme

* Removed duplicated section.

* Removed subdir mention

* Merged dependencies and prerequisites

* Lint at bottom

* Added configuration.md and execution.md

* Moved configuration

* Update path

* Moved administrator configuration

* Update name

* Moved execution.

* Moved stuff to execution.md

* Moved dependencies and prerequisites to sub-mds

* Moved stuff out of oracle subfolder

* Whitespace

* Simplyfy readme

* Removed backticks

* Whitespace

* Update path.

* Update user info

* Update phrasing

* Phrasing
2019-06-28 11:31:57 +02:00

3.0 KiB

POA Token Bridge / Deployment Execution

Please refer to the Configuration first.

Dependencies

On your local machine install:

The playbook will automatically install Docker, docker-compose, Python, Git and it dependencies (such as curl, ca-certificates, apt-transport-https, etc.) to the node. Also this playbooks creates an additional non-sudo docker user to run service as.

Running the playbook

ansible-playbook -i hosts.yml site.yml

Useful arguments

To be used with the ansible-playbook command, for example:

ansible-playbook -i hosts.yml site.yml --ask-become-pass
  • --ask-pass - ask for the password used to connect to the bridge VM.

  • --ask-become-pass - ask for the become password used to execute some commands (such as Docker installation) with root privileges.

  • -i <file> - use specified file as a hosts.yml file.

  • -e "<variable>=<value>" - override default variable.

  • --private-key=<file_name> - if private keyfile is required to connect to the ubuntu instance.

  • --user=<username> - connect as this username

Bridge service commands

The Bridge service is named poabridge. Use the default SysVinit commands to start, stop, restart, and rebuild the service and to check the status of the service.

Commands format:

sudo service poabridge [start|stop|restart|status|rebuild]

Rollback the Last Processed Block in Redis

If the bridge does not handle an event properly (i.e. a transaction stalls due to a low gas price), the Redis DB can be rolled back. You must identify which watcher needs to re-run. For example, if the validator signatures were collected but the transaction with signatures was not sent to the Foreign network, the collected-signatures watcher must look at the block where the corresponding CollectedSignatures event was raised.

Execute the reset-lastBlock.sh script in the bridge root directory. For example, if you've installed your bridge with this deployment script and all the default parameters, use the following set of commands:

$ sudo su poadocker
$ cd ~/bridge
$ docker-compose stop bridge_affirmation bridge_request bridge_collected
$ docker-compose exec bridge_senderhome bash ./reset-lastBlock.sh <watcher> <block num>
$ exit
$ sudo service poabridge restart

where the could be one of the following:

  • signature-request
  • collected-signatures
  • affirmation-request

Logs

If the syslog_server_port option in the hosts.yml file is not set, all logs will be stored in /var/log/docker/ folder in the set of folders with the bridge_ prefix.

If the syslog_server_port is set, logs will be redirected to the specified server and cannot be accessed on the bridge machine.

syslog_server_port: "<protocol>://<ip>:<port>" # When this parameter is set all bridge logs will be redirected to the <ip>:<port> address.