diff --git a/zq2/docs/apis/1123f1a7/api/erigon/erigon_getHeaderByNumber.md b/zq2/docs/apis/1123f1a7/api/erigon/erigon_getHeaderByNumber.md new file mode 100644 index 0000000..babf2b6 --- /dev/null +++ b/zq2/docs/apis/1123f1a7/api/erigon/erigon_getHeaderByNumber.md @@ -0,0 +1,58 @@ +--- +id: APIs/1123f1a7/api/erigon/erigon_getHeaderByNumber +title: erigon_getHeaderByNumber +keywords: erigon,header,number +--- + +--- + +Returns the erigon headers for a given block number + +### Example Request + +=== "cURL" + + ```shell + curl -d '{ + "id": "1", + "jsonrpc": "2.0", + "method": "erigon_getHeaderByNumber", + "params": [ 1000 ] + }' -H "Content-Type: application/json" -X POST "https://api.zq2-devnet.zilliqa.com" + ``` + +### Example response + +```json +{ + "jsonrpc": "2.0", + "result": { + "number": "0x3e8", + "hash": "0x7dbeae485c26511423301be854c6cdec6b07170427f3270ac1748782f4fe4a8f", + "parentHash": "0x71d2d959e0eb73b429686c0c1107e4183f04c0a54752d4fe519a1f0c54ab7cdb", + "nonce": "0x0000000000000000", + "sha3Uncles": "0x0000000000000000000000000000000000000000000000000000000000000000", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "transactionsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", + "stateRoot": "0xd639a448087e7d087fb2d0fef4a1bd95237a965277dcbf7ee33344384491d409", + "receiptsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", + "miner": "0x768af8c0b4792ed2948186857f1122f3cd6a695d", + "difficulty": "0x0", + "totalDifficulty": "0x0", + "extraData": "0x", + "size": "0x0", + "gasLimit": "0x501bd00", + "gasUsed": "0x0", + "timestamp": "0x6602d4bc", + "transactions": [], + "uncles": [] + }, + "id": "1" +} +``` + +### Arguments + +| Parameter | Type | Required | Description | +| --------- | ------ | -------- | ------------------------- | +| `block` | number | Required | The block number to query | diff --git a/zq2/docs/apis/1123f1a7/api/ots/ots_getApiLevel.md b/zq2/docs/apis/1123f1a7/api/ots/ots_getApiLevel.md new file mode 100644 index 0000000..014095c --- /dev/null +++ b/zq2/docs/apis/1123f1a7/api/ots/ots_getApiLevel.md @@ -0,0 +1,34 @@ +--- +id: APIs/1123f1a7/api/ots/ots_getApiLevel +title: ots_getApiLevel +keywords: ots +--- + +--- + +Returns the Otterscan API level + +### Example Request + +=== "cURL" + + ```shell + curl -d '{ + "id": "1", + "jsonrpc": "2.0", + "method": "ots_getApiLevel", + "params": [ ] + }' -H "Content-Type: application/json" -X POST "https://api.zq2-devnet.zilliqa.com" + ``` + +### Example response + +```json +{ + "jsonrpc": "2.0", + "result": 8, + "id": "1" +} +``` + +### Arguments diff --git a/zq2/docs/apis/1123f1a7/api/ots/ots_getBlockDetails.md b/zq2/docs/apis/1123f1a7/api/ots/ots_getBlockDetails.md new file mode 100644 index 0000000..ec0a902 --- /dev/null +++ b/zq2/docs/apis/1123f1a7/api/ots/ots_getBlockDetails.md @@ -0,0 +1,66 @@ +--- +id: APIs/1123f1a7/api/ots/ots_getBlockDetails +title: ots_getBlockDetails +keywords: ots,details,block +--- + +--- + +Returns details of a numbered block for otterscan + +### Example Request + +=== "cURL" + + ```shell + curl -d '{ + "id": "1", + "jsonrpc": "2.0", + "method": "ots_getBlockDetails", + "params": [ 1000 ] + }' -H "Content-Type: application/json" -X POST "https://api.zq2-devnet.zilliqa.com" + ``` + +### Example response + +```json +{ + "jsonrpc": "2.0", + "result": { + "block": { + "number": "0x3e8", + "hash": "0x7dbeae485c26511423301be854c6cdec6b07170427f3270ac1748782f4fe4a8f", + "parentHash": "0x71d2d959e0eb73b429686c0c1107e4183f04c0a54752d4fe519a1f0c54ab7cdb", + "nonce": "0x0", + "sha3Uncles": "0x0000000000000000000000000000000000000000000000000000000000000000", + "transactionsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", + "stateRoot": "0xd639a448087e7d087fb2d0fef4a1bd95237a965277dcbf7ee33344384491d409", + "receiptsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", + "miner": "0x768af8c0b4792ed2948186857f1122f3cd6a695d", + "difficulty": "0x0", + "totalDifficulty": "0x0", + "extraData": "0x", + "size": "0x0", + "gasLimit": "0x1", + "gasUsed": "0x0", + "timestamp": "0x6602d4bc", + "transactionCount": 0, + "uncles": [], + "baseFeePerGas": "0x0" + }, + "issuance": { + "blockReward": "0x0", + "uncleReward": "0x0", + "issuance": "0x0" + }, + "totalFees": "0x0" + }, + "id": "1" +} +``` + +### Arguments + +| Parameter | Type | Required | Description | +| --------- | ------ | -------- | ------------------------- | +| `block` | number | Required | The block number to query | diff --git a/zq2/docs/apis/1123f1a7/api/ots/ots_getBlockDetailsByHash.md b/zq2/docs/apis/1123f1a7/api/ots/ots_getBlockDetailsByHash.md new file mode 100644 index 0000000..65dd1c5 --- /dev/null +++ b/zq2/docs/apis/1123f1a7/api/ots/ots_getBlockDetailsByHash.md @@ -0,0 +1,66 @@ +--- +id: APIs/1123f1a7/api/ots/ots_getBlockDetailsByHash +title: ots_getBlockDetailsByHash +keywords: ots,api,hash,block,details +--- + +--- + +Returns details of a block for otterscan by hash + +### Example Request + +=== "cURL" + + ```shell + curl -d '{ + "id": "1", + "jsonrpc": "2.0", + "method": "ots_getBlockDetailsByHash", + "params": [ "0x7dbeae485c26511423301be854c6cdec6b07170427f3270ac1748782f4fe4a8f" ] + }' -H "Content-Type: application/json" -X POST "https://api.zq2-devnet.zilliqa.com" + ``` + +### Example response + +```json +{ + "jsonrpc": "2.0", + "result": { + "block": { + "number": "0x3e8", + "hash": "0x7dbeae485c26511423301be854c6cdec6b07170427f3270ac1748782f4fe4a8f", + "parentHash": "0x71d2d959e0eb73b429686c0c1107e4183f04c0a54752d4fe519a1f0c54ab7cdb", + "nonce": "0x0", + "sha3Uncles": "0x0000000000000000000000000000000000000000000000000000000000000000", + "transactionsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", + "stateRoot": "0xd639a448087e7d087fb2d0fef4a1bd95237a965277dcbf7ee33344384491d409", + "receiptsRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", + "miner": "0x768af8c0b4792ed2948186857f1122f3cd6a695d", + "difficulty": "0x0", + "totalDifficulty": "0x0", + "extraData": "0x", + "size": "0x0", + "gasLimit": "0x1", + "gasUsed": "0x0", + "timestamp": "0x6602d4bc", + "transactionCount": 0, + "uncles": [], + "baseFeePerGas": "0x0" + }, + "issuance": { + "blockReward": "0x0", + "uncleReward": "0x0", + "issuance": "0x0" + }, + "totalFees": "0x0" + }, + "id": "1" +} +``` + +### Arguments + +| Parameter | Type | Required | Description | +| --------- | ------ | -------- | ----------------------- | +| `hash` | string | Required | The block hash to query | diff --git a/zq2/docs/apis/1123f1a7/api/zilliqa/DSBlockListing.md b/zq2/docs/apis/1123f1a7/api/zilliqa/DSBlockListing.md new file mode 100644 index 0000000..c501ed2 --- /dev/null +++ b/zq2/docs/apis/1123f1a7/api/zilliqa/DSBlockListing.md @@ -0,0 +1,129 @@ +--- +id: APIs/1123f1a7/api/zilliqa/DSBlockListing +title: DSBlockListing +keywords: ds,block,listing +--- + +--- + +!!! warning + + This API is not yet implemented in this version of Zilliqa 2.0 + +Returns a paginated list of up to **10** Directory Service (DS) blocks and their +block hashes for a specified page. The `maxPages` variable that specifies the +maximum number of pages available is also returned. + +### Example Request + +=== "cURL" + + ```shell + curl -d '{ + "id": "1", + "jsonrpc": "2.0", + "method": "DSBlockListing", + "params": [1] + }' -H "Content-Type: application/json" -X POST "https://api.zq2-devnet.zilliqa.com" + ``` + +=== "node.js" + + ```js + const dsBlockListing = await zilliqa.blockchain.getDSBlockListing(1); + console.log(dsBlockListing.result); + ``` + +=== "java" + + ```java + public class App { + public static void main(String[] args) throws IOException { + HttpProvider client = new HttpProvider("https://api.zq2-devnet.zilliqa.com"); + Rep blockListing = client.getDSBlockListing(1); + System.out.println(new Gson().toJson(blockListing)); + } + } + ``` + +=== "python" + + ```python + from pyzil.zilliqa import chain + chain.set_active_chain(chain.MainNet) + print(chain.active_chain.api.DSBlockListing(1)) + ``` + +=== "go" + + ```go + func DSBlockListing() { + provider := NewProvider("https://api.zq2-devnet.zilliqa.com") + response := provider.DSBlockListing(1) + result, _ := json.Marshal(response) + fmt.Println(string(result)) + } + ``` + +### Example response + +```json +{ + "id": "1", + "jsonrpc": "2.0", + "result": { + "data": [ + { + "BlockNum": 5898, + "Hash": "4DEED80AFDCC89D5B691DCB54CCB846AD9D823D448A56ACAC4DBE5E1213244C7" + }, + { + "BlockNum": 5897, + "Hash": "968E2E7820A3795DE8C8A7A2E94379CC10F50ADA5EA6F90C03C4E61E22EE83B5" + }, + { + "BlockNum": 5896, + "Hash": "A52D113357910ADECEFA713D89A667030F521FFB153EEFA97A0D9E7E4AA5230B" + }, + { + "BlockNum": 5895, + "Hash": "8d49d4b18b441dc0da6ca580f468c9e83278c47f0f54fe342e1fe1425c39044f" + }, + { + "BlockNum": 5894, + "Hash": "b966c36557480a35a36a0d1c33723fd9bac8538588dea6716b4dfb2a05815458" + }, + { + "BlockNum": 5893, + "Hash": "fc20118eec0f14fdc089fcfee528276337dcf403a308153485f24f2856998613" + }, + { + "BlockNum": 5892, + "Hash": "4ed593d66b1ea5fa9a77cc1bb119baf90029c249bf5507b01079bc2fbf45aec7" + }, + { + "BlockNum": 5891, + "Hash": "1385bf48e584ebb82cf11a9064d99b5e0b4ae560866a92efe9b78604e08fc821" + }, + { + "BlockNum": 5890, + "Hash": "05d6d24a8f5411ff70fe58a09f38fd4b49ec4122b7c26817964a4a8b8a089c1f" + }, + { + "BlockNum": 5889, + "Hash": "137e56be8966eba0c04138d79faa1515997fc790ccf5213c00bb13a3550cca39" + } + ], + "maxPages": 590 + } +} +``` + +### Arguments + +| Parameter | Type | Required | Description | +| --------- | ------ | -------- | ---------------------------------------------------------- | +| `id` | string | Required | `"1"` | +| `jsonrpc` | string | Required | `"2.0"` | +| `method` | string | Required | `"DSBlockListing"` | +| `params` | number | Required | Specifed page of DS blocks listing to return. Example: `1` | diff --git a/zq2/docs/apis/1123f1a7/api/zilliqa/GetBalance.md b/zq2/docs/apis/1123f1a7/api/zilliqa/GetBalance.md new file mode 100644 index 0000000..357e0ba --- /dev/null +++ b/zq2/docs/apis/1123f1a7/api/zilliqa/GetBalance.md @@ -0,0 +1,101 @@ +--- +id: APIs/1123f1a7/api/zilliqa/GetBalance +title: GetBalance +keywords: balance,zilliqa,get,account +--- + +--- + +- Returns the current `balance` of an account, measured in the smallest + accounting unit **Qa** (or 10^-12 **Zil**). This is represented as a + `String`. + +- Returns the current `nonce` of an account. This is represented as a + `Number`. + +If the account does not exist, returns error code -5. + +### Example Request + +=== "cURL" + + ```shell + curl -d '{ + "id": "1", + "jsonrpc": "2.0", + "method": "GetBalance", + "params": ["1eefc4f453539e5ee732b49eb4792b268c2f3908"] + }' -H "Content-Type: application/json" -X POST "https://api.zq2-devnet.zilliqa.com/" + ``` + +=== "node.js" + + ```js + const balance = await zilliqa.blockchain.getBalance( + "1eefc4f453539e5ee732b49eb4792b268c2f3908" + ); + console.log(balance.result); + ``` + +=== "java" + + ```java + public class App { + public static void main(String[] args) throws IOException { + HttpProvider client = new HttpProvider("https://api.zq2-devnet.zilliqa.com"); + Rep balance = client.getBalance("1eefc4f453539e5ee732b49eb4792b268c2f3908"); + System.out.println(new Gson().toJson(balance)); + } + } + ``` + +=== "python" + + ```python + from pyzil.zilliqa import chain + chain.set_active_chain(chain.MainNet) + print(chain.active_chain.api.GetBalance("1eefc4f453539e5ee732b49eb4792b268c2f3908")) + ``` + +=== "go" + + ```go + func TestGetBalance() { + provider := NewProvider("https://api.zq2-devnet.zilliqa.com/") + response := provider.GetBalance("9bfec715a6bd658fcb62b0f8cc9bfa2ade71434a") + result, _ := json.Marshal(response) + fmt.Println(string(result)) + } + ``` + +### Example response + +```json +{ + "id": "1", + "jsonrpc": "2.0", + "result": { + "balance": "18446744073637511711", + "nonce": 16 + } +} +``` + +or, if the account does not exist: + +```json +{ + "error": { "code": -5, "data": null, "message": "Account is not created" }, + "id": "1", + "jsonrpc": "2.0" +} +``` + +### Arguments + +| Parameter | Type | Required | Description | +| --------- | ------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | string | Required | `"1"` | +| `jsonrpc` | string | Required | `"2.0"` | +| `method` | string | Required | `"GetBalance"` | +| `params` | string | Required | An User's account address of 20 bytes.
Example: `"1eefc4f453539e5ee732b49eb4792b268c2f3908"`

