developers.cloudflare.com
Open in
urlscan Pro
104.16.2.189
Public Scan
Submitted URL: https://base-gateway.rizkyoktan.my.id/
Effective URL: https://developers.cloudflare.com/web3/how-to/use-ethereum-gateway/
Submission: On December 13 via automatic, source certstream-suspicious — Scanned from US
Effective URL: https://developers.cloudflare.com/web3/how-to/use-ethereum-gateway/
Submission: On December 13 via automatic, source certstream-suspicious — Scanned from US
Form analysis
4 forms found in the DOM<form class="astro-x6kpz2mu">
<fieldset class="astro-x6kpz2mu">
<div class="astro-x6kpz2mu"> <input type="radio" id="accurate" value="accurate" name="reason" class="astro-x6kpz2mu"> <label for="accurate" class="astro-x6kpz2mu">Accurate</label> </div>
<div class="astro-x6kpz2mu"> <input type="radio" id="easy-to-understand" value="easy-to-understand" name="reason" class="astro-x6kpz2mu"> <label for="easy-to-understand" class="astro-x6kpz2mu">Easy to understand</label> </div>
<div class="astro-x6kpz2mu"> <input type="radio" id="solved-my-problem" value="solved-my-problem" name="reason" class="astro-x6kpz2mu"> <label for="solved-my-problem" class="astro-x6kpz2mu">Solved my problem</label> </div>
<div class="astro-x6kpz2mu"> <input type="radio" id="helped-me-decide-to-use-the-product" value="solved-my-problem" name="reason" class="astro-x6kpz2mu"> <label for="helped-me-decide-to-use-the-product" class="astro-x6kpz2mu">Helped me decide to
use the product</label> </div>
<div class="astro-x6kpz2mu"> <input type="radio" id="other-yes" value="other" name="reason" class="astro-x6kpz2mu"> <label for="other-yes" class="astro-x6kpz2mu">Other</label> </div>
<div class="astro-x6kpz2mu"> <input type="text" placeholder="Tell us more about your experience." id="info" name="info" class="astro-x6kpz2mu"> </div> <input type="submit" value="Submit" class="astro-x6kpz2mu">
</fieldset>
</form>
<form class="astro-x6kpz2mu">
<fieldset class="astro-x6kpz2mu">
<div class="astro-x6kpz2mu"> <input type="radio" id="hard-to-understand" value="hard-to-understand" name="reason" class="astro-x6kpz2mu"> <label for="hard-to-understand" class="astro-x6kpz2mu">Hard to understand</label> </div>
<div class="astro-x6kpz2mu"> <input type="radio" id="incorrect-information" value="incorrect-information" name="reason" class="astro-x6kpz2mu"> <label for="incorrect-information" class="astro-x6kpz2mu">Incorrect information</label> </div>
<div class="astro-x6kpz2mu"> <input type="radio" id="missing-the-information" value="missing-the-information" name="reason" class="astro-x6kpz2mu"> <label for="missing-the-information" class="astro-x6kpz2mu">Missing the information</label> </div>
<div class="astro-x6kpz2mu"> <input type="radio" id="other-no" value="other" name="reason" class="astro-x6kpz2mu"> <label for="other-no" class="astro-x6kpz2mu">Other</label> </div>
<div class="astro-x6kpz2mu"> <input type="text" placeholder="Tell us more about your experience." id="info" name="info" class="astro-x6kpz2mu"> </div> <input type="submit" value="Submit" class="astro-x6kpz2mu">
</fieldset>
</form>
<form class="astro-x6kpz2mu">
<fieldset class="astro-x6kpz2mu">
<div class="astro-x6kpz2mu"> <input type="radio" id="accurate" value="accurate" name="reason" class="astro-x6kpz2mu"> <label for="accurate" class="astro-x6kpz2mu">Accurate</label> </div>
<div class="astro-x6kpz2mu"> <input type="radio" id="easy-to-understand" value="easy-to-understand" name="reason" class="astro-x6kpz2mu"> <label for="easy-to-understand" class="astro-x6kpz2mu">Easy to understand</label> </div>
<div class="astro-x6kpz2mu"> <input type="radio" id="solved-my-problem" value="solved-my-problem" name="reason" class="astro-x6kpz2mu"> <label for="solved-my-problem" class="astro-x6kpz2mu">Solved my problem</label> </div>
<div class="astro-x6kpz2mu"> <input type="radio" id="helped-me-decide-to-use-the-product" value="solved-my-problem" name="reason" class="astro-x6kpz2mu"> <label for="helped-me-decide-to-use-the-product" class="astro-x6kpz2mu">Helped me decide to
use the product</label> </div>
<div class="astro-x6kpz2mu"> <input type="radio" id="other-yes" value="other" name="reason" class="astro-x6kpz2mu"> <label for="other-yes" class="astro-x6kpz2mu">Other</label> </div>
<div class="astro-x6kpz2mu"> <input type="text" placeholder="Tell us more about your experience." id="info" name="info" class="astro-x6kpz2mu"> </div> <input type="submit" value="Submit" class="astro-x6kpz2mu">
</fieldset>
</form>
<form class="astro-x6kpz2mu">
<fieldset class="astro-x6kpz2mu">
<div class="astro-x6kpz2mu"> <input type="radio" id="hard-to-understand" value="hard-to-understand" name="reason" class="astro-x6kpz2mu"> <label for="hard-to-understand" class="astro-x6kpz2mu">Hard to understand</label> </div>
<div class="astro-x6kpz2mu"> <input type="radio" id="incorrect-information" value="incorrect-information" name="reason" class="astro-x6kpz2mu"> <label for="incorrect-information" class="astro-x6kpz2mu">Incorrect information</label> </div>
<div class="astro-x6kpz2mu"> <input type="radio" id="missing-the-information" value="missing-the-information" name="reason" class="astro-x6kpz2mu"> <label for="missing-the-information" class="astro-x6kpz2mu">Missing the information</label> </div>
<div class="astro-x6kpz2mu"> <input type="radio" id="other-no" value="other" name="reason" class="astro-x6kpz2mu"> <label for="other-no" class="astro-x6kpz2mu">Other</label> </div>
<div class="astro-x6kpz2mu"> <input type="text" placeholder="Tell us more about your experience." id="info" name="info" class="astro-x6kpz2mu"> </div> <input type="submit" value="Submit" class="astro-x6kpz2mu">
</fieldset>
</form>
Text Content
Skip to content Cloudflare Docs SearchK Products Learning Status Support Log in GitHub X YouTube Select theme DarkLightAuto Web3 * Overview * About * Get started * How to * Overview * Manage gateways * Subscribe to gateways * Use Ethereum gateway * Use IPFS gateway * Customize Cloudflare settings * Restrict gateway access * IPFS Gateway * Overview * Concepts * Overview * Interplanetary File System (IPFS) * DNSLink gateways * Universal Path gateway * Reference * Overview * Peering * Using IPFS with your website * Automated deployments * Troubleshooting * Ethereum Gateway * Overview * Concepts * Overview * Ethereum network * Node types * Reference * Overview * Supported API methods * Supported networks * Rinkeby deprecation * Kill Switches * Reference * Overview * Gateway DNS records * Gateway status * Legacy gateway migration * Limits * API reference ↗ API Products Learning Status Support Log in GitHub X YouTube Select theme DarkLightAuto On this page Overview * Overview * Read from the network * Write to the network ON THIS PAGE * Overview * Read from the network * Write to the network WAS THIS HELPFUL? Yes No WHAT DID YOU LIKE? Accurate Easy to understand Solved my problem Helped me decide to use the product Other WHAT WENT WRONG? Hard to understand Incorrect information Missing the information Other THANK YOU FOR HELPING IMPROVE CLOUDFLARE'S DOCUMENTATION! 1. Products 2. … 3. Web3 4. How to 5. Use Ethereum gateway USE ETHEREUM GATEWAY Once you have an Ethereum gateway — meaning that you create a new gateway with a target of Ethereum — you can interact with different Ethereum networks by specifying the correct JSON blob for your query. READ FROM THE NETWORK The Cloudflare Ethereum Gateway allows HTTP requests where the body of the request is set to be the JSON body of the request you would like to make. For example, if you would like to read the block that is at number 0x2244, then your JSON blob takes the form: { "jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x2244", true], "id": 1 } Each blob use a valid method parameter. The params array here contains the block number that we would like to locate and a boolean expressing whether each individual transaction in the block should be shown in their entirety (true) or as stubs (false). To send this query to your custom Ethereum Gateway, you could use a cURL command: Terminal window curl https://web3-trial.cloudflare-eth.com/v1/mainnet -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0x2244", true],"id":1}' You can also write the same query using the JS Fetch API: await fetch( new Request("https://web3-trial.cloudflare-eth.com/v1/mainnet", { method: "POST", body: JSON.stringify({ jsonrpc: "2.0", method: "eth_getBlockByNumber", params: ["0x2244", true], id: 1, }), headers: { "Content-Type": "application/json", }, }), ).then((resp) => { return resp.json(); }); The response in both cases will be a JSON blob of the form: { "jsonrpc": "2.0", "id": 1, "result": { "difficulty": "0x746ef15b66", "extraData": "0x476574682f76312e302e302f6c696e75782f676f312e342e32", "gasLimit": "0x1388", "gasUsed": "0x0", "hash": "0xd6bb42034740c5d728e774e43a01f26222e0fcc279c504ca5963dc34fe70f392", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "miner": "0xf927a40c8b7f6e07c5af7fa2155b4864a4112b13", "mixHash": "0x975da446e302e6da6cedb3fbaa763c3c203ae88d6fab4924e2a3d34a568c4361", "nonce": "0x88a7f12f49151c83", "number": "0x2244", "parentHash": "0x067fd84ecdbc7491bf5ec7d5d4ead361b1f590eec74797a7f90b4a7d7004a48d", "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "size": "0x21b", "stateRoot": "0x828dade2067283e370993ec6a1bda0e65c1310e404a6d5bbb030b596eb80017c", "timestamp": "0x55bb040f", "totalDifficulty": "0x5c328da43525d", "transactions": [], "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncles": [] } } WRITE TO THE NETWORK Currently, the Ethereum Gateway allows you to write to the network using the eth_sendRawTransaction RPC method. This creates a new message call transaction or a contract creation for signed transactions. The transactions are signed using a secret key corresponding to your own Ethereum wallet ↗. Once you have a wallet set up and a method of signing your own transactions, you can write that transaction to the Ethereum network via the Cloudflare Ethereum Gateway. Signed transactions use hexadecimal strings of the form: "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675" Then you can use your custom Gateway to send the transaction to the network with a cURL command: Terminal window curl https://web3-trial.cloudflare-eth.com/v1/mainnet -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"eth_sendRawTransaction","params":["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"],"id":1}' You could also use a JS Fetch API request: await fetch( new Request("https://web3-trial.cloudflare-eth.com/v1/mainnet", { method: "POST", body: JSON.stringify({ jsonrpc: "2.0", method: "eth_sendRawTransaction", params: [ "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675", ], id: 1, }), headers: { "Content-Type": "application/json", }, }), ).then((resp) => { return resp.json(); }); (The actual command above will not work — you need to provide your own signed transaction.) WAS THIS HELPFUL? Yes No WHAT DID YOU LIKE? Accurate Easy to understand Solved my problem Helped me decide to use the product Other WHAT WENT WRONG? Hard to understand Incorrect information Missing the information Other THANK YOU FOR HELPING IMPROVE CLOUDFLARE'S DOCUMENTATION! Edit page Cloudflare DashboardDiscordCommunityLearning CenterSupport Portal Your Privacy Choices