upgrade elixir to 1.8.1

pull/1532/head
Ayrat Badykov 6 years ago
parent 1832b40061
commit e023ed454a
No known key found for this signature in database
GPG Key ID: B44668E265E9396F
  1. 2
      .tool-versions
  2. 58
      README.md
  3. 4
      apps/block_scout_web/mix.exs
  4. 6
      apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/web_socket.ex
  5. 4
      apps/ethereum_jsonrpc/mix.exs
  6. 4
      apps/explorer/mix.exs
  7. 2
      apps/explorer/test/explorer/smart_contract/publisher_test.exs
  8. 2
      apps/explorer/test/explorer/smart_contract/solidity/code_compiler_test.exs
  9. 2
      apps/explorer/test/explorer/smart_contract/verifier_test.exs
  10. 4
      apps/indexer/mix.exs
  11. 2
      mix.exs
  12. 4
      mix.lock
  13. 7
      rel/config.exs

@ -1,3 +1,3 @@
elixir 1.7.1
elixir 1.8.1
erlang 21.0.4
nodejs 10.11.0

@ -77,7 +77,7 @@ The [development stack page](https://github.com/poanetwork/blockscout/wiki/Devel
| Dependency | Mac | Linux |
|-------------|-----|-------|
| [Erlang/OTP 21.0.4](https://github.com/erlang/otp) | `brew install erlang` | [Erlang Install Example](https://github.com/poanetwork/blockscout-terraform/blob/33f68e816e36dc2fb055911fa0372531f0e956e7/modules/stack/libexec/init.sh#L134) |
| [Elixir 1.7.1](https://elixir-lang.org/) | :point_up: | [Elixir Install Example](https://github.com/poanetwork/blockscout-terraform/blob/33f68e816e36dc2fb055911fa0372531f0e956e7/modules/stack/libexec/init.sh#L138) |
| [Elixir 1.8.1](https://elixir-lang.org/) | :point_up: | [Elixir Install Example](https://github.com/poanetwork/blockscout-terraform/blob/33f68e816e36dc2fb055911fa0372531f0e956e7/modules/stack/libexec/init.sh#L138) |
| [Postgres 10.3](https://www.postgresql.org/) | `brew install postgresql` | [Postgres Install Example](https://github.com/poanetwork/blockscout-terraform/blob/33f68e816e36dc2fb055911fa0372531f0e956e7/modules/stack/libexec/init.sh#L187) |
| [Node.js 10.5.0](https://nodejs.org/en/) | `brew install node` | [Node.js Install Example](https://github.com/poanetwork/blockscout-terraform/blob/33f68e816e36dc2fb055911fa0372531f0e956e7/modules/stack/libexec/init.sh#L66) |
| [Automake](https://www.gnu.org/software/automake/) | `brew install automake` | [Automake Install Example](https://github.com/poanetwork/blockscout-terraform/blob/33f68e816e36dc2fb055911fa0372531f0e956e7/modules/stack/libexec/init.sh#L72) |
@ -88,31 +88,31 @@ The [development stack page](https://github.com/poanetwork/blockscout/wiki/Devel
### Build and Run
1. Clone the repository.
1. Clone the repository.
`git clone https://github.com/poanetwork/blockscout`
2. Go to the explorer subdirectory.
2. Go to the explorer subdirectory.
`cd blockscout`
3. Set up default configurations.
`cp apps/explorer/config/dev.secret.exs.example apps/explorer/config/dev.secret.exs`
3. Set up default configurations.
`cp apps/explorer/config/dev.secret.exs.example apps/explorer/config/dev.secret.exs`
`cp apps/block_scout_web/config/dev.secret.exs.example apps/block_scout_web/config/dev.secret.exs`
<br />Linux: Update the database username and password configuration in `apps/explorer/config/dev.secret.exs`
<br />Mac: Remove the `username` and `password` fields from `apps/explorer/config/dev.secret.exs`
<br />Optional: Set up default configuration for testing.
`cp apps/explorer/config/test.secret.exs.example apps/explorer/config/test.secret.exs`
<br />Mac: Remove the `username` and `password` fields from `apps/explorer/config/dev.secret.exs`
<br />Optional: Set up default configuration for testing.
`cp apps/explorer/config/test.secret.exs.example apps/explorer/config/test.secret.exs`
Example usage: Changing the default Postgres port from localhost:15432 if [Boxen](https://github.com/boxen/boxen) is installed.
4. Install dependencies.
4. Install dependencies.
`mix do deps.get, local.rebar --force, deps.compile, compile`
5. Create and migrate database.
`mix ecto.create && mix ecto.migrate`
<br />_Note:_ If you have run previously, drop the previous database
5. Create and migrate database.
`mix ecto.create && mix ecto.migrate`
<br />_Note:_ If you have run previously, drop the previous database
`mix do ecto.drop, ecto.create, ecto.migrate`
6. Install Node.js dependencies.
`cd apps/block_scout_web/assets && npm install; cd -`
6. Install Node.js dependencies.
`cd apps/block_scout_web/assets && npm install; cd -`
`cd apps/explorer && npm install; cd -`
7. Update your JSON RPC Variant in `apps/explorer/config/dev.exs` and `apps/indexer/config/dev.exs`.
@ -120,7 +120,7 @@ The [development stack page](https://github.com/poanetwork/blockscout/wiki/Devel
8. Update your JSON RPC Endpoint in `apps/explorer/config/dev/` and `apps/indexer/config/dev/`
For the `variant` chosen in step 7, enter the correct information for the corresponding JSON RPC Endpoint in `parity.exs`, `geth.exs`, or `ganache.exs`
9. Enable HTTPS in development. The Phoenix server only runs with HTTPS.
* `cd apps/block_scout_web`
* `mix phx.gen.cert blockscout blockscout.local; cd -`
@ -132,14 +132,14 @@ The [development stack page](https://github.com/poanetwork/blockscout/wiki/Devel
```
* If using Chrome, Enable `chrome://flags/#allow-insecure-localhost`.
9. Start Phoenix Server.
9. Start Phoenix Server.
`mix phx.server`
Now you can visit [`localhost:4000`](http://localhost:4000) from your browser.
_Additional runtime options:_
* Run Phoenix Server with IEx (Interactive Elixer)
* Run Phoenix Server with IEx (Interactive Elixer)
`iex -S mix phx.server`
* Run Phoenix Server with real time indexer
@ -204,29 +204,29 @@ To monitor build status, configure your local [CCMenu](http://ccmenu.org/) with
#### Running the tests
1. Build the assets.
1. Build the assets.
`cd apps/block_scout_web/assets && npm run build; cd -`
2. Format the Elixir code.
2. Format the Elixir code.
`mix format`
3. Run the test suite with coverage for whole umbrella project. This step can be run with different configuration outlined below.
`mix coveralls.html --umbrella`
4. Lint the Elixir code.
4. Lint the Elixir code.
`mix credo --strict`
5. Run the dialyzer.
5. Run the dialyzer.
`mix dialyzer --halt-exit-status`
6. Check the Elixir code for vulnerabilities.
`cd apps/explorer && mix sobelow --config; cd -`
6. Check the Elixir code for vulnerabilities.
`cd apps/explorer && mix sobelow --config; cd -`
`cd apps/block_scout_web && mix sobelow --config; cd -`
7. Lint the JavaScript code.
7. Lint the JavaScript code.
`cd apps/block_scout_web/assets && npm run eslint; cd -`
8. Test the JavaScript code.
8. Test the JavaScript code.
`cd apps/block_scout_web/assets && npm run test; cd -`
##### Parity
@ -281,12 +281,12 @@ mix coveralls.html --umbrella --exclude no_geth
To view Modules and API Reference documentation:
1. Generate documentation.
1. Generate documentation.
`mix docs`
2. View the generated docs.
2. View the generated docs.
`open doc/index.html`
## Front-end
## Front-end
### Javascript
@ -307,7 +307,7 @@ To understand how to build new pages that need redux in this project, see the [r
The app is currently internationalized. It is only localized to U.S. English. To translate new strings.
1. To setup translation file.
1. To setup translation file.
`cd apps/block_scout_web; mix gettext.extract --merge; cd -`
2. To edit the new strings, go to `apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po`.

@ -15,7 +15,7 @@ defmodule BlockScoutWeb.Mixfile do
plt_add_deps: :transitive,
ignore_warnings: "../../.dialyzer-ignore"
],
elixir: "~> 1.6",
elixir: "~> 1.8",
elixirc_paths: elixirc_paths(Mix.env()),
lockfile: "../../mix.lock",
package: package(),
@ -122,7 +122,7 @@ defmodule BlockScoutWeb.Mixfile do
# Tracing
{:spandex, github: "spandex-project/spandex", branch: "allow-setting-trace-key", override: true},
# `:spandex` integration with Datadog
{:spandex_datadog, "~> 0.3.1"},
{:spandex_datadog, "~> 0.4.0"},
# `:spandex` tracing of `:phoenix`
{:spandex_phoenix, "~> 0.3.1"},
{:timex, "~> 3.4"},

@ -37,14 +37,14 @@ defmodule EthereumJSONRPC.WebSocket do
@doc """
Allow `c:start_link/1` to be called as part of a supervision tree.
"""
@callback child_spec([url :: String.t() | options :: term()]) :: Supervisor.child_spec()
@callback child_spec([(url :: String.t()) | (options :: term())]) :: Supervisor.child_spec()
@doc """
Starts web socket attached to `url` with `options`.
"""
# Return is same as `t:GenServer.on_start/0`
@callback start_link([url :: String.t() | options :: term()]) ::
{:ok, pid()} | :ignore | {:error, {:already_started, pid()} | reason :: term()}
@callback start_link([(url :: String.t()) | (options :: term())]) ::
{:ok, pid()} | :ignore | {:error, {:already_started, pid()} | (reason :: term())}
@doc """
Run a single Remote Procedure Call (RPC) `t:EthereumJSONRPC.Transport.request/0` through `t:web_socket/0`.

@ -15,7 +15,7 @@ defmodule EthereumJsonrpc.MixProject do
plt_add_apps: [:mix],
ignore_warnings: "../../.dialyzer-ignore"
],
elixir: "~> 1.6",
elixir: "~> 1.8",
elixirc_paths: elixirc_paths(Mix.env()),
lockfile: "../../mix.lock",
preferred_cli_env: [
@ -80,7 +80,7 @@ defmodule EthereumJsonrpc.MixProject do
# Tracing
{:spandex, github: "spandex-project/spandex", branch: "allow-setting-trace-key", override: true},
# `:spandex` integration with Datadog
{:spandex_datadog, "~> 0.3.1"},
{:spandex_datadog, "~> 0.4.0"},
# Convert unix timestamps in JSONRPC to DateTimes
{:timex, "~> 3.4"},
# Encode/decode function names and arguments

@ -15,7 +15,7 @@ defmodule Explorer.Mixfile do
plt_add_apps: ~w(ex_unit mix)a,
ignore_warnings: "../../.dialyzer-ignore"
],
elixir: "~> 1.6",
elixir: "~> 1.8",
elixirc_paths: elixirc_paths(Mix.env()),
lockfile: "../../mix.lock",
package: package(),
@ -108,7 +108,7 @@ defmodule Explorer.Mixfile do
# Tracing
{:spandex, github: "spandex-project/spandex", branch: "allow-setting-trace-key", override: true},
# `:spandex` integration with Datadog
{:spandex_datadog, "~> 0.3.1"},
{:spandex_datadog, "~> 0.4.0"},
# `:spandex` tracing of `:ecto`
{:spandex_ecto, "~> 0.4.0"},
# Attach `:prometheus_ecto` to `:ecto`

@ -99,7 +99,7 @@ defmodule Explorer.SmartContract.PublisherTest do
test "validates and creates smart contract with external libraries" do
contract_data =
"#{System.cwd!()}/test/support/fixture/smart_contract/compiler_tests.json"
"#{File.cwd!()}/test/support/fixture/smart_contract/compiler_tests.json"
|> File.read!()
|> Jason.decode!()
|> List.first()

@ -6,7 +6,7 @@ defmodule Explorer.SmartContract.Solidity.CodeCompilerTest do
alias Explorer.Factory
alias Explorer.SmartContract.Solidity.CodeCompiler
@compiler_tests "#{System.cwd!()}/test/support/fixture/smart_contract/compiler_tests.json"
@compiler_tests "#{File.cwd!()}/test/support/fixture/smart_contract/compiler_tests.json"
|> File.read!()
|> Jason.decode!()

@ -30,7 +30,7 @@ defmodule Explorer.SmartContract.VerifierTest do
test "verifies the generated bytecode with external libraries" do
contract_data =
"#{System.cwd!()}/test/support/fixture/smart_contract/compiler_tests.json"
"#{File.cwd!()}/test/support/fixture/smart_contract/compiler_tests.json"
|> File.read!()
|> Jason.decode!()
|> List.first()

@ -10,7 +10,7 @@ defmodule Indexer.MixProject do
deps: deps(),
deps_path: "../../deps",
description: "Fetches block chain data from on-chain node for later reading with Explorer.",
elixir: "~> 1.6",
elixir: "~> 1.8",
elixirc_paths: elixirc_paths(Mix.env()),
lockfile: "../../mix.lock",
preferred_cli_env: [
@ -63,7 +63,7 @@ defmodule Indexer.MixProject do
# Tracing
{:spandex, github: "spandex-project/spandex", branch: "allow-setting-trace-key", override: true},
# `:spandex` integration with Datadog
{:spandex_datadog, "~> 0.3.1"}
{:spandex_datadog, "~> 0.4.0"}
]
end

@ -13,7 +13,7 @@ defmodule BlockScout.Mixfile do
plt_add_apps: ~w(ex_unit mix)a,
ignore_warnings: ".dialyzer-ignore"
],
elixir: "~> 1.6",
elixir: "~> 1.8",
preferred_cli_env: [
coveralls: :test,
"coveralls.detail": :test,

@ -71,7 +71,7 @@
"mochiweb": {:hex, :mochiweb, "2.18.0", "eb55f1db3e6e960fac4e6db4e2db9ec3602cc9f30b86cd1481d56545c3145d2e", [:rebar3], [], "hexpm"},
"mock": {:hex, :mock, "0.3.2", "e98e998fd76c191c7e1a9557c8617912c53df3d4a6132f561eb762b699ef59fa", [:mix], [{:meck, "~> 0.8.8", [hex: :meck, repo: "hexpm", optional: false]}], "hexpm"},
"mox": {:hex, :mox, "0.4.0", "7f120840f7d626184a3d65de36189ca6f37d432e5d63acd80045198e4c5f7e6e", [:mix], [], "hexpm"},
"msgpax": {:hex, :msgpax, "1.1.0", "e31625e256db2decca1ae2b841f21b4d2483b1332649ce3ebc96c7ff7a4986e3", [:mix], [{:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm"},
"msgpax": {:hex, :msgpax, "2.2.2", "559a07806bbe5fdd31e4597455be030bd96356f7a621ca9eed832747c83bfb67", [:mix], [{:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm"},
"nimble_parsec": {:hex, :nimble_parsec, "0.5.0", "90e2eca3d0266e5c53f8fbe0079694740b9c91b6747f2b7e3c5d21966bba8300", [:mix], [], "hexpm"},
"optimal": {:hex, :optimal, "0.3.6", "46bbf52fbbbd238cda81e02560caa84f93a53c75620f1fe19e81e4ae7b07d1dd", [:mix], [], "hexpm"},
"parallel_stream": {:hex, :parallel_stream, "1.0.6", "b967be2b23f0f6787fab7ed681b4c45a215a81481fb62b01a5b750fa8f30f76c", [:mix], []},
@ -98,7 +98,7 @@
"set_locale": {:git, "https://github.com/minifast/set_locale.git", "da9ae029642bc0fbd9212c2aaf86c0adca70c084", [branch: "master"]},
"sobelow": {:hex, :sobelow, "0.7.4", "228cc6185b448b63ecc88429b43e864e8dd570e8e09f2d04b3aa71894db1bdbb", [:mix], [], "hexpm"},
"spandex": {:git, "https://github.com/spandex-project/spandex.git", "92992b4aaf3d92e031c2417ff2e6c9e94d27fe36", [branch: "allow-setting-trace-key"]},
"spandex_datadog": {:hex, :spandex_datadog, "0.3.1", "984d27ad1f45cfd243509692f0f63b900a23b79566c529a644c7f3a2b4120603", [:mix], [{:msgpax, "~> 1.1", [hex: :msgpax, repo: "hexpm", optional: false]}, {:spandex, "~> 2.3", [hex: :spandex, repo: "hexpm", optional: false]}], "hexpm"},
"spandex_datadog": {:hex, :spandex_datadog, "0.4.0", "75113a73e843123074886a2e31994af07d6e0632749a8d97e9ca6157b120c287", [:mix], [{:msgpax, "~> 2.2.1", [hex: :msgpax, repo: "hexpm", optional: false]}, {:spandex, "~> 2.3", [hex: :spandex, repo: "hexpm", optional: false]}], "hexpm"},
"spandex_ecto": {:hex, :spandex_ecto, "0.4.0", "deaeaddc11a35f1c551206c53d09bb93a0da5808dbef751430e465c8c7de01d3", [:mix], [{:spandex, "~> 2.2", [hex: :spandex, repo: "hexpm", optional: false]}], "hexpm"},
"spandex_phoenix": {:hex, :spandex_phoenix, "0.3.1", "9cb9a4a9f2161f171d9df9afa1289a0d037abbbeecabae674f959b57f106f201", [:mix], [{:plug, "~> 1.3", [hex: :plug, repo: "hexpm", optional: false]}, {:spandex, "~> 2.2", [hex: :spandex, repo: "hexpm", optional: false]}], "hexpm"},
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.4", "f0eafff810d2041e93f915ef59899c923f4568f4585904d010387ed74988e77b", [:make, :mix, :rebar3], [], "hexpm"},

@ -12,10 +12,10 @@ defer = fn fun ->
end
app_root = fn ->
if String.contains?(System.cwd!(), "apps") do
Path.join([System.cwd!(), "/../../"])
if String.contains?(File.cwd!(), "apps") do
Path.join([File.cwd!(), "/../../"])
else
System.cwd!()
File.cwd!()
end
end
@ -82,4 +82,3 @@ release :blockscout do
seed: "rel/commands/seed.sh",
]
end

Loading…
Cancel
Save