forked from archethic-foundation/archethic-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmix.exs
140 lines (128 loc) · 4.31 KB
/
mix.exs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
defmodule Archethic.MixProject do
use Mix.Project
def project do
[
app: :archethic,
version: "0.16.0",
build_path: "_build",
config_path: "config/config.exs",
deps_path: "deps",
lockfile: "mix.lock",
aliases: aliases(),
elixir: "~> 1.11",
start_permanent: Mix.env() == :prod,
deps: deps(),
compilers: [:elixir_make, :phoenix] ++ Mix.compilers(),
elixirc_paths: elixirc_paths(Mix.env()),
elixirc_options: [warnings_as_errors: true],
dialyzer: dialyzer()
]
end
# Run "mix help compile.app" to learn about applications.
def application do
[
extra_applications: [:logger, :inets, :os_mon, :runtime_tools, :xmerl],
mod: {Archethic.Application, []}
]
end
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
# Specify dialyzer path
defp dialyzer do
[
plt_add_apps: [:mix, :ex_unit],
plt_core_path: "priv/plts",
plt_file: {:no_warn, "priv/plts/dialyzer.plt"}
]
end
# Run "mix help deps" to learn about dependencies.
defp deps do
[
# Web
{:phoenix, ">= 1.5.4"},
{:phoenix_html, "~> 2.14"},
{:phoenix_live_view, "~> 0.15.0"},
{:phoenix_pubsub, "~> 2.0"},
{:jason, "~> 1.0"},
{:plug_cowboy, "~> 2.3"},
{:absinthe, "~> 1.5.0"},
{:absinthe_plug, "~> 1.5"},
{:absinthe_phoenix, "~> 2.0"},
{:cors_plug, "~> 1.5"},
{:mint, "~> 1.0"},
{:ecto, "~> 3.5"},
{:websockex, "~> 0.4.3"},
# Dev
{:benchee, "~> 1.0"},
{:benchee_html, "~> 1.0", only: :dev},
{:ex_doc, "~> 0.24", only: :dev, runtime: false},
{:git_hooks, "~> 0.4.0", runtime: false},
{:credo, "~> 1.5", only: [:dev, :test], runtime: false},
{:elixir_make, "~> 0.6.0", runtime: false},
{:dialyxir, "~> 1.0", runtime: false},
# {:broadway_dashboard, "~> 0.2.0", only: :dev},
# Test
{:mox, "~> 0.5.2", only: [:test]},
{:stream_data, "~> 0.5.0", only: [:test], runtime: false},
{:floki, ">= 0.30.0", only: :test},
# P2P
{:ranch, "~> 2.1", override: true},
{:mmdb2_decoder, "~> 3.0"},
# Net
{:inet_ext, "~> 1.0"},
{:inet_cidr, "~> 1.1", hex: :erl_cidr, override: true},
# Monitoring
{:observer_cli, "~> 1.5"},
{:telemetry_metrics, "~> 0.6"},
{:telemetry_metrics_prometheus_core, "~> 1.0.0"},
{:telemetry_poller, "~> 0.5.1"},
{:phoenix_live_dashboard, "~> 0.3"},
# Utils
{:crontab, "~> 1.1"},
{:earmark, "~> 1.4"},
{:sizeable, "~> 1.0"},
{:distillery, github: "bitwalker/distillery", ref: "6700edb"},
{:exjsonpath, "~> 0.9.0"},
{:rand_compat, "~> 0.0.3"},
{:gen_state_machine, "~> 3.0"},
{:retry, "~> 0.14.1"},
{:gen_stage, "~> 1.1"},
{:flow, "~> 1.0"},
{:broadway, "~> 1.0"},
{:knigge, "~> 1.4"},
{:ex_json_schema, "~> 0.9.1", override: true},
{:pathex, "~> 2.0"}
]
end
defp aliases do
[
# Intial developer Setup
"dev.setup": ["deps.get", "cmd npm install --prefix assets"],
# When Changes are not registered by compiler | any()
"dev.clean": ["cmd make clean", "clean", "format", "compile"],
# run single node
"dev.run": ["deps.get", "cmd mix dev.clean", "cmd iex -S mix"],
# Must be run before git push --no-verify | any(dialyzer issue)
"dev.checks": ["clean", "format", "compile", "credo", "cmd mix test", "dialyzer"],
# paralele checks
"dev.pchecks": [" clean & format & compile & credo & test & dialyzer"],
# docker test-net with 3 nodes
"dev.docker": [
"cmd docker-compose down",
"cmd docker build -t archethic-node .",
"cmd docker-compose up"
],
# benchmark
"dev.bench": ["cmd docker-compose up bench"],
# Cleans docker
"dev.debug_docker": ["cmd docker-compose down", "cmd docker system prune -a"],
# bench local
"dev.lbench": ["cmd mix archethic.regression --bench localhost"],
# production aliases
"prod.run": ["cmd MIX_ENV=prod ARCHETHIC_CRYPTO_NODE_KEYSTORE_IMPL=SOFTWARE
ARCHETHIC_NODE_ALLOWED_KEY_ORIGINS=SOFTWARE ARCHETHIC_NODE_IP_VALIDATION='true' iex -S mix"],
# dry-run,
"run.dry": ["cmd iex -S mix run --no-start"]
]
end
end