Skip to content

Commit

Permalink
Update network version, fix metamask button (#65)
Browse files Browse the repository at this point in the history
* Network Version & Metamask

* update node title

* Test Fix for metamask button

* Update network version, fix metamask button
  • Loading branch information
Lama1403 authored Dec 13, 2024
1 parent e66ba4d commit 0242df6
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 12 deletions.
6 changes: 3 additions & 3 deletions zq2/docs/endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ As we introduce additional test networks for Zilliqa 2.0, their public RPC node
<br>
<br>

<span id="addZilliqaChainButton" class="metamask">
<span id="addZilliqaPTChainButton" class="metamask">
Add Zilliqa 2 EVM proto-testnet
</span>
<br>
<br>

<span id="addZilliqaChainButton" class="metamask">
<span id="addZilliqaPMChainButton" class="metamask">
Add Zilliqa 2 EVM proto-mainnet
</span>
<br>
Expand All @@ -33,7 +33,7 @@ Details for the current network versions of Zilliqa 2.0 are listed below.
| Name | Version | ChainId | API | Otterscan | Faucet | Checkpoint Bucket |
| ------ | ------- | ------- | --- | --------- | ------ | ----------------- |
| proto-testnet | v0.1.0 | 33103 | https://api.zq2-prototestnet.zilliqa.com | https://explorer.zq2-prototestnet.zilliqa.com | https://faucet.zq2-prototestnet.zilliqa.com | https://checkpoints.zq2-prototestnet.zilliqa.com |
| proto-mainnet | v0.1.0 | 32770 | https://api.zq2-protomainnet.zilliqa.com | https://explorer.zq2-protomainnet.zilliqa.com | https://faucet.zq2-protomainnet.zilliqa.com | https://checkpoints.zq2-protomainnet.zilliqa.com |
| proto-mainnet | v0.4.1 | 32770 | https://api.zq2-protomainnet.zilliqa.com | https://explorer.zq2-protomainnet.zilliqa.com | https://faucet.zq2-protomainnet.zilliqa.com | https://checkpoints.zq2-protomainnet.zilliqa.com |
</div>

_**Note** that this is currently a proto-testnet and proto-mainnet versions of Zilliqa 2.0 designed primarily for testing purposes, and therefore its state and uptime are not guaranteed_
Expand Down
9 changes: 8 additions & 1 deletion zq2/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,17 @@ More documentation for Zilliqa 2.0 will become available as new functionality is
<br>
<br>

<span id="addZilliqaChainButton" class="metamask">
<span id="addZilliqaPTChainButton" class="metamask">
Add Zilliqa 2 EVM proto-testnet
</span>
<br>
<br>
<br>
<span id="addZilliqaPMChainButton" class="metamask">
Add Zilliqa 2 EVM proto-mainnet
</span>
<br>
<br>

<br>
</div>
46 changes: 46 additions & 0 deletions zq2/docs/js/add-zilliqa-PM-chain.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// add-zilliqa-PM-chain.js

document.addEventListener('DOMContentLoaded', function() {
const addZilliqaPMChainButton = document.getElementById('addZilliqaPMChainButton');

if (addZilliqaPMChainButton) {
addZilliqaPMChainButton.addEventListener('click', addZilliqaPMChain);
}
});

async function addZilliqaPMChain() {
if (typeof window.ethereum !== 'undefined') {
try {
await window.ethereum.request({
method: "wallet_addEthereumChain",
params: [
{
blockExplorerUrls: [
"https://explorer.zq2-protomainnet.zilliqa.com"
],
iconUrls: [
"https://www.zilliqa.com/images/icon-zilliqa-testnet.svg",
"https://www.zilliqa.com/images/icon-zilliqa-testnet.png"
],
nativeCurrency: {
name: "ZIL",
symbol: "ZIL",
decimals: 18
},
rpcUrls: [
"https://api.zq2-protomainnet.zilliqa.com"
],
chainId: "0x8002",
chainName: "Zilliqa 2 EVM proto-mainnet"
}
],
});
alert('Zilliqa 2 EVM proto-mainnet has been added to your wallet!');
} catch (error) {
console.error(error);
alert('An error occurred while trying to add the network: ' + error.message);
}
} else {
alert('MetaMask is not installed. Please install it to use this feature.');
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// add-zilliqa-chain.js
// add-zilliqa-PT-chain.js

document.addEventListener('DOMContentLoaded', function() {
const addZilliqaChainButton = document.getElementById('addZilliqaChainButton');
const addZilliqaPTChainButton = document.getElementById('addZilliqaPTChainButton');

if (addZilliqaChainButton) {
addZilliqaChainButton.addEventListener('click', addZilliqaChain);
if (addZilliqaPTChainButton) {
addZilliqaPTChainButton.addEventListener('click', addZilliqaPTChain);
}
});

async function addZilliqaChain() {
async function addZilliqaPTChain() {
if (typeof window.ethereum !== 'undefined') {
try {
await window.ethereum.request({
Expand Down
8 changes: 6 additions & 2 deletions zq2/docs/nodes/node.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
id: nodes/nodes
title: Prototestnet nodes
title: Prototestnet Nodes
---

# Nodes
# Prototestnet nodes

Both the proto-testnet and the proto-mainnet version of Zilliqa 2.0 allow users to setup a node and join the network.

Expand Down Expand Up @@ -122,6 +122,10 @@ There are two methods for setting the synchronization rules for the node.
You can now follow the steps below.

### [Start the node](#start-the-node)
Only full archive nodes need to sync from the genesis block. This can take up to a few days depending on the network and the node's hardware. Once a node is fully synced, its data directory can be copied to setup more nodes quickly. Note that running a node with a copied data directory is matter of trust since the data is not verified.
<br><br>
Nodes that do not need all historical blocks can be synced much faster from a checkpoint, preferably the latest one. This takes only a few hours at most. The root of trust in this case is the hash of the checkpoint block that can be obtained from and verified against public sources.

* Start the node without Checkpoint:
```bash
chmod +x start_node.sh && \
Expand Down
4 changes: 3 additions & 1 deletion zq2/parent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ extra_javascript:
- js/connect.js
- js/chain.js
- js/buffer.js
- js/add-zilliqa-chain.js
- js/add-zilliqa-PM-chain.js
- js/add-zilliqa-PT-chain.js


theme:
name: material
Expand Down

0 comments on commit 0242df6

Please sign in to comment.