Skip to content

Commit

Permalink
chore: rename sidechain-main-cli to pc-contracts-cli
Browse files Browse the repository at this point in the history
ETCM-8248
This coorelates with the renaming in
input-output-hk/partner-chains-smart-contracts#113
  • Loading branch information
tgunnoe committed Sep 19, 2024
1 parent 0c48bf9 commit c5e27e5
Show file tree
Hide file tree
Showing 24 changed files with 133 additions and 144 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ jobs:
uses: actions/checkout@v4
with:
token: ${{ github.token }}
- name: Update flake.lock with calling PR
if: github.event_name == 'repository_dispatch'
run: |
nix flake lock --update-input trustless-sidechain \
--override-input trustless-sidechain \
github:input-output-hk/partner-chains-smart-contracts/${{ github.event.client_payload.ref }}
- name: Acquire AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
Expand Down
18 changes: 7 additions & 11 deletions .github/workflows/sidechain-main-cli-binary-host.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build sidechain-main-cli and Push to EKS binary-host (optional)
name: Build pc-contracts-cli and Push to EKS binary-host (optional)

on:
workflow_dispatch:
Expand All @@ -25,7 +25,7 @@ jobs:
path: partner-chains-smart-contracts

- name: Build
run: nix build ./partner-chains-smart-contracts#sidechain-release-bundle
run: nix build ./partner-chains-smart-contracts#pc-contracts-release-bundle

- name: Prepare Artifact
run: |
Expand All @@ -45,7 +45,7 @@ jobs:
runs-on: ubuntu-latest
needs: build-and-upload
steps:
- name: Download sidechain-main-cli Artifact
- name: Download pc-contracts-cli Artifact
uses: actions/download-artifact@v4
with:
name: partner-chains-smart-contracts-artifact
Expand All @@ -56,10 +56,6 @@ jobs:
mkdir -p artifact/unzipped
unzip artifact/release.zip -d artifact/unzipped
- name: Rename Binary
run: |
mv artifact/unzipped/sidechain-cli artifact/unzipped/sidechain-main-cli
- name: Upload Unzipped Artifact
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -97,13 +93,13 @@ jobs:

