Skip to content
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

Benchmark single transfer per node #267

Merged
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
d490675
228_first_commit
apoorv-2204 Mar 28, 2022
fedd5fb
added Static faucet provider
apoorv-2204 Mar 30, 2022
aa234f6
Moves aliases to comments
apoorv-2204 Mar 30, 2022
a7ab2d0
Addition of Mix aliases Tasks mix dev._
apoorv-2204 Mar 30, 2022
0935710
Augmented with Internal Faucet
apoorv-2204 Mar 30, 2022
c9d729f
Described more aliases
apoorv-2204 Mar 30, 2022
ef03b3c
end of day 30march22 , nochecks
apoorv-2204 Mar 30, 2022
ad15d48
building faucet txn
apoorv-2204 Mar 31, 2022
135a695
Retreive Funds from faucetendpoint, thisnode, via host
apoorv-2204 Mar 31, 2022
bb550c9
Txn creation
apoorv-2204 Mar 31, 2022
a0b343d
improve PBkey Prkey generation
apoorv-2204 Mar 31, 2022
093a445
Refactoring, TOdo: Redesign Play.sendtxn
apoorv-2204 Apr 1, 2022
84dac63
code improvement
apoorv-2204 Apr 1, 2022
e50fb89
tps scenario benchee
apoorv-2204 Apr 1, 2022
7844518
benchmarking
apoorv-2204 Apr 1, 2022
524c6ed
each New(A to b) tarnsaction
apoorv-2204 Apr 4, 2022
ffc3b9e
eod commit 6-04-22
apoorv-2204 Apr 6, 2022
7e713eb
Starting state of branch 228TPS
apoorv-2204 Apr 7, 2022
295e8f8
RAndom A to b o/p s
apoorv-2204 Apr 7, 2022
5abf2e0
fix mix format
apoorv-2204 Apr 7, 2022
411a197
removed benchmark outputs
apoorv-2204 Apr 8, 2022
a870e66
exposed api implementation
apoorv-2204 Apr 11, 2022
9f7f78d
Merge branch 'develop' of https://github.com/archethic-foundation/arc…
apoorv-2204 Apr 11, 2022
3273d38
integeration_works_fine
apoorv-2204 Apr 11, 2022
a5d3538
verify-replciation not tested
apoorv-2204 Apr 11, 2022
b6f894d
query timeout
apoorv-2204 Apr 12, 2022
27c4912
updated port : fixed timeout error
apoorv-2204 Apr 12, 2022
cde4e23
eod 120422
apoorv-2204 Apr 12, 2022
cda8f10
eod 140422
apoorv-2204 Apr 14, 2022
b659311
finding ws lib
apoorv-2204 Apr 15, 2022
8f654e1
mix.lock mint 1.0 to 1.1 , remaining libs in mix lock back to default
apoorv-2204 Apr 15, 2022
efcab9a
eod
apoorv-2204 Apr 15, 2022
6fa003e
webclient error
apoorv-2204 Apr 16, 2022
f8938c8
ws
apoorv-2204 Apr 18, 2022
09df9ec
___
apoorv-2204 Apr 19, 2022
f3d0aae
Add GraphqlClient
blackode Apr 22, 2022
d5de7f8
Update the graphql client calling
blackode Apr 22, 2022
c5de6ce
removed from supervison tree
apoorv-2204 Apr 25, 2022
785c2be
rename the modules
apoorv-2204 Apr 25, 2022
e7f53ea
correct typos
apoorv-2204 Apr 25, 2022
be15715
via playbook error no timeout thrown
apoorv-2204 Apr 25, 2022
3aaf0e2
moved Graphqlserver api to benchmark
apoorv-2204 Apr 25, 2022
a6da6dc
ioinspect to logger debug
apoorv-2204 Apr 25, 2022
d5870c4
new
apoorv-2204 Apr 26, 2022
4e04161
rebase
apoorv-2204 Apr 26, 2022
8c0230c
rebase2
apoorv-2204 Apr 26, 2022
4e35d97
Merge branch 'temp' into 228_benchmark_tps_per_node
apoorv-2204 Apr 26, 2022
3020789
rebase errors
apoorv-2204 Apr 26, 2022
409b9fc
fix errors
apoorv-2204 Apr 26, 2022
8d0d530
finding ws lib
apoorv-2204 Apr 27, 2022
4465312
added GQL SUB CLIENT || EOD(27/04/22)
apoorv-2204 Apr 27, 2022
cb5cc84
eod 27.04.22
apoorv-2204 Apr 27, 2022
3d8bed4
WS integeration with playbook
apoorv-2204 Apr 27, 2022
d64f34f
init: integeration with via helpers
apoorv-2204 Apr 27, 2022
3c0b08d
close: Via Tps helper | Drop: via Tps helper | refactor ws_client
apoorv-2204 Apr 28, 2022
e752f25
resolved git hooks | removed Poison
apoorv-2204 Apr 28, 2022
aeb691c
added untested ingestion and completion benchmark code
apoorv-2204 Apr 29, 2022
b6b17a8
added before scenario for ingestion and completeion
apoorv-2204 Apr 29, 2022
c87f1aa
Refactor to simplify and fix websocket handling
May 2, 2022
b850451
Fix ledger movements resolution to add bburn movement
May 2, 2022
680088a
Reset formatting
May 3, 2022
8e99f8f
Unlock unused deps
May 3, 2022
42ea6a7
Merge branch 'develop' into 228_benchmark_tps_per_node
May 3, 2022
861cec5
Fix renaming
May 3, 2022
7355461
Resolve transaction recipients by time
May 3, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions lib/archethic/utils/regression/benchmarks/faucet_endpoint.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
defmodule ArchEthic.Utils.Regression.FaucetEndpoint do
@moduledoc false

alias ArchEthic.Utils.Regression.Benchmark.FaucetProvider

@behaviour FaucetProvider

def main() do
wallet_address = "0000c084b09c60e3bde2d0a81df08b20d82d8b6dfc1d39bc3dfa5e41b731718f09e1"
withdraw_uco({:https, "testnet.archethic.net", 443}, wallet_address)
end

def withdraw_uco({type, url, http_port}, wallet_address) do
with {:ok, conn_ref} <- establish_connection(type, url, http_port),
{:ok, conn, _req_ref} <- request(conn_ref, wallet_address) do
stream_responses(conn)
end
end

defp establish_connection(type, url, http_port) do
Mint.HTTP.connect(type, url, http_port)
end

defp request(conn_ref, wallet_address) do
{body, content_length} = get_request_body(wallet_address)
header = get_request_header(content_length)

Mint.HTTP.request(
conn_ref,
_method_type = "POST",
_path = "/faucet",
_header = header,
_body = body
)
end

def get_request_header(content_length) do
[
{"Content-Type", "application/x-www-form-urlencoded"},
{"Content-Length", "#{content_length}"},
{"cookie",
"_archethic_key=SFMyNTY.g3QAAAABbQAAAAtfY3NyZl90b2tlbm0AAAAYbnFtT0lVWE9ZZmVIVHZHQVdHenJKTzh2.AuLNklbvM6lHiGY2yGN6mmoDBNrcGqSL5v206ghydFs"}
]
end

def get_request_body(wallet_address) do
body =
"_csrf_token=DCcfJAc6Bz1sVl0ebAx-NhIlSgMMIH8DbVrkNo_r508V8z9wEb0qFoGu&address=#{wallet_address}"

{body, body |> :erlang.byte_size()}
end

def stream_responses(conn) do
receive do
message ->
with {:ok, conn, [{:status, _, 200}, {:headers, _, _}, {:data, _, _}, {:done, _}]} <-
Mint.HTTP.stream(conn, message),
{:ok, _} <- Mint.HTTP.close(conn) do
{:ok, :transferred}
end
after
5_000 ->
{:error, :timeout}
end
end
end
7 changes: 7 additions & 0 deletions lib/archethic/utils/regression/faucet_provider.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
defmodule ArchEthic.Utils.Regression.Benchmark.FaucetProvider do
apoorv-2204 marked this conversation as resolved.
Show resolved Hide resolved
@moduledoc """
Behavior for uco with-drawl from Faucet
"""
@callback withdraw_uco({atom(), String.t(), number()}, String.t()) ::
{:ok, any()} | {:error, any()}
end
10 changes: 10 additions & 0 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ defmodule ArchEthic.MixProject do
elixir: "~> 1.11",
start_permanent: Mix.env() == :prod,
deps: deps(),
aliases: aliases(),
compilers: [:elixir_make, :phoenix] ++ Mix.compilers(),
elixirc_paths: elixirc_paths(Mix.env()),
elixirc_options: [warnings_as_errors: true],
Expand Down Expand Up @@ -93,4 +94,13 @@ defmodule ArchEthic.MixProject do
{:knigge, "~> 1.4"}
]
end

defp aliases do
[
"dev.setup": ["deps.get", "cmd npm install --prefix assets"],
apoorv-2204 marked this conversation as resolved.
Show resolved Hide resolved
"dev.clean": ["cmd make clean", "clean", "format", "compile"],
apoorv-2204 marked this conversation as resolved.
Show resolved Hide resolved
"dev.checks": ["clean", "format", "compile", "credo", "cmd mix test", "dialyzer"],
apoorv-2204 marked this conversation as resolved.
Show resolved Hide resolved
"dev.docker": ["docker build -t archethic-node ."]
apoorv-2204 marked this conversation as resolved.
Show resolved Hide resolved
]
end
end