Deployment and management scripts for the new OmniEngine-based Omniwallet.
Omniwallet consists of 4 main components/servers:
- Master Core RPC Server
- PostgreSQL Database Server
- OmniEngine Server
- Omniwallet Server
Although it is possible to deploy all four servers in a single virtual (or physical) machine, it is recommended to use four seprate VMs and these scripts are currently designed to build and deploy 4 separate VMs.
- Virtual Box 4.3.10 or later
- Vagrant 1.6.2 or later
Vagrant is available for Mac OS X, Windows, and Linux. In addition to VirtualBox, Vagrant may be used to provision VMWare, AWS and other virtual environments.
- Bash command-line shell
- PostgreSQL command line client tools
- Java JDK
- Groovy language
- Amazon EC2 CLI Tools
- Amazon RDS Command Line Tools
The Vagrantfile is currently using (trusting) the ubuntu/trusty64 base box created by Ubuntu and the Mastercoin base box msgilligan/mastercoin-ubuntu-base.
You should consider them untrusted binaries. Only use them with TEST-MSC and small amounts of Bitcoin.
-
Clone this repository and check out the 'master' branch
$ git clone git@github.com:mastercoin-MSC/omni-devops.git $ cd omni-devops
The instructions for setting up the various servers include the --provider=aws
option which require that Vagrant have support for AWS installed and a AWS base box named "omni-aws" created. (It is possible to use Vagrant with VirtualBox, in which case you can skip this section and ommit the --provider=aws
argument)
-
Install the Vagrant AWS plugins
$ vagrant plugin install vagrant-aws $ vagrant plugin install vagrant-awsinfo
-
Create the Omni AWS Vagrant Base Box
$ cd omni-devops $ vagrant box add omni-aws tools/omni-aws.box
-
Create and boot a VM with Vagrant and install Master Core
$ vagrant up mastercore --provider=aws
-
Connect to the VirtualBox VM
$ vagrant ssh mastercore
-
Open the
bitcoin.conf
with an editor, e.g.$ vi /etc/bitcoin/bitcoin.conf
-
Make sure the following configuration options in
bitcoin.conf
are set correctly:rpcuser
,rpcpassword
,rpcallowip
,rpcssl
. -
Start the Master Core daemon:
$ sudo service mastercored start
-
Record the
rpcuser
,rpcpassword
values as well as the IP address of the server for use in OmniEngine configuration.
The Master Core daemon is now running as an Ubuntu service and will be automatically restarted upon system reboots as well as if the daemon crashes.
Althought PostgreSQL may be run in a general purpose VM, development at the Mastercoin Foundation has been focused upon using the RDS database service provided by Amazon.
To create your own PostgreSQL instance using Amazon RDS, follow these steps:
-
Make sure you have the AWS EC2 Tools and AWS RDS Tools installed corectly.
-
Make sure you have the Groovy language installed correctly.
-
Copy the environment setup template file.
$ cp setup-omni-template.sh setup-omni-private.sh $ chmod 700 setup-omni-private.sh
-
Edit
setup-omni-private.sh
and make sure to set (at least) the following variables:AWS_ACCESS_KEY
,AWS_SECRET_KEY
,AWS_CREDENTIAL_FILE
,PGUSER
,PGPASSWORD
,OMNI_DB_INSTANCE
,OMNI_DB_SEC_GID
-
Run the following commands:
$ source setup-omni-private.sh $ cd rds $ ./create-omnidb-instance.sh $ ./waitForDBAvailable.groovy
-
Use the
./list-rds-instances.sh
command to find the hostname of the RDS instance
-
Edit
omniengine-synced/bitcoin.conf
andomniengine-synced/sql.conf
to contain the correct host, username, and password values for the DB and Master Core RPC servers. -
Create and boot a VM with Vagrant and install and run OmniEngine
$ vagrant up omniengine --provider=aws
To be written.