Skip to content

Commit

Permalink
Decomissioning rococo
Browse files Browse the repository at this point in the history
Removing rococo backend completely, while as for frontend, adding a
temporary deprecation page
  • Loading branch information
mutantcornholio committed Sep 11, 2024
1 parent 82e3560 commit 3f1858a
Show file tree
Hide file tree
Showing 19 changed files with 66 additions and 171 deletions.
9 changes: 0 additions & 9 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,6 @@ deploy-versi:
DOMAIN: parity-versi
APP: substrate-faucet-versi

deploy-rococo:
stage: deploy
<<: *deploy-prod-refs
extends: .deploy-with-argocd
environment: rococo
variables:
DOMAIN: parity-testnet
APP: substrate-faucet-rococo

deploy-westend:
stage: deploy
<<: *deploy-prod-refs
Expand Down
2 changes: 1 addition & 1 deletion .papi/descriptors/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.1.0-autogenerated.13690154651401807995",
"version": "0.1.0-autogenerated.15923036596518606994",
"name": "@polkadot-api/descriptors",
"files": [
"dist"
Expand Down
Binary file removed .papi/metadata/rococo.scale
Binary file not shown.
4 changes: 0 additions & 4 deletions .papi/polkadot-api.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
"version": 0,
"descriptorPath": ".papi/descriptors",
"entries": {
"rococo": {
"chain": "rococo_v2_2",
"metadata": ".papi/metadata/rococo.scale"
},
"westend": {
"chain": "westend2",
"metadata": ".papi/metadata/westend.scale"
Expand Down
5 changes: 3 additions & 2 deletions client/src/lib/components/NetworkInput.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { testnet } from "$lib/utils/stores";
import { getChainName, Rococo } from "../utils/networkData";
import { getChainName } from "../utils/networkData";
import Chevron from "./icons/Chevron.svelte";
export let network: number = -1;
Expand All @@ -10,8 +10,9 @@
let customValue: boolean = false;
let customBtnMessage = "Use preselected chains";
$: customBtnMessage = !customValue ? "Use custom chain id" : "Use preselected chains";
$: customValue = !getChainName(Rococo, network);
$: customValue = !getChainName($testnet, network);
function switchCustomValue() {
if (!customValue) {
Expand Down
1 change: 1 addition & 0 deletions client/src/lib/utils/networkData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export interface NetworkData {
explorer: string | null;
}

// TODO: needed for proper routing; remove after rococo shutdown
export const Rococo: NetworkData = {
networkName: "Rococo",
currency: "ROC",
Expand Down
6 changes: 3 additions & 3 deletions client/src/lib/utils/stores.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { derived, writable } from "svelte/store";

import { type NetworkData, Rococo } from "./networkData";
import { type NetworkData, Paseo } from "./networkData";

// If we want to have a new network we need to change this hardcoded value.
export const testnet = writable<NetworkData>(Rococo);
// Defaults to Paseo, being updated in Faucet.svelte
export const testnet = writable<NetworkData>(Paseo);

export const testnetName = derived(testnet, ($net) => $net.networkName);

Expand Down
51 changes: 45 additions & 6 deletions client/src/routes/rococo/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,12 +1,51 @@
<!-- Temporary page; take down some time after rococo shutdown -->
<script lang="ts">
import faqMd from "$lib/assets/FAQ.md?raw";
import Faucet from "$lib/components/Faucet.svelte";
import Card from "$lib/components/Card.svelte";
import MarkUp from "$lib/components/MarkUp.svelte";
import FrequentlyAskedQuestions from "$lib/components/screens/FrequentlyAskedQuestions.svelte";
import SocialTags from "$lib/components/SocialTags.svelte";
import { type NetworkData, Rococo } from "$lib/utils/networkData";
import { testnet } from "$lib/utils/stores";
import { onMount } from "svelte";
let network: NetworkData = Rococo;
let faq: string = faqMd
.replaceAll("<NETWORK-TOKEN>", network.currency)
.replaceAll("<NETWORK-NAME>", network.networkName);
// Keeping the FAQ section just because it's easier than either:
// * removing "Questions" section from navbar
// * getting around broken link test
let faq: string = `
# Rococo decomission plan
https://forum.polkadot.network/t/rococo-to-be-deprecated-in-october/8702
`;
onMount(() => {
testnet.set(network);
});
</script>

<Faucet {network} {faq} />
<main>
<SocialTags />
<div class="flex items-center justify-center mt-16 mb-4 md:my-16">
<Card title="Rococo faucet has been deprecated">
<h3 class="card-subtitle">
Rococo network is being shut down. <br />
Please use it's successor, <a href="https://github.com/paseo-network">Paseo network</a>
</h3>
</Card>
</div>
<MarkUp {faq} />
<FrequentlyAskedQuestions {faq} />
</main>

<style lang="postcss">
main {
@apply mx-auto my-0 md:p-8;
max-width: 720px;
text-align: center;
}
@media (min-width: 768px) {
main {
min-height: 90vh;
}
}
</style>
6 changes: 6 additions & 0 deletions client/svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ import preprocess from "svelte-preprocess";

const config = {
preprocess: [preprocess({ postcss: true })],
onwarn: (warning, handler) => {
if (warning.code === 'css-unused-selector') {
return;
}
handler(warning);
},

kit: {
adapter: process.env.STATIC ? staticAdapter() : nodeAdapter(),
Expand Down
13 changes: 0 additions & 13 deletions client/tests/rococo.test.ts

This file was deleted.

1 change: 0 additions & 1 deletion client/tests/switch.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ type Network = { name: string; url: string };

export const networks: Network[] = [
{ name: "Paseo", url: "/" },
{ name: "Rococo", url: "/rococo" },
{ name: "Westend", url: "/westend" },
];

Expand Down
2 changes: 1 addition & 1 deletion env.faucet.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"type": "string"
},
"NETWORK": {
"description": "name of the network: westend, rococo, etc.",
"description": "name of the network: westend, paseo, etc.",
"mandatory": true,
"type": "string"
},
Expand Down
2 changes: 1 addition & 1 deletion helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: substrate-faucet
description: A Helm chart for Kubernetes
type: application
version: 0.2.1
version: 0.2.2
dependencies:
- name: substrate-faucet
version: "3.0.3"
Expand Down
27 changes: 0 additions & 27 deletions helm/values-parity-testnet-rococo.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions src/papi/chains/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Binary, PolkadotClient } from "polkadot-api";

import e2e from "./e2e";
import paseo from "./paseo";
import rococo from "./rococo";
import versi from "./versi";
import westend from "./westend";

Expand All @@ -12,7 +11,6 @@ export interface ChainData {
}

export const networks: Record<string, { data: NetworkData; api: NetworkApi }> = {
rococo,
versi,
westend,
e2e,
Expand Down
96 changes: 0 additions & 96 deletions src/papi/chains/rococo.ts

This file was deleted.

4 changes: 2 additions & 2 deletions src/server/routes/actions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jest.mock("../../config", () => {
(key: string) =>
// eslint-disable-next-line security/detect-object-injection
({
NETWORK: "rococo",
NETWORK: "paseo",
FAUCET_ACCOUNT_MNEMONIC: "initial evolve valve plate south word judge pistol label lizard category cycle",
})[key], // minimal viable config on the initial import
),
Expand Down Expand Up @@ -65,7 +65,7 @@ describe("/drip/web tests", () => {
app.use(router);

mockConfigValue.config = {
NETWORK: "rococo",
NETWORK: "paseo",
FAUCET_ACCOUNT_MNEMONIC:
"scrub inquiry adapt lounge voice current manage chief build shoot drip liar head season inside",
};
Expand Down
2 changes: 1 addition & 1 deletion src/test/globalSetup.unit.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export default function() {
process.env.SMF_CONFIG_NETWORK = "rococo"
process.env.SMF_CONFIG_NETWORK = "westend"
}
4 changes: 2 additions & 2 deletions src/utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ type DataProvider = {

jest.mock("./config");

describe("test rococo", () => {
describe("test westend", () => {
beforeAll(() => {
process.env.SMF_CONFIG_NETWORK = "rococo";
process.env.SMF_CONFIG_NETWORK = "westend";
});
const dataProvider: DataProvider[] = [
{ username: "1", expected: false },
Expand Down

0 comments on commit 3f1858a

Please sign in to comment.