# Release process

### Update releases in pom and check tests are passing.

* x402-commons
  * Intellij  / analyse / inspect code
  * `just run_tests`
  * `just run_install`
* x402-java-client
  * Intellij  / analyse / inspect code
  * Change `mogami.commons.version` to latest snapshot.
  * `just run_tests`
  * `just run_install`
* x402-spring-boot-starter
  * Intellij  / analyse / inspect code
  * Change `mogami.commons.version` to latest snapshot.
  * `just run_tests`
  * `just run_install`
* x402-facilitator
  * Intellij  / analyse / inspect code
  * Change `mogami.commons.version` to latest snapshot.
  * Change `mogami.java-client.version` to latest snapshot.
  * `just run_tests`
  * `just build_docker_image`
* x402-example-server
  * Intellij  / analyse / inspect code
  * Change `mogami.spring-boot-starter.version` to latest snapshot.
  * Change `mogami.java-client.version` to latest snapshot.

### Run a payment with a local facilitator on Base Sepolia.

Start a local docker facilitator:&#x20;

```bash
docker run 	-e PORT=4020 \
		-e X402_FACILITATOR_PRIVATE_KEY=FACILITATOR_PRIVATE_KEY \
		-p 4020:8080 \
		mogamitech/facilitator:latest
```

Get the example projet and run the tests with:

```bash
just run_tests_local_facilitator
```

You can check the balance of our two test addresses here:\
\- [0xf6b42050A71Ca13f842eDa53C7d31B7C1BD94F6E](https://sepolia.basescan.org/address/0xf6b42050A71Ca13f842eDa53C7d31B7C1BD94F6E#tokentxns) (payer)\
\- [0x375605671ddA2d461E333Cfa51F5b53763E8C585](https://sepolia.basescan.org/address/0x375605671ddA2d461E333Cfa51F5b53763E8C585#tokentxns) (provider)

### Run a payment with a local facilitator on Base Mainnet.

Start a local docker facilitator:&#x20;

```bash
docker run 	-e PORT=4020 \
		-e X402_FACILITATOR_PRIVATE_KEY=FACILITATOR_PRIVATE_KEY \
		-p 4020:8080 \
		mogamitech/facilitator:latest
```

Open a terminal and set the sender private key with this command:

```bash
export TIP_PRIVATE_KEY=SENDER_PRIVATE_KEY
```

The presence of `TIP_PRIVATE_KEY`  will force the example application to call the `/tip` api and pay for it.\
In the example project, just run the application with:&#x20;

<pre class="language-bash"><code class="lang-bash"><strong>just run_application_local_facilitator
</strong></code></pre>

You can check the balance of our two test addresses here:\
\- [0x375605671ddA2d461E333Cfa51F5b53763E8C585](https://basescan.org/address/0x375605671ddA2d461E333Cfa51F5b53763E8C585#tokentxns) (payer)\
\- [0x2306e12F56e45E698bFAfa9c5E7D4e77cDEb4d06](https://basescan.org/address/0x2306e12F56e45E698bFAfa9c5E7D4e77cDEb4d06#tokentxns) (provider)

### Release and update projects in that order

* [x402-commons](https://github.com/mogami-tech/x402-commons)
* [x402-java-client](https://github.com/mogami-tech/x402-java-client)
* [x402-spring-boot-starter](https://github.com/mogami-tech/x402-spring-boot-starter)

Wait until all projects are available here: <https://central.sonatype.com/search?q=mogami>

Make a release of [x402-facilitator](https://github.com/mogami-tech/x402-facilitator) and wait until it's deployed. Once deploy, check the launch logs to check if the configuration is correct.

**Update releases in projet** [**x402-examples**](https://github.com/mogami-tech/x402-examples)**.**

### Run a payment with hosted facilitator on Base Sepolia.

**Warning**: Stop the local facilitator and remove the `TIP_PRIVATE_KEY` env variable.

Run the example using hosted facilitator:

```bash
just run_tests
```

You can check the balance of our two test addresses here:\
\- [0xf6b42050A71Ca13f842eDa53C7d31B7C1BD94F6E](https://sepolia.basescan.org/address/0xf6b42050A71Ca13f842eDa53C7d31B7C1BD94F6E#tokentxns) (payer)\
\- [0x375605671ddA2d461E333Cfa51F5b53763E8C585](https://sepolia.basescan.org/address/0x375605671ddA2d461E333Cfa51F5b53763E8C585#tokentxns) (provider)

### Run a payment with hosted facilitator on Base Mainnet.

Open a terminal, set the sender private key and the target URL with this command:

```bash
EXPORT TIP_PRIVATE_KEY=SENDER_PRIVATE_KEY
EXPORT TIP_URL=https://playground.mogami.tech/tip
```

And then, run:

```bash
just run_application
```

You can check the balance of our two test addresses here:

* [0x375605671ddA2d461E333Cfa51F5b53763E8C585](https://basescan.org/token/0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913?a=0x375605671ddA2d461E333Cfa51F5b53763E8C585)
* [0x2306e12F56e45E698bFAfa9c5E7D4e77cDEb4d06](https://basescan.org/token/0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913?a=0x2306e12F56e45E698bFAfa9c5E7D4e77cDEb4d06)

You can now release [x402-examples](https://github.com/mogami-tech/x402-examples).

### Documentation.

You can now update the documentation, *especially project versions*.
