Skip to content

Commit 3125536

Browse files
author
Pablo Mendez
committed
Merge branch 'develop'
2 parents 7e03e70 + 342c173 commit 3125536

File tree

32 files changed

+1190
-89
lines changed

32 files changed

+1190
-89
lines changed

packages/admin-ui/src/__mock-backend__/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ export const otherCalls: Omit<Routes, keyof typeof namedSpacedCalls> = {
224224
ipfsClientTargetSet: async () => {},
225225
ipfsClientTargetGet: async () => ({
226226
ipfsClientTarget: IpfsClientTarget.remote,
227-
ipfsGateway: "https://gateway.ipfs.dappnode.io"
227+
ipfsGateway: "https://ipfs-gateway.dappnode.net"
228228
}),
229229
enableEthicalMetrics: async () => {},
230230
getEthicalMetricsConfig: async () => ({

packages/admin-ui/src/__mock-backend__/stakerConfig.ts

Lines changed: 175 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Routes, Network } from "@dappnode/types";
22

33
export const stakerConfig: Pick<Routes, "stakerConfigGet" | "stakerConfigSet"> = {
4-
stakerConfigSet: async () => {},
4+
stakerConfigSet: async () => { },
55
stakerConfigGet: async ({ network }: { network: Network }) => {
66
switch (network) {
77
case "mainnet":
@@ -1674,6 +1674,180 @@ export const stakerConfig: Pick<Routes, "stakerConfigGet" | "stakerConfigSet"> =
16741674
},
16751675
feeRecipient: "0x71C7656EC7ab88b098defB751B7401B5f6d8976F"
16761676
};
1677+
case "starknet":
1678+
return {
1679+
executionClients: [
1680+
{
1681+
status: "ok",
1682+
dnpName: "juno.dnp.dappnode.eth",
1683+
isInstalled: false,
1684+
isRunning: false,
1685+
isUpdated: false,
1686+
isSelected: false,
1687+
avatarUrl: "",
1688+
data: {
1689+
dnpName: "package",
1690+
reqVersion: "0.1.0",
1691+
semVersion: "0.1.0",
1692+
imageFile: {
1693+
hash: "QM..",
1694+
source: "ipfs",
1695+
size: 123
1696+
},
1697+
warnings: {},
1698+
signedSafe: true,
1699+
manifest: {
1700+
name: "juno.dnp.dappnode.eth",
1701+
description: "Juno - Starknet full node client",
1702+
shortDescription: "Juno Starknet client",
1703+
version: "0.1.0"
1704+
}
1705+
}
1706+
},
1707+
{
1708+
status: "ok",
1709+
dnpName: "pathfinder.dnp.dappnode.eth",
1710+
isInstalled: false,
1711+
isRunning: false,
1712+
isUpdated: false,
1713+
isSelected: false,
1714+
avatarUrl: "",
1715+
data: {
1716+
dnpName: "package",
1717+
reqVersion: "0.1.0",
1718+
semVersion: "0.1.0",
1719+
imageFile: {
1720+
hash: "QM..",
1721+
source: "ipfs",
1722+
size: 123
1723+
},
1724+
warnings: {},
1725+
signedSafe: true,
1726+
manifest: {
1727+
name: "pathfinder.dnp.dappnode.eth",
1728+
description: "Pathfinder - Starknet full node client",
1729+
shortDescription: "Pathfinder Starknet client",
1730+
version: "0.1.0"
1731+
}
1732+
}
1733+
}
1734+
],
1735+
consensusClients: [],
1736+
web3Signer: {
1737+
status: "ok",
1738+
dnpName: "starknetstaking.dnp.dappnode.eth",
1739+
isInstalled: false,
1740+
isRunning: false,
1741+
isUpdated: false,
1742+
isSelected: false,
1743+
avatarUrl: "",
1744+
data: {
1745+
dnpName: "package",
1746+
reqVersion: "0.1.0",
1747+
semVersion: "0.1.0",
1748+
imageFile: {
1749+
hash: "QM..",
1750+
source: "ipfs",
1751+
size: 123
1752+
},
1753+
warnings: {},
1754+
signedSafe: true,
1755+
manifest: {
1756+
name: "starknetstaking.dnp.dappnode.eth",
1757+
description: "Starknet Staking Application",
1758+
shortDescription: "Starknet Staking",
1759+
version: "0.1.0"
1760+
}
1761+
}
1762+
}
1763+
};
1764+
case "starknet-sepolia":
1765+
return {
1766+
executionClients: [
1767+
{
1768+
status: "ok",
1769+
dnpName: "juno-sepolia.dnp.dappnode.eth",
1770+
isInstalled: false,
1771+
isRunning: false,
1772+
isUpdated: false,
1773+
isSelected: false,
1774+
avatarUrl: "",
1775+
data: {
1776+
dnpName: "package",
1777+
reqVersion: "0.1.0",
1778+
semVersion: "0.1.0",
1779+
imageFile: {
1780+
hash: "QM..",
1781+
source: "ipfs",
1782+
size: 123
1783+
},
1784+
warnings: {},
1785+
signedSafe: true,
1786+
manifest: {
1787+
name: "juno-sepolia.dnp.dappnode.eth",
1788+
description: "Juno - Starknet Sepolia full node client",
1789+
shortDescription: "Juno Starknet Sepolia",
1790+
version: "0.1.0"
1791+
}
1792+
}
1793+
},
1794+
{
1795+
status: "ok",
1796+
dnpName: "pathfinder-sepolia.dnp.dappnode.eth",
1797+
isInstalled: false,
1798+
isRunning: false,
1799+
isUpdated: false,
1800+
isSelected: false,
1801+
avatarUrl: "",
1802+
data: {
1803+
dnpName: "package",
1804+
reqVersion: "0.1.0",
1805+
semVersion: "0.1.0",
1806+
imageFile: {
1807+
hash: "QM..",
1808+
source: "ipfs",
1809+
size: 123
1810+
},
1811+
warnings: {},
1812+
signedSafe: true,
1813+
manifest: {
1814+
name: "pathfinder-sepolia.dnp.dappnode.eth",
1815+
description: "Pathfinder - Starknet Sepolia full node client",
1816+
shortDescription: "Pathfinder Starknet Sepolia",
1817+
version: "0.1.0"
1818+
}
1819+
}
1820+
}
1821+
],
1822+
consensusClients: [],
1823+
web3Signer: {
1824+
status: "ok",
1825+
dnpName: "starknetstaking-sepolia.dnp.dappnode.eth",
1826+
isInstalled: false,
1827+
isRunning: false,
1828+
isUpdated: false,
1829+
isSelected: false,
1830+
avatarUrl: "",
1831+
data: {
1832+
dnpName: "package",
1833+
reqVersion: "0.1.0",
1834+
semVersion: "0.1.0",
1835+
imageFile: {
1836+
hash: "QM..",
1837+
source: "ipfs",
1838+
size: 123
1839+
},
1840+
warnings: {},
1841+
signedSafe: true,
1842+
manifest: {
1843+
name: "starknetstaking-sepolia.dnp.dappnode.eth",
1844+
description: "Starknet Sepolia Staking Application",
1845+
shortDescription: "Starknet Sepolia Staking",
1846+
version: "0.1.0"
1847+
}
1848+
}
1849+
}
1850+
};
16771851
default:
16781852
throw Error(`Unknown network ${network}`);
16791853
}

packages/admin-ui/src/components/IpfsClient.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export function IpfsClient({
6767

6868
{option === "remote" && (
6969
<Input
70-
placeholder="https://gateway.ipfs.dappnode.io"
70+
placeholder="https://ipfs-gateway.dappnode.net"
7171
value={gatewayTarget || ""}
7272
onValueChange={onGatewayTargetChange}
7373
/>

packages/admin-ui/src/hooks/useFilterStakersNetworks.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const testSet = new Set(networksByType.testnets);
1313
const mainSet = new Set(networksByType.mainnets);
1414

1515
/**
16-
* Treats "optimism" as MAINNET (exception).
16+
* Treats "optimism" and "starknet" as MAINNET (exception) and "starknet-sepolia" as TESTNET (exception).
1717
* Filters on render based on URL.
1818
* Navigates to a matching route when toggled.
1919
*/
@@ -30,8 +30,10 @@ export function useFilterStakersNetworks(availableRoutes: RouteType[]) {
3030
const currentRoute = availableRoutes.find((r) => r.subPath === subPath);
3131

3232
const testnetsSelected =
33-
currentRoute?.subPath === "optimism"
34-
? false // Optimism is mainnet (exception)
33+
currentRoute?.subPath === "optimism" || currentRoute?.subPath === "starknet"
34+
? false // Optimism and Starknet mainnet are mainnet (exception)
35+
: currentRoute?.subPath === "starknet-sepolia"
36+
? true // Starknet Sepolia is testnet (exception)
3537
: currentRoute && isStakerRoute(currentRoute)
3638
? testSet.has(netOf(currentRoute) as Network)
3739
: false;
@@ -41,7 +43,8 @@ export function useFilterStakersNetworks(availableRoutes: RouteType[]) {
4143
() =>
4244
availableRoutes.filter((r) => {
4345
if ([Network.Prater, Network.Holesky].includes(r.element.props.network)) return false; // hide prater && holesky
44-
if (r.subPath === "optimism") return !testnetsSelected; // only in mainnets view
46+
if (r.subPath === "optimism" || r.subPath === "starknet") return !testnetsSelected; // only in mainnets view
47+
if (r.subPath === "starknet-sepolia") return testnetsSelected; // only in testnets view
4548
if (!isStakerRoute(r)) return false;
4649
const net = netOf(r);
4750
return testnetsSelected ? testSet.has(net as Network) : mainSet.has(net as Network);
@@ -53,7 +56,8 @@ export function useFilterStakersNetworks(availableRoutes: RouteType[]) {
5356
const handleNetworkFilter = (toTestnets: boolean) => {
5457
const target = availableRoutes.find((r) => {
5558
if ([Network.Prater, Network.Holesky].includes(r.element.props.network)) return false;
56-
if (r.subPath === "optimism") return !toTestnets; // optimism counts only for mainnets
59+
if (r.subPath === "optimism" || r.subPath === "starknet") return !toTestnets; // optimism and starknet mainnet count only for mainnets
60+
if (r.subPath === "starknet-sepolia") return toTestnets; // starknet sepolia counts only for testnets
5761
if (!isStakerRoute(r)) return false;
5862
const net = netOf(r);
5963
return toTestnets ? testSet.has(net as Network) : mainSet.has(net as Network);

0 commit comments

Comments
 (0)