9.1.3 Verify the Set Up

To verify that you have set up the Tuxedo environment properly, download the sample Tuxedo application and run it in the Tuxedo environment.

Before you run an XA transaction using MicroTx, you must run the sample Tuxedo application in your Tuxedo environment to ensure that you have set up the environment properly.
  1. Download the sample code and application binaries (.zip file) from the link provided to you by the Product team.
  2. Unzip the sample code bundle in the parent directory of $TUXDIR.
    unzip bankapp-env.zip
    The following new files and folders are available: Dockerfile file, install1222.rsp file, start.sh file, and bankapp folder.
  3. Initialize the Tuxedo environment variables.
    cd parent_directory_of_$TUXDIR
    . tuxedo12.2.2.0.0/tux.env

    This also sets the value for the TUXDIR environment variable.

  4. Navigate to the bankapp folder.
    cd bankapp
  5. Run the bankvar file to set up the environment variables for the Tuxedo sample application.
    . ./bankvar

    This also sets the value for the APPDIR environment variable.

  6. Run the following script to update the settings in different files.
    now=$(date +%m%d%H%M%S)
    for f in "bankapp.dep" "bankapp.mk" "bankvar" "ENVFILE" "TMUSREVT.ENV" "ubbshm"
    do
      cp $f $f.${now}
      test -e $TUXDIR && test -e $APPDIR && sed -i -e "s^/u01/data/bankapp^${APPDIR}^" -e "s^/u01/app/tuxedo12.2.2.0.0^${TUXDIR}^" $f
    done

    Set the two environment variables TUXDIR and APPDIR according to your environment. Set the value for APPDIR to point to the directory that contains the files for the banking application.

  7. Run the following commands to rebuild and start the sample Tuxedo application.
    rm -f TLOG GWTLOG tuxconfig saltconfig bankdl1 bankdl2 bankdl3
    . ./bankvar
    tmloadcf -y ubbshm
    wsloadcf -y bankapp.dep
    ./crbank
    ./crtlog
    tmboot -y
    ./populate
  8. Run the following commands to verify that the sample Tuxedo application works and returns the expected response.
    # Query account, readonly operation
    curl -X POST -H "Content-type:application/json" http://Tuxedo_host_name_or_IP_address:2345/INQUIRY -d '{"ACCOUNT_ID":10001}'
    
    # Withdrawal API
    curl -X POST -H "Content-type:application/json" http://Tuxedo_host_name_or_IP_address:2345/WITHDRAWAL -d '{"ACCOUNT_ID":10001,"SAMOUNT":"1"}'
     
    # Deposit API
    curl -X POST -H "Content-type:application/json" http://Tuxedo_host_name_or_IP_address:2345/DEPOSIT -d '{"ACCOUNT_ID":10001,"SAMOUNT":"1"}'
     
    # Transfer API
    curl -X POST -H "Content-type:application/json" http://Tuxedo_host_name_or_IP_address:2345/TRANSFER -d '{"ACCOUNT_ID":[10001,10002],"SAMOUNT":"1"}'

    Where, Tuxedo_host_name_or_IP_address is the IP address or the name of the host on which you have installed Tuxedo. Run uname -n to find the name of the host. Run ifconfig to get the IP address of the host.

    You can change the value of the port and the ACCOUNT_ID based on your environment.

For each Tuxedo application that you want to use with MicroTx, create separate configuration files and use separate ports.

After your Tuxedo application is running, make changes to the initiator application in the sample XA application. In the initiator application, configure the Tuxedo application as a participant application. When you run an XA transaction using the sample app, the initiator application sends requests to your Tuxedo participant application.

After installing the sample application, run an XA transaction.

After you successfully install and run the sample application, your environment is ready for you to create and run your own Tuxedo applications.