diff --git a/Makefile b/Makefile index b3c09b1d58..cb48dab3ac 100644 --- a/Makefile +++ b/Makefile @@ -408,7 +408,7 @@ start-watcher: rm -f ./_build/${BAREBUILD_ENV}/rel/watcher/var/sys.config || true && \ echo "Init Watcher DBs" && \ _build/${BAREBUILD_ENV}/rel/watcher/bin/watcher eval "OMG.DB.ReleaseTasks.InitKeyValueDB.run()" && \ - _build/${BAREBUILD_ENV}/rel/watcher_info/bin/watcher_info eval "OMG.DB.ReleaseTasks.InitKeysWithValues.run()" && \ + _build/${BAREBUILD_ENV}/rel/watcher/bin/watcher eval "OMG.DB.ReleaseTasks.InitKeysWithValues.run()" && \ echo "Run Watcher" && \ . ${OVERRIDING_VARIABLES} && \ PORT=${WATCHER_PORT} _build/${BAREBUILD_ENV}/rel/watcher/bin/watcher $(OVERRIDING_START) diff --git a/apps/omg_watcher/lib/omg_watcher/api/transaction.ex b/apps/omg_watcher/lib/omg_watcher/api/transaction.ex index f13f0fa5b0..f40167ef28 100644 --- a/apps/omg_watcher/lib/omg_watcher/api/transaction.ex +++ b/apps/omg_watcher/lib/omg_watcher/api/transaction.ex @@ -33,6 +33,12 @@ defmodule OMG.Watcher.API.Transaction do * transaction doesn't spend funds not yet mined * etc... """ + @spec submit(list(Transaction.Signed.t())) :: Client.response_t() | {:error, atom()} + def batch_submit(signed_txs) do + url = Application.get_env(:omg_watcher, :child_chain_url) + Client.batch_submit(signed_txs, url) + end + @spec submit(Transaction.Signed.t()) :: Client.response_t() | {:error, atom()} def submit(%Transaction.Signed{} = signed_tx) do url = Application.get_env(:omg_watcher, :child_chain_url) diff --git a/apps/omg_watcher/lib/omg_watcher/http_rpc/adapter.ex b/apps/omg_watcher/lib/omg_watcher/http_rpc/adapter.ex index e1dab45f63..d54e2d5751 100644 --- a/apps/omg_watcher/lib/omg_watcher/http_rpc/adapter.ex +++ b/apps/omg_watcher/lib/omg_watcher/http_rpc/adapter.ex @@ -66,7 +66,7 @@ defmodule OMG.Watcher.HttpRPC.Adapter do the structure in body is known, so we can try to deserialize it. """ @spec get_response_body(HTTPoison.Response.t() | {:error, HTTPoison.Error.t()}) :: - {:ok, map()} | {:error, atom() | tuple() | HTTPoison.Error.t()} + {:ok, map()} | {:ok, list(map())} | {:error, atom() | tuple() | HTTPoison.Error.t()} def get_response_body(http_response) do with {:ok, body} <- get_unparsed_response_body(http_response), {:ok, response} <- Jason.decode(body), @@ -78,8 +78,9 @@ defmodule OMG.Watcher.HttpRPC.Adapter do end end - defp convert_keys_to_atoms(data) when is_list(data), - do: Enum.map(data, &convert_keys_to_atoms/1) + defp convert_keys_to_atoms(data) when is_list(data) do + Enum.map(data, &convert_keys_to_atoms/1) + end defp convert_keys_to_atoms(data) when is_map(data) do data diff --git a/apps/omg_watcher/lib/omg_watcher/http_rpc/client.ex b/apps/omg_watcher/lib/omg_watcher/http_rpc/client.ex index 74d00f6069..cfec3bacf4 100644 --- a/apps/omg_watcher/lib/omg_watcher/http_rpc/client.ex +++ b/apps/omg_watcher/lib/omg_watcher/http_rpc/client.ex @@ -23,7 +23,8 @@ defmodule OMG.Watcher.HttpRPC.Client do require Logger @type response_t() :: - {:ok, %{required(atom()) => any()}} + list() + | {:ok, %{required(atom()) => any()}} | {:error, {:client_error | :server_error, any()} | {:malformed_response, any() | {:error, :invalid}}} @@ -40,8 +41,16 @@ defmodule OMG.Watcher.HttpRPC.Client do @spec submit(binary(), binary()) :: response_t() def submit(tx, url), do: call(%{transaction: Encoding.to_hex(tx)}, "transaction.submit", url) + @doc """ + Submits a batch of transactions + """ + @spec batch_submit(list(binary()), binary()) :: response_t() + def batch_submit(txs, url) do + call(%{transactions: Enum.map(txs, &Encoding.to_hex(&1))}, "transaction.batch_submit", url) + end + defp call(params, path, url) do - Adapter.rpc_post(params, path, url) |> Adapter.get_response_body() |> decode_response() + params |> Adapter.rpc_post(path, url) |> Adapter.get_response_body() |> decode_response() end # Translates response's body to known elixir structure, either block or tx submission response or error. @@ -54,12 +63,29 @@ defmodule OMG.Watcher.HttpRPC.Client do }} end - defp decode_response({:ok, %{tx_hash: _hash} = response}) do - {:ok, Map.update!(response, :tx_hash, &decode16!/1)} + defp decode_response({:ok, %{txhash: _hash} = response}) do + {:ok, Map.update!(response, :txhash, &decode16!/1)} + end + + defp decode_response({:ok, response}) when is_list(response) do + decode_response(response, []) end defp decode_response(error), do: error + defp decode_response([], acc) do + Enum.reverse(acc) + end + + defp decode_response([%{txhash: _hash} = transaction_response | response], acc) do + decode_response(response, [Map.update!(transaction_response, :txhash, &decode16!/1) | acc]) + end + + # all error tuples + defp decode_response([%{error: error} | response], acc) do + decode_response(response, [%{error: {:skip_hex_encode, error}} | acc]) + end + defp decode16!(hexstr) do {:ok, bin} = Encoding.from_hex(hexstr) bin diff --git a/apps/omg_watcher/test/omg_watcher/exit_processor/standard_exit_test.exs b/apps/omg_watcher/test/omg_watcher/exit_processor/standard_exit_test.exs index 3185510ed2..047320819e 100644 --- a/apps/omg_watcher/test/omg_watcher/exit_processor/standard_exit_test.exs +++ b/apps/omg_watcher/test/omg_watcher/exit_processor/standard_exit_test.exs @@ -561,12 +561,12 @@ defmodule OMG.Watcher.ExitProcessor.StandardExitTest do defp start_se_from_deposit(processor, exiting_pos, alice) do tx = TestHelper.create_recovered([], [{alice, @eth, 10}]) - processor |> start_se_from(tx, exiting_pos) + start_se_from(processor, tx, exiting_pos) end defp start_se_from_block_tx(processor, exiting_pos, alice) do tx = TestHelper.create_recovered([Tuple.append(@deposit_input2, alice)], [{alice, @eth, 10}]) - processor |> start_se_from(tx, exiting_pos) + start_se_from(processor, tx, exiting_pos) end defp get_bytes_sig(tx, sig_idx \\ 0), do: {Transaction.raw_txbytes(tx), Enum.at(tx.signed_tx.sigs, sig_idx)} diff --git a/apps/omg_watcher_rpc/lib/web/controllers/transaction.ex b/apps/omg_watcher_rpc/lib/web/controllers/transaction.ex index 1905e26bac..0a1d15c008 100644 --- a/apps/omg_watcher_rpc/lib/web/controllers/transaction.ex +++ b/apps/omg_watcher_rpc/lib/web/controllers/transaction.ex @@ -57,6 +57,15 @@ defmodule OMG.WatcherRPC.Web.Controller.Transaction do end end + @doc """ + Submits transaction to child chain + """ + def batch_submit(conn, params) do + with {:ok, txbytes} <- expect(params, "transactions", list: &to_transaction/1, optional: false) do + submit_tx_sec(txbytes, conn) + end + end + @doc """ Thin-client version of `/transaction.submit` that accepts json encoded transaction """ @@ -109,6 +118,12 @@ defmodule OMG.WatcherRPC.Web.Controller.Transaction do end # Provides extra validation (recover_from) and passes transaction to API layer + defp submit_tx_sec(txbytes, conn) when is_list(txbytes) do + txbytes + |> SecurityApiTransaction.batch_submit() + |> api_response(conn, :batch_submission) + end + defp submit_tx_sec(txbytes, conn) do with {:ok, recovered_tx} <- Transaction.Recovered.recover_from(txbytes), :ok <- is_supported(recovered_tx) do @@ -119,10 +134,13 @@ defmodule OMG.WatcherRPC.Web.Controller.Transaction do end end - defp is_supported(%Transaction.Recovered{ - signed_tx: %Transaction.Signed{raw_tx: %Transaction.Fee{}} - }), - do: {:error, :transaction_not_supported} + defp is_supported(%Transaction.Recovered{signed_tx: %Transaction.Signed{raw_tx: %Transaction.Fee{}}}) do + {:error, :transaction_not_supported} + end defp is_supported(%Transaction.Recovered{}), do: :ok + + defp to_transaction(transaction) do + expect(%{"transaction" => transaction}, "transaction", :hex) + end end diff --git a/apps/omg_watcher_rpc/lib/web/router.ex b/apps/omg_watcher_rpc/lib/web/router.ex index a99e7f96da..e641da8646 100644 --- a/apps/omg_watcher_rpc/lib/web/router.ex +++ b/apps/omg_watcher_rpc/lib/web/router.ex @@ -58,7 +58,7 @@ defmodule OMG.WatcherRPC.Web.Router do post("/utxo.get_challenge_data", Controller.Challenge, :get_utxo_challenge) post("/transaction.submit", Controller.Transaction, :submit) - + post("/transaction.batch_submit", Controller.Transaction, :batch_submit) post("/in_flight_exit.get_data", Controller.InFlightExit, :get_in_flight_exit) post("/in_flight_exit.get_competitor", Controller.InFlightExit, :get_competitor) post("/in_flight_exit.prove_canonical", Controller.InFlightExit, :prove_canonical) diff --git a/apps/omg_watcher_rpc/lib/web/views/transaction.ex b/apps/omg_watcher_rpc/lib/web/views/transaction.ex index c48c96b8c3..36c817ed79 100644 --- a/apps/omg_watcher_rpc/lib/web/views/transaction.ex +++ b/apps/omg_watcher_rpc/lib/web/views/transaction.ex @@ -30,6 +30,12 @@ defmodule OMG.WatcherRPC.Web.View.Transaction do |> WatcherRPCResponse.add_app_infos() end + def render("batch_submission.json", %{response: transactions}) do + transactions + |> Response.serialize() + |> WatcherRPCResponse.add_app_infos() + end + def render("transactions.json", %{response: %Paginator{data: transactions, data_paging: data_paging}}) do transactions |> Enum.map(&render_transaction/1) diff --git a/apps/omg_watcher_rpc/priv/swagger/info_api_specs/batch_transaction/paths.yaml b/apps/omg_watcher_rpc/priv/swagger/info_api_specs/batch_transaction/paths.yaml new file mode 100644 index 0000000000..44d6bb0267 --- /dev/null +++ b/apps/omg_watcher_rpc/priv/swagger/info_api_specs/batch_transaction/paths.yaml @@ -0,0 +1,17 @@ +transaction.batch_submit: + post: + tags: + - Transaction + summary: This endpoint submits an array of signed transaction to the child chain. + description: > + Normally you should call the Watcher's Transaction - Submit instead of this. + The Watcher's version performs various security and validation checks (TO DO) before submitting the transaction, + so is much safer. However, if the Watcher is not available this version exists. + operationId: batch_submit + requestBody: + $ref: 'request_bodies.yaml#/TransactionBatchSubmitBodySchema' + responses: + 200: + $ref: 'responses.yaml#/TransactionBatchSubmitResponse' + 500: + $ref: '../responses.yaml#/InternalServerError' \ No newline at end of file diff --git a/apps/omg_watcher_rpc/priv/swagger/info_api_specs/batch_transaction/request_bodies.yaml b/apps/omg_watcher_rpc/priv/swagger/info_api_specs/batch_transaction/request_bodies.yaml new file mode 100644 index 0000000000..dab963354a --- /dev/null +++ b/apps/omg_watcher_rpc/priv/swagger/info_api_specs/batch_transaction/request_bodies.yaml @@ -0,0 +1,17 @@ +TransactionBatchSubmitBodySchema: + description: Array of signed transactions, RLP-encoded to bytes, and HEX-encoded to string + required: true + content: + application/json: + schema: + title: 'TransactionBatchSubmitBodySchema' + type: object + properties: + transactions: + type: array + items: + type: string + required: + - transactions + example: + transactions: ['0xf8d083015ba98080808080940000...', '0xf8d083a15ba98080808080920000...'] \ No newline at end of file diff --git a/apps/omg_watcher_rpc/priv/swagger/info_api_specs/batch_transaction/response_schemas.yaml b/apps/omg_watcher_rpc/priv/swagger/info_api_specs/batch_transaction/response_schemas.yaml new file mode 100644 index 0000000000..521f0c6711 --- /dev/null +++ b/apps/omg_watcher_rpc/priv/swagger/info_api_specs/batch_transaction/response_schemas.yaml @@ -0,0 +1,14 @@ +TransactionBatchSubmitResponseSchema: + allOf: + - $ref: '../response_schemas.yaml#/WatcherBaseResponseSchema' + - type: object + properties: + data: + type: array + $ref: 'schemas.yaml#/TransactionBatchSubmitSchema ' + example: + data: + - + blknum: 123000 + txindex: 111 + txhash: '0xbdf562c24ace032176e27621073df58ce1c6f65de3b5932343b70ba03c72132d' \ No newline at end of file diff --git a/apps/omg_watcher_rpc/priv/swagger/info_api_specs/batch_transaction/responses.yaml b/apps/omg_watcher_rpc/priv/swagger/info_api_specs/batch_transaction/responses.yaml new file mode 100644 index 0000000000..90f3a8fe93 --- /dev/null +++ b/apps/omg_watcher_rpc/priv/swagger/info_api_specs/batch_transaction/responses.yaml @@ -0,0 +1,6 @@ +TransactionBatchSubmitResponse: + description: Transaction batch submission successful response + content: + application/json: + schema: + $ref: 'response_schemas.yaml#/TransactionBatchSubmitResponseSchema' \ No newline at end of file diff --git a/apps/omg_watcher_rpc/priv/swagger/info_api_specs/batch_transaction/schemas.yaml b/apps/omg_watcher_rpc/priv/swagger/info_api_specs/batch_transaction/schemas.yaml new file mode 100644 index 0000000000..ad14286ff5 --- /dev/null +++ b/apps/omg_watcher_rpc/priv/swagger/info_api_specs/batch_transaction/schemas.yaml @@ -0,0 +1,13 @@ +TransactionBatchSubmitSchema: + type: array + items: + type: object + properties: + blknum: + type: integer + format: int64 + txindex: + type: integer + format: int16 + txhash: + type: string \ No newline at end of file diff --git a/apps/omg_watcher_rpc/priv/swagger/security_critical_api_specs.yaml b/apps/omg_watcher_rpc/priv/swagger/security_critical_api_specs.yaml index 3f52b8230b..432f4cd8ab 100644 --- a/apps/omg_watcher_rpc/priv/swagger/security_critical_api_specs.yaml +++ b/apps/omg_watcher_rpc/priv/swagger/security_critical_api_specs.yaml @@ -1427,6 +1427,138 @@ paths: description: Something went wrong on the server messages: error_key: error_reason +/transaction.batch_submit: + post: + tags: + - Transaction + summary: This endpoint submits an array of signed transaction to the child chain. + description: | + Normally you should call the Watcher's Transaction - Submit instead of this. The Watcher's version performs various security and validation checks (TO DO) before submitting the transaction, so is much safer. However, if the Watcher is not available this version exists. + operationId: batch_submit + requestBody: + description: 'Array of signed transactions, RLP-encoded to bytes, and HEX-encoded to string' + required: true + content: + application/json: + schema: + title: TransactionBatchSubmitBodySchema + type: object + properties: + transactions: + type: array + items: + type: string + required: + - transactions + example: + transactions: + - 0xf8d083015ba98080808080940000... + - 0xf8d083a15ba98080808080920000... + responses: + '200': + description: Transaction batch submission successful response + content: + application/json: + schema: + allOf: + - description: The response schema for a successful operation + type: object + properties: + version: + type: string + success: + type: boolean + data: + type: object + service_name: + type: string + required: + - service_name + - version + - success + - data + example: + service_name: watcher + version: 1.0.0+abcdefa + success: true + data: {} + - type: object + properties: + data: + type: array + items: + type: object + properties: + blknum: + type: integer + format: int64 + txindex: + type: integer + format: int16 + txhash: + type: string + example: + data: + - blknum: 123000 + txindex: 111 + txhash: '0xbdf562c24ace032176e27621073df58ce1c6f65de3b5932343b70ba03c72132d' + '500': + description: Returns an internal server error + content: + application/json: + schema: + description: The response schema for an error + allOf: + - description: The response schema for a successful operation + type: object + properties: + version: + type: string + success: + type: boolean + data: + type: object + service_name: + type: string + required: + - service_name + - version + - success + - data + example: + service_name: watcher + version: 1.0.0+abcdefa + success: true + data: {} + - type: object + properties: + data: + description: The object schema for an error + type: object + properties: + object: + type: string + code: + type: string + description: + type: string + messages: + type: object + required: + - object + - code + - description + - messages + required: + - data + example: + success: false + data: + object: error + code: 'server:internal_server_error' + description: Something went wrong on the server + messages: + error_key: error_reason /in_flight_exit.get_data: post: tags: diff --git a/apps/omg_watcher_rpc/priv/swagger/security_critical_api_specs/batch_transaction/paths.yaml b/apps/omg_watcher_rpc/priv/swagger/security_critical_api_specs/batch_transaction/paths.yaml new file mode 100644 index 0000000000..44d6bb0267 --- /dev/null +++ b/apps/omg_watcher_rpc/priv/swagger/security_critical_api_specs/batch_transaction/paths.yaml @@ -0,0 +1,17 @@ +transaction.batch_submit: + post: + tags: + - Transaction + summary: This endpoint submits an array of signed transaction to the child chain. + description: > + Normally you should call the Watcher's Transaction - Submit instead of this. + The Watcher's version performs various security and validation checks (TO DO) before submitting the transaction, + so is much safer. However, if the Watcher is not available this version exists. + operationId: batch_submit + requestBody: + $ref: 'request_bodies.yaml#/TransactionBatchSubmitBodySchema' + responses: + 200: + $ref: 'responses.yaml#/TransactionBatchSubmitResponse' + 500: + $ref: '../responses.yaml#/InternalServerError' \ No newline at end of file diff --git a/apps/omg_watcher_rpc/priv/swagger/security_critical_api_specs/batch_transaction/request_bodies.yaml b/apps/omg_watcher_rpc/priv/swagger/security_critical_api_specs/batch_transaction/request_bodies.yaml new file mode 100644 index 0000000000..dab963354a --- /dev/null +++ b/apps/omg_watcher_rpc/priv/swagger/security_critical_api_specs/batch_transaction/request_bodies.yaml @@ -0,0 +1,17 @@ +TransactionBatchSubmitBodySchema: + description: Array of signed transactions, RLP-encoded to bytes, and HEX-encoded to string + required: true + content: + application/json: + schema: + title: 'TransactionBatchSubmitBodySchema' + type: object + properties: + transactions: + type: array + items: + type: string + required: + - transactions + example: + transactions: ['0xf8d083015ba98080808080940000...', '0xf8d083a15ba98080808080920000...'] \ No newline at end of file diff --git a/apps/omg_watcher_rpc/priv/swagger/security_critical_api_specs/batch_transaction/response_schemas.yaml b/apps/omg_watcher_rpc/priv/swagger/security_critical_api_specs/batch_transaction/response_schemas.yaml new file mode 100644 index 0000000000..521f0c6711 --- /dev/null +++ b/apps/omg_watcher_rpc/priv/swagger/security_critical_api_specs/batch_transaction/response_schemas.yaml @@ -0,0 +1,14 @@ +TransactionBatchSubmitResponseSchema: + allOf: + - $ref: '../response_schemas.yaml#/WatcherBaseResponseSchema' + - type: object + properties: + data: + type: array + $ref: 'schemas.yaml#/TransactionBatchSubmitSchema ' + example: + data: + - + blknum: 123000 + txindex: 111 + txhash: '0xbdf562c24ace032176e27621073df58ce1c6f65de3b5932343b70ba03c72132d' \ No newline at end of file diff --git a/apps/omg_watcher_rpc/priv/swagger/security_critical_api_specs/batch_transaction/responses.yaml b/apps/omg_watcher_rpc/priv/swagger/security_critical_api_specs/batch_transaction/responses.yaml new file mode 100644 index 0000000000..90f3a8fe93 --- /dev/null +++ b/apps/omg_watcher_rpc/priv/swagger/security_critical_api_specs/batch_transaction/responses.yaml @@ -0,0 +1,6 @@ +TransactionBatchSubmitResponse: + description: Transaction batch submission successful response + content: + application/json: + schema: + $ref: 'response_schemas.yaml#/TransactionBatchSubmitResponseSchema' \ No newline at end of file diff --git a/apps/omg_watcher_rpc/priv/swagger/security_critical_api_specs/batch_transaction/schemas.yaml b/apps/omg_watcher_rpc/priv/swagger/security_critical_api_specs/batch_transaction/schemas.yaml new file mode 100644 index 0000000000..ad14286ff5 --- /dev/null +++ b/apps/omg_watcher_rpc/priv/swagger/security_critical_api_specs/batch_transaction/schemas.yaml @@ -0,0 +1,13 @@ +TransactionBatchSubmitSchema: + type: array + items: + type: object + properties: + blknum: + type: integer + format: int64 + txindex: + type: integer + format: int16 + txhash: + type: string \ No newline at end of file diff --git a/apps/omg_watcher_rpc/priv/swagger/security_critical_api_specs/swagger.yaml b/apps/omg_watcher_rpc/priv/swagger/security_critical_api_specs/swagger.yaml index b3301dfd79..74cfa913eb 100644 --- a/apps/omg_watcher_rpc/priv/swagger/security_critical_api_specs/swagger.yaml +++ b/apps/omg_watcher_rpc/priv/swagger/security_critical_api_specs/swagger.yaml @@ -51,6 +51,8 @@ paths: $ref: 'utxo/paths.yaml#/utxo.get_exit_data' /transaction.submit: $ref: 'transaction/paths.yaml#/transaction.submit' + /transaction.batch_submit: + $ref: 'batch_transaction/paths.yaml#/transaction.batch_submit' /in_flight_exit.get_data: $ref: 'in_flight_exit/paths.yaml#/in_flight_exit.get_data' /in_flight_exit.get_competitor: diff --git a/config/config.exs b/config/config.exs index 64bd54464a..a765503c12 100644 --- a/config/config.exs +++ b/config/config.exs @@ -67,7 +67,7 @@ config :omg_db, ethereum_client_timeout_ms = 20_000 config :ethereumex, - url: "http://localhost:8545", + url: System.get_env("ETHEREUM_RPC_URL", "http://localhost:8545"), http_options: [recv_timeout: ethereum_client_timeout_ms] config :omg_eth, @@ -126,9 +126,8 @@ config :os_mon, system_memory_high_watermark: 1.00, process_memory_high_watermark: 1.00 -config :omg_watcher, child_chain_url: "http://localhost:9656" - config :omg_watcher, + child_chain_url: System.get_env("CHILD_CHAIN_URL", "http://localhost:9656/v1"), # 23 hours worth of blocks - this is how long the child chain server has to block spends from exiting utxos exit_processor_sla_margin: 23 * 60 * 4, # this means we don't want the `sla_margin` above be larger than the `min_exit_period` @@ -146,7 +145,7 @@ config :omg_watcher, OMG.Watcher.Tracer, type: :omg_watcher config :omg_watcher_info, - child_chain_url: "http://localhost:9656/v1", + child_chain_url: System.get_env("CHILD_CHAIN_URL", "http://localhost:9656/v1"), namespace: OMG.WatcherInfo, ecto_repos: [OMG.WatcherInfo.DB.Repo], metrics_collection_interval: 60_000 diff --git a/docker-compose.feefeed.yml b/docker-compose.feefeed.yml index 0ed0c3d1dd..52e7eef178 100644 --- a/docker-compose.feefeed.yml +++ b/docker-compose.feefeed.yml @@ -3,43 +3,57 @@ services: childchain: environment: - FEE_ADAPTER=feed - - FEE_FEED_URL=http://172.27.0.110:4000/api/v1 + #- FEE_FEED_URL=http://172.27.0.110:4000/api/v1 + - FEE_FEED_URL=http://172.27.0.110/file.json depends_on: feefeed: condition: service_healthy feefeed: - image: gcr.io/omisego-development/feefeed:latest - command: "start" - container_name: feefeed - environment: - - GITHUB_TOKEN="" - - GITHUB_ORGANISATION=omgnetwork - - GITHUB_REPO=fee-rules-public - - SENTRY_DSN="" - - GITHUB_BRANCH=master - - RULES_FETCH_INTERVAL=200 - - RATES_FETCH_INTERVAL=200 - - GITHUB_FILENAME=fee_rules - - DATABASE_URL=postgresql://feefeed:feefeed@172.27.0.107:5432/feefeed - - SECRET_KEY_BASE="Y8naENMR8b+vbPHILjwNtEfWFrnbGi2k+UYWm75VnKHfsavmyGLtTmmeJxAGK+zJ" - - DATADOG_DISABLED=true - - DATADOG_HOST="localhost" - - ETHEREUM_NODE_URL=http://172.27.0.108:80 + image: omisego/feefeed_mock:latest + volumes: + - ./docker/static_feefeed/:/www-data/ ports: - - "4000:4000" + - "4000:80" expose: - "4000" - depends_on: - postgres: - condition: service_healthy - restart: always - healthcheck: - test: curl -v --silent http://localhost:4000/api/v1/fees 2>&1 | grep contract_address - interval: 4s - timeout: 2s - retries: 30 - start_period: 60s networks: chain_net: ipv4_address: 172.27.0.110 + # feefeed: + # image: "gcr.io/omisego-development/feefeed:latest" + # command: "start" + # container_name: feefeed + # environment: + # - GITHUB_TOKEN="" + # - GITHUB_ORGANISATION=omgnetwork + # - GITHUB_REPO=fee-rules-public + # - SENTRY_DSN="" + # - GITHUB_BRANCH=master + # - RULES_FETCH_INTERVAL=20 + # - RATES_FETCH_INTERVAL=20 + # - GITHUB_FILENAME=fee_rules + # - DATABASE_URL=postgresql://feefeed:feefeed@172.27.0.107:5432/feefeed + # - SECRET_KEY_BASE="Y8naENMR8b+vbPHILjwNtEfWFrnbGi2k+UYWm75VnKHfsavmyGLtTmmeJxAGK+zJ" + # - DATADOG_DISABLED=true + # - DATADOG_HOST="localhost" + # - ETHEREUM_NODE_URL=http://172.27.0.102:80 + # ports: + # - "4000:4000" + # expose: + # - "4000" + # depends_on: + # postgres: + # condition: service_healthy + # nginx: + # condition: service_healthy + # restart: always + # healthcheck: + # test: curl -v --silent http://localhost:4000/api/v1/fees 2>&1 | grep contract_address + # interval: 4s + # timeout: 2s + # retries: 30 + # start_period: 60s + # networks: + # chain_net: + # ipv4_address: 172.27.0.110 \ No newline at end of file