Setting up the http server and stellar.toml file

We'll start by configuring the http server for banka.com and bankb.com. I'm using apache2, but you can feel free to install and use any http server you find easy to use. Let's get started:

  1. Configure the apache2.conf file, which is available under /etc/apache2/ by default. Update the virtual host section in the conf file, as follows:
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/banka
ServerName banka.com
ErrorLog logs/bankb.com-error_log
</VirtualHost>

<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/bankb
ServerName bankb.com
ErrorLog logs/bankb.com-error_log
</VirtualHost>

<VirtualHost *:443>
DocumentRoot /var/www/banka
ServerName banka.com
ServerAdmin [email protected]
SSLEngine on
SSLCertificateKeyFile /etc/apache2/ssl/banka/banka.com-key.pem
SSLCertificateFile /etc/apache2/ssl/banka/banka.com.pem
ErrorLog logs/banka.com-error_log
</VirtualHost>

<VirtualHost *:443>
DocumentRoot /var/www/bankb
ServerName bankb.com
ServerAdmin [email protected]
SSLEngine on
SSLCertificateKeyFile /etc/apache2/ssl/bankb/bankb.com-key.pem
SSLCertificateFile /etc/apache2/ssl/bankb/bankb.com.pem
ErrorLog logs/bankb.com-error_log
</VirtualHost>

This redirects incoming requests to ports 9080 and 443 to the relevant document root based on the domain that's requested, either banka.com or bankb.com.

  1. Copy the self-signed certificate (banka.com.pem) and certificate key (banka.com-key.pem) we generated for banka.com to /etc/apache2/ssl/banka/. You need to create the directory and subdirectory before you copy these files.
  2. Repeat this for bankb.com as well. Copy the bankb.com.pem and bankb.com-key.pem files to /etc/apache2/ssl/bankb/.
  1. Next, we'll set up the toml file to redirect incoming requests. Stellar expects you to set up the stellar.toml file, which contains public information that your peers need to interact with and send payments to your account. By default, Stellar nodes look for the stellar.toml file in the following location:
http://<your domain name>/.well-known/stellar.toml
  1. Now, we need to configure our toml file and put it in this location for both domains. Start by downloading a sample stellar.toml file. You can get it from Stellar's website here (https://www.stellar.org/developers/guides/concepts/stellar-toml.html). Update the file and replace its contents, as follows:
FEDERATION_SERVER=https://banka.com:8001/federation
AUTH_SERVER=https://banka.com:8003
SIGNING_KEY="GDW3IXTH3UFCU2KD6REURTLK7XVSUC4P4WDATMFPTW6YZFEAV7RWATAD"
ACCOUNTS=[
"GDW3IXTH3UFCU2KD6REURTLK7XVSUC4P4WDATMFPTW6YZFEAV7RWATAD"
]
DESIRED_BASE_FEE=100
DESIRED_MAX_TX_PER_LEDGER=400
[[CURRENCIES]]
code="USD"
issuer="GAIHBCB57M2SDFQYUMANDBHW4YYMD3FJVK2OGHRKKCNF2HBZIRBKRX6E"
display_decimals=2

This toml file indicates that we'll set up our federation service at port 8001, where it can be accessed by other parties trying to send transactions to our domain. The Auth server indicates the compliance module service port. For compliance checks, requests need to be sent to port 8003. We'll use these ports to set up our federation and compliance server later.

The toml file also provided information about the accounts controlled by our domain, which is the Bank A receiving account. It also provides a public key for inbound messages, which is basically the public key of our account. Lastly, the toml file specifies the currency assets that our account can receive and send, as well as the issuer account for the asset.

  1. Similarly, create a toml file for the bankb.com domain as well:
FEDERATION_SERVER=https://bankb.com:8002/federation
AUTH_SERVER=https://bankb.com:8005
SIGNING_KEY=" GBETQAVAWJJIQ7CZPXWLXKZO6BELLACNR3E7BRD4WTYEANAGGR62VP6Q "
ACCOUNTS=[
" GBETQAVAWJJIQ7CZPXWLXKZO6BELLACNR3E7BRD4WTYEANAGGR62VP6Q "
]
DESIRED_BASE_FEE=100
DESIRED_MAX_TX_PER_LEDGER=400
[[CURRENCIES]]
code="USD"
issuer="GAIHBCB57M2SDFQYUMANDBHW4YYMD3FJVK2OGHRKKCNF2HBZIRBKRX6E"
display_decimals=2
  1. Update access ports for the federation and compliance server for the bankb.com domain and the receiving account for Bank B.
  2. Copy the stellar.toml file for the banka.com domain to /var/www/banka/.well-known/stellar.toml.
  3. Copy the stellar.toml file for the bankb.com domain to /var/www/bankb/.well-known/stellar.toml.
  4. In the web browser, navigate to www.banka.com/.well-known/stellar.toml. You should be able to view the toml file for banka.com.
  5. Repeat the same for www.bankb.com/.well-known/stellar.toml. You should be able to view the toml file for bankb.com in the web browser as well.

Great! Now, we have everything set up for banka.com and bankb.com. We'll set up our internal infrastructure next.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.53.68