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

chore: create ci for kitkat #4035

Merged
merged 10 commits into from
Sep 27, 2023
Merged
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
37 changes: 37 additions & 0 deletions .github/workflows/release-kitkat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release Chainflip KitKat
on:
workflow_dispatch:

concurrency:
group: ${{ github.ref }}-release-kitkat
cancel-in-progress: true

jobs:
check-versions:
uses: ./.github/workflows/_03_check_versions.yml
bins:
needs: [check-versions]
uses: ./.github/workflows/_02_retrieve-bins.yml
secrets: inherit
docker:
needs: [bins]
uses: ./.github/workflows/_24_docker.yml
with:
network: kitkat
environment: prod
publish_public_images: true
secrets: inherit
package:
needs: [bins]
uses: ./.github/workflows/_25_package.yml
with:
network: "kitkat"
environment: prod
secrets: inherit
publish:
needs: [package]
uses: ./.github/workflows/_30_publish.yml
with:
version: "kitkat/"
environment: prod
secrets: inherit
15 changes: 15 additions & 0 deletions state-chain/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,18 @@ assets = [
"644",
],
]

[package.metadata.deb.variants.kitkat]
maintainer-scripts = "package/kitkat"
assets = [
[
"target/release/chainflip-node",
"usr/bin/",
"755",
],
[
"chainspecs/kitkat.chainspec.raw.json",
"etc/chainflip/kitkat.chainspec.json",
"644",
],
]
421 changes: 421 additions & 0 deletions state-chain/node/chainspecs/kitkat.chainspec.json

Large diffs are not rendered by default.

181 changes: 181 additions & 0 deletions state-chain/node/chainspecs/kitkat.chainspec.raw.json

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions state-chain/node/package/kitkat/chainflip-archive-node.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[Unit]
Description=Chainflip Archive Node

[Service]
Restart=always
RestartSec=30

WorkingDirectory=/etc/chainflip

ExecStart=/usr/bin/chainflip-node \
--chain=/etc/chainflip/kitkat.chainspec.json \
--base-path=/etc/chainflip/chaindata \
--node-key-file=/etc/chainflip/keys/node_key_file \
tomjohnburton marked this conversation as resolved.
Show resolved Hide resolved
--trie-cache-size=0 \
--prometheus-external \
--rpc-cors=all \
--rpc-methods=unsafe \
--state-pruning=archive \
--blocks-pruning=archive \
--unsafe-rpc-external \
--sync=full

[Install]
WantedBy=multi-user.target
19 changes: 19 additions & 0 deletions state-chain/node/package/kitkat/chainflip-genesis-node.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[Unit]
Description=Chainflip Genesis Node

[Service]
Restart=always
RestartSec=30

WorkingDirectory=/etc/chainflip

ExecStart=/usr/bin/chainflip-node \
--chain=/etc/chainflip/kitkat.chainspec.json \
--base-path=/etc/chainflip/chaindata \
--node-key-file=/etc/chainflip/keys/node_key_file \
--validator \
--trie-cache-size=0 \
--sync=full
tomjohnburton marked this conversation as resolved.
Show resolved Hide resolved

[Install]
WantedBy=multi-user.target
22 changes: 22 additions & 0 deletions state-chain/node/package/kitkat/chainflip-node.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[Unit]
Description=Chainflip Validator Node

[Service]
Restart=always
RestartSec=30

WorkingDirectory=/etc/chainflip

ExecStart=/usr/bin/chainflip-node \
--chain=/etc/chainflip/kitkat.chainspec.json \
--base-path=/etc/chainflip/chaindata \
--node-key-file=/etc/chainflip/keys/node_key_file \
--validator \
--trie-cache-size=0 \
--sync=warp

StandardOutput=journal
StandardError=journal