Also supports Bech32 address
Example: `"zil1rmhufazn2w09aeejkj0tg7fty6xz7wggup2tsh"` | diff --git a/zq2/docs/apis/1123f1a7/api/zilliqa/GetBlockchainInfo.md b/zq2/docs/apis/1123f1a7/api/zilliqa/GetBlockchainInfo.md new file mode 100644 index 0000000..5c23d04 --- /dev/null +++ b/zq2/docs/apis/1123f1a7/api/zilliqa/GetBlockchainInfo.md @@ -0,0 +1,98 @@ +--- +id: APIs/1123f1a7/api/zilliqa/GetBlockchainInfo +title: GetBlockchainInfo +keywords: blockchain,info,get +--- + +--- + +Returns the current network statistics for the specified network. See [https://chainlist.org/?search=zilliqa&testnets=true](https://chainlist.org/?search=zilliqa&testnets=true) for details of deployed chains. + +!!! note + + `CHAIN_ID` from `2` to `9` are reserved for Zilliqa Core use. + +### Example Request + +=== "cURL" + + ```shell + curl -d '{ + "id": "1", + "jsonrpc": "2.0", + "method": "GetBlockchainInfo", + "params": [""] + }' -H "Content-Type: application/json" -X POST "https://api.zq2-devnet.zilliqa.com" + ``` + + === "node.js" + + ```js + const blockChainInfo = await zilliqa.blockchain.getBlockChainInfo(); + console.log(blockChainInfo.result); + ``` + + === "java" + + ```java + public class App { + public static void main(String[] args) throws IOException { + HttpProvider client = new HttpProvider("https://api.zq2-devnet.zilliqa.com"); + Rep blockchainInfo = client.getBlockchainInfo(); + System.out.println(new Gson().toJson(blockchainInfo)); + } + } + ``` + + === "python" + + ```python + from pyzil.zilliqa import chain + chain.set_active_chain(chain.MainNet) + print(chain.active_chain.api.GetBlockchainInfo()) + ``` + + === "go" + + ```go + func GetBlockchainInfo() { + provider := NewProvider("https://api.zq2-devnet.zilliqa.com") + response := provider.GetBlockchainInfo() + result, _ := json.Marshal(response) + fmt.Println(string(result)) + } + ``` + +### Example response + +```json +{ + "id": "1", + "jsonrpc": "2.0", + "result": { + "CurrentDSEpoch": "5898", + "CurrentMiniEpoch": "589778", + "DSBlockRate": 0.00014142137245459714, + "NumDSBlocks": "5899", + "NumPeers": 2400, + "NumTransactions": "4350627", + "NumTxBlocks": "589778", + "NumTxnsDSEpoch": "748", + "NumTxnsTxEpoch": "4", + "ShardingStructure": { + "NumPeers": [600, 600, 600] + }, + "TransactionRate": 0.09401852277720939, + "TxBlockRate": 0.014137955733170903 + } +} +``` + +### Arguments + +| Parameter | Type | Required | Description | +| --------- | ------ | -------- | --------------------- | +| `id` | string | Required | `"1"` | +| `jsonrpc` | string | Required | `"2.0"` | +| `method` | string | Required | `"GetBlockchainInfo"` | +| `params` | string | Required | Empty string `""` | diff --git a/zq2/docs/apis/1123f1a7/api/zilliqa/GetCurrentDSComm.md b/zq2/docs/apis/1123f1a7/api/zilliqa/GetCurrentDSComm.md new file mode 100644 index 0000000..c06956a --- /dev/null +++ b/zq2/docs/apis/1123f1a7/api/zilliqa/GetCurrentDSComm.md @@ -0,0 +1,54 @@ +--- +id: APIs/1123f1a7/api/zilliqa/GetCurrentDSComm +title: GetCurrentDSComm +keywords: DS,committee,get,current +--- + +--- + +!!! warning + + This API is not yet implemented in this version of Zilliqa 2.0 + +Gives information on the public keys of DS committee members. Also, returns a parameter indicating the number of dsguards in the network. + +### Example Request + +=== "cURL" + + ```shell + curl -d '{ + "id": "1", + "jsonrpc": "2.0", + "method": "GetCurrentDSComm", + "params": [""] + }' -H "Content-Type: application/json" -X POST "https://api.zq2-devnet.zilliqa.com" + ``` + +### Example response + +```json +{ + "id": "1", + "jsonrpc": "2.0", + "result": { + "CurrentDSEpoch": "35342", + "CurrentTxEpoch": "3534154", + "NumOfDSGuard": 420, + "dscomm": [ + "0x020035B739426374C5327A1224B986005297102E01C29656B8B086BF4B352C6CA9", + "0x0200834D709AD621785A90673F6011BC36ECF4CB13475237EAA2D4DEDAE7E9E554", + ... + ] + } +} +``` + +### Arguments + +| Parameter | Type | Required | Description | +| --------- | ------ | -------- | -------------------- | +| `id` | string | Required | `"1"` | +| `jsonrpc` | string | Required | `"2.0"` | +| `method` | string | Required | `"GetCurrentDSComm"` | +| `params` | string | Required | Empty string `""` | diff --git a/zq2/docs/apis/1123f1a7/api/zilliqa/GetCurrentDSEpoch.md b/zq2/docs/apis/1123f1a7/api/zilliqa/GetCurrentDSEpoch.md new file mode 100644 index 0000000..9c9ea44 --- /dev/null +++ b/zq2/docs/apis/1123f1a7/api/zilliqa/GetCurrentDSEpoch.md @@ -0,0 +1,84 @@ +--- +id: APIs/1123f1a7/api/zilliqa/GetCurrentDSEpoch +title: GetCurrentDSEpoch +keywords: DS,epoch,get,current +--- + +--- + +!!! warning + + This API is not yet implemented in this version of Zilliqa 2.0 + +Returns the current number of DS blocks in the network. This is represented as a +`String`. + +### Example Request + +=== "cURL" + + ```shell + curl -d '{ + "id": "1", + "jsonrpc": "2.0", + "method": "GetCurrentDSEpoch", + "params": [""] + }' -H "Content-Type: application/json" -X POST "https://api.zq2-devnet.zilliqa.com" + ``` + +=== "node.js" + + ```js + const currentDSEpoch = await zilliqa.blockchain.getCurrentDSEpoch(); + console.log(currentDSEpoch.result); + ``` + +=== "java" + + ```java + public class App { + public static void main(String[] args) throws IOException { + HttpProvider client = new HttpProvider("https://api.zq2-devnet.zilliqa.com"); + Rep currentDSEpoch = client.getCurrentDSEpoch(); + System.out.println(new Gson().toJson(currentDSEpoch)); + } + } + ``` + +=== "python" + + ```python + from pyzil.zilliqa import chain + chain.set_active_chain(chain.MainNet) + print(chain.active_chain.api.GetCurrentDSEpoch()) + ``` + +=== "go" + + ```go + func GetCurrentDSEpoch() { + provider := NewProvider("https://api.zq2-devnet.zilliqa.com") + response := provider.GetCurrentDSEpoch() + result, _ := json.Marshal(response) + fmt.Println(string(result)) + } + ``` + +### Example response + +```json +{ + "id": "1", + "jsonrpc": "2.0", + "result": "5898" +} +``` + +### Arguments + +| Parameter | Type | Required | Description | +| --------- | ------ | -------- | --------------------- | +| `id` | string | Required | `"1"` | +| `jsonrpc` | string | Required | `"2.0"` | +| `method` | string | Required | `"GetCurrentDSEpoch"` | +| `params` | string | Required | Empty string `""` | diff --git a/zq2/docs/apis/1123f1a7/api/zilliqa/GetDSBlock.md b/zq2/docs/apis/1123f1a7/api/zilliqa/GetDSBlock.md new file mode 100644 index 0000000..f0b1915 --- /dev/null +++ b/zq2/docs/apis/1123f1a7/api/zilliqa/GetDSBlock.md @@ -0,0 +1,104 @@ +--- +id: APIs/1123f1a7/api/zilliqa/GetDSBlock +title: GetDSBlock +keywords: DS,block,get +--- + +--- + +!!! warning + + This API is not yet implemented in this version of Zilliqa 2.0 + +Returns the details of a specified Directory Service block. + +### Example Request + +=== "cURL" + + ```shell + curl -d '{ + "id": "1", + "jsonrpc": "2.0", + "method": "GetDsBlock", + "params": ["9000"] + }' -H "Content-Type: application/json" -X POST "https://api.zq2-devnet.zilliqa.com" + ``` + +=== "node.js" + + ```js + const dsBlock = await zilliqa.blockchain.getDSBlock("1"); + console.log(dsBlock.result); + ``` + +=== "java" + + ```java + public class App { + public static void main(String[] args) throws IOException { + HttpProvider client = new HttpProvider("https://api.zq2-devnet.zilliqa.com"); + Rep dsBlock = client.getDsBlock("9000 + System.out.println(new Gson().toJson(dsBlock)); + } + } + ``` + +=== "python" + + ```python + from pyzil.zilliqa import chain + chain.set_active_chain(chain.MainNet) + print(chain.active_chain.api.GetDsBlock("9000 + ``` + +=== "go" + + ```go + func GetDsBlock() { + provider := NewProvider("https://api.zq2-devnet.zilliqa.com") + response := provider.GetDsBlock("9000 + result, _ := json.Marshal(response) + fmt.Println(string(result)) + } + ``` + +### Example response + +```json +{ + "id": "1", + "jsonrpc": "2.0", + "result": { + "header": { + "BlockNum": "9000", + "Difficulty": 95, + "DifficultyDS": 156, + "GasPrice": "2000000000", + "PoWWinners": [ + "0x0207184EB580333132787B360CA6D93290000C9F71E0B6A02C4412E7148FB1AF81", + "0x0285B572471A9D3BA729719ED2EEE86395D3B8F243572E9099A5E8B750F46092A7", + "0x02C1D8C0C7884E65A22FFD76DF9ACC2EA3551133E4ADD59C2DF74F327E09F709FF", + "0x02D728E77C8DA14E900BA8A2014A0D4B5512C6BABCCB77B83F21381437E0038F44", + "0x0321B0E1A20F02C99394DD24B34AB4E79AE6CBF0C689C222F246431A764D6B59DB", + "0x038A724504899CCCA068BD165AE15CE2947667225C72912039CEE4EF3992334843", + "0x03AB477A7A895DD4E84F240A2F1FCF5F86B1A3D59B6AD3065C18CD69729D089959", + "0x03B29C7F3F85329B0621914AB0367BA78135889FB8E4F937DDB7DAA8123AD4DF3C", + "0x03E82B00B53ECC10073404E844841C519152E500A655EEF1D8EAD6612ABDF5B552" + ], + "PrevHash": "585373fb2c607b324afbe8f592e43b40d0091bbcef56c158e0879ced69648c8e", + "Timestamp": "1606443830834512" + }, + "signature": "7EE023C56602A17F2C8ABA2BEF290386D7C2CE1ABD8E3621573802FA67B243DE60B3EBEE5C4CCFDB697C80127B99CB384DAFEB44F70CD7569F2816DB950877BB" + } +} +``` + +### Arguments + +| Parameter | Type | Required | Description | +| --------- | ------ | -------- | ---------------------------------------------------- | +| `id` | string | Required | `"1"` | +| `jsonrpc` | string | Required | `"2.0"` | +| `method` | string | Required | `"GetDsBlock"` | +| `params` | string | Required | Specified DS block number to return. Example: `"40"` | diff --git a/zq2/docs/apis/1123f1a7/api/zilliqa/GetDSBlockRate.md b/zq2/docs/apis/1123f1a7/api/zilliqa/GetDSBlockRate.md new file mode 100644 index 0000000..63e04aa --- /dev/null +++ b/zq2/docs/apis/1123f1a7/api/zilliqa/GetDSBlockRate.md @@ -0,0 +1,83 @@ +--- +id: APIs/1123f1a7/api/zilliqa/GetDSBlockRate +title: GetDSBlockRate +keywords: DS,block,get,rate +--- + +--- + +!!! warning + + This API is not yet implemented in this version of Zilliqa 2.0 + +Returns the current Directory Service blockrate per second. + +### Example Request + +=== "cURL" + + ```shell + curl -d '{ + "id": "1", + "jsonrpc": "2.0", + "method": "GetDSBlockRate", + "params": [""] + }' -H "Content-Type: application/json" -X POST "https://api.zq2-devnet.zilliqa.com" + ``` + +=== "node.js" + + ```js + const dsBlockRate = await zilliqa.blockchain.getDSBlockRate(); + console.log(dsBlockRate.result); + ``` + +=== "java" + + ```java + public class App { + public static void main(String[] args) throws IOException { + HttpProvider client = new HttpProvider("https://api.zq2-devnet.zilliqa.com"); + Rep dsBlockRate = client.getDSBlockRate(); + System.out.println(new Gson().toJson(dsBlockRate)); + } + } + ``` + +=== "python" + + ```python + from pyzil.zilliqa import chain + chain.set_active_chain(chain.MainNet) + print(chain.active_chain.api.GetDSBlockRate()) + ``` + +=== "go" + + ```go + func GetDSBlockRate() { + provider := NewProvider("https://api.zq2-devnet.zilliqa.com") + response := provider.GetDSBlockRate() + result, _ := json.Marshal(response) + fmt.Println(string(result)) + } + ``` + +### Example response + +```json +{ + "id": "1", + "jsonrpc": "2.0", + "result": 0.00014142137245459714 +} +``` + +### Arguments + +| Parameter | Type | Required | Description | +| --------- | ------ | -------- | ------------------ | +| `id` | string | Required | `"1"` | +| `jsonrpc` | string | Required | `"2.0"` | +| `method` | string | Required | `"GetDSBlockRate"` | +| `params` | string | Required | Empty string `""` | diff --git a/zq2/docs/apis/1123f1a7/api/zilliqa/GetDSBlockVerbose.md b/zq2/docs/apis/1123f1a7/api/zilliqa/GetDSBlockVerbose.md new file mode 100644 index 0000000..77af4be --- /dev/null +++ b/zq2/docs/apis/1123f1a7/api/zilliqa/GetDSBlockVerbose.md @@ -0,0 +1,131 @@ +--- +id: APIs/1123f1a7/api/zilliqa/GetDSBlockVerbose +title: GetDSBlockVerbose +keywords: DS,block,get,verbose +--- + +--- + +!!! warning + + This API is not yet implemented in this version of Zilliqa 2.0 + +Returns verbose details of a specified Directory Service block. + +### Example Request + +=== "cURL" + + ```shell + curl -d '{ + "id": "1", + "jsonrpc": "2.0", + "method": "GetDsBlockVerbose", + "params": ["9000"] + }' -H "Content-Type: application/json" -X POST "https://api.zq2-devnet.zilliqa.com" + ``` + +### Example response + +```json +{ + "id": "1", + "jsonrpc": "2.0", + "result": { + "B1": [ + false, + false, + false + // Output truncated + ], + "B2": [ + false, + false + // Output truncated + ], + "CS1": "FBA696961142862169D03EED67DD302EAB91333CBC4EEFE7EDB230515DA31DC1B9746EEEE5E7C105685E22C483B1021867B3775D30215CA66D5D81543E9FE8B5", + "PrevDSHash": "585373fb2c607b324afbe8f592e43b40d0091bbcef56c158e0879ced69648c8e", + "header": { + "BlockNum": "9000", + "CommitteeHash": "da38b3b21b26b71835bb1545246a0a248f97003de302ae20d70aeaf854403029", + "Difficulty": 95, + "DifficultyDS": 156, + "EpochNum": "899900", + "GasPrice": "2000000000", + "MembersEjected": [ + "0x02572A2FCD59F8115297B399F76D7ACCFDA7E82AC53702063C3A61FB4D85E0D0C1", + "0x029933F07FF634654C2ECB17A90EAD00CF9EE9F75395E206660CCEFB21874ECEA1", + "0x02AAD92E5A3C9D8ECB364225719478B51026DD5C786BF7312C5C9765353BC4C98B" + ], + "PoWWinners": [ + "0x0207184EB580333132787B360CA6D93290000C9F71E0B6A02C4412E7148FB1AF81", + "0x0285B572471A9D3BA729719ED2EEE86395D3B8F243572E9099A5E8B750F46092A7", + "0x02C1D8C0C7884E65A22FFD76DF9ACC2EA3551133E4ADD59C2DF74F327E09F709FF", + "0x02D728E77C8DA14E900BA8A2014A0D4B5512C6BABCCB77B83F21381437E0038F44", + "0x0321B0E1A20F02C99394DD24B34AB4E79AE6CBF0C689C222F246431A764D6B59DB", + "0x038A724504899CCCA068BD165AE15CE2947667225C72912039CEE4EF3992334843", + "0x03AB477A7A895DD4E84F240A2F1FCF5F86B1A3D59B6AD3065C18CD69729D089959", + "0x03B29C7F3F85329B0621914AB0367BA78135889FB8E4F937DDB7DAA8123AD4DF3C", + "0x03E82B00B53ECC10073404E844841C519152E500A655EEF1D8EAD6612ABDF5B552" + ], + "PoWWinnersIP": [ + { + "IP": "34.212.122.139", + "port": 33133 + }, + { + "IP": "34.214.85.15", + "port": 33133 + }, + { + "IP": "54.148.246.51", + "port": 33133 + }, + { + "IP": "54.218.112.25", + "port": 33133 + }, + { + "IP": "54.184.108.224", + "port": 33133 + }, + { + "IP": "34.211.53.138", + "port": 33133 + }, + { + "IP": "44.234.38.187", + "port": 33133 + }, + { + "IP": "44.234.126.143", + "port": 33133 + }, + { + "IP": "34.223.254.106", + "port": 33133 + } + ], + "PrevHash": "585373fb2c607b324afbe8f592e43b40d0091bbcef56c158e0879ced69648c8e", + "ReservedField": "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "SWInfo": { + "Scilla": [0, 0, 0, "0", 0], + "Zilliqa": [0, 0, 0, "0", 0] + }, + "ShardingHash": "3216a33bfd4801e1907e72c7d529cef99c38d57cd281d0e9d726639fd9882d25", + "Timestamp": "1606443830834512", + "Version": 2 + }, + "signature": "7EE023C56602A17F2C8ABA2BEF290386D7C2CE1ABD8E3621573802FA67B243DE60B3EBEE5C4CCFDB697C80127B99CB384DAFEB44F70CD7569F2816DB950877BB" + } +} +``` + +### Arguments + +| Parameter | Type | Required | Description | +| --------- | ------ | -------- | ---------------------------------------------------- | +| `id` | string | Required | `"1"` | +| `jsonrpc` | string | Required | `"2.0"` | +| `method` | string | Required | `"GetDsBlockVerbose"` | +| `params` | string | Required | Specified DS block number to return. Example: `"40"` | diff --git a/zq2/docs/apis/1123f1a7/api/zilliqa/GetLatestDSBlock.md b/zq2/docs/apis/1123f1a7/api/zilliqa/GetLatestDSBlock.md new file mode 100644 index 0000000..d12d842 --- /dev/null +++ b/zq2/docs/apis/1123f1a7/api/zilliqa/GetLatestDSBlock.md @@ -0,0 +1,105 @@ +--- +id: APIs/1123f1a7/api/zilliqa/GetLatestDSBlock +title: GetLatestDSBlock +keywords: DS,block,get,latest +--- + +--- + +!!! warning + + This API is not yet implemented in this version of Zilliqa 2.0 + +Returns the details of the most recent Directory Service block. + +### Example Request + +=== "cURL" + + ```shell + curl -d '{ + "id": "1", + "jsonrpc": "2.0", + "method": "GetLatestDsBlock", + "params": [""] + }' -H "Content-Type: application/json" -X POST "https://api.zq2-devnet.zilliqa.com" + ``` + +=== "node.js" + + ```js + const dsBlock = await zilliqa.blockchain.getLatestDSBlock(); + console.log(dsBlock.result); + ``` + +=== "java" + + ```java + public class App { + public static void main(String[] args) throws IOException { + HttpProvider client = new HttpProvider("https://api.zq2-devnet.zilliqa.com"); + Rep dsBlock = client.getLatestDsBlock(); + System.out.println(new Gson().toJson(dsBlock)); + } + } + ``` + +=== "python" + + ```python + from pyzil.zilliqa import chain + chain.set_active_chain(chain.MainNet) + print(chain.active_chain.api.GetLatestDsBlock()) + ``` + +=== "go" + + ```go + func GetLatestDsBlock() { + provider := NewProvider("https://api.zq2-devnet.zilliqa.com") + response := provider.GetLatestDsBlock() + result, _ := json.Marshal(response) + fmt.Println(string(result)) + } + ``` + +### Example response + +```json +{ + "id": "1", + "jsonrpc": "2.0", + "result": { + "header": { + "BlockNum": "5898", + "Difficulty": 91, + "DifficultyDS": 149, + "GasPrice": "1000000000", + "LeaderPubKey": "0x026964CBF00EE542F5CBE80395FFEA747227BC3EFCC21D04956380180A9BE21546", + "PoWWinners": [ + "0x0219DB403A630022EE014AFD97D02E2DBC6BCEED2506A9E57B5EE5D9EA4F154929", + "0x02D9C8FC6C87891968ECCEE5EF1CD8A9F8FC32C6463F2FE4E846DFD5C5F45A625E", + "0x02E07F03C71D26433E7F290416FA43374DA72704F8AA973D4771AA763ACD7C509C", + "0x02E0FB6CDAEA57738959B493652A74E86339AF2CFE998FB7424BBD7A813450743F", + "0x0315E9B13D5A5D29902F1EECE0933E96A0AF9939853D5F82B438AAED9F7560B3FC", + "0x034D9B1B0DC80A0103AE7826886B415C29BF3E814FF6720F6C9C47B57589EFEAAA", + "0x0394EA64F2F833B88C56464E12B37780BDB9684875F55BC569B397ABE0FCCD8E0E", + "0x03C53B6C3D901ED46E786DA383BE61A46A442461D2A83379A11A42D7403FB7102E", + "0x03F6427EE15A5EC409FE7F8CDCC8E7C7704CC07AD2BF8CADFD2A19BB98E80836AF" + ], + "PrevHash": "968e2e7820a3795de8c8a7a2e94379cc10f50ada5ea6f90c03c4e61e22ee83b5", + "Timestamp": "1590641169078644" + }, + "signature": "803D64288A6F827DAFA529235C7A78E7BC2D1C882C5DA643E03CB0B2A786C7A5508CCD5F409CDAA325709E4E9A98F1D67596E61CB8CF958AD98B7DB842F87A44" + } +} +``` + +### Arguments + +| Parameter | Type | Required | Description | +| --------- | ------ | -------- | -------------------- | +| `id` | string | Required | `"1"` | +| `jsonrpc` | string | Required | `"2.0"` | +| `method` | string | Required | `"GetLatestDsBlock"` | +| `params` | string | Required | Empty string `""` | diff --git a/zq2/docs/apis/1123f1a7/api/zilliqa/GetLatestTxBlock.md b/zq2/docs/apis/1123f1a7/api/zilliqa/GetLatestTxBlock.md new file mode 100644 index 0000000..595583e --- /dev/null +++ b/zq2/docs/apis/1123f1a7/api/zilliqa/GetLatestTxBlock.md @@ -0,0 +1,124 @@ +--- +id: APIs/1123f1a7/api/zilliqa/GetLatestTxBlock +title: GetLatestTxBlock +keywords: Tx,block,get,latest +--- + +--- + +Returns the details of the most recent Transaction block. + +### Example Request + +=== "cURL" + + ```shell + curl -d '{ + "id": "1", + "jsonrpc": "2.0", + "method": "GetLatestTxBlock", + "params": [""] + }' -H "Content-Type: application/json" -X POST "https://api.zq2-devnet.zilliqa.com" + ``` + +=== "node.js" + + ```js + const txBlock = await zilliqa.blockchain.getLatestTxBlock(); + console.log(txBlock.result); + ``` + +=== "java" + + ```java + public class App { + public static void main(String[] args) throws IOException { + HttpProvider client = new HttpProvider("https://api.zq2-devnet.zilliqa.com"); + Rep txBlock = client.getLatestTxBlock(); + System.out.println(new Gson().toJson(txBlock)); + } + } + ``` + +=== "python" + + ```python + from pyzil.zilliqa import chain + chain.set_active_chain(chain.MainNet) + print(chain.active_chain.api.GetLatestTxBlock()) + ``` + +=== "go" + + ```go + func GetLatestTxBlock() { + provider := NewProvider("https://api.zq2-devnet.zilliqa.com") + response := provider.GetLatestTxBlock() + result, _ := json.Marshal(response) + fmt.Println(string(result)) + } + ``` + +### Example response + +```json +{ + "id": "1", + "jsonrpc": "2.0", + "result": { + "body": { + "BlockHash": "53a24881823dd5f2a3dfda5902d1b79710e2bec5477ed3aa7325d74e30436b58", + "HeaderSign": "8E0C73945CC2282173CF8CF44D7EB55E5DAD9B2D6D3437C6AC09DE8CF0D6B698575E535168AA898B6B3A3107603BDFC4BC671A4621E77C9004369FC3513F53A0", + "MicroBlockInfos": [ + { + "MicroBlockHash": "ebadc2d6e80b749e6e322ae54467d516618ea79d1ae495f26f3592c70b4de71a", + "MicroBlockShardId": 0, + "MicroBlockTxnRootHash": "165049b84c5f4499ce781aab63cba06aa31ed4e1b556f0aac643f01eb5814da4" + }, + { + "MicroBlockHash": "7111f32a526a381ecb3492e21a382f2dc5ad10c346340aaae3addd1a349cc559", + "MicroBlockShardId": 1, + "MicroBlockTxnRootHash": "640a7019993fcdaec2bfd10b50f5f9faea92920a1a4c0cb931ae56e061f983d9" + }, + { + "MicroBlockHash": "1a914f52aaef51fa3d585c666e56ae55c2dc5e3b8c759c66d1b79b211b783d0e", + "MicroBlockShardId": 2, + "MicroBlockTxnRootHash": "aea9eafc983f75947ef63d0aedd14c0c138025cbbaa5934f3ef327b2116bfd68" + }, + { + "MicroBlockHash": "cf095207f2f3cece2bc21f172022e2e3473c8a9279ba67a4d9bd1e352890f496", + "MicroBlockShardId": 3, + "MicroBlockTxnRootHash": "d97261b9c32ca9d1cfc8431a64523c9e3d26beff7e5265c5d431d5a41b416e49" + } + ] + }, + "header": { + "BlockNum": "1002353", + "DSBlockNum": "10024", + "GasLimit": "650000", + "GasUsed": "25517", + "MbInfoHash": "b2a862649507a9d86b21246b1538aa237c75f65cf7ef9a512e03ba39d0e62933", + "MinerPubKey": "0x02134CC19B594B1571916AABBA4475026D1B2021C19045CB2065E0D3B12706768E", + "NumMicroBlocks": 4, + "NumPages": 5, + "NumTxns": 10022, + "PrevBlockHash": "18426f28438c500dd8b424f7923844290f4f082d43e84262ce629eebce68b82c", + "Rewards": "0", + "StateDeltaHash": "9e2c6b2b542219e421792892e8d42923f30fd3e4d4c55369feb89e3979b5a3a7", + "StateRootHash": "57710511d91f7ec765c264babd53d6b607b320167029cc88c477fafd78c14632", + "Timestamp": "1612477810820092", + "TxnFees": "51138500000000", + "Version": 1 + } + } +} +``` + +### Arguments + +| Parameter | Type | Required | Description | +| --------- | ------ | -------- | -------------------- | +| `id` | string | Required | `"1"` | +| `jsonrpc` | string | Required | `"2.0"` | +| `method` | string | Required | `"GetLatestTxBlock"` | +| `params` | string | Required | Empty string `""` | diff --git a/zq2/docs/apis/1123f1a7/api/zilliqa/GetMinerInfo.md b/zq2/docs/apis/1123f1a7/api/zilliqa/GetMinerInfo.md new file mode 100644 index 0000000..79bdd58 --- /dev/null +++ b/zq2/docs/apis/1123f1a7/api/zilliqa/GetMinerInfo.md @@ -0,0 +1,90 @@ +--- +id: APIs/1123f1a7/api/zilliqa/GetMinerInfo +title: GetMinerInfo +keywords: miner,info,get +--- + +--- + +!!! warning + + This API is not yet implemented in this version of Zilliqa 2.0 + +Returns the mining nodes (i.e., the members of the DS committee and shards) at +the specified DS block. + +**Notes:** + +1. Nodes owned by Zilliqa Research are omitted. +1. `dscommittee` has no `size` field since the DS committee size is fixed for a + given chain. +1. For the Zilliqa mainnet, this API is only available from DS block 5500 + onwards. + +### Example Request + +=== "cURL" + + ```shell + curl -d '{ + "id": "1", + "jsonrpc": "2.0", + "method": "GetMinerInfo", + "params": ["5500"] + }' -H "Content-Type: application/json" -X POST "https://api.zq2-devnet.zilliqa.com" + ``` + +### Example response + +```json +{ + "id": "1", + "jsonrpc": "2.0", + "result": { + "dscommittee": [ + "0x03F25E4B68050496086758C33D16C47792F18D1102BB5DFC0CE5E3A57927008A0B", + "0x03CF937B2EBE194C72350A6A7E6612C2D8636A33753929F1553E6273442B2F8E5B", + "0x0372E43C4E7960F02E10F5AFE800E903579E2BE853B160681CBDF7C048FFB78A0F", + ..."0x0397FD33ED459AD72939CA531385271311DA74094D89109F3876E81BEE84B4E414" + ], + "shards": [ + { + "nodes": [ + "0x0245C0DDAA493700F86A3943260EB04D05DEBD62897E3EC51AE65A704E5C65C0A6", + "0x0250CF4B40C0C984F2BB005599D2A7503F9C68F701A24CBC10B1EB2533575ADBA7", + "0x023F2F657F170563E9B28BF837AB295FD13A7E2A4117DB44B2ADFE536F28D28102", + ..."0x02358F60B4BD90805E6940A901E3C3A5867FFF5BDBD5AD9BFD66FE47C9FA6F1035" + ], + "size": 535 + }, + { + "nodes": [ + "0x02646640964F472CBE1E9BAF2DC5F1A0915AE529DDFF08F28DDE3E460C755DC8C4", + "0x025EC6741880EC217F921A8FFB4AACDB95FF6477E1BB66CB39950FB2723D3740C8", + "0x03DE42F6719E8A0147A93604C5F6A4304D14AD5F6A70C011EE37DBFC65D1E7F842", + ..."0x02B1DB735BF54FC5765D89248DA1C07934282182F3C65CD9152D8F48C539BB5C53" + ], + "size": 535 + }, + { + "nodes": [ + "0x0218C2BA9876BCF3EE9EFF220C9F4CF433F5BE09D9D592F3C657AE7353CFFC3245", + "0x02BCD61D2F47165E0CD6B3CF9429140C3F017C440DA63E9F44A84503A7D1E41590", + "0x03E7699C19CFF554D265DC9C797713A7403D99A607EA7C8794259150436EB9FFBB", + ..."0x031169CB469B6083954F578C19FC7833A90D835AA75942820119272FC6EE4361A5" + ], + "size": 534 + } + ] + } +} +``` + +### Arguments + +| Parameter | Type | Required | Description | +| --------- | ------ | -------- | ---------------------------------- | +| `id` | string | Required | `"1"` | +| `jsonrpc` | string | Required | `"2.0"` | +| `method` | string | Required | `"GetMinerInfo"` | +| `params` | string | Required | DS block number. Example: `"5500"` | diff --git a/zq2/docs/apis/1123f1a7/api/zilliqa/GetNetworkId.md b/zq2/docs/apis/1123f1a7/api/zilliqa/GetNetworkId.md new file mode 100644 index 0000000..4ba1518 --- /dev/null +++ b/zq2/docs/apis/1123f1a7/api/zilliqa/GetNetworkId.md @@ -0,0 +1,83 @@ +--- +id: APIs/1123f1a7/api/zilliqa/GetNetworkId +title: GetNetworkId +keywords: network,id,get +--- + +--- + +Returns the `CHAIN_ID` of the specified network. This is represented as a `String`. + +Our chain ids are listed at [chainlist.org](https://chainlist.org/?search=zilliqa&testnets=true). + +The chain id reported by the Zilliqa API has bit 15 clear (`chain_id & ~0x8000`) whilst the chain id reported by the EVM API has bit 15 set (`chain_id | 0x8000`). + +### Example Request + +=== "cURL" + + ```shell + curl -d '{ + "id": "1", + "jsonrpc": "2.0", + "method": "GetNetworkId", + "params": [""] + }' -H "Content-Type: application/json" -X POST "https://api.zq2-devnet.zilliqa.com" + ``` + +=== "node.js" + + ```js + const NetworkId = await zilliqa.network.GetNetworkId(); + console.log(NetworkId); + ``` + +=== "java" + + ```java + public class App { + public static void main(String[] args) throws IOException { + HttpProvider client = new HttpProvider("https://api.zq2-devnet.zilliqa.com"); + Rep networkId = client.getNetworkId(); + System.out.println(new Gson().toJson(networkId)); + } + } + ``` + +=== "python" + + ```python + from pyzil.zilliqa import chain + from pyzil.zilliqa.api import ZilliqaAPI + +=== "go" + + ```go + func GetNetworkId() { + provider := NewProvider("https://api.zq2-devnet.zilliqa.com") + response := provider.GetNetworkId() + result, _ := json.Marshal(response) + fmt.Println(string(result)) + } + ``` + +### Example response + +```json +{ + "id": "1", + "jsonrpc": "2.0", + "result": "1" +} +``` + +### Arguments + +| Parameter | Type | Required | Description | +| --------- | ------ | -------- | ----------------- | +| `id` | string | Required | `"1"` | +| `jsonrpc` | string | Required | `"2.0"` | +| `method` | string | Required | `"GetNetworkId"` | +| `params` | string | Required | Empty string `""` | + +| diff --git a/zq2/docs/apis/1123f1a7/api/zilliqa/GetNodeType.md b/zq2/docs/apis/1123f1a7/api/zilliqa/GetNodeType.md new file mode 100644 index 0000000..ba1512c --- /dev/null +++ b/zq2/docs/apis/1123f1a7/api/zilliqa/GetNodeType.md @@ -0,0 +1,45 @@ +--- +id: APIs/1123f1a7/api/zilliqa/GetNodeType +title: GetNodeType +keywords: node,type,get +--- + +--- + +!!! warning + + This API is not yet implemented in this version of Zilliqa 2.0 + +Returns node type. The possible return values are: + +- `"Not in network, synced till epoch [epoch number]"` if the server has not joined the network and is synced until a specific epoch. +- `"Seed"` if the server is in lookup node mode and is an archival lookup node. +- `"Lookup"` if the server is in lookup node mode + +### Example Request + +=== "cURL" + + ```shell + curl -d '{ + "id": "1", + "jsonrpc": "2.0", + "method": "GetNodeType", + "params": [""] + }' -H "Content-Type: application/json" -X POST "https://api.zq2-devnet.zilliqa.com" + ``` + +### Example response + +```json +{ "id": "1", "jsonrpc": "2.0", "result": "Seed" } +``` + +### Arguments + +| Parameter | Type | Required | Description | +| --------- | ------ | -------- | ----------------- | +| `id` | string | Required | `"1"` | +| `jsonrpc` | string | Required | `"2.0"` | +| `method` | string | Required | `"GetNodeType"` | +| `params` | string | Required | Empty string `""` | diff --git a/zq2/docs/apis/1123f1a7/api/zilliqa/GetNumDSBlocks.md b/zq2/docs/apis/1123f1a7/api/zilliqa/GetNumDSBlocks.md new file mode 100644 index 0000000..cddb6be --- /dev/null +++ b/zq2/docs/apis/1123f1a7/api/zilliqa/GetNumDSBlocks.md @@ -0,0 +1,83 @@ +--- +id: APIs/1123f1a7/api/zilliqa/GetNumDSBlocks +title: GetNumDSBlocks +keywords: DS,get,blocks,count,number +--- + +--- + +!!! warning + + This API is not yet implemented in this version of Zilliqa 2.0 + +Returns the current number of validated Directory Service blocks in the network. This is represented as a `String`. + +### Example Request + +=== "cURL" + + ```shell + curl -d '{ + "id": "1", + "jsonrpc": "2.0", + "method": "GetNumDSBlocks", + "params": [""] + }' -H "Content-Type: application/json" -X POST "https://api.zq2-devnet.zilliqa.com" + ``` + +=== "node.js" + + ```js + const numDsBlock = await zilliqa.blockchain.getNumDSBlocks(); + console.log(numDsBlock.result); + ``` + +=== "java" + + ```java + public class App { + public static void main(String[] args) throws IOException { + HttpProvider client = new HttpProvider("https://api.zq2-devnet.zilliqa.com"); + Rep numDSBlocks = client.getNumDSBlocks(); + System.out.println(new Gson().toJson(numDSBlocks)); + } + } + ``` + +=== "python" + + ```python + from pyzil.zilliqa import chain + chain.set_active_chain(chain.MainNet) + print(chain.active_chain.api.GetNumDSBlocks()) + ``` + +=== "go" + + ```go + func GetNumDSBlocks() { + provider := NewProvider("https://api.zq2-devnet.zilliqa.com") + response := provider.GetNumDSBlocks() + result, _ := json.Marshal(response) + fmt.Println(string(result)) + } + ``` + +### Example response + +```json +{ + "id": "1", + "jsonrpc": "2.0", + "result": "5899" +} +``` + +### Arguments + +| Parameter | Type | Required | Description | +| --------- | ------ | -------- | ------------------ | +| `id` | string | Required | `"1"` | +| `jsonrpc` | string | Required | `"2.0"` | +| `method` | string | Required | `"GetNumDSBlocks"` | +| `params` | string | Required | Empty string `""` | diff --git a/zq2/docs/apis/1123f1a7/api/zilliqa/GetNumPeers.md b/zq2/docs/apis/1123f1a7/api/zilliqa/GetNumPeers.md new file mode 100644 index 0000000..c940a1c --- /dev/null +++ b/zq2/docs/apis/1123f1a7/api/zilliqa/GetNumPeers.md @@ -0,0 +1,41 @@ +--- +id: APIs/1123f1a7/api/zilliqa/GetNumPeers +title: GetNumPeers +keywords: peers,get,number,count +--- + +--- + +!!! warning + + This API is not yet implemented in this version of Zilliqa 2.0 + +Returns total number of peers including committee peers. + +### Example Request + +=== "cURL" + + ```shell + curl -d '{ + "id": "1", + "jsonrpc": "2.0", + "method": "GetNumPeers", + "params": [""] + }' -H "Content-Type: application/json" -X POST "https://api.zq2-devnet.zilliqa.com" + ``` + +### Example response + +```json +{ "id": "1", "jsonrpc": "2.0", "result": 600 } +``` + +### Arguments + +| Parameter | Type | Required | Description | +| --------- | ------ | -------- | ----------------- | +| `id` | string | Required | `"1"` | +| `jsonrpc` | string | Required | `"2.0"` | +| `method` | string | Required | `"GetNumPeers"` | +| `params` | string | Required | Empty string `""` | diff --git a/zq2/docs/apis/1123f1a7/api/zilliqa/GetNumTransactions.md b/zq2/docs/apis/1123f1a7/api/zilliqa/GetNumTransactions.md new file mode 100644 index 0000000..81db2c2 --- /dev/null +++ b/zq2/docs/apis/1123f1a7/api/zilliqa/GetNumTransactions.md @@ -0,0 +1,83 @@ +--- +id: APIs/1123f1a7/api/zilliqa/GetNumTransactions +title: GetNumTransactions +keywords: get,transactions,count +--- + +--- + +!!! warning + + This API is not yet implemented in this version of Zilliqa 2.0 + +Returns the current number of validated Transactions in the network. This is represented as a `String.` + +### Example Request + +=== "cURL" + + ```shell + curl -d '{ + "id": "1", + "jsonrpc": "2.0", + "method": "GetNumTransactions", + "params": [""] + }' -H "Content-Type: application/json" -X POST "https://api.zq2-devnet.zilliqa.com" + ``` + +=== "node.js" + + ```js + const numTransactions = await zilliqa.blockchain.getNumTransactions(); + console.log(numTransactions.result); + ``` + +=== "java" + + ```java + public class App { + public static void main(String[] args) throws IOException { + HttpProvider client = new HttpProvider("https://api.zq2-devnet.zilliqa.com"); + Rep numTransactions = client.getNumTransactions(); + System.out.println(new Gson().toJson(numTransactions)); + } + } + ``` + +=== "python" + + ```python + from pyzil.zilliqa import chain + chain.set_active_chain(chain.MainNet) + print(chain.active_chain.api.GetNumTransactions()) + ``` + +=== "go" + + ```go + func GetNumTransactions() { + provider := NewProvider("https://api.zq2-devnet.zilliqa.com") + response := provider.GetNumTransactions() + result, _ := json.Marshal(response) + fmt.Println(string(result)) + } + ``` + +### Example response + +```json +{ + "id": "1", + "jsonrpc": "2.0", + "result": "4350695" +} +``` + +### Arguments + +| Parameter | Type | Required | Description | +| --------- | ------ | -------- | ---------------------- | +| `id` | string | Required | `"1"` | +| `jsonrpc` | string | Required | `"2.0"` | +| `method` | string | Required | `"GetNumTransactions"` | +| `params` | string | Required | Empty string `""` | diff --git a/zq2/docs/apis/1123f1a7/api/zilliqa/GetNumTxBlocks.md b/zq2/docs/apis/1123f1a7/api/zilliqa/GetNumTxBlocks.md new file mode 100644 index 0000000..9575110 --- /dev/null +++ b/zq2/docs/apis/1123f1a7/api/zilliqa/GetNumTxBlocks.md @@ -0,0 +1,79 @@ +--- +id: APIs/1123f1a7/api/zilliqa/GetNumTxBlocks +title: GetNumTxBlocks +keywords: get,number,count,tx,blocks +--- + +--- + +Returns the current number of Transaction blocks in the network. This is represented as a `String`. + +### Example Request + +=== "cURL" + + ```shell + curl -d '{ + "id": "1", + "jsonrpc": "2.0", + "method": "GetNumTxBlocks", + "params": [""] + }' -H "Content-Type: application/json" -X POST "https://api.zq2-devnet.zilliqa.com" + ``` + +=== "node.js" + + ```js + const numTxBlock = await zilliqa.blockchain.getNumTxBlocks(); + console.log(numTxBlock.result); + ``` + +=== "java" + + ```java + public class App { + public static void main(String[] args) throws IOException { + HttpProvider client = new HttpProvider("https://api.zq2-devnet.zilliqa.com"); + Rep numTxBlocks = client.getNumTxBlocks(); + System.out.println(new Gson().toJson(numTxBlocks)); + } + } + ``` + +=== "python" + + ```python + from pyzil.zilliqa import chain + chain.set_active_chain(chain.MainNet) + print(chain.active_chain.api.GetNumTxBlocks()) + ``` + +=== "go" + + ```go + func GetNumTxBlocks() { + provider := NewProvider("https://api.zq2-devnet.zilliqa.com") + response := provider.GetNumTxBlocks() + result, _ := json.Marshal(response) + fmt.Println(string(result)) + } + ``` + +### Example response + +```json +{ + "id": "1", + "jsonrpc": "2.0", + "result": "589790" +} +``` + +### Arguments + +| Parameter | Type | Required | Description | +| --------- | ------ | -------- | ------------------ | +| `id` | string | Required | `"1"` | +| `jsonrpc` | string | Required | `"2.0"` | +| `method` | string | Required | `"GetNumTxBlocks"` | +| `params` | string | Required | Empty string `""` | diff --git a/zq2/docs/apis/1123f1a7/api/zilliqa/GetPrevDSDifficulty.md b/zq2/docs/apis/1123f1a7/api/zilliqa/GetPrevDSDifficulty.md new file mode 100644 index 0000000..cbf1674 --- /dev/null +++ b/zq2/docs/apis/1123f1a7/api/zilliqa/GetPrevDSDifficulty.md @@ -0,0 +1,84 @@ +--- +id: APIs/1123f1a7/api/zilliqa/GetPrevDSDifficulty +title: GetPrevDSDifficulty +keywords: get,difficulty,DS +--- + +--- + +!!! warning + + This API is no longer relevant to Zilliqa 2.0 and will not be implemented; attempts to call it will + result in an error. This documentation is retained for historical reasons. + +Returns the minimum DS difficulty of the previous block. This is represented as an `Number`. + +### Example Request + +=== "cURL" + + ```shell + curl -d '{ + "id": "1", + "jsonrpc": "2.0", + "method": "GetPrevDSDifficulty", + "params": [""] + }' -H "Content-Type: application/json" -X POST "https://api.zq2-devnet.zilliqa.com" + ``` + +=== "node.js" + + ```js + const prevDSDifficulty = await zilliqa.blockchain.getPrevDSDifficulty(); + console.log(prevDSDifficulty.result); + ``` + +=== "java" + + ```java + public class App { + public static void main(String[] args) throws IOException { + HttpProvider client = new HttpProvider("https://api.zq2-devnet.zilliqa.com"); + Rep prevDSDifficulty = client.getPrevDSDifficulty(); + System.out.println(new Gson().toJson(prevDSDifficulty)); + } + } + ``` + +=== "python" + + ```python + from pyzil.zilliqa import chain + chain.set_active_chain(chain.MainNet) + print(chain.active_chain.api.GetPrevDSDifficulty()) + ``` + +=== "go" + + ```go + func GetPrevDSDifficulty() { + provider := NewProvider("https://api.zq2-devnet.zilliqa.com") + response := provider.GetPrevDSDifficulty() + result, _ := json.Marshal(response) + fmt.Println(string(result)) + } + ``` + +### Example response + +```json +{ + "id": "1", + "jsonrpc": "2.0", + "result": 149 +} +``` + +### Arguments + +| Parameter | Type | Required | Description | +| --------- | ------ | -------- | ----------------------- | +| `id` | string | Required | `"1"` | +| `jsonrpc` | string | Required | `"2.0"` | +| `method` | string | Required | `"GetPrevDSDifficulty"` | +| `params` | string | Required | Empty string `""` | diff --git a/zq2/docs/apis/1123f1a7/api/zilliqa/GetPrevDifficulty.md b/zq2/docs/apis/1123f1a7/api/zilliqa/GetPrevDifficulty.md new file mode 100644 index 0000000..520bf89 --- /dev/null +++ b/zq2/docs/apis/1123f1a7/api/zilliqa/GetPrevDifficulty.md @@ -0,0 +1,84 @@ +--- +id: APIs/1123f1a7/api/zilliqa/GetPrevDifficulty +title: GetPrevDifficulty +keywords: get,difficulty +--- + +--- + +!!! warning + + This API is no longer relevant to Zilliqa 2.0 and will not be implemented; attempts to call it will + result in an error. This documentation is retained for historical reasons. + +Returns the minimum shard difficulty of the previous block. This is represented as an `Number`. This is no longer required in Zilliqa 2.0 because of the change to proof of stake consensus. + +### Example Request + +=== "cURL" + + ```shell + curl -d '{ + "id": "1", + "jsonrpc": "2.0", + "method": "GetPrevDifficulty", + "params": [""] + }' -H "Content-Type: application/json" -X POST "https://api.zq2-devnet.zilliqa.com" + ``` + +=== "node.js" + + ```js + const prevDifficulty = await zilliqa.blockchain.getPrevDifficulty(); + console.log(prevDifficulty.result); + ``` + +=== "java" + + ```java + public class App { + public static void main(String[] args) throws IOException { + HttpProvider client = new HttpProvider("https://api.zq2-devnet.zilliqa.com"); + Rep prevDifficulty = client.getPrevDifficulty(); + System.out.println(new Gson().toJson(prevDifficulty)); + } + } + ``` + +=== "python" + + ```python + from pyzil.zilliqa import chain + chain.set_active_chain(chain.MainNet) + print(chain.active_chain.api.GetPrevDifficulty()) + ``` + +=== "go" + + ```go + func GetPrevDifficulty() { + provider := NewProvider("https://api.zq2-devnet.zilliqa.com}") + response := provider.GetPrevDifficulty() + result, _ := json.Marshal(response) + fmt.Println(string(result)) + } + ``` + +### Example response + +```json +{ + "id": "1", + "jsonrpc": "2.0", + "result": 91 +} +``` + +### Arguments + +| Parameter | Type | Required | Description | +| --------- | ------ | -------- | --------------------- | +| `id` | string | Required | `"1"` | +| `jsonrpc` | string | Required | `"2.0"` | +| `method` | string | Required | `"GetPrevDifficulty"` | +| `params` | string | Required | Empty string `""` | diff --git a/zq2/docs/apis/1123f1a7/api/zilliqa/GetShardingStructure.md b/zq2/docs/apis/1123f1a7/api/zilliqa/GetShardingStructure.md new file mode 100644 index 0000000..959f3ee --- /dev/null +++ b/zq2/docs/apis/1123f1a7/api/zilliqa/GetShardingStructure.md @@ -0,0 +1,42 @@ +--- +id: APIs/1123f1a7/api/zilliqa/GetShardingStructure +title: GetShardingStructure +keywords: get,sharding,structure +--- + +--- + +!!! warning + + This API is no longer relevant to Zilliqa 2.0 and will not be implemented; attempts to call it will + result in an error. This documentation is retained for historical reasons. + +Retrieves the sharding structure from the lookup server. In Zilliqa 2.0, this is replaced by the XShard on-chain query mechanism. + +### Example Request + +=== "cURL" + + ```shell + curl -d '{ + "id": "1", + "jsonrpc": "2.0", + "method": "GetShardingStructure", + "params": [""] + }' -H "Content-Type: application/json" -X POST "https://api.zq2-devnet.zilliqa.com" + ``` + +### Example response + +```json +{ "id": "1", "jsonrpc": "2.0", "result": { "NumPeers": [0] } } +``` + +### Arguments + +| Parameter | Type | Required | Description | +| --------- | ------ | -------- | ------------------------ | +| `id` | string | Required | `"1"` | +| `jsonrpc` | string | Required | `"2.0"` | +| `method` | string | Required | `"GetShardingStructure"` | +| `params` | string | Required | Empty string `""` | diff --git a/zq2/docs/apis/1123f1a7/api/zilliqa/GetTotalCoinSupply.md b/zq2/docs/apis/1123f1a7/api/zilliqa/GetTotalCoinSupply.md new file mode 100644 index 0000000..841c021 --- /dev/null +++ b/zq2/docs/apis/1123f1a7/api/zilliqa/GetTotalCoinSupply.md @@ -0,0 +1,82 @@ +--- +id: APIs/1123f1a7/api/zilliqa/GetTotalCoinSupply +title: GetTotalCoinSupply +keywords: get,coin,total,supply +--- + +--- + +!!! warning + + This API is not yet implemented in this version of Zilliqa 2.0 + +`GetTotalCoinSupply` Returns the total supply (ZIL) of coins in the network. This is represented as a +`String`. + +### Example Request + +=== "cURL" + + ```shell + curl -d '{ + "id": "1", + "jsonrpc": "2.0", + "method": "GetTotalCoinSupply", + "params": [""] + }' -H "Content-Type: application/json" -X POST "https://api.zq2-devnet.zilliqa.com" + ``` + +=== "node.js" + + ```js + const totalCoinSupply = await zilliqa.blockchain.getTotalCoinSupply(); + console.log(totalCoinSupply); + ``` + +=== "java" + + ```java + public class App { + public static void main(String[] args) throws IOException { + HttpProvider client = new HttpProvider("https://api.zq2-devnet.zilliqa.com"); + Rep totalCoinSupply = client.getTotalCoinSupply(); + System.out.println(new Gson().toJson(totalCoinSupply)); + } + } + ``` + +=== "python" + + ```python + from pyzil.zilliqa import chain + from pyzil.zilliqa.api import ZilliqaAPI + +=== "go" + + ```go + func GetTotalCoinSupply() { + provider := NewProvider("https://api.zq2-devnet.zilliqa.com") + response := provider.GetTotalCoinSupply() + result, _ := json.Marshal(response) + fmt.Println(string(result)) + } + ``` + +### Example response + +```json +{ + "id": "1", + "jsonrpc": "2.0", + "result": "13452081092.277490607172" +} +``` + +### Arguments + +| Parameter | Type | Required | Description | +| --------- | ------ | -------- | ------------------------------------------------- | +| `id` | string | Required | `"1"` | +| `jsonrpc` | string | Required | `"2.0"` | +| `method` | string | Required | `"GetTotalCoinSupply or GetTotalCoinSupplyAsInt"` | +| `params` | string | Required | Empty string `""` | diff --git a/zq2/docs/apis/1123f1a7/api/zilliqa/GetTotalCoinSupplyAsInt.md b/zq2/docs/apis/1123f1a7/api/zilliqa/GetTotalCoinSupplyAsInt.md new file mode 100644 index 0000000..af87382 --- /dev/null +++ b/zq2/docs/apis/1123f1a7/api/zilliqa/GetTotalCoinSupplyAsInt.md @@ -0,0 +1,46 @@ +--- +id: APIs/1123f1a7/api/zilliqa/GetTotalCoinSupplyAsInt +title: GetTotalCoinSupplyAsInt +keywords: get,coin,supply,int,total +--- + +--- + +!!! warning + + This API is not yet implemented in this version of Zilliqa 2.0 + +`GetTotalCoinSupplyAsInt` Returns the total supply (ZIL) of coins in the network. This is represented as a +`Rounded Number`. + +### Example Request + +=== "cURL" + + ```shell + curl -d '{ + "id": "1", + "jsonrpc": "2.0", + "method": "GetTotalCoinSupplyAsInt", + "params": [""] + }' -H "Content-Type: application/json" -X POST "https://api.zq2-devnet.zilliqa.com" + ``` + +### Example response + +```json +{ + "id": "1", + "jsonrpc": "2.0", + "result": 13452081092 +} +``` + +### Arguments + +| Parameter | Type | Required | Description | +| --------- | ------ | -------- | ------------------------------------------------- | +| `id` | string | Required | `"1"` | +| `jsonrpc` | string | Required | `"2.0"` | +| `method` | string | Required | `"GetTotalCoinSupply or GetTotalCoinSupplyAsInt"` | +| `params` | string | Required | Empty string `""` | diff --git a/zq2/docs/apis/1123f1a7/api/zilliqa/GetVersion.md b/zq2/docs/apis/1123f1a7/api/zilliqa/GetVersion.md new file mode 100644 index 0000000..2f3ea46 --- /dev/null +++ b/zq2/docs/apis/1123f1a7/api/zilliqa/GetVersion.md @@ -0,0 +1,44 @@ +--- +id: APIs/1123f1a7/api/zilliqa/GetVersion +title: GetVersion +keywords: get,version +--- + +--- + +Returns the software version of the Zilliqa node. Additionally, returns a commit id if defined. + +### Example Request + +=== "cURL" + + ```shell + curl -d '{ + "id": "1", + "jsonrpc": "2.0", + "method": "GetVersion", + "params": [""] + }' -H "Content-Type: application/json" -X POST "https://api.zq2-devnet.zilliqa.com" + ``` + +### Example response + +```json +{ + "id": "1", + "jsonrpc": "2.0", + "result": { + "Commit": "", + "Version": "v9.0.1" + } +} +``` + +### Arguments + +| Parameter | Type | Required | Description | +| --------- | ------ | -------- | ----------------- | +| `id` | string | Required | `"1"` | +| `jsonrpc` | string | Required | `"2.0"` | +| `method` | string | Required | `"GetVersion"` | +| `params` | string | Required | Empty string `""` | diff --git a/zq2/docs/assets/arrow-icon.svg b/zq2/docs/assets/arrow-icon.svg new file mode 100644 index 0000000..1f178d0 --- /dev/null +++ b/zq2/docs/assets/arrow-icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/zq2/docs/assets/banner.webp b/zq2/docs/assets/banner.webp new file mode 100644 index 0000000..006db68 Binary files /dev/null and b/zq2/docs/assets/banner.webp differ diff --git a/zq2/docs/assets/metamask_fox.png b/zq2/docs/assets/metamask_fox.png new file mode 100644 index 0000000..44a295b Binary files /dev/null and b/zq2/docs/assets/metamask_fox.png differ diff --git a/zq2/docs/assets/zilliqa.svg b/zq2/docs/assets/zilliqa.svg new file mode 100644 index 0000000..d315c27 --- /dev/null +++ b/zq2/docs/assets/zilliqa.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/zq2/docs/index.md b/zq2/docs/index.md index 2fd9ec8..34890f0 100644 --- a/zq2/docs/index.md +++ b/zq2/docs/index.md @@ -3,48 +3,87 @@ hide: - title - toc --- +
-# Zilliqa 2.0 Developer Documentation +
-Welcome to the developer documentation for Zilliqa 2.0, a fast-finality, scalable blockchain protocol. Zilliqa 2.0 features a native EVM execution layer, supporting standard EVM development tools and wallets while also retaining a custom execution layer based on the [Scilla](https://scilla.readthdocs.io/latest) smart contract language. +# The Zilliqa 2.0 Developer Portal +
+
+Welcome to the developer documentation for Zilliqa 2.0, a fast-finality, scalable blockchain protocol. Zilliqa 2.0 features a native EVM execution layer, supporting standard EVM development tools and wallets while also retaining a custom execution layer based on the [Scilla](https://scilla.readthdocs.io/latest) smart contract language. +
+
+[Check the Roadmap](http://roadmap.zilliqa.com/) +
+
+
-__For an overview__ of the features and capabilities introduced in Zilliqa 2.0, please visit the [roadmap website](https://roadmap.zilliqa.com/), where you can also find a list of development milestones. -__To learn more__ about the design of the Zilliqa 2.0 protocol, [read the whitepaper](https://drive.google.com/file/d/1XqSySl0w_OtxyxBZ0ahS06cqIv-vd10M/view). -__At the current stage__ of Zilliqa 2.0 development, the core protocol is available to test via the Jasper proto-testnet. +
-__The proto-testnet__ exists as the first implementation of the Zilliqa 2.0 consensus mechanism, which comprises Proof-of-Stake validator selection paired with Pipelined Fast-HotStuff for fast and efficient transaction processing. +
+# Everything you need to know +
+
-Here you will find documentation related to the current implementation of Zilliqa 2.0, including: +## The Roadmap +For an overview of the features and capabilities introduced in Zilliqa 2.0, please visit the [roadmap website](https://roadmap.zilliqa.com/), where you can also find a list of development milestones. -
+
+
-- __What's new in Zilliqa 2.0__ +## The Whitepaper +To learn more about the design of the Zilliqa 2.0 protocol, [read the whitepaper](https://drive.google.com/file/d/1XqSySl0w_OtxyxBZ0ahS06cqIv-vd10M/view). - [:octicons-arrow-right-24: Read More](/zilliqa2/changes/) +
+
+## Core protocol +At the current stage of Zilliqa 2.0 development, the core protocol is available to test via the Jasper proto-testnet. -- __URLs of RPC endpoint, faucet and block explorer__ +
+
- [:octicons-arrow-right-24: Read More](/zilliqa2/endpoints/) +## Proto-testnet +The proto-testnet exists as the first implementation of the Zilliqa 2.0 consensus mechanism, which comprises Proof-of-Stake validator selection paired with Pipelined Fast-HotStuff for fast and efficient transaction processing. -- __How to run a node and become a validator__ +
+
- [:octicons-arrow-right-24: Read More](/zilliqa2/nodes/) +# Implementation of the Zilliqa 2.0 +
-- __Development tools, SDKs, and Git repositories__ +- [__What's new
in Zilliqa 2.0__](/zilliqa2/changes/) - [:octicons-arrow-right-24: Read More](/zilliqa2/sdk/) -- __Supported APIs__ - [:octicons-arrow-right-24: Read More](/zilliqa2/support/) +- [__URLs of RPC endpoint, faucet and block explorer__](/zilliqa2/endpoints/) + + +- [__How to run a node and become a validator__](/zilliqa2/nodes/) + + +- [__Development tools, SDKs, and Git repositories__](/zilliqa2/sdk/) + + +- [__Supported
APIs__](/zilliqa2/support/) +
More documentation for Zilliqa 2.0 will become available as new functionality is rolled out to the protocol and its capabilities are expanded. *__Note:__ This documentation refers to Zilliqa 2.0. Documentation for the current production version of Zilliqa is available at - [https://dev.zilliqa.com/zilliqa1/](/zilliqa1/)* - + [__https://dev.zilliqa.com/zilliqa1/__](/zilliqa1/)* +
+
+
+ + +Add Zilliqa 2 EVM proto-testnet + +
+
+
+
diff --git a/zq2/docs/js/add-zilliqa-chain.js b/zq2/docs/js/add-zilliqa-chain.js new file mode 100644 index 0000000..44ca536 --- /dev/null +++ b/zq2/docs/js/add-zilliqa-chain.js @@ -0,0 +1,46 @@ +// add-zilliqa-chain.js + +document.addEventListener('DOMContentLoaded', function() { + const addZilliqaChainButton = document.getElementById('addZilliqaChainButton'); + + if (addZilliqaChainButton) { + addZilliqaChainButton.addEventListener('click', addZilliqaChain); + } +}); + +async function addZilliqaChain() { + if (typeof window.ethereum !== 'undefined') { + try { + await window.ethereum.request({ + method: "wallet_addEthereumChain", + params: [ + { + blockExplorerUrls: [ + "https://otterscan.zq2-prototestnet.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-prototestnet.zilliqa.com" + ], + chainId: "0x814f", + chainName: "Zilliqa 2 EVM proto-testnet" + } + ], + }); + alert('Zilliqa 2 EVM proto-testnet 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.'); + } +} \ No newline at end of file diff --git a/zq2/docs/stylesheets/extra.css b/zq2/docs/stylesheets/extra.css index c104008..6081142 100644 --- a/zq2/docs/stylesheets/extra.css +++ b/zq2/docs/stylesheets/extra.css @@ -1,10 +1,12 @@ @media only screen and (min-width: 76.25em) { - .md-main__inner { - max-width: none; + .md-grid { + max-width: 70rem; } + .md-sidebar--primary { left: 0; } + .md-sidebar--secondary { right: 0; margin-left: 0; @@ -14,7 +16,7 @@ } [data-md-color-scheme="zilliqa"] { - --md-primary-fg-color: #000000; + --md-primary-fg-color: #272626; --md-primary-bg-color: #ffffff; --md-default-fg-color: #ffffff; --md-default-fg-color--light: #ffffff; @@ -29,7 +31,7 @@ --md-primary-bg-color: #272626; --md-primary-bg-color--light: #272626; - --md-code-bg-color: #292929; + --md-code-bg-color: #161616; --md-code-fg-color: #ffffff; --md-code-fg-color--light: #ffffff; --md-code-hl-comment-color: #cccc00; @@ -42,18 +44,28 @@ --md-code-hl-variable-color: #c02080; --md-code-hl-name-color: #00d0c6; --md-code-hl-operator-color: #90c090; + --md-footer-bg-color: #272626; } .md-header { color: #ffffff; + box-shadow: 0px 0px 4px 0px #0000001a; +} + +[dir="ltr"] .md-header__title { + margin-left: 0; } .md-search__input + .md-search__icon { - color: #6329b7; + color: #ffffff; } .md-search__input::placeholder { - color: #00d7bc; + color: #707070; +} + +.md-search__inner { + width: 28rem; } .md-typeset__table { @@ -92,7 +104,8 @@ td { } .md-typeset .center-table :is(td, th):not([align]) { - text-align: initial; /* reset alignment for table cells */ + text-align: initial; + /* reset alignment for table cells */ } .disp-btn { @@ -140,3 +153,231 @@ td { .md-typeset em { color: var(--md-default-fg-color--lightest); } + +/* Cre */ +p a { + text-decoration: underline; +} + +.md-zil-wrapper { + padding: 0 4rem; +} + +.md-main__inner { + margin-top: 0; +} + +.md-content__inner:before { + height: 0; +} + +.md-content__inner { + padding-top: 4rem; +} + +.md-sidebar { + width: 15rem; + padding-top: 4rem; +} + +@supports selector(::-webkit-scrollbar) { + [dir="ltr"] .md-sidebar__inner { + padding-right: calc(100% - 15rem); + } +} + +.md-zil-banner { + min-height: 400px; + background: url("../assets/banner.webp"); + background-position: center; + padding: 4rem; + position: relative; + margin-bottom: 3rem; + margin-top: -4rem; +} + +.md-typeset .md-zil-banner h1 { + color: var(--md-accent-fg-color); + max-width: 50%; + font-size: 45px; + line-height: 53px; + margin-bottom: 1rem; +} + +.md-typeset h1 { + color: var(--md-accent-fg-color); + margin-bottom: 1rem; + font-size: 31px; + font-weight: 700; + letter-spacing: -0.5px; + display: inline-block; +} + +.md-zil-banner .flex { + display: flex; +} + +.md-zil-banner .flex > div { + width: 50%; + line-height: 28px; +} + +.md-zil-banner .flex > div:last-child a { + border: 1px solid var(--md-accent-fg-color); + line-height: 62px; + border-radius: 15px; + padding: 0 3rem; + margin: 0.5rem 0 0 4rem; + display: inline-block; + font-weight: 700; + letter-spacing: -0.5px; + text-decoration: none; +} + +.md-zil-banner .flex > div:last-child a:hover { + background-color: var(--md-accent-fg-color); + color: #ffffff; +} + +.md-zil-banner > div { + position: relative; + z-index: 1; +} + +.md-zil-banner:before { + content: ""; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: #000000; + opacity: 0.4; + z-index: 0; +} + +.md-zil-cards { + display: grid; + grid-template-columns: auto auto; + gap: 2rem; + margin-bottom: 3rem; +} + +.md-zil-cards.cards { + grid-template-columns: auto; +} + +.md-zil-cards.cards ul { + list-style: none; + padding: 0; + margin: 0; + display: grid; + gap: 1.5rem; + grid-template-columns: auto auto; +} + +.md-zil-cards.cards ul li, +.md-zil-cards > div { + border: 1px solid #3b3b3b; + border-radius: 15px; +} + +.md-zil-cards.cards ul li { + margin: 0; +} + +.md-zil-cards.cards ul li a { + padding: 20px; + color: #ffffff; + text-decoration: none; + font-size: 25px; + line-height: 36px; + display: inline-block; + width: 100%; + height: 100%; + background: url(../assets/arrow-icon.svg); + background-repeat: no-repeat; + background-position: calc(100% - 20px) 30px; + background-size: 30px; + padding-right: 70px; +} + +.md-zil-cards > div { + padding: 1.5rem 2rem; + display: flex; + min-height: 220px; + flex-direction: column; + justify-content: space-between; +} + +.md-zil-cards > div h2 { + margin: 0; + margin-bottom: 1.5rem; +} + +.md-zil-cards > div p { + margin: 0; + color: rgba(255, 255, 255, 0.6); + font-size: 14px; +} + +.metamask { + font-size: 16px; + font-weight: 600; + padding: 14px 24px; + padding-left: 50px; + background-color: #1d1d1d; + border-radius: 7px; + background-image: url(../assets/metamask_fox.png); + background-repeat: no-repeat; + background-size: 30px; + background-position: 12px center; + color: #fff; +} + +.metamask:hover { + background-color: #00d0c6; + cursor: pointer; +} + +@media screen and (max-width: 76.1875em) { + [dir="ltr"] .md-sidebar { + left: -15rem; + } + + [data-md-toggle="drawer"]:checked ~ .md-container .md-side bar--primary { + box-shadow: var(--md-shadow-z3); + transform: translateX(15rem); + } + [data-md-toggle="drawer"]:checked ~ .md-container .md-sidebar--primary { + box-shadow: var(--md-shadow-z3); + transform: translateX(15rem); + } + .md-zil-banner, + .md-zil-wrapper { + padding: 1.8rem; + background-position: 30% center; + margin: -4rem -0.8rem 1.2rem; + } + .md-typeset .md-zil-banner h1 { + max-width: 100%; + } + .md-zil-banner .flex { + flex-direction: column; + } + .md-zil-banner .flex > div { + width: 100%; + } + .md-zil-banner .flex > div:last-child a { + margin-left: 0; + } + .md-zil-cards, + .md-zil-cards.cards ul { + gap: 1rem; + grid-template-columns: auto; + } + .md-zil-cards > div { + padding: 1rem; + min-height: 0; + } +} diff --git a/zq2/parent.yaml b/zq2/parent.yaml index 88d2a36..ffb9cda 100644 --- a/zq2/parent.yaml +++ b/zq2/parent.yaml @@ -1,7 +1,7 @@ site_name: Zilliqa Developer Portal site_url: https://dev.zilliqa.com/zilliqa2 docs_dir: !ENV DOC_SOURCE -site_description: Zilliqa blockchain +site_description: Welcome to the developer documentation for Zilliqa 2.0. Access guides, tools, and APIs for building on the scalable and user-friendly Zilliqa 2.0 network. site_author: Zilliqa extra_css: @@ -12,10 +12,11 @@ extra_javascript: - js/connect.js - js/chain.js - js/buffer.js + - js/add-zilliqa-chain.js theme: name: material - logo: assets/zilliqa.png + logo: assets/zilliqa.svg font: text: Poppins code: Roboto Mono @@ -139,5 +140,5 @@ extra: link: https://status.zilliqa.com plugins: - - search + - search: - markdownextradata: {}