Mantle 백서

Mantle

원문

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 37쪽 중 12쪽

for reference. {% endhint %} ## Third-Party Providers[​](https://docs-v2.mantle.xyz/devs/dev-guides/tools/endpoints#third-party-providers) <a href="#third-party-providers" id="third-party-providers"></a> We're working with popular node providers that you can use to connect your dApps or games to the Mantle network. They enable convenient and scalable API access to Mantle nodes, so you can focus on building without having to worry about the underlying infrastructure. {% hint style="info" %} The public third-party RPC endpoints listed below are intended for test environments only. For production environments, please use their premium services to ensure stability and reliability. {% endhint %} {% tabs %} {% tab title="Mainnet" %} | Name | Https Url | WebSocket Url | | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- | | [**DRPC**](https://drpc.org/chainlist/mantle) | [https://mantle.drpc.org](https://mantle.drpc.org/) | wss\://mantle.drpc.org | | [**Allnodes**](https://mantle.publicnode.com/) | <https://mantle-rpc.publicnode.com/> | wss\://mantle-rpc.publicnode.com | | [**1RPC**](https://www.1rpc.io/) | <https://1rpc.io/mantle> | N/A | | [**QuickNode**](https://www.quicknode.com/chains/mantle) **\*** | [https://rpc.mantle.quicknode.com](https://rpc.mantle.quicknode.com/) | N/A | | [**ZAN Node**](https://zan.top/service/apikeys) | <https://api.zan.top/public/mantle-mainnet> | N/A | | [**Alchemy**](https://dashboard.alchemy.com/?utm_source=chain_partner\&utm_medium=referral\&utm_campaign=mantle) | [Login to create your endpoint](https://dashboard.alchemy.com/?utm_source=chain_partner\&utm_medium=referral\&utm_campaign=mantle) | N/A | | [**Blockmachine**](https://blockmachine.io/mantle-rpc) | <https://rpc-mantle.blockmachine.io> | wss\://rpc-mantle.blockmachine.io | \* If you have a higher demand for RPC endpoints, QuickNode has launched a series of discounts for Mantle users, check out the details [here](https://quicknode.notion.site/QuickNode-Benefits-for-Mantle-Developers-94c0992b87a24858b22f5e4a21a44bd1?pvs=4). {% endtab %} {% tab title="Testnet (Sepolia)" %} | Name | Https Url | WebSocket Url | | ------------------------------------------------------------ | ---------------------------------------------------------------------- | ------------------------------ | | [**Ankr**](https://www.ankr.com/rpc/mantle/) | <https://rpc.ankr.com/mantle_sepolia> | N/A | | [**DRPC**](https://drpc.org/chainlist/mantle#mantle-sepolia) | [https://mantle-sepolia.drpc.org](https://mantle-sepolia.drpc.org/) | wss\://mantle-sepolia.drpc.org | | [**QuickNode**](https://www.quicknode.com/chains/mantle) | [Login to create your endpoint](https://www.quicknode.com/docs/mantle) | N/A | | {% endtab %} | | | | {% endtabs %} | | | # Mantle API Applications need to connect to a node to fetch block data and send transactions to the Mantle network. Mantle Network shares the same JSON-RPC API implementation as Ethereum. {% hint style="info" %} You can refer to the common methods [here](https://ethereum.org/en/developers/docs/apis/json-rpc/#json-rpc-methods). If you want to get the L2 gas price, you can either use [`eth_gasPrice`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gasprice) or get it from `GasPriceOracle` 's [`gasPrice`](https://mantlescan.xyz/address/0x420000000000000000000000000000000000000F#readProxyContract#F4) function. If you want to get the L1 gas price, you can get it from `GasPriceOracle` 's [`l1BaseFee`](https://mantlescan.xyz/address/0x420000000000000000000000000000000000000F#readProxyContract#F7) function. {% endhint %} We've also introduced custom methods to simplify certain Mantle-specific interactions. All methods can be accessed via `https` and `websocket`, endpoints can be found [here](/network/for-developers/resources-and-tooling/node-endpoints-and-providers). ## Custom Methods[​](https://docs-v2.mantle.xyz/devs/dev-guides/tools/api#custom-methods) <a href="#custom-methods" id="custom-methods"></a> | **Method** | **Description** | | ------------------- | ------------------------------------------------------------------------ | | `eth_getBlockRange` | Returns block info for multiple blocks, takes a block range as parameter | | `rollup_getInfo` | Returns L2 node info | ### `eth_getBlockRange`[​](https://docs-v2.mantle.xyz/devs/dev-guides/tools/api#eth_getblockrange) <a href="#eth_getblockrange" id="eth_getblockrange"></a> Returns the block info in the form of an array of block objects for multiple blocks within a specified range. (See [`eth_getBlockByHash`](https://eth.wiki/json-rpc/API#eth_getblockbyhash) for the structure of a block object) #### **Parameters**[**​**](https://docs-v2.mantle.xyz/devs/dev-guides/tools/api#parameters) <table data-header-hidden><thead><tr><th width="209"></th><th width="173"></th><th></th></tr></thead><tbody><tr><td><strong>Parameter</strong></td><td><strong>Type</strong></td><td><strong>Description</strong></td></tr><tr><td><code>QUANTITY | TAG</code></td><td>Integer | String</td><td>Starting block no. of the range, or one of <code>"earliest"</code>, <code>"latest"</code>, or <code>"pending"</code>, as in the <a href="https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block">default block parameter</a></td></tr><tr><td><code>QUANTITY | TAG</code></td><td>Integer | String</td><td>Ending block no. of the range, or one of <code>"earliest"</code>, <code>"latest"</code>, or <code>"pending"</code>, as in the <a href="https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block">default block parameter</a></td></tr><tr><td><code>BOOLEAN</code></td><td>Boolean</td><td>If <code>true</code>, returns full transaction objects If <code>false</code>, returns transaction hashes only</td></tr></tbody></table> #### **Sample Request**[**​**](https://docs-v2.mantle.xyz/devs/dev-guides/tools/api#sample-request) ```sh curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBlockRange","params":["0x1", "0x2", false],"id":1}' <node url> ``` #### **Sample Response**[**​**](https://docs-v2.mantle.xyz/devs/dev-guides/tools/api#sample-response) ```sh { "jsonrpc": "2.0", "id": 1, "result": [ { "difficulty": "0x2", "extraData": "0xd97735082a846765746889676f312e31352e3133856c696e75780000000000009c3827892825f0825a7e329b6913b84c9e4f89168350aff0939e0e6609629f2e7f07f2aeb62acbf4b16a739cab68866f4880ea406583a4b28a59d4f55dc2314e00", "gasLimit": "0xe4e1c0", "gasUsed": "0x3183d", "hash": "0xbee7192e575af30420cae0c7776304ac196077ee72b048970549e4f08e875453", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000400000000000100000000000000200000000002000000000000001000000000000000000004000000000000000000000000000040000400000100400000000000000100000000000000000000000000000020000000000000000000000000000000000000000000000001000000000000000000000100000000000000000000000000000000000000000000000000000000000000088000000080000000000010000000000000000000000000000800008000120000000000000000000000000000000002000", "miner": "0x0000000000000000000000000000000000000000", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x1", "parentHash": "0x7ca38a1916c42007829c55e69d3e9a73265554b586a499015373241b8a3fa48b", "receiptsRoot": "0xf4c97b1186b690ad3318f907c0cdaf46f4598f27f711a5609064b2690a767287", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x30c", "stateRoot": "0xd3ac40854cd2ac17d8effeae6065cea990b04be714f7061544973feeb2f1c95f", "timestamp": "0x618d4769", "totalDifficulty": "0x3", "transactions": [ "0x5e77a04531c7c107af1882d76cbff9486d0a9aa53701c30888509d4f5f2b003a" ], "transactionsRoot": "0x19f5efd0d94386e72fcb3f296f1cb2936d017c37487982f76f09c591129f561f", "uncles": [] }, { "difficulty": "0x2", "extraData": "0xd98301090a848932606889676f312e61742e3133856c696e757800000000000064a82cb66c7810b9619e7f14ab65c769a828b1616974987c530684eb3870b65e5b2400c1b61c6d340beef8c8e99127ac0de50e479d21f0833a5e2910fe64b41801", "gasLimit": "0xe4e1c0", "gasUsed": "0x1c60d", "hash": "0x45fd6ce41bb8ebb2bccdaa92dd1619e367404cb07722039901a7eba63dea1d13", "logsBloom": "0x00080000000200000000000000000008000000000000000000000100008000000000000000000000000000000000000000000000000000000000400000000000100000000000000000000000020000000000000000000000000000000000004000000000000000000000000000000000400000000400000000000000100000000000000000000000000000020000000000000000000000000000000000000000100000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000008400000000000000000010000000000000000020000000020000000000000000000000000000000000000000000002000", "miner": "0x0000000000000000000000000000000000000000", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x0000000000000000", "number": "0x2", "parentHash": "0xbee7192e575af30420cae0c7776304ac196077ee72b048970549e4f08e875453", "receiptsRoot": "0x2057c8fb79c0f294062c1436aa56741134dc46d228a4f874929f8b791a7007a4", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x30c", "stateRoot": "0x87026f3a614318ae24bcef6bc8f7564479afbbbe2b1fb189bc133a5de5a2b0f8", "timestamp": "0x618d8837", "totalDifficulty": "0x5", "transactions": [ "0xaf6ed8a6864d44989adc47c84f6fe0aeb1819817505c42cde6cbbcd5e14dd317" ], "transactionsRoot": "0xa39c4d0d2397f8fcb1683ba833d4ab935cd2f4c5ca6f56a7d9a45b9904ea1c69", "uncles": [] } ] } ``` ### `rollup_getInfo`[​](https://docs-v2.mantle.xyz/devs/dev-guides/tools/api#rollup_getinfo) <a href="#rollup_getinfo" id="rollup_getinfo"></a> Returns various pieces of information in the form of an Object for a specified node. The response Object structure is as follows: <table data-header-hidden><thead><tr><th width="205"></th><th width="130"></th><th></th></tr></thead><tbody><tr><td><strong>Field</strong></td><td><strong>Type</strong></td><td><strong>Description</strong></td></tr><tr><td><code>mode</code></td><td>String</td><td>Node's mode of operation - <code>"sequencer"</code> or <code>"verifier"</code></td></tr><tr><td><code>syncing</code></td><td>Boolean</td><td><code>true</code> if the node is currently syncing <code>false</code> otherwise</td></tr><tr><td><code>ethContext</code></td><td>Object</td><td>Nested object. Contains <code>blockNumber</code> and <code>timestamp</code></td></tr><tr><td><code>blockNumber</code></td><td>Quantity</td><td>Block no. of the latest known L1 block</td></tr><tr><td><code>timestamp</code></td><td>Quantity</td><td>Timestamp of the latest known L1 block</td></tr><tr><td><code>rollupContext</code></td><td>Object</td><td>Nested object. Contains <code>queueIndex</code>, <code>index</code>, and <code>verifiedIndex</code></td></tr><tr><td><code>queueIndex</code></td><td>Quantity</td><td>Index within the CTC of the last L1 to L2 message ingested</td></tr><tr><td><code>index</code></td><td>Quantity</td><td>Index of the last L2 transaction processed</td></tr><tr><td><code>verifiedIndex</code></td><td>Quantity</td><td>Index of the last transaction that was ingested from a batch that was posted to L1</td></tr></tbody></table> #### **Parameters**[**​**](https://docs-v2.mantle.xyz/devs/dev-guides/tools/api#parameters-1) None #### **Sample Request**[**​**](https://docs-v2.mantle.xyz/devs/dev-guides/tools/api#sample-request-1) ```sh curl -X POST --data '{"jsonrpc":"2.0","method":"rollup_getInfo","params":[],"id":1}' <node url> ``` #### **Sample Response**[**​**](https://docs-v2.mantle.xyz/devs/dev-guides/tools/api#sample-response-1) ```sh { "jsonrpc": "2.0", "id": 1, "result": { "mode": "verifier", "syncing": false, "ethContext": { "blockNumber": 10743302, "timestamp": 1957082793 }, "rollupContext": { "index": 11287, "queueIndex": 14362, "verifiedIndex": 0 } } } ``` ### Unsupported Methods[​](https://docs-v2.mantle.xyz/devs/dev-guides/tools/api#unsupported-methods) <a href="#unsupported-methods" id="unsupported-methods"></a> <table data-header-hidden><thead><tr><th width="247"></th><th></th></tr></thead><tbody><tr><td><strong>Method</strong></td><td><strong>Description</strong></td></tr><tr><td><code>eth_getAccounts</code></td><td>Used to fetch the list of addresses owned by a user. Mantle nodes do not expose internal wallets for security reasons, and thus block the <code>eth_getAccounts</code> method. You can use an external wallet service as an alternative.</td></tr><tr><td><code>eth_sendTransaction</code></td><td>Mantle nodes block <code>eth_sendTransaction</code> for security reasons as well. This is different from <code>eth_sendRawTransaction</code> which takes a signed transaction as input, and is supported by Mantle nodes.</td></tr></tbody></table> <br> # Oracles Oracles enable access to reliable off-chain data and information that might be necessary for for smart contracts to enable specific use cases. The most common requirement is token prices for different token pairs. There are more complex use cases as well, for example: * Dynamic NFTs that have variable properties that can change based on events that happen in the real world * Some dApps require access to a reliable source of random numbers Oracles are essentially API services that smart contracts can use to fetch off-chain data. ## Api3[​](https://docs-v2.mantle.xyz/devs/dev-guides/tools/oracles#api3) <a href="#api3" id="api3"></a> The [Api3 Market](https://market.api3.org/mantle) provides access to 200+ price feeds on [Mantle](https://market.api3.org/mantle).&#x20; By connecting real-world data providers directly to smart contracts, Api3 eliminates intermediaries, ensuring unmatched transparency and security. With pioneering mechanisms to recapture Oracle Extractable Value (OEV), Api3 empowers dApps with reliable data while minimizing and reclaiming the value they would otherwise leak to external actors. Api3 is redefining the oracle space by elevating oracles from mere data providers to entities that help builders retain the value they create. ## Chronicle[​](https://docs-v2.mantle.xyz/devs/dev-guides/tools/oracles#chronicle) <a href="#chronicle" id="chronicle"></a> The first Oracle on Ethereum, Chronicle’s decentralized Oracle network was originally built within MakerDAO for the development of DAI. Trusted and utilized by leading DeFi protocols such as Spark, MakerDAO, and Morpho, [Chronicle Protocol](https://chroniclelabs.org/) is now available to builders on Mantle testnet and mainnet. <details> <summary><code>Read more</code></summary> * **Data Feeds:** Builders can choose from 65+ data feeds, including crypto assets, yield rates, and RWAs. Chronicle’s data is sourced via custom-built data models, only utilizing Tier 1 Primary Sources, such as the markets where tokens are actively traded, including Coinbase, Binance, Uniswap, and Curve. * **Transparency & Integrity:** Chronicle’s Oracle network is fully transparent and verifiable. Via [The Chronicle](https://chroniclelabs.org/dashboard/oracle/METH/ETH?blockchain=MANTLE\&txn=0x009c561afd8320ffd1627691583f215463b5ae63aaf55d4662fceccb2e9170b5\&contract=0xBFE568Ea8f6bDFFe7c03F83dC8348517f8E7010A), the data supply chain for any Oracle can be viewed in real-time and historically, including data sources and the identity of all Validators/Signers. Users can cryptographically challenge the integrity of every Oracle update using the ‘verify’ feature. Data is independently sourced by a [community of Validators](https://chroniclelabs.org/validators), including Gitcoin, Etherscan, Infura, DeFi Saver, and MakerDAO. * **Gas Efficiency:** Pioneering the Schnorr-based Oracle architecture, Chronicle’s Oracles use 60-80% less gas per update than other Oracle providers. This lowest cost per update allows Push Oracle updates to be made more regularly, ensuring more accurate and granular data reporting. </details> ## ORA[​](https://docs-v2.mantle.xyz/devs/dev-guides/tools/oracles#ora) <a href="#ora" id="ora"></a> [ORA](https://www.ora.io/) is Ethereum's Trustless AI. ORA is the verifiable oracle protocol that brings AI and complex compute onchain. ORA’s main product, **Onchain AI Oracle (OAO)**, brings AI onchain. <details> <summary><code>Read more</code></summary> Some useful links to build with OAO on Mantle: * [ORA Doc](https://docs.ora.io/) * [Quickstart guide](https://docs.ora.io/doc/oao-onchain-ai-oracle/develop-guide/tutorials/interaction-with-oao-tutorial) * The best way to contact our team, ORA [Discord](https://discord.gg/ora-io) </details> ## Pyth Network[​](https://docs-v2.mantle.xyz/devs/dev-guides/tools/oracles#pyth-network) <a href="#pyth-network" id="pyth-network"></a> [Pyth network](https://docs.pyth.network/) is an oracle that publishes financial market data to multiple blockchains. They aggregate price data and provide price feeds for different asset types such as US equities, commodities, and other cryptocurrencies. ## RedStone[​](https://docs-v2.mantle.xyz/devs/dev-guides/tools/oracles#redstone) <a href="#redstone" id="redstone"></a> [RedStone](https://docs.redstone.finance/docs/introduction) is a data ecosystem that delivers frequently updated, reliable and diverse data for your dApp and smart contracts. ## SupraOracles[​](https://docs-v2.mantle.xyz/devs/dev-guides/tools/oracles#supraoracles) <a href="#supraoracles" id="supraoracles"></a> [SupraOracles](https://supraoracles.com/docs) provides access to reliable price feeds on multiple chains, and Verifiable Random Function (VRF). <br> # Monitoring ## Block Explorers[​](https://docs-v2.mantle.xyz/devs/dev-guides/tools/monitors#block-explorers) <a href="#block-explorers" id="block-explorers"></a> Block explorers provide access to real-time and historical transaction data via a UI and API. Here's a list of all the Mantle block explorers. ### Mantlescan[​](https://docs-v2.mantle.xyz/devs/dev-guides/tools/monitors#mantlescan) <a href="#mantlescan" id="mantlescan"></a> [Mantlescan](https://mantlescan.xyz/) is an explorer powered by Etherscan that provides real-time and historical transaction data. ### Blockscout[​](https://docs-v2.mantle.xyz/devs/dev-guides/tools/monitors#blockscout) <a href="#blockscout" id="blockscout"></a> [Blockscout](https://explorer.mantle.xyz/) is a free, open source blockchain explorer that provides real-time and historical transaction data. ### Socialscan[​](https://docs-v2.mantle.xyz/devs/dev-guides/tools/monitors#blockscout) <a href="#blockscout" id="blockscout"></a> [Socialscan](https://mantle.socialscan.io/) is a community-owned explorer with multiple blockchain stats and charts. ## Dashboard[​](https://docs-v2.mantle.xyz/devs/dev-guides/tools/monitors#dashboard) <a href="#dashboard" id="dashboard"></a> ### Arkham <a href="#dashboard" id="dashboard"></a> [Arkham](https://arkm.com/) is a blockchain intelligence and analytics platform designed to deanonymize blockchain data, enhance on-chain transparency, and improve security. It provides powerful tools to identify entity ownership of blockchain addresses, trace fund flows, and analyze complex on-chain behavior patterns. ### DeBank[​](https://docs-v2.mantle.xyz/devs/dev-guides/tools/monitors#debank) <a href="#debank" id="debank"></a> [DeBank](https://debank.com/) is a DeFi dashboard that enables users to track their portfolio, access data and analytics for decentralized lending protocols, stablecoins, margin trading platforms and DEXes. Developers can integrate API end-points including information about users, chains, protocols and tokens in their programmes. ### DefiLlama[​](https://docs-v2.mantle.xyz/devs/dev-guides/tools/monitors#defillama) <a href="#defillama
프로젝트로 돌아가기