forked from archethic-foundation/archethic-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mix.exs
159 lines (146 loc) · 4.73 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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
defmodule Archethic.MixProject do
use Mix.Project
def project do
[
app: :archethic,
version: "0.26.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.6"},
{:phoenix_html, "~> 3.0"},
{:phoenix_live_view, "~> 0.18"},
{:phoenix_pubsub, "~> 2.1"},
{:jason, "~> 1.0"},
{:plug_cowboy, "~> 2.3"},
{:absinthe, "~> 1.7"},
{:absinthe_plug, "~> 1.5"},
{:absinthe_phoenix, "~> 2.0"},
{:cors_plug, "~> 3.0"},
{:mint, "~> 1.0"},
{:ecto, "~> 3.9"},
{:websockex, "~> 0.4"},
# Dev
{:benchee, "~> 1.1"},
{:benchee_html, "~> 1.0", only: :dev},
{:ex_doc, "~> 0.29", only: :dev, runtime: false},
{:git_hooks, "~> 0.7", runtime: false},
{:credo, "~> 1.6", only: [:dev, :test], runtime: false},
{:elixir_make, "~> 0.6", runtime: false},
{:dialyxir, "~> 1.2", runtime: false},
{:logger_file_backend, "~> 0.0.13", only: :dev},
{:esbuild, "~> 0.2", runtime: Mix.env() == :dev},
{:dart_sass, "~> 0.5", runtime: Mix.env() == :dev},
# Security
{:sobelow, "~> 0.11", only: [:test, :dev], runtime: false},
# Test
{:mox, "~> 1.0", only: [:test]},
{:stream_data, "~> 0.5", only: [:test], runtime: false},
{:floki, "~> 0.33", 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.1"},
{:telemetry_poller, "~> 1.0"},
{:phoenix_live_dashboard, "~> 0.7"},
# Utils
{:crontab, "~> 1.1"},
{:earmark, "~> 1.4"},
{:sizeable, "~> 1.0"},
{:distillery, github: "bitwalker/distillery", ref: "6700edb"},
{:exjsonpath, "~> 0.9"},
{:rand_compat, "~> 0.0.3"},
{:gen_state_machine, "~> 3.0"},
{:retry, "~> 0.17"},
{:gen_stage, "~> 1.1"},
{:flow, "~> 1.2"},
{:knigge, "~> 1.4"},
{:ex_json_schema, "~> 0.9", override: true},
{:pathex, "~> 2.4"},
{:easy_ssl, "~> 1.3"},
{:castore, "~> 0.1"}
]
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",
"sobelow",
"cmd mix test --trace",
"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"],
# Make sure the plts folder is created
dialyzer: ["cmd mkdir -p priv/plts", "dialyzer"],
"assets.saas": ["sass default --no-source-map --style=compressed"],
"assets.deploy": [
"esbuild default --minify",
"phx.digest"
]
]
end
end