- name: Create SHA directory on binary-host
run: |
kubectl exec binary-host -c binary-host -n sc -- mkdir -p /tools/sidechain-main-cli/${{ github.event.inputs.commit_sha }}
kubectl exec binary-host -c binary-host -n sc -- mkdir -p /tools/pc-contracts-cli/${{ github.event.inputs.commit_sha }}
- name: Copy to binary-host
run: |
kubectl cp artifact/unzipped/sidechain-main-cli binary-host:/tools/sidechain-main-cli/${{ github.event.inputs.commit_sha }} -c binary-host -n sc
kubectl cp artifact/unzipped/node_modules binary-host:/tools/sidechain-main-cli/${{ github.event.inputs.commit_sha }} -c binary-host -n sc
kubectl cp artifact/unzipped/pc-contracts-cli binary-host:/tools/pc-contracts-cli/${{ github.event.inputs.commit_sha }} -c binary-host -n sc
kubectl cp artifact/unzipped/node_modules binary-host:/tools/pc-contracts-cli/${{ github.event.inputs.commit_sha }} -c binary-host -n sc
- name: Make binary executable
run: |
kubectl exec binary-host -c binary-host -n sc -- chmod +x /tools/sidechain-main-cli/${{ github.event.inputs.commit_sha }}/sidechain-main-cli
kubectl exec binary-host -c binary-host -n sc -- chmod +x /tools/pc-contracts-cli/${{ github.event.inputs.commit_sha }}/pc-contracts-cli
7 changes: 4 additions & 3 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ This changelog is based on [Keep A Changelog](https://keepachangelog.com/en/1.1.
to `sc-partner-chains-consensus-aura` and `sp-partner-chains-consensus-aura`.
This change requires migration of the node, PartnerChainsProposerFactory has to be used.
See `service.rs` in `partner-chains-node` crate for an example.
* renamed sidechain-main-cli and relevant naming to pc-contracts-cli

## Removed

Expand Down Expand Up @@ -70,7 +71,7 @@ users in their runtime crate.
* ETCM-7762 - update to polkadot v1.13.0 - requires adaption in node code, because GenericChainSpec has lost one generic parameter
* ETCM-7759 - decoupled all crates that use chain follower data sources from the concrete `DataSources` type.
Now all logic accepts any type that implements one of the traits: `XXXDataSource` or `HasXXXDataSource`.
* ETCM-7766 - updates to accommodate to new version of trustless-sidechain: containers and devnet settings and utilities
* ETCM-7766 - updates to accommodate to new version of partner-chains-smart-contracts: containers and devnet settings and utilities
* BREAKING: ETCM-7818 read candidates related main chain configuration from ledger, not from environment. Migration for existing chains is to put proper configuration in the ledger and then export chain as a spec file.
* ETCM-7855 - removed all Active Flow-related components and features. This change should not affect
Partner Chains nodes that did not use Active Flow.
Expand Down Expand Up @@ -119,7 +120,7 @@ Cleaned `inherent_data.rs` which now contains only wiring and necessary minor he
* ETCM-7080: add aura and grandpa public keys to registrations data returned from RPC method

## Changed
* IMPORTANT: trustless-sidechain revision has been updated in flake.nix. Downstream projects, like Midnight, should keep using the previous value, to keep configuration utilities in sync with their testnets.
* IMPORTANT: partner-chains-smart-contracts revision has been updated in flake.nix. Downstream projects, like Midnight, should keep using the previous value, to keep configuration utilities in sync with their testnets.
* BREAKING: ETCM-5905 - remove all storage maps from pallet-active-flow

* ETCM-7136 - replaced the local partner-chains-session pallet with one from the SDK
Expand Down Expand Up @@ -153,7 +154,7 @@ hiding each data source type behind a feature
## Changed
* BREAKING: ETCM-5898 - remove storage maps from pallet-session-validator-management and simplify the committee rotation logic
* ETCM-6877 - improved the performance of getting the latest on chain committee hash, requires update in deployment configuration.
* ETCM-6822 - update trustless-sidechain revision to: 76f57380b6d85f2c1a1f212591a99ebd0db96213.
* ETCM-6822 - update partner-chains-smart-contracts revision to: 76f57380b6d85f2c1a1f212591a99ebd0db96213.
* ETCM-6816, ETCM-6813 - removed dependency on `sidechain-inherents`, `mock-types` and `sidechain-domain` from `pallet-session-validator-management` crate
* ETCM-6813 - moved authority selection code from `sidechain-inherents` to a new `authority-selection-inherents` crate
* ETCM-6813 - moved code shared between `authority-selection-inherents` and `pallet-session-validator-management`
Expand Down
2 changes: 1 addition & 1 deletion cli/commands/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pub mod key_params;
pub mod output;
pub mod registration_signatures;
pub mod sidechain_main_cli_params;
pub mod pc_contracts_cli_params;
pub mod signing;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use clap::Parser;

#[derive(Clone, Debug, Default, Parser)]
pub struct SidechainMainCliParams {
pub struct PcContractsCliParams {
#[arg(long)]
pub ogmios_host: Option<String>,
#[arg(long)]
Expand All @@ -17,7 +17,7 @@ pub struct SidechainMainCliParams {
pub kupo_secure: bool,
}

impl SidechainMainCliParams {
impl PcContractsCliParams {
pub fn command_line_params(&self) -> Vec<Vec<String>> {
let mut args = vec![];
if let Some(ogmios_host) = &self.ogmios_host {
Expand Down
2 changes: 1 addition & 1 deletion devnet/.envrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export GOVERNANCE_AUTHORITY=76da17b2e3371ab7ca88ce0500441149f03cc5091009f99c99c0
export SIDECHAIN_BLOCK_BENEFICIARY="0x0000000000000000000000000000000000000000000000000000000000000001"

# below exports parse config/addresses.json file, which needs to regenerated for each new sidechain by running
# sidechain-main-cli addresses ... > config/addresses.json
# pc-contracts-cli addresses ... > config/addresses.json
export COMMITTEE_CANDIDATE_ADDRESS=$(jq -r '.addresses.CommitteeCandidateValidator' devnet/addresses.json)
export D_PARAMETER_POLICY_ID=$(jq -r '.mintingPolicies.DParameterPolicy' devnet/addresses.json)
export PERMISSIONED_CANDIDATES_POLICY_ID=$(jq -r '.mintingPolicies.PermissionedCandidatesPolicy' devnet/addresses.json)
Expand Down
2 changes: 1 addition & 1 deletion docs/developer-guides/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The main chain follower reads from **postgres** that **db-sync** writes to.
**db-sync** itself requires UDS connection to **cardano-node**.

For executing **partner-chains-smart-contracts** CLI commands **ogmios** and **kupo** are required.
Both of them open HTTP ports that `sidechain-main-cli` is looking for by default (1337 and 1442).
Both of them open HTTP ports that `pc-contracts-cli` is looking for by default (1337 and 1442).

This document will help you with spinning up the dependencies running in either docker; or
_process-compose_; the latter utilizing containerless, natively built binaries via nix.
Expand Down
7 changes: 3 additions & 4 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@

# Partner Chains deps
smart-contracts = {
url = "github:input-output-hk/partner-chains-smart-contracts/v6.1.0";
# Update to desired tag when ready for release
url = "github:input-output-hk/partner-chains-smart-contracts";
flake = false;
};
cardano-node = {
Expand Down
2 changes: 1 addition & 1 deletion nix/packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

in {
packages = {
inherit (smartContractsPkgs) sidechain-main-cli;
inherit (smartContractsPkgs) pc-contracts-cli;
inherit (cardanoPackages) cardano-node cardano-cli cardano-testnet;
inherit (dbSyncPackages) "cardano-db-sync:exe:cardano-db-sync";
kupo = cardanoExtraPkgs."kupo-${kupoVersion}";
Expand Down
8 changes: 4 additions & 4 deletions nix/shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@
'';
}
{
name = "sidechain-main-cli";
name = "pc-contracts-cli";
help = "CLI to interact with Partner Chains Smart Contracts";
command = ''
${self'.packages.sidechain-main-cli}/bin/sidechain-main-cli $@
${self'.packages.pc-contracts-cli}/bin/pc-contracts-cli $@
'';
}
];
Expand All @@ -151,10 +151,10 @@
commands = commands ++ [
{
category = "Partner Chains";
name = "sidechain-main-cli";
name = "pc-contracts-cli";
help = "CLI to interact with Partner Chains Smart Contracts";
command = ''
${self'.packages.sidechain-main-cli}/bin/sidechain-main-cli $@
${self'.packages.pc-contracts-cli}/bin/pc-contracts-cli $@
'';
}
];
Expand Down
2 changes: 1 addition & 1 deletion partner-chains-cli/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

A set of CLI style wizards to help getting started with Partner Chains.

Should be packaged together with **partner-chains-node** executable, and **trustless-sidechain CLI**.
Should be packaged together with **partner-chains-node** executable, and **partner-chain-smart-contracts CLI**.
2 changes: 1 addition & 1 deletion partner-chains-cli/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ pub const KEYS_FILE_PATH: &str = "partner-chains-public-keys.json";
pub const CHAIN_CONFIG_FILE_PATH: &str = "partner-chains-cli-chain-config.json";
pub const RESOURCES_CONFIG_FILE_PATH: &str = "partner-chains-cli-resources-config.json";
pub const CHAIN_SPEC_PATH: &str = "chain-spec.json";
pub const SIDECHAIN_MAIN_CLI_PATH: &str = "./sidechain-main-cli";
pub const PC_CONTRACTS_CLI_PATH: &str = "./pc-contracts-cli";

pub fn load_chain_config(context: &impl IOContext) -> anyhow::Result<ChainConfig> {
if let Some(chain_config_file) = context.read_file(CHAIN_CONFIG_FILE_PATH) {
Expand Down
2 changes: 1 addition & 1 deletion partner-chains-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub(crate) mod permissioned_candidates;
mod prepare_configuration;
pub mod register;
mod setup_main_chain_state;
pub(crate) mod sidechain_main_cli_resources;
pub(crate) mod pc_contracts_cli_resources;
pub(crate) mod smart_contracts;
pub mod start_node;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ use crate::io::IOContext;
use std::str::FromStr;

#[derive(Debug, Clone)]
pub(crate) struct SidechainMainCliResources {
pub(crate) struct PcContractsCliResources {
pub(crate) kupo: ServiceConfig,
pub(crate) ogmios: ServiceConfig,
}

impl Default for SidechainMainCliResources {
impl Default for PcContractsCliResources {
fn default() -> Self {
Self {
kupo: ServiceConfig {
Expand All @@ -34,9 +34,9 @@ impl Default for SidechainMainCliResources {

pub(crate) const KUPO_AND_OGMIOS_REQUIRED: &str = "Partner Chains Smart Contracts require access to Kupo and Ogmios. Please provide their configuration.";

pub(crate) fn establish_sidechain_main_cli_configuration<C: IOContext>(
pub(crate) fn establish_pc_contracts_cli_configuration<C: IOContext>(
context: &C,
) -> anyhow::Result<SidechainMainCliResources> {
) -> anyhow::Result<PcContractsCliResources> {
context.print(KUPO_AND_OGMIOS_REQUIRED);
let kupo_protocol = KUPO_PROTOCOL
.select_options_with_default_from_file_and_save(KUPO_PROTOCOL.name, context)
Expand All @@ -48,7 +48,7 @@ pub(crate) fn establish_sidechain_main_cli_configuration<C: IOContext>(
.map_err(anyhow::Error::msg)?;
let ogmios_hostname = OGMIOS_HOSTNAME.prompt_with_default_from_file_and_save(context);
let ogmios_port = OGMIOS_PORT.prompt_with_default_from_file_parse_and_save(context)?;
Ok(SidechainMainCliResources {
Ok(PcContractsCliResources {
kupo: ServiceConfig { protocol: kupo_protocol, hostname: kupo_hostname, port: kupo_port },
ogmios: ServiceConfig {
protocol: ogmios_protocol,
Expand All @@ -64,13 +64,13 @@ pub(crate) mod tests {
prompt_multi_option_with_default_and_save_to_existing_file,
prompt_with_default_and_save_to_existing_file,
};
use crate::sidechain_main_cli_resources::*;
use crate::pc_contracts_cli_resources::*;
use crate::tests::MockIO;

/// Assumption for this function is that resources config file exists, so tests context should have it.
pub(crate) fn establish_sidechain_main_cli_configuration_io(
existing_config: Option<SidechainMainCliResources>,
config_to_set: SidechainMainCliResources,
pub(crate) fn establish_pc_contracts_cli_configuration_io(
existing_config: Option<PcContractsCliResources>,
config_to_set: PcContractsCliResources,
) -> MockIO {
let default_config = existing_config.unwrap_or_default();
MockIO::Group(vec![
Expand Down
Loading

0 comments on commit c5e27e5

Please sign in to comment.