get2pc commit --txid tx-001

You rarely write raw 2PC. Instead, use proven protocols and frameworks: