Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 401
refactor(tracker): rewrite operator tracker in elixir#1000
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
475b43a4bd10252df7f2074757b87c8413ec63f797d53b6ae95617807bac49f54eb9fbb99b9bff60ebf157e07768da05e67c232193d47d50e911d64d6dedbdb58580e46fa064d58c3004a1578aaa43de01c735a3ceb5e2245cc375File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
JuArce marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| ALIGNED_CONFIG_FILE="../contracts/script/output/devnet/alignedlayer_deployment_output.json" | ||
| ENVIRONMENT=devnet |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| [ | ||
| import_deps: [:ecto, :ecto_sql, :phoenix], | ||
| subdirectories: ["priv/*/migrations"], | ||
| inputs: ["*.{ex,exs}", "{config,lib,test}/**/*.{ex,exs}", "priv/*/seeds.exs"] | ||
| ] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # The directory Mix will write compiled artifacts to. | ||
| /_build/ | ||
| # If you run "mix test --cover", coverage assets end up here. | ||
| /cover/ | ||
| # The directory Mix downloads your dependencies sources to. | ||
| /deps/ | ||
| # Where 3rd-party dependencies like ExDoc output generated docs. | ||
| /doc/ | ||
| # Ignore .fetch files in case you like to edit your project deps locally. | ||
| /.fetch | ||
| # If the VM crashes, it generates a dump, let's ignore it too. | ||
| erl_crash.dump | ||
| # Also ignore archive artifacts (built via "mix archive.build"). | ||
| *.ez | ||
| # Temporary files, for example, from tests. | ||
| /tmp/ | ||
| # Ignore package tarball (built via "mix hex.build"). | ||
| telemetry_api-*.tar | ||
| # Elixir lsp server | ||
| .elixir_ls |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # https://hub.docker.com/_/postgres | ||
| FROM postgres:16.3 | ||
| # Environment variables | ||
| ENV POSTGRES_USER=telemetry_user | ||
| ENV POSTGRES_PASSWORD=telemetry_pass | ||
| ENV POSTGRES_DB=telemetry_db | ||
| # Expose the default PostgreSQL port | ||
| EXPOSE 5432 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| # TelemetryApi | ||
| ## Database Setup | ||
| To create a Postgres container and run it: | ||
| ```shell | ||
| make telemetry_run_db | ||
JuArce marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| ``` | ||
| This will create and run the container using the credentials set in `Dockerfile` | ||
| > [!CAUTION] | ||
| > Do not use default credentials in Production environments. | ||
| ### Delete database | ||
| If you want to delete the container: | ||
| ```shell | ||
| make telemetry_remove_db_container | ||
| ``` | ||
| This will remove the container but will keep the storage | ||
| If you also want to delete the storage run: | ||
| ```shell | ||
| make telemetry_clean_db | ||
| ``` | ||
| ## Run Server | ||
| First you need to manually set the `telemetry_api/.env` file. | ||
| To use `telemetry_api/.env.dev`, run: | ||
| ```shell | ||
| make telemetry_create_env | ||
| ``` | ||
| To start your Phoenix server: | ||
JuArce marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| ```shell | ||
| make telemetry_start | ||
| ``` | ||
| On startup, it will run ecto migrations. | ||
| * Run `mix setup` to install and setup dependencies | ||
| * Start Phoenix endpoint with `mix phx.server` or inside IEx with `iex -S mix phx.server` | ||
| Now you can visit [`localhost:4000`](http://localhost:4000) from your browser. | ||
| ## Database Migrations | ||
| This API uses Ecto for migrations. To apply migrations, run: | ||
| ```shell | ||
| make telemetry_ecto_migrate | ||
| ``` | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # This file is responsible for configuring your application | ||
| # and its dependencies with the aid of the Config module. | ||
| # | ||
| # This configuration file is loaded before any dependency and | ||
| # is restricted to this project. | ||
| # General application configuration | ||
| import Config | ||
| config :telemetry_api, | ||
| ecto_repos: [TelemetryApi.Repo], | ||
| generators: [timestamp_type: :utc_datetime] | ||
| # Configures the endpoint | ||
| config :telemetry_api, TelemetryApiWeb.Endpoint, | ||
| url: [host: "localhost"], | ||
| adapter: Bandit.PhoenixAdapter, | ||
| render_errors: [ | ||
| formats: [json: TelemetryApiWeb.ErrorJSON], | ||
| layout: false | ||
| ], | ||
| pubsub_server: TelemetryApi.PubSub, | ||
| live_view: [signing_salt: "eQaI7lMW"] | ||
| # Configures Elixir's Logger | ||
| config :logger, :console, | ||
| format: "$time $metadata[$level] $message\n", | ||
| metadata: [:request_id] | ||
| # Use Jason for JSON parsing in Phoenix | ||
| config :phoenix, :json_library, Jason | ||
| # Import environment specific config. This must remain at the bottom | ||
| # of this file so it overrides the configuration defined above. | ||
| import_config "#{config_env()}.exs" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| import Config | ||
| # Configure your database | ||
| config :telemetry_api, TelemetryApi.Repo, | ||
| username: "telemetry_user", | ||
| password: "telemetry_pass", | ||
| database: "telemetry_db", | ||
| hostname: "localhost", | ||
| port: 5434, | ||
| stacktrace: true, | ||
| show_sensitive_data_on_connection_error: true, | ||
| pool_size: 10 | ||
| # For development, we disable any cache and enable | ||
| # debugging and code reloading. | ||
| # | ||
| # The watchers configuration can be used to run external | ||
| # watchers to your application. For example, we can use it | ||
| # to bundle .js and .css sources. | ||
| config :telemetry_api, TelemetryApiWeb.Endpoint, | ||
| # Binding to loopback ipv4 address prevents access from other machines. | ||
| # Change to `ip: {0, 0, 0, 0}` to allow access from other machines. | ||
| http: [ip: {127, 0, 0, 1}, port: 4001], | ||
| check_origin: false, | ||
| code_reloader: true, | ||
| debug_errors: true, | ||
| secret_key_base: "SKxKWZhd8cfUXMUqskUHvegw8P46kkfwIYWTW86tsqn+t6M2S1HUFjTqgVWAkvX0", | ||
| watchers: [] | ||
| # ## SSL Support | ||
| # | ||
| # In order to use HTTPS in development, a self-signed | ||
| # certificate can be generated by running the following | ||
| # Mix task: | ||
| # | ||
| # mix phx.gen.cert | ||
| # | ||
| # Run `mix help phx.gen.cert` for more information. | ||
| # | ||
| # The `http:` config above can be replaced with: | ||
| # | ||
| # https: [ | ||
| # port: 4001, | ||
| # cipher_suite: :strong, | ||
| # keyfile: "priv/cert/selfsigned_key.pem", | ||
| # certfile: "priv/cert/selfsigned.pem" | ||
| # ], | ||
| # | ||
| # If desired, both `http:` and `https:` keys can be | ||
| # configured to run both http and https servers on | ||
| # different ports. | ||
| # Enable dev routes for dashboard and mailbox | ||
| # config :telemetry_api, dev_routes: true | ||
| # Do not include metadata nor timestamps in development logs | ||
| config :logger, :console, format: "[$level] $message\n" | ||
| # Set a higher stacktrace during development. Avoid configuring such | ||
| # in production as building large stacktraces may be expensive. | ||
| config :phoenix, :stacktrace_depth, 20 | ||
| # Initialize plugs at runtime for faster development compilation | ||
| config :phoenix, :plug_init_mode, :runtime | ||
| # Configure ethereumex url | ||
| config :ethereumex, url: "http://localhost:8545" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import Config | ||
| # Do not print debug messages in production | ||
| config :logger, level: :info | ||
| # Runtime production configuration, including reading | ||
| # of environment variables, is done on config/runtime.exs. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.