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

Etcm 9058 remove pc contracts cli from tests #434

Merged
merged 13 commits into from
Jan 30, 2025
2 changes: 0 additions & 2 deletions .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ export DATA_DIR="$RUN_DIR/data"
mkdir -p $DATA_DIR
chmod 777 $RUN_DIR $DATA_DIR
export CARDANO_CONFIG_DIR="$(pwd)/dev/docker/config"
export KUPO_WORKDIR="$RUN_DIR/kupo-db"
mkdir -p $KUPO_WORKDIR

source dev/envs/devnet/.envrc

Expand Down
2 changes: 0 additions & 2 deletions E2E-tests/config/api_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@ class StackApiConfig:
ogmios_host: str = MISSING
ogmios_port: int = MISSING
ogmios_url: str = SI("${.ogmios_scheme}://${.ogmios_host}:${.ogmios_port}")
LGLO marked this conversation as resolved.
Show resolved Hide resolved
kupo_host: str = MISSING
kupo_port: int = MISSING
tools: dict[str, Tool] = MISSING
tools_host: str = MISSING
tools_shell: Optional[str] = None
Expand Down
2 changes: 0 additions & 2 deletions E2E-tests/config/substrate/ci_stack.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
"stack_config": {
"ogmios_host": "devnet-services-service",
"ogmios_port": 1337,
"kupo_host": "devnet-services-service",
"kupo_port": 1442,
"tools_host": "10.0.12.126",
"ssh": {
"username": "root",
Expand Down
2 changes: 0 additions & 2 deletions E2E-tests/config/substrate/devnet_stack.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
"stack_config": {
"ogmios_host": "devnet-services-service",
"ogmios_port": 1337,
"kupo_host": "devnet-services-service",
"kupo_port": 1442,
"tools_host": "10.0.12.126",
"ssh": {
"username": "root",
Expand Down
2 changes: 0 additions & 2 deletions E2E-tests/config/substrate/local_stack.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
"stack_config": {
"ogmios_host": "ogmios",
"ogmios_port": 1337,
"kupo_host": "kupo",
"kupo_port": 1442,
"tools_shell": "/bin/bash",
"tools": {
"cardano_cli": {
Expand Down
2 changes: 0 additions & 2 deletions E2E-tests/config/substrate/staging_stack.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
"stack_config": {
"ogmios_host": "staging-preview-services-service.staging-preview.svc.cluster.local",
"ogmios_port": 1337,
"kupo_host": "staging-preview-services-service.staging-preview.svc.cluster.local",
"kupo_port": 1442,
"tools_host": "10.0.12.157",
"ssh": {
"username": "root",
Expand Down
8 changes: 3 additions & 5 deletions E2E-tests/docs/run-tests-on-new-env.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* A partner chain node with JSON-RPC API available
* A node with Postgres SQL (for automated test data)
* A node with [cardano-node](https://github.com/IntersectMBO/cardano-node) + [cardano-db-sync](https://github.com/IntersectMBO/cardano-db-sync) + [postgres](https://www.postgresql.org/) (running locally OR on one of the partner-chains nodes)
* [ogmios](https://github.com/CardanoSolutions/ogmios) and [kupo](https://github.com/CardanoSolutions/kupo) (running locally OR on the remote host)
* [ogmios](https://github.com/CardanoSolutions/ogmios) (running locally OR on the remote host)
* [partner-chains-node](https://github.com/input-output-hk/partner-chains) (running locally OR on the remote tools host)
* cardano-cli (from a local cardano-node OR on the remote tools host)

Expand Down Expand Up @@ -148,10 +148,10 @@ E.g. for Cardano Preview it will be:

### 4. Add `<env>_stack.json` to `config/<blockchain>/<env>` folder

`<env>_stack.json` configuration file represents connection strings to partner chain dependencies (ogmios, kupo) and binaries (partner-chains-node, sidechain-main-cli, cardano-cli).
`<env>_stack.json` configuration file represents connection strings to partner chain dependencies (ogmios) and binaries (partner-chains-node, sidechain-main-cli, cardano-cli).

**NOTE:**
- **ogmios** and **kupo** services can be executed on the remote host or made available on test runner machine
- **ogmios** services can be executed on the remote host or made available on test runner machine
- partner chains binaries can be made available on the test runner machine or on the remote host
- if you want to use the remote host - you need to configure your own SSH keys

Expand All @@ -162,8 +162,6 @@ E.g. for Cardano Preview it will be:
"stack_config": {
"ogmios_host": <STRING>,
"ogmios_port": 1337,
"kupo_host": <STRING>,
"kupo_port": 1442,
"tools_shell": "/bin/bash",
"tools_host": <STRING,
"ssh": {
Expand Down
11 changes: 0 additions & 11 deletions dev/docker/sidechain-dependencies/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,3 @@ services:
- ipc:/ipc
- ogmios-data:/data
- $CARDANO_CONFIG_DIR:/config

kupo:
image: cardanosolutions/kupo:v2.10.0
container_name: sidechains-kupo
command: '--node-socket /ipc/node.socket --node-config /config/preview/config.json --host 0.0.0.0 --workdir /db --match "*" --since origin'
ports:
- "1442:1442"
volumes:
- $KUPO_WORKDIR:/db
- ipc:/ipc
- $CARDANO_CONFIG_DIR:/config
7 changes: 3 additions & 4 deletions dev/local-environment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ The local environment includes:
- 1 x PostgreSQL database
- 1 x Db-sync
- 1 x Ogmios
- 1 x Kupo
- 1 x Partner Chains Setup container based on Partner Chains Node Image to setup the smart-contracts

The stack `setup.sh` script will create a docker-compose.yml stack configuration files, and populate an .env file with environment values. The stack can be deployed with `docker-compose up -d`.
Expand All @@ -20,7 +19,7 @@ The stack `setup.sh` script will create a docker-compose.yml stack configuration

- When first run, all images will be pulled from public repositories. This stage may take some time. The stack will then be built and run.
- When the stack is running, the Cardano node begins block production. This is a private testnet and will not connect to the public Cardano network, but rather from a pre-configured genesis file.
- Once the Cardano chain is synced, Ogmios, Kupo and DB-Sync will in turn connect to the Cardano node node.socket and begin syncing the chain.
- Once the Cardano chain is synced, Ogmios, and DB-Sync will in turn connect to the Cardano node node.socket and begin syncing the chain.
- The partner-chains-setup will insert D parameter values and register Partner Chains Node keys with the Cardano chain.
- Once Postgres is populated with the required data, the Partner Chains nodes will begin syncing the chain and will begin block production after 2 main chain epochs.

Expand Down Expand Up @@ -62,8 +61,8 @@ These can be found at the very top of the `setup.sh` script.
The `setup.sh` script supports argument `--deployment-option X` with the below possible options:

1. Include only Cardano testnet
2. Include Cardano testnet with Kupo and Ogmios
3. Include Cardano testnet, Kupo, Ogmios, DB-Sync and Postgres
2. Include Cardano testnet with Ogmios
3. Include Cardano testnet, Ogmios, DB-Sync and Postgres
4. Deploy a single Partner Chains node with network_mode: "host" for external connections

Option 3 is suitable for providing a local Postgres with our minimal Cardano chain for local testing. Option 4 is suitable for deploying individual Partner Chain Nodes across distributed systems.
Expand Down
23 changes: 0 additions & 23 deletions dev/local-environment/configurations/kupo/entrypoint.sh

This file was deleted.

21 changes: 0 additions & 21 deletions dev/local-environment/modules/kupo.txt

This file was deleted.

1 change: 0 additions & 1 deletion dev/local-environment/modules/volumes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ volumes:
partner-chains-node-5-data: {}
ogmios-data: {}
ipc: {}
kupo-workdir: {}
74 changes: 42 additions & 32 deletions dev/local-environment/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
PARTNER_CHAINS_NODE_IMAGE="ghcr.io/input-output-hk/partner-chains/partner-chains-node:v1.4.0"
CARDANO_IMAGE="ghcr.io/intersectmbo/cardano-node:10.1.4"
DBSYNC_IMAGE="ghcr.io/intersectmbo/cardano-db-sync:13.6.0.4"
KUPO_IMAGE="cardanosolutions/kupo:v2.10.0"
OGMIOS_IMAGE="cardanosolutions/ogmios:v6.11.0"
POSTGRES_IMAGE="postgres:17.2"
SIDECHAIN_MAIN_CLI_IMAGE="node:22-bookworm"
Expand Down Expand Up @@ -135,15 +134,41 @@ configure_ogmios() {
echo
}

configure_kupo() {
echo "===== KUPO CONFIGURATION ========"
read -p "Do you want to set a non-default port for Kupo? (Will default to 1442) (Y/N): " set_kupo_port
if [[ $set_kupo_port == [Yy]* ]]; then
kupo_port=$(validate_port "Enter port for Kupo: ")
else
kupo_port=1442
fi
echo
configure_artifact_overrides() {
local mode=$1

if [ "$mode" == "interactive" ]; then
echo "===== ARTIFACT OVERRIDE CONFIGURATION ========"

if [ "$overrides" == "yes" ]; then
echo -e "Artifact overrides enabled. \n"
else
read -p "Do you want to override artifacts from local paths? (Y/N): " override_artifact
if [[ $override_artifact == [Yy]* ]]; then
overrides=yes
echo -e "Artifact overrides enabled. \n"
echo "To override the partner-chains-node artifact, copy artifact to path:"
echo -e "./configurations/partner-chains-node/overrides/partner-chains-node \n"
else
echo -e "Artifact overrides disabled. Stable versions will be automatically downloaded within the container from Github Releases. \n"
fi
fi
else
# Non-interactive mode
if [ "$overrides" == "yes" ]; then
echo -e "Artifact overrides enabled. \n"
fi
fi

# Check for the existence of the artifact paths
if [ "$overrides" == "yes" ]; then
# Check for partner-chains-node artifact
if [ -f "./configurations/partner-chains-node/overrides/partner-chains-node" ]; then
echo -e "partner-chains-node found. Override enabled. \n"
else
echo -e "partner-chains-node not found. Override disabled for partner-chains-node. \n"
fi
fi
}

resource_limits_setup() {
Expand All @@ -166,8 +191,6 @@ resource_limits_setup() {
mem_dbsync=200M
cpu_ogmios=0.2
mem_ogmios=500M
cpu_kupo=0.4
mem_kupo=600M
else
CPU_PARTNER_CHAINS_NODE=$(validate_cpu_limit "Enter CPU limit for Partner Chains nodes (e.g., 0.4 for 0.4 CPU): ")
MEM_PARTNER_CHAINS_NODE=$(validate_memory_limit "Enter Memory limit for each of the 3 x Partner Chains nodes (e.g., 400M for 400 MB): ")
Expand All @@ -181,8 +204,6 @@ resource_limits_setup() {
mem_dbsync=$(validate_memory_limit "Enter Memory limit for db-sync (e.g., 200M for 200 MB): ")
cpu_ogmios=$(validate_cpu_limit "Enter CPU limit for Ogmios (e.g., 0.2 for 0.2 CPU): ")
mem_ogmios=$(validate_memory_limit "Enter Memory limit for Ogmios (e.g., 500M for 500 MB): ")
cpu_kupo=$(validate_cpu_limit "Enter CPU limit for Kupo (e.g., 0.4 for 0.4 CPU): ")
mem_kupo=$(validate_memory_limit "Enter Memory limit for Kupo (e.g., 600M for 600 MB): ")
fi
else
DEFAULT_CPU_LIMIT="0.000"
Expand All @@ -197,8 +218,6 @@ resource_limits_setup() {
mem_dbsync=$DEFAULT_MEM_LIMIT
cpu_ogmios=$DEFAULT_CPU_LIMIT
mem_ogmios=$DEFAULT_MEM_LIMIT
cpu_kupo=$DEFAULT_CPU_LIMIT
mem_kupo=$DEFAULT_MEM_LIMIT
fi
echo
}
Expand Down Expand Up @@ -259,7 +278,6 @@ configure_env() {
POSTGRES_PORT=5432
POSTGRES_PASSWORD=$db_password
OGMIOS_PORT=1337
KUPO_PORT=1442
CPU_PARTNER_CHAINS_NODE=0.000
MEM_PARTNER_CHAINS_NODE=1000G
CPU_CARDANO=0.000
Expand All @@ -270,15 +288,13 @@ CPU_DBSYNC=0.000
MEM_DBSYNC=1000G
CPU_OGMIOS=0.000
MEM_OGMIOS=1000G
CPU_KUPO=0.000
MEM_KUPO=1000G
ARTIFACT_OVERRIDE=$overrides
EOF
else
cat <<EOF >.env
POSTGRES_PORT=$db_port
POSTGRES_PASSWORD=$db_password
OGMIOS_PORT=$ogmios_port
KUPO_PORT=$kupo_port
CPU_PARTNER_CHAINS_NODE=$CPU_PARTNER_CHAINS_NODE
MEM_PARTNER_CHAINS_NODE=$MEM_PARTNER_CHAINS_NODE
CPU_CARDANO=$cpu_cardano
Expand All @@ -289,15 +305,13 @@ CPU_DBSYNC=$cpu_dbsync
MEM_DBSYNC=$mem_dbsync
CPU_OGMIOS=$cpu_ogmios
MEM_OGMIOS=$mem_ogmios
CPU_KUPO=$cpu_kupo
MEM_KUPO=$mem_kupo
ARTIFACT_OVERRIDE=$overrides
EOF
fi

cat <<EOF >>.env
CARDANO_IMAGE=$CARDANO_IMAGE
DBSYNC_IMAGE=$DBSYNC_IMAGE
KUPO_IMAGE=$KUPO_IMAGE
OGMIOS_IMAGE=$OGMIOS_IMAGE
POSTGRES_IMAGE=$POSTGRES_IMAGE
SIDECHAIN_MAIN_CLI_IMAGE=$SIDECHAIN_MAIN_CLI_IMAGE
Expand All @@ -316,8 +330,8 @@ choose_deployment_option() {
if [[ $modify_stack =~ ^[Yy]$ ]]; then
echo "Choose your deployment option:"
echo "1) Include only Cardano testnet"
echo "2) Include Cardano testnet with Kupo and Ogmios"
echo "3) Include Cardano testnet, Kupo, Ogmios, DB-Sync and Postgres"
echo "2) Include Cardano testnet with Ogmios"
echo "3) Include Cardano testnet, Ogmios, DB-Sync and Postgres"
echo "4) Deploy a single Partner Chains node with network_mode: "host" for external connections (adjust partner-chains-external-node.txt before running this script)"
read -p "Enter your choice (1/2/3/4): " deployment_option
else
Expand All @@ -342,24 +356,21 @@ create_docker_compose() {
cat ./modules/cardano.txt >> docker-compose.yml
;;
2)
echo -e "Including Cardano testnet, Kupo, and Ogmios services.\n"
echo -e "Including Cardano testnet, and Ogmios services.\n"
cat ./modules/cardano.txt >> docker-compose.yml
cat ./modules/ogmios.txt >> docker-compose.yml
cat ./modules/kupo.txt >> docker-compose.yml
;;
3)
echo -e "Including Cardano testnet, Kupo, Ogmios, DB-Sync, and Postgres services.\n"
echo -e "Including Cardano testnet, Ogmios, DB-Sync, and Postgres services.\n"
cat ./modules/cardano.txt >> docker-compose.yml
cat ./modules/ogmios.txt >> docker-compose.yml
cat ./modules/kupo.txt >> docker-compose.yml
cat ./modules/db-sync.txt >> docker-compose.yml
cat ./modules/postgres.txt >> docker-compose.yml
;;
4)
echo -e "Including all services with external partner chain node.\n"
cat ./modules/cardano.txt >> docker-compose.yml
cat ./modules/ogmios.txt >> docker-compose.yml
cat ./modules/kupo.txt >> docker-compose.yml
cat ./modules/db-sync.txt >> docker-compose.yml
cat ./modules/postgres.txt >> docker-compose.yml
cat ./modules/partner-chains-external-node.txt >> docker-compose.yml
Expand All @@ -369,7 +380,6 @@ create_docker_compose() {
echo -e "Including all services.\n"
cat ./modules/cardano.txt >> docker-compose.yml
cat ./modules/ogmios.txt >> docker-compose.yml
cat ./modules/kupo.txt >> docker-compose.yml
cat ./modules/db-sync.txt >> docker-compose.yml
cat ./modules/postgres.txt >> docker-compose.yml
cat ./modules/partner-chains-nodes.txt >> docker-compose.yml
Expand Down Expand Up @@ -477,7 +487,7 @@ main() {
backup_files "interactive"
configure_postgres "interactive"
configure_ogmios
configure_kupo
configure_artifact_overrides "interactive"
resource_limits_setup

if [ "$deployment_option" -eq 0 ]; then
Expand Down
1 change: 0 additions & 1 deletion dev/nix/packages/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
packages = {
inherit (cardanoPackages) cardano-node cardano-cli cardano-testnet;
inherit (dbSyncPackages) "cardano-db-sync:exe:cardano-db-sync";
kupo = pkgs.callPackage ./kupo.nix { };
ogmios = pkgs.callPackage ./ogmios.nix { };
process-compose = pkgs.process-compose.overrideAttrs (oldAttrs: {
patches = [ ./pc.patch ];
Expand Down
24 changes: 0 additions & 24 deletions dev/nix/packages/kupo.nix

This file was deleted.

Loading