Skip to content

Commit

Permalink
Add example 'request' and 'request_cost' calls to 'scripts/local'
Browse files Browse the repository at this point in the history
  • Loading branch information
rvanasa committed Sep 14, 2023
1 parent bb30a8f commit f83187c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions scripts/local
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@ dfx deploy ic_eth --mode reinstall -y
dfx canister call ic_eth authorize "(principal \"$PRINCIPAL\", variant { RegisterProvider })"

dfx canister call ic_eth register_provider '(record {base_url = "https://cloudflare-eth.com"; credential_path = "/v1/mainnet"; chain_id = 1; cycles_per_call = 1000; cycles_per_message_byte = 100})'

dfx canister call ic_eth request_cost '("https://cloudflare-eth.com", "{ \"jsonrpc\": \"2.0\", \"method\": \"eth_getBlockByNumber\", \"params\": [\"0x2244\", true], \"id\": 1 }", 1000)'
dfx canister call ic_eth request '("https://cloudflare-eth.com", "{ \"jsonrpc\": \"2.0\", \"method\": \"eth_getBlockByNumber\", \"params\": [\"0x2244\", true], \"id\": 1 }", 1000)'

dfx canister call ic_eth provider_request_cost '(0, "{ \"jsonrpc\": \"2.0\", \"method\": \"eth_getBlockByNumber\", \"params\": [\"0x2244\", true], \"id\": 1 }", 1000)'
dfx canister call ic_eth provider_request '(0, "{ \"jsonrpc\": \"2.0\", \"method\": \"eth_getBlockByNumber\", \"params\": [\"0x2244\", true], \"id\": 1 }", 1000)'

0 comments on commit f83187c

Please sign in to comment.