2024-10-01 12:17:10 +00:00
# service-provider-setup
## Prerequisites
2024-10-22 10:06:46 +00:00
- Setup Ansible: follow the [installation ](../README.md#installation ) guide to setup ansible on your machine
2024-10-01 12:17:10 +00:00
- Set up a DigitalOcean Droplet with passwordless SSH access
- Buy a domain and configure [nameservers pointing to DigitalOcean ](https://docs.digitalocean.com/products/networking/dns/getting-started/dns-registrars/ )
- Generate a DigitalOcean access token, used for API authentication and managing cloud resources
2024-10-22 10:06:46 +00:00
- Setup a user: Follow steps from [Setup a user ](../user-setup/README.md#setup-a-user ) to setup a new user with passwordless sudo
2024-10-01 12:17:10 +00:00
## Become a Service Provider
### Setup
- Copy the vars files:
```bash
cd vars
cp dns-vars.example.yml dns-vars.yml
cp gpg-vars.example.yml gpg-vars.yml
cp k8s-vars.example.yml k8s-vars.yml
cp container-vars.example.yml container-vars.yml
2024-10-21 10:22:32 +00:00
cp laconicd-vars.example.yml laconicd-vars.yml
2024-10-01 12:17:10 +00:00
cp webapp-vars.example.yml webapp-vars.yml
cd -
```
- Update the following values in the respective variable files:
```bash
# vars/dns-vars.yml
2024-10-22 11:47:53 +00:00
full_domain: "" # eg: laconic.com
service_provider_ip: "" # eg: 23.111.78.179
do_api_token: "" # DigitalOcean access token that you generated, eg: dop_v1...
2024-10-01 12:17:10 +00:00
# vars/gpg-vars.yml
2024-10-22 11:47:53 +00:00
gpg_user_name: "" # full name of the user for the GPG key
gpg_user_email: "" # email address associated with the GPG key
gpg_passphrase: "" # passphrase for securing the GPG key
2024-10-01 12:17:10 +00:00
# vars/k8s-vars.yml
2024-10-22 11:47:53 +00:00
org_id: "" # eg: lcn
location_id: "" # eg: cad
support_email: "" # eg: support@laconic.com
2024-10-01 12:17:10 +00:00
# vars/container-vars.yml
2024-10-22 11:47:53 +00:00
container_registry_username: "" # username to login to the container registry
container_registry_password: "" # password to login to the container registry
2024-10-01 12:17:10 +00:00
2024-10-21 10:22:32 +00:00
# vars/laconicd-vars.yml
chain_id: "" # chain id to use for the Laconic chain
2024-10-01 12:17:10 +00:00
# vars/webapp-vars.yml
2024-10-22 11:47:53 +00:00
authority_name: "" # eg: laconic-authority
cpu_reservation: "1" # minimum number of cpu cores to be used, eg: 2
memory_reservation: "2G" # minimum amount of memory in GB to be used, eg: 4G
cpu_limit: "6" # maximum number of cpu cores to be used, eg: 6
memory_limit: "8G" # maximum amount of memory in GB to be used, eg: 8G
deployer_gpg_passphrase: "" # passphrase for creating GPG key used by webapp-deployer, eg: SECRET
handle_auction_requests: "true" # whether the webapp deployer should handle deployment auction requests, eg: true
auction_bid_amount: "100000" # bid amount for deployment auctions in alnt, eg: 500000
2024-10-01 12:17:10 +00:00
```
- Update the [`hosts.ini` ](./hosts.ini ) file:
```ini
[deployment_host]
< host_name > ansible_host=< target_ip > ansible_user=< new_username > ansible_ssh_common_args='-o ForwardAgent=yes'
```
- Replace `<host_name>` with the desired `hostname` of the remote machine
- Replace `<target_ip>` with the IP address or hostname of the target machine
- Under `deployment_host` , Replace `<ansible_user>` with the name of the user you have created
- Verify that you are able to connect to the host using the following command:
```bash
ansible all -m ping -i hosts.ini
# Expected output:
# < host_name > | SUCCESS => {
# "ansible_facts": {
# "discovered_interpreter_python": "/usr/bin/python3.10"
# },
# "changed": false,
# "ping": "pong"
# }
```
- Run the `service-provider-setup.yml` ansible-playbook to:
- Create DNS records
- Deploy k8s
- Setup laconicd and laconic console
- Setup container registry
- Deploy the webapp-deployer API and webapp-deployer UI
```bash
LANG=en_US.utf8 ansible-playbook service-provider-setup.yml -i hosts.ini --extra-vars='{ target_host: "deployment_host" }' --user $USER
```
2024-10-08 12:41:36 +00:00
### Result
After the playbook finishes executing, the following services will be deployed (your setup should look similar to the example below):
2024-10-21 10:22:32 +00:00
- laconicd chain RPC endpoint: < http: // lcn-daemon . laconic . com:26657 >
- laconicd GQL endpoint: < http: // lcn-daemon . laconic . com:9473 / api >
- laconic console: < http: // lcn-console . laconic . com:8080 / registry >
- webapp deployer API: < https: // webapp-deployer-api . pwa . laconic . com >
- webapp deployer UI: < https: // webapp-deployer-ui . pwa . laconic . com >