[Install]
WantedBy=multi-user.target
2 changes: 2 additions & 0 deletions state-chain/node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ use sp_runtime::{

pub mod common;
pub mod devnet;
pub mod kitkat;
pub mod partnernet;
pub mod perseverance;
pub mod sisyphos;
Expand Down Expand Up @@ -423,6 +424,7 @@ network_spec!(testnet);
network_spec!(partnernet);
network_spec!(sisyphos);
network_spec!(perseverance);
network_spec!(kitkat);

/// Configure initial storage state for FRAME modules.
/// 150 authority limit
Expand Down
82 changes: 82 additions & 0 deletions state-chain/node/src/chain_spec/kitkat.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
pub use super::{
common::*,
testnet::{BITCOIN_EXPIRY_BLOCKS, ETHEREUM_EXPIRY_BLOCKS, POLKADOT_EXPIRY_BLOCKS},
};
use super::{parse_account, StateChainEnvironment};
use cf_chains::{dot::RuntimeVersion, eth::CHAIN_ID_MAINNET};
use cf_primitives::{AccountId, AccountRole, BlockNumber, FlipBalance, NetworkEnvironment};
use sc_service::ChainType;
use sp_core::H256;

// *** Overrides from common
pub const ACCRUAL_RATIO: (i32, u32) = (10, 10);
// ***

pub struct Config;

pub const NETWORK_NAME: &str = "Chainflip-KitKat";
pub const CHAIN_TYPE: ChainType = ChainType::Live;
pub const NETWORK_ENVIRONMENT: NetworkEnvironment = NetworkEnvironment::Mainnet;
pub const PROTOCOL_ID: &str = "flip-kitkat";

pub const ENV: StateChainEnvironment = StateChainEnvironment {
flip_token_address: hex_literal::hex!("6fA66Cb44dE97CaA1aE7742019DF6e7AFA3F9b51"),
eth_usdc_address: hex_literal::hex!("A0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"),
state_chain_gateway_address: hex_literal::hex!("B5E2C8fa04Ae426167490a0437c4F20556c9B07C"),
key_manager_address: hex_literal::hex!("697C9BCA7916305C1D9377AB0E985da1411Dd70b"),
eth_vault_address: hex_literal::hex!("806cDBA7E42AdDE2B6cb09b748943E4B9A9188E5"),
eth_address_checker_address: hex_literal::hex!("D2D873BCaE693C9Cb9F7757183012edD671d2216"),
ethereum_chain_id: CHAIN_ID_MAINNET,
eth_init_agg_key: hex_literal::hex!(
"0250f648bae0db9366550d041e163c9b23b79b1b06be7fac83ba4f338bd02e4024"
),
ethereum_deployment_block: 18227257u64,
genesis_funding_amount: 1_000 * FLIPPERINOS_PER_FLIP,
min_funding: MIN_FUNDING,
dot_genesis_hash: H256(hex_literal::hex!(
"91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3" // Polkadot mainnet
)),
dot_vault_account_id: None,
dot_runtime_version: RuntimeVersion { spec_version: 9430, transaction_version: 24 },
};

pub const EPOCH_DURATION_BLOCKS: BlockNumber = 24 * HOURS;
tomjohnburton marked this conversation as resolved.
Show resolved Hide resolved

pub const BASHFUL_ACCOUNT_ID: &str = "cFNBWrx4Wx68hVugPVX3KAtKwbsmHjw6ozAXE3d663bwtYF5R";
pub const BASHFUL_SR25519: [u8; 32] =
hex_literal::hex!["beb23228343fc71c913a10299f577cbc20ee0eb44dcf8a698ab861c76223495b"];
pub const BASHFUL_ED25519: [u8; 32] =
hex_literal::hex!["92e620fa4cc3736bbef778b5852309936c0ce640ad50c1f4f36fc15eba7f4ed8"];
pub const DOC_ACCOUNT_ID: &str = "cFJHNnou7QwegcEEhL3xeD1aUrjeaL5Ydqtrfyd7ousKoiLPU";
pub const DOC_SR25519: [u8; 32] =
hex_literal::hex!["123990561086190def905deab1f5c3fe1f7dd08585e677ff4fe3196e1201a82e"];
pub const DOC_ED25519: [u8; 32] =
hex_literal::hex!["4a11427487645aade5f5134904668a9dcde93e493f668f0b347f23d3cd4d7c76"];
pub const DOPEY_ACCOUNT_ID: &str = "cFJyZdYw1p9bkYNUuwDppkfKrGinn8r4ZWaPvSaxSvrpiSTa2";
pub const DOPEY_SR25519: [u8; 32] =
hex_literal::hex!["30dfdf38642c300105e2ac604b92d08f1e26f01459539bfd7f8c51cf60e0ce68"];
pub const DOPEY_ED25519: [u8; 32] =
hex_literal::hex!["39df8c764fb991819aeb94bfb2e7809a2728660113e6ec0758e751d3c00f4fcd"];
pub const SNOW_WHITE_ACCOUNT_ID: &str = "cFKsNoWaviRPS5s4xPxHxEXWBwAm3Q4JGXoXY3HXcsfWgun1D";
pub const SNOW_WHITE_SR25519: [u8; 32] =
hex_literal::hex!["58642e85c7889f9cda6e5d87249c6ab4c6d9b2f6bad8c5986cab81c6317d4e61"];

pub fn extra_accounts() -> Vec<(AccountId, AccountRole, FlipBalance, Option<Vec<u8>>)> {
[vec![
(
parse_account("cFHwQ2eJQqRLJWgcHhdgAVCXx2TNRaS3R4Zc98mU2SrkW6AMH"),
AccountRole::Broker,
1_000 * FLIPPERINOS_PER_FLIP,
Some(b"Chainflip Genesis Broker".to_vec()),
),
(
parse_account("cFNaeW7FBpjVxh5haxwmnnATCXriuThVJ8vcyQWKi6SfwWHni"),
AccountRole::LiquidityProvider,
1_000 * FLIPPERINOS_PER_FLIP,
Some(b"Chainflip Genesis Liquidity Provider".to_vec()),
),
]]
.into_iter()
.flatten()
.collect()
}
1 change: 1 addition & 0 deletions state-chain/node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ impl SubstrateCli for Cli {
"sisyphos-new" => Box::new(chain_spec::sisyphos::Config::build_spec(None)?),
"partnernet-new" => Box::new(chain_spec::partnernet::Config::build_spec(None)?),
"perseverance-new" => Box::new(chain_spec::perseverance::Config::build_spec(None)?),
"kitkat-new" => Box::new(chain_spec::kitkat::Config::build_spec(None)?),
"sisyphos" => Box::new(chain_spec::ChainSpec::from_json_bytes(
include_bytes!("../chainspecs/sisyphos.chainspec.raw.json").as_slice(),
)?),
Expand Down