Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 15 additions & 0 deletions e2e/all-tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,21 @@
union = e2e.unionNode.node;
};
};

voyager-runs = e2e.mkTestWithDevnetSetup {
name = "voyager-runs";

testScript = ''
start_all()
voyager.wait_for_console_text('pool timed out while waiting for an open connection')
# voyager.wait_until_succeeds('${pkgs.lib.meta.getExe self'.packages.voyager} -c ${./voyager-configs/voyager-config.jsonc} rpc info')
'';

nodes = {
# empty node used to communicate with the other nodes
client = _: { };
};
};
}
)
);
Expand Down
68 changes: 60 additions & 8 deletions e2e/e2e.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,32 @@
};
};

devnetVoyagerNode = {
node = {...}: {
imports = [
inputs.arion.nixosModules.arion
];
networking = {
useNetworkd = true;
useDHCP = false;
firewall.enable = false;
};

systemd.network.networks."01-eth1" = {
name = "eth1";
networkConfig.Address = "10.0.0.2/24";
};
virtualisation = {
diskSize = 4 * 1024;
memorySize = 4 * 1024;
arion = {
backend = "docker";
projects.devnet-voyager.settings = networks.modules.devnet-voyager;
};
};
};
};

unionTestnetGenesisNode = {
node =
{ pkgs, ... }:
Expand Down Expand Up @@ -84,6 +110,30 @@
};
};
};

voyager-queue = {
node = {...}: {
imports = [ inputs.arion.nixosModules.arion ];
networking = {
useNetworkd = true;
useDHCP = false;
firewall.enable = false;
};

systemd.network.networks."01-eth1" = {
name = "eth1";
networkConfig.Address = "10.0.0.1/24";
};
virtualisation = {
diskSize = 2 * 1024;
memorySize = 8 * 1024;
arion = {
backend = "docker";
projects.voyager-queue.settings = networks.modules.postgres;
};
};
};
};
in
{
_module.args.e2e = {
Expand All @@ -106,14 +156,14 @@

testScript = ''
# NOTE: Start union first!
union.wait_for_open_port(${toString unionNode.wait_for_open_port})
devnetEth.wait_for_open_port(${toString devnetEthNode.wait_for_open_port})
# union.wait_for_open_port(${toString unionNode.wait_for_open_port})
# devnetEth.wait_for_open_port(${toString devnetEthNode.wait_for_open_port})

# match non-zero blocks
union.wait_until_succeeds('[[ $(curl "http://localhost:26660/block" --fail --silent | ${pkgs.lib.meta.getExe pkgs.jq} ".result.block.header.height | tonumber > 1") == "true" ]]')
devnetEth.wait_for_console_text('${devnetEthNode.wait_for_console_text}')
# # match non-zero blocks
# union.wait_until_succeeds('[[ $(curl "http://localhost:26660/block" --fail --silent | ${pkgs.lib.meta.getExe pkgs.jq} ".result.block.header.height | tonumber > 1") == "true" ]]')
# devnetEth.wait_for_console_text('${devnetEthNode.wait_for_console_text}')

devnetEth.wait_until_succeeds('[[ $(curl http://localhost:9596/eth/v2/beacon/blocks/head --fail --silent | ${pkgs.lib.meta.getExe pkgs.jq} \'.data.message.slot | tonumber > 0\') == "true" ]]')
# devnetEth.wait_until_succeeds('[[ $(curl http://localhost:9596/eth/v2/beacon/blocks/head --fail --silent | ${pkgs.lib.meta.getExe pkgs.jq} \'.data.message.slot | tonumber > 0\') == "true" ]]')

${testScript}
'';
Expand All @@ -123,8 +173,10 @@
(pkgs.lib.throwIf (builtins.hasAttr "devnetEth" nodes) "devnetEth node already exists; use a different name")
(
{
union = unionNode.node;
devnetEth = devnetEthNode.node;
# union = unionNode.node;
# devnetEth = devnetEthNode.node;
voyager = devnetVoyagerNode.node;
voyager-queue = voyager-queue.node;
}
// nodes
);
Expand Down
61 changes: 61 additions & 0 deletions e2e/mkVoyagerConfig.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{ pkgs, ... }:
{
voyager,
voyager-module-plugins,
}:
let
getPlugin = plugin: pkgs.lib.getExe' voyager-module-plugins plugin;

mkModulePlugin = {plugin, info ? {}, config ? {}}: {
enabled = true;
path = getPlugin plugin;
info = info;
config = config;
};
in
{
name = "e2e-devnet-voyager";
settings = {
stack-size = 20971520;
log-level = "voyager_plugin_packet_filter=trace,beacon=debug,cosmos_client=debug,concurrent_keyring=debug,cosmos_client=debug,arbitrum=debug,voyager_consensus_module_cometbls=info,voyager_message::rpc::server=info,voyager=debug,info";
log-format = "json";
runtime-max-secs = 3600;
};
package = voyager;
modules = {
state = [
mkModulePlugin {
plugin = "voyager-state-module-cosmos-sdk";
info = {
chain_id = "union-devnet-1";
ibc_spec_id = "1.0.0";
};
config = {
rpc_url = "http://0.0.0.0:26657";
};
}
mkModulePlugin {
plugin = "voyager-state-module-cosmos-sdk-union";
info = {
chain_id = "union-devnet-1";
ibc_spec_id = "ibc-union";
};
config = {
rpc_url = "http://0.0.0.0:26657";
ibc_host_contract_address = "union1nk3nes4ef6vcjan5tz6stf9g8p08q2kgqysx6q5exxh89zakp0msq5z79t";
};
}
mkModulePlugin {
plugin = "voyager-state-module-ethereum";
info = {
chain_id = "32382";
ibc_spec_id = "ibc-union";
};
config = {
ibc_handler_address = "0xed2af2aD7FE0D92011b26A2e5D1B4dC7D12A47C5";
rpc_url = "http://0.0.0.0:8545";
};
}
];
};
}
Loading