# Update your oracle

## The easy way

Run this unique command where the environment variables file is located (`env_oracle`). By default it is in the home directory.&#x20;

```sh
curl -L https://moneyonchain.com/omoc_update.sh | bash
```

Basically this is a script that performs the procedure described in the [next section](#procedure) but in a single step.&#x20;

[![example](https://asciinema.org/a/kwwgKxyPQL4YePT1r9j4QLHqD.svg)](https://asciinema.org/a/kwwgKxyPQL4YePT1r9j4QLHqD)<br>

## Procedure

To be transparent, this section explains the whole procedure. We recommend use [the easy way](#the-easy-way).

Where `docker` runs, you need to execute these commands to update the oracle node.\
You must run them step by step in the following order:

#### 1. Pull the new docker image&#x20;

```sh
docker pull moneyonchain/omoc_node:latest 
```

#### 2. Stop your oracle service

```sh
docker stop omoc-node
```

#### 3. Remove your current oracle instance

```sh
docker rm omoc-node
```

#### 4. Rebuild your oracle instance and run it &#x20;

```sh
docker run -d --restart always --log-driver json-file --log-opt max-size=50M --log-opt max-file=15 --log-opt compress=true -p 5556:5556 --name omoc-node --env-file=/home/ubuntu/env_oracle moneyonchain/omoc_node:latest 
```

#### 5. View the oracle log to make sure it is working properly (Optional)

```sh
docker logs -n 1 -t -f omoc-node
```

When you have seen enough press `Ctrl + C` to exit.

## How to check the oracle version

Since `1.3.6.3` version an oracle endpoint has been added to expose which version is running.\
The endpoint is `http://<server-ip-address>:<port>/version` where `<server-ip-address>` is the oracle's `IP` and `<port>` is the oracle's port number (by default it is `5556`).

You can execute this command where `docker` runs:

```sh
curl http://localhost:<port>/version
```

Replacing `<port>` by the port number (usually `5556`) and you get something like this:

```sh
user@host:~$ curl http://localhost:5556/version
{"version":"1.3.6.9"}
```

{% hint style="danger" %}
If you try to obtain this data in an prior `1.3.6.3` version oracle you will get as an answer. *"The request was not made by a selected oracle."*
{% endhint %}

## Changelog&#x20;

#### 1.3.7.0 (latest) - cost savings in price publications <a href="#id-1364---minor-updates-in-doc-and-requirements" id="id-1364---minor-updates-in-doc-and-requirements"></a>

* Dynamic minimum gas price limit
* Publication parameters conditioned on the state of the stable coin protocol

#### 1.3.6.9 - Support for new pairs <a href="#id-1364---minor-updates-in-doc-and-requirements" id="id-1364---minor-updates-in-doc-and-requirements"></a>

* Officially adds `USD/ARS` and `USD/COP` pairs support

#### 1.3.6.8 - Minor fixes related to security <a href="#id-1364---minor-updates-in-doc-and-requirements" id="id-1364---minor-updates-in-doc-and-requirements"></a>

* Fix coinpair switch round gas price

#### 1.3.6.7 - Minor fixes related to security <a href="#id-1364---minor-updates-in-doc-and-requirements" id="id-1364---minor-updates-in-doc-and-requirements"></a>

* Fix coinpair switch round gas limit
* Fix `FastAPI` DoS

#### 1.3.6.6 - Minor updates related to the gas price and RIF prices source <a href="#id-1364---minor-updates-in-doc-and-requirements" id="id-1364---minor-updates-in-doc-and-requirements"></a>

* Adds hard limits to the `gas price`
* Adds local copy of contracts `ABI`
* Adds new `gas price` log
* Fix some `RIF` price sources

#### 1.3.6.5 - Fix gas price issues <a href="#id-1364---minor-updates-in-doc-and-requirements" id="id-1364---minor-updates-in-doc-and-requirements"></a>

Related to the `20 Gwei` spikes in the `gas price` that the RSK network node announces.

#### 1.3.6.4 - Minor updates in doc and requirements <a href="#id-1364---minor-updates-in-doc-and-requirements" id="id-1364---minor-updates-in-doc-and-requirements"></a>

Minimal wording changes in `readme.md` and invalid and unrequired dependency removed from `requisites.txt`.

#### 1.3.6.3 - Add endpoints for node version and information <a href="#id-1363-add-endpoints-for-node-version-and-information" id="id-1363-add-endpoints-for-node-version-and-information"></a>

Two endpoints were added:

* `/version` returns json-formatted version of the oracle-node
* `/info` returns extra-information about oracle-node state

#### 1.3.6.2 - Improve error responses when a sign request is rejected <a href="#id-1362-improve-error-responses-when-a-sign-request-is-rejected" id="id-1362-improve-error-responses-when-a-sign-request-is-rejected"></a>

When an oracle-node is requested to sign a price, and a publishing required condition isn’t meet it will report back which condition fails. In case an exception is produced it will report the exception. Also if there’s no information about the exception the message was improved.

#### 1.3.6.1 - Owner address instead of oracle address <a href="#id-1361---owner-address-instead-of-oracle-address" id="id-1361---owner-address-instead-of-oracle-address"></a>

With this change the oracle-node invokes a contract requiring the oracle’s owner address not only with the oracle itself address but also with its owner address. In this way, we made it compatible with newer and older contract versions.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.moneyonchain.com/omoc/update-your-oracle.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
