-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
156 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import Config | ||
|
||
# Set LOGGER_LEVEL env to one of the valid | ||
# values for level https://hexdocs.pm/logger/1.12.3/Logger.html#module-levels | ||
# In order to help with debugging, set LOGGER_LEVEL="debug" | ||
case config_env() do | ||
:test -> | ||
config :logger, | ||
level: System.get_env("LOGGER_LEVEL", "warning") |> String.to_existing_atom() | ||
|
||
_ -> | ||
config :logger, | ||
level: System.get_env("LOGGER_LEVEL", "info") |> String.to_existing_atom() | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
defmodule Xogmios do | ||
@moduledoc false | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
defmodule Xogmios.Application do | ||
@moduledoc false | ||
|
||
use Application | ||
|
||
@impl true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
defmodule Xogmios.ChainSync.Messages do | ||
@moduledoc """ | ||
This module returns messages according to the Ogmios API | ||
""" | ||
|
||
def next_block_start() do | ||
~S""" | ||
{ | ||
"jsonrpc": "2.0", | ||
"method": "nextBlock", | ||
"id": "start" | ||
} | ||
""" | ||
end | ||
|
||
def next_block() do | ||
~S""" | ||
{ | ||
"jsonrpc": "2.0", | ||
"method": "nextBlock" | ||
} | ||
""" | ||
end | ||
|
||
def find_intersection(slot, id) do | ||
~s""" | ||
{ | ||
"jsonrpc": "2.0", | ||
"method": "findIntersection", | ||
"params": { | ||
"points": [ | ||
{ | ||
"slot": #{slot}, | ||
"id": "#{id}" | ||
} | ||
] | ||
} | ||
} | ||
""" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
defmodule ChainSync.TestRouter do | ||
@moduledoc false | ||
|
||
use Plug.Router | ||
|
||
plug(:match) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
defmodule ChainSync.TestServer do | ||
@moduledoc false | ||
|
||
@default_port 8989 | ||
|
||
def get_url(port \\ @default_port) do | ||
|
Oops, something went wrong.