Skip to content

Commit

Permalink
Merge branch 'main' into 10042
Browse files Browse the repository at this point in the history
Signed-off-by: Kanstantsin Kastsevich <kkast@users.noreply.github.com>
  • Loading branch information
kkast authored Dec 7, 2023
2 parents a5e7a80 + bf152e2 commit 0d20570
Show file tree
Hide file tree
Showing 8 changed files with 450 additions and 1,692 deletions.
1,675 changes: 208 additions & 1,467 deletions flake.lock

Large diffs are not rendered by default.

19 changes: 13 additions & 6 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
url = "github:lnl7/nix-darwin/master";
inputs.nixpkgs.follows = "nixpkgs";
};

cosmos = {
url =
"github:dzmitry-lahoda-forks/cosmos.nix/e398b4dc9fa8e44c9201d3285eb2818116c0b9d3";
Expand All @@ -55,22 +56,28 @@
inputs.rust-overlay.follows = "rust-overlay";
};

cosmos-old = {
url =
"github:dzmitry-lahoda-forks/cosmos.nix/3039c8f154b1f9f1fb217c2bc0048eaff0da2472";
};

bech32cli = {
url = "github:strangelove-ventures/bech32cli";
inputs.nixpkgs.follows = "nixpkgs";
};

composable-ibc-src = {
composable-ibc-relayer-src = {
flake = false;
url =
"github:ComposableFi/composable-ibc/698146a5a66ce9e5e7a21633ef60e39fa1c8840e";
};

composable-ibc-light-client-src = {
flake = false;
url =
"github:ComposableFi/composable-ibc/50eb36a8a1c4f67ae573ac447f6b1ba46f37791c";
};

composable-cosmos-src = {
flake = false;
url = "github:ComposableFi/composable-cosmos/devnet";
};

cvm = { url = "github:ComposableFi/cvm"; };

networks = { url = "github:ComposableFi/networks"; };
Expand Down
97 changes: 97 additions & 0 deletions flake/devnets/picasso-centauri.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
{ pkgs, devnet-root-directory, self', chain-restart, parachain-startup, relay
, devnetTools, }:

{
settings = {
log_level = "trace";
log_location = "/tmp/composable-devnet/pc.log";
processes = {
centauri = {
command = pkgs.writeShellApplication {
runtimeInputs = devnetTools.withBaseContainerTools;
name = "centauri";
text = ''
${pkgs.lib.meta.getExe self'.packages.centaurid-gen} reuse 0
'';
};
readiness_probe.http_get = {
host = "127.0.0.1";
port = 26657;
};
log_location = "${devnet-root-directory}/centauri.log";
availability = { restart = chain-restart; };
namespace = "cosmos";
};
centauri-init = {
command = self'.packages.centaurid-init;
depends_on."centauri".condition = "process_healthy";
log_location = "${devnet-root-directory}/centauri-init.log";
availability = { restart = chain-restart; };
namespace = "cosmos";
};

picasso = {
command = self'.packages.zombienet-rococo-local-picasso-dev;
availability = { restart = chain-restart; };
log_location = "${devnet-root-directory}/picasso.log";
readiness_probe = {
exec.command = ''
curl --header "Content-Type: application/json" --data '{"id":1, "jsonrpc":"2.0", "method" : "assets_listAssets"}' http://localhost:9988
'';
} // parachain-startup;
namespace = "polkadot";
};

picasso-centauri-ibc-init = {
command = self'.packages.picasso-centauri-ibc-init;
log_location = "${devnet-root-directory}/picasso-centauri-ibc-init.log";
depends_on = {
"centauri-init".condition = "process_completed_successfully";
"centauri".condition = "process_healthy";
"picasso".condition = "process_healthy";
};
availability = { restart = relay; };
};

picasso-centauri-ibc-connection-init = {
command = self'.packages.picasso-centauri-ibc-connection-init;
log_location =
"${devnet-root-directory}/picasso-centauri-ibc-connection-init.log";
depends_on = {
"picasso-centauri-ibc-init".condition =
"process_completed_successfully";
};
availability = { restart = relay; };
};

picasso-centauri-ibc-channels-init = {
command = self'.packages.picasso-centauri-ibc-channels-init;
log_location =
"${devnet-root-directory}/picasso-centauri-ibc-channels-init.log";
depends_on = {
"picasso-centauri-ibc-connection-init".condition =
"process_completed_successfully";
"picasso-centauri-ibc-init".condition =
"process_completed_successfully";
};
availability = { restart = relay; };
};

picasso-centauri-ibc-relay = {
command = self'.packages.picasso-centauri-ibc-relay;
log_location =
"${devnet-root-directory}/picasso-centauri-ibc-relay.log";
depends_on = {
"picasso-centauri-ibc-channels-init".condition =
"process_completed_successfully";
"picasso-centauri-ibc-connection-init".condition =
"process_completed_successfully";
"picasso-centauri-ibc-init".condition =
"process_completed_successfully";
};
availability = { restart = relay; };
};

};
};
}
13 changes: 7 additions & 6 deletions flake/ibc.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
devnet-root-directory = "/tmp/composable-devnet";
validator-key = "osmo12smx2wdlyttvyzvzg54y2vnqwq2qjateuf7thj";
RUST_LOG =
"debug,hyperspace=info,hyperspace_parachain=info,hyperspace_cosmos=info";
"info,hyperspace=info,hyperspace_parachain=debug,hyperspace_cosmos=debug";
in {
packages = rec {
picasso-centauri-ibc-init = pkgs.writeShellApplication {
Expand All @@ -23,6 +23,7 @@
CODE_ID=$(cat ${devnet-root-directory}/.centaurid/code_id)
echo "$CODE_ID"
sed -i "s/wasm_code_id = \"0000000000000000000000000000000000000000000000000000000000000000\"/wasm_code_id = \"$CODE_ID\"/" "/tmp/composable-devnet/picasso-centauri-ibc/config-chain-b.toml"
echo "wasm_code_id = \"$CODE_ID\""
RUST_LOG='${RUST_LOG}' ${self'.packages.hyperspace-composable-rococo-picasso-rococo}/bin/hyperspace create-clients --config-a /tmp/composable-devnet/picasso-centauri-ibc/config-chain-a.toml --config-b /tmp/composable-devnet/picasso-centauri-ibc/config-chain-b.toml --config-core /tmp/composable-devnet/picasso-centauri-ibc/config-core.toml --delay-period 10
'';
};
Expand Down Expand Up @@ -50,7 +51,7 @@
text = ''
HOME="${devnet-root-directory}/composable-picasso-ibc"
export HOME
RUST_LOG="hyperspace=info,hyperspace_parachain=debug,hyperspace_cosmos=debug"
RUST_LOG="hyperspace=info,hyperspace_parachain=info,hyperspace_cosmos=info"
export RUST_LOG
${self'.packages.hyperspace-composable-rococo-picasso-rococo}/bin/hyperspace create-connection --config-a ${devnet-root-directory}/composable-picasso-ibc/config-chain-a.toml --config-b ${devnet-root-directory}/composable-picasso-ibc/config-chain-b.toml --config-core ${devnet-root-directory}/composable-picasso-ibc/config-core.toml --delay-period 10
'';
Expand All @@ -62,9 +63,9 @@
text = ''
HOME="${devnet-root-directory}/composable-picasso-ibc"
export HOME
RUST_LOG="hyperspace=info,hyperspace_parachain=debug,hyperspace_cosmos=debug"
RUST_LOG="${RUST_LOG}"
export RUST_LOG
${self'.packages.hyperspace-composable-rococo-picasso-rococo}/bin/hyperspace create-channel --config-a ${devnet-root-directory}/composable-picasso-ibc/config-chain-a.toml --config-b ${devnet-root-directory}/composable-picasso-ibc/config-chain-b.toml --config-core ${devnet-root-directory}/composable-picasso-ibc/config-core.toml --delay-period 10 --port-id transfer --version ics20-1 --order unordered
RUST_LOG='${RUST_LOG}' ${self'.packages.hyperspace-composable-rococo-picasso-rococo}/bin/hyperspace create-channel --config-a ${devnet-root-directory}/composable-picasso-ibc/config-chain-a.toml --config-b ${devnet-root-directory}/composable-picasso-ibc/config-chain-b.toml --config-core ${devnet-root-directory}/composable-picasso-ibc/config-core.toml --delay-period 10 --port-id transfer --version ics20-1 --order unordered
'';
};

Expand Down Expand Up @@ -99,7 +100,7 @@
export HOME
RUST_LOG="${RUST_LOG}"
export RUST_LOG
${self'.packages.hyperspace-composable-rococo-picasso-rococo}/bin/hyperspace create-connection --config-a /tmp/composable-devnet/picasso-centauri-ibc/config-chain-a.toml --config-b /tmp/composable-devnet/picasso-centauri-ibc/config-chain-b.toml --config-core /tmp/composable-devnet/picasso-centauri-ibc/config-core.toml --delay-period 10
RUST_LOG='${RUST_LOG}' ${self'.packages.hyperspace-composable-rococo-picasso-rococo}/bin/hyperspace create-connection --config-a /tmp/composable-devnet/picasso-centauri-ibc/config-chain-a.toml --config-b /tmp/composable-devnet/picasso-centauri-ibc/config-chain-b.toml --config-core /tmp/composable-devnet/picasso-centauri-ibc/config-core.toml --delay-period 10
'';
};

Expand All @@ -109,7 +110,7 @@
text = ''
HOME="/tmp/composable-devnet/composable-picasso-ibc"
export HOME
RUST_LOG="hyperspace=info,hyperspace_parachain=debug,hyperspace_cosmos=debug"
RUST_LOG="hyperspace=info,hyperspace_parachain=info,hyperspace_cosmos=info"
export RUST_LOG
sed -i "s/private_key = \"\/\/Alice\"/private_key = \"\/\/Bob\"/" "/tmp/composable-devnet/composable-picasso-ibc/config-chain-a.toml"
sed -i "s/private_key = \"\/\/Alice\"/private_key = \"\/\/Bob\"/" "/tmp/composable-devnet/composable-picasso-ibc/config-chain-b.toml"
Expand Down
143 changes: 13 additions & 130 deletions flake/process-compose.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@
'';
};

devnet-picasso-centauri-fresh = pkgs.writeShellApplication {
runtimeInputs = devnetTools.withBaseContainerTools;
name = "devnet-picasso-centauri-fresh";
text = ''
rm --force --recursive ${devnet-root-directory}
mkdir --parents ${devnet-root-directory}
${pkgs.lib.meta.getExe self'.packages.devnet-picasso-centauri}
'';
};

devnet-xc-dotsama-fresh-background = pkgs.writeShellApplication {
runtimeInputs = devnetTools.withBaseContainerTools;
name = "devnet-xc-dotsama-fresh-background";
Expand Down Expand Up @@ -456,136 +466,9 @@
};
};

devnet-xc-picasso-cosmos = {
settings = {
log_level = "trace";
log_location = "/tmp/composable-devnet/pc.log";
processes = {
centauri = {
command = pkgs.writeShellApplication {
runtimeInputs = devnetTools.withBaseContainerTools;
name = "centauri";
text = ''
${pkgs.lib.meta.getExe self'.packages.centaurid-gen} reuse 0
'';
};
readiness_probe.http_get = {
host = "127.0.0.1";
port = 26657;
};
log_location = "${devnet-root-directory}/centauri.log";
availability = { restart = chain-restart; };
namespace = "cosmos";
};
centauri-init = {
command = self'.packages.centaurid-init;
depends_on."centauri".condition = "process_healthy";
log_location = "${devnet-root-directory}/centauri-init.log";
availability = { restart = chain-restart; };
namespace = "cosmos";
};

osmosis = {
command = self'.packages.osmosisd-gen;
readiness_probe.http_get = {
host = "127.0.0.1";
port = pkgs.networksLib.osmosis.devnet.PORT;
};
log_location = "${devnet-root-directory}/osmosis.log";
availability = { restart = chain-restart; };
namespace = "cosmos";
};
osmosisd-cvm-init = {
command = self'.packages.osmosisd-cvm-init;
depends_on."osmosis".condition = "process_healthy";
log_location = "${devnet-root-directory}/osmosisd-cvm-init.log";
availability = { restart = chain-restart; };
namespace = "cosmos";
};

picasso = {
command = self'.packages.zombienet-rococo-local-picasso-dev;
availability = { restart = chain-restart; };
log_location = "${devnet-root-directory}/picasso.log";
readiness_probe = {
exec.command = ''
curl --header "Content-Type: application/json" --data '{"id":1, "jsonrpc":"2.0", "method" : "assets_listAssets"}' http://localhost:9988
'';
} // parachain-startup;
namespace = "polkadot";
};

osmosis-centauri-hermes-init = {
command = self'.packages.osmosis-centauri-hermes-init;
depends_on = {
"centauri-init".condition = "process_completed_successfully";
"picasso-centauri-ibc-channels-init".condition =
"process_completed_successfully";
"osmosis".condition = "process_healthy";
};
log_location =
"${devnet-root-directory}/osmosis-centauri-hermes-init.log";
availability = { restart = relay; };
};

osmosis-centauri-hermes-relay = {
command = self'.packages.osmosis-centauri-hermes-relay;
depends_on = {
"osmosis-centauri-hermes-init".condition =
"process_completed_successfully";
};
log_location =
"${devnet-root-directory}/osmosis-centauri-hermes-relay.log";
availability = { restart = relay; };
};

picasso-centauri-ibc-init = {
command = self'.packages.picasso-centauri-ibc-init;
log_location =
"${devnet-root-directory}/picasso-centauri-ibc-init.log";
depends_on = {
"centauri-init".condition = "process_completed_successfully";
"centauri".condition = "process_healthy";
"picasso".condition = "process_healthy";
};
availability = { restart = relay; };
};

picasso-centauri-ibc-connection-init = {
command = self'.packages.picasso-centauri-ibc-connection-init;
log_location =
"${devnet-root-directory}/picasso-centauri-ibc-connection-init.log";
depends_on = {
"picasso-centauri-ibc-init".condition =
"process_completed_successfully";
};
availability = { restart = relay; };
};

picasso-centauri-ibc-channels-init = {
command = self'.packages.picasso-centauri-ibc-channels-init;
log_location =
"${devnet-root-directory}/picasso-centauri-ibc-channels-init.log";
depends_on = {
"picasso-centauri-ibc-connection-init".condition =
"process_completed_successfully";
};
availability = { restart = relay; };
};

picasso-centauri-ibc-relay = {
command = self'.packages.picasso-centauri-ibc-relay;
log_location =
"${devnet-root-directory}/picasso-centauri-ibc-relay.log";
depends_on = {
"picasso-centauri-ibc-channels-init".condition =
"process_completed_successfully";
};
availability = { restart = relay; };
};

};
};
devnet-picasso-centauri = import ./devnets/picasso-centauri.nix {
inherit pkgs devnet-root-directory self' chain-restart
parachain-startup relay devnetTools;
};

devnet-cosmos-background = devnet-cosmos // { tui = false; };
Expand Down
Loading

0 comments on commit 0d20570

Please sign in to comment.