Skip to content

Commit

Permalink
Merge pull request #857 from oasisprotocol/mz/emerald
Browse files Browse the repository at this point in the history
Enable Emerald
  • Loading branch information
buberdds authored Sep 12, 2023
2 parents 153e4ce + 3f594b9 commit 1033d79
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 12 deletions.
1 change: 1 addition & 0 deletions .changelog/857.feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Enable Emerald Mainnet and Testnet
7 changes: 6 additions & 1 deletion src/app/components/Search/search-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ type LayerSuggestions = {

export const searchSuggestionTerms: Record<Network, Partial<Record<Layer, LayerSuggestions>>> = {
mainnet: {
// @ts-expect-error Emerald will be enabled as soon as Nexus re-indexing will be finished
emerald: {
suggestedBlock: '4260',
suggestedTransaction: '0x2f461f83745e1fa1177138aa815e210e1c69305db8065af9015b2e490a5033f1',
Expand All @@ -36,6 +35,12 @@ export const searchSuggestionTerms: Record<Network, Partial<Record<Layer, LayerS
},
},
testnet: {
emerald: {
suggestedBlock: '1398623', // The prod testnet deploy only started processing blocks from round 1398623.
suggestedTransaction: '0x7b118fadc9e6569b933edf3a9b8c442eb145fc22613bc11111b8aeb223d4e271',
suggestedAccount: '0x6d5A9A4C063b840ef3fe792E5DD6232fbf2c0982',
suggestedTokenFragment: 'yuzu', // Not available until a full reindex with all analyzers is done.
},
sapphire: {
suggestedBlock: '4260',
suggestedTransaction: '0xd9b5c08be1cb74229abedd9b3e1afb8b43228085a6abf72993db415959ab6b35',
Expand Down
20 changes: 18 additions & 2 deletions src/app/pages/ParatimeDashboardPage/LearningMaterials.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ const getContent = (t: TFunction): Record<Network, NetworkContent> => {

return {
[Network.mainnet]: {
// @ts-expect-error Emerald will be enabled as soon as Nexus re-indexing will be finished
[Layer.emerald]: {
primary: {
description: t('learningMaterials.emerald.description'),
Expand Down Expand Up @@ -87,6 +86,23 @@ const getContent = (t: TFunction): Record<Network, NetworkContent> => {
},
},
[Network.testnet]: {
[Layer.emerald]: {
primary: {
description: t('learningMaterials.emerald.description'),
header: t('learningMaterials.emerald.header'),
url: docs.emeraldTestnet,
},
secondary: {
description: t('learningMaterials.testnet.description'),
header: t('learningMaterials.testnet.header'),
url: docs.emeraldTestnetNode,
},
tertiary: {
description: t('learningMaterials.emerald.gatewayDescription'),
header: t('learningMaterials.emerald.gateway'),
url: docs.emeraldGateway,
},
},
[Layer.sapphire]: {
primary: {
description: t('learningMaterials.sapphire.description'),
Expand All @@ -96,7 +112,7 @@ const getContent = (t: TFunction): Record<Network, NetworkContent> => {
secondary: {
description: t('learningMaterials.testnet.description'),
header: t('learningMaterials.testnet.header'),
url: docs.testnetNode,
url: docs.sapphireTestnetNode,
},
tertiary: {
description: t('learningMaterials.hardhat.description'),
Expand Down
5 changes: 4 additions & 1 deletion src/app/utils/externalLinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@ export const docs = {
consensus: `${docsUrl}core/consensus/`,
cipher: `${docsUrl}dapp/cipher/`,
emerald: `${docsUrl}dapp/emerald/`,
emeraldTestnet: `${docsUrl}dapp/emerald/#testnet`,
emeraldTestnetNode: `${docsUrl}node/testnet/#emerald`,
emeraldGateway: `${docsUrl}dapp/emerald/#web3-gateway`,
sapphire: `${docsUrl}dapp/sapphire/`,
token: `${docsUrl}general/oasis-network/token-metrics-and-distribution`,
paraTimeTransfer: `${docsUrl}general/manage-tokens/how-to-transfer-rose-into-paratime`,
testnetNode: `${docsUrl}node/testnet/#sapphire`,
sapphireTestnetNode: `${docsUrl}node/testnet/#sapphire`,
sapphireTestnet: `${docsUrl}dapp/sapphire/#testnet`,
sapphireTestnetHardhat: `${docsUrl}dapp/sapphire/quickstart/#add-the-sapphire-testnet-to-hardhat`,
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/utils/route-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ export type SpecifiedPerEnabledLayer<T = any> = {
export abstract class RouteUtils {
private static ENABLED_LAYERS_FOR_NETWORK = {
[Network.mainnet]: {
// [Layer.emerald]: true,
[Layer.emerald]: true,
[Layer.sapphire]: true,
},
[Network.testnet]: {
// [Layer.emerald]: true,
[Layer.emerald]: true,
[Layer.sapphire]: true,
},
} satisfies Partial<Record<Network, Partial<Record<Layer, true>>>>
Expand Down
8 changes: 4 additions & 4 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ export enum RuntimeTypes {

const emeraldConfig: LayerConfig = {
mainnet: {
activeNodes: 55,
activeNodes: 60,
address: 'oasis1qzvlg0grjxwgjj58tx2xvmv26era6t2csqn22pte',
// Match max_batch_gas https://github.com/oasisprotocol/emerald-paratime/blob/5a36a646b989e510fadc0029178fe96a24cad101/src/lib.rs#L112-L112
blockGasLimit: 10_000_000,
runtimeId: '000000000000000000000000000000000000000000000000e2eaa99fc008f87f',
},
testnet: {
activeNodes: 30,
activeNodes: 28,
address: 'oasis1qr629x0tg9gm5fyhedgs9lw5eh3d8ycdnsxf0run',
blockGasLimit: 30_000_000,
runtimeId: '00000000000000000000000000000000000000000000000072c8215e60d5bca7',
Expand Down Expand Up @@ -83,14 +83,14 @@ const cipherConfig: LayerConfig = {

const sapphireConfig: LayerConfig = {
mainnet: {
activeNodes: 32,
activeNodes: 31,
address: 'oasis1qrd3mnzhhgst26hsp96uf45yhq6zlax0cuzdgcfc',
// See max_batch_gas https://github.com/oasisprotocol/sapphire-paratime/blob/5cbcdf764390bba3ae27411c551a4f4444117f3f/runtime/src/lib.rs#L146
blockGasLimit: 15_000_000,
runtimeId: '000000000000000000000000000000000000000000000000f80306c9858e7279',
},
testnet: {
activeNodes: 21,
activeNodes: 16,
address: 'oasis1qqczuf3x6glkgjuf0xgtcpjjw95r3crf7y2323xd',
blockGasLimit: 30_000_000,
runtimeId: '000000000000000000000000000000000000000000000000a6d1e3ebf60dff6c',
Expand Down
6 changes: 4 additions & 2 deletions src/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"not_defined": "Not defined",
"oasis": "Oasis",
"paratime": "Paratime",
"parentheses":"({{subject}})",
"parentheses": "({{subject}})",
"percentage": "Percentage",
"rank": "Rank",
"select": "Select",
Expand Down Expand Up @@ -156,7 +156,9 @@
"learningMaterials": {
"emerald": {
"header": "What is the Emerald network?",
"description": "The Emerald ParaTime is our official EVM Compatible ParaTime providing smart contract environment with full EVM compatibility."
"description": "The Emerald ParaTime is our official EVM Compatible ParaTime providing smart contract environment with full EVM compatibility.",
"gateway": "Web3 Gateway",
"gatewayDescription": "To get started building on our Emerald ParaTime, you can use our public Web3 gateway, fully compatible with Ethereum's Web3 gateway."
},
"sapphire": {
"header": "What is the Sapphire network?",
Expand Down

0 comments on commit 1033d79

Please sign in to comment.