parent
ee9177b88e
commit
9a4fa4ffc7
@ -0,0 +1,49 @@ |
|||||||
|
defmodule Explorer.Fetcher do |
||||||
|
alias Explorer.Block |
||||||
|
alias Explorer.Repo |
||||||
|
import Ethereumex.HttpClient, only: [eth_get_block_by_number: 2] |
||||||
|
|
||||||
|
@moduledoc false |
||||||
|
|
||||||
|
def fetch(block) do |
||||||
|
block |
||||||
|
|> download_block |
||||||
|
|> extract_block |
||||||
|
|> validate_block |
||||||
|
|> Repo.insert |
||||||
|
end |
||||||
|
|
||||||
|
def download_block(block_number) do |
||||||
|
{:ok, block} = eth_get_block_by_number(block_number, true) |
||||||
|
block |
||||||
|
end |
||||||
|
|
||||||
|
def extract_block(block) do |
||||||
|
%Block{ |
||||||
|
hash: block["hash"], |
||||||
|
number: block["number"] |> decode_integer_field, |
||||||
|
gas_used: block["gasUsed"] |> decode_integer_field, |
||||||
|
timestamp: block["timestamp"] |> decode_time_field, |
||||||
|
parent_hash: block["parentHash"], |
||||||
|
miner: block["miner"], |
||||||
|
difficulty: block["difficulty"] |> decode_integer_field, |
||||||
|
total_difficulty: block["totalDifficulty"] |> decode_integer_field, |
||||||
|
size: block["size"] |> decode_integer_field, |
||||||
|
gas_limit: block["gasLimit"] |> decode_integer_field, |
||||||
|
nonce: block["nonce"] || "0", |
||||||
|
} |
||||||
|
end |
||||||
|
|
||||||
|
def validate_block(struct) do |
||||||
|
Block.changeset(struct, %{}) |
||||||
|
end |
||||||
|
|
||||||
|
def decode_integer_field(hex) do |
||||||
|
{"0x", base_16} = String.split_at(hex, 2) |
||||||
|
String.to_integer(base_16, 16) |
||||||
|
end |
||||||
|
|
||||||
|
def decode_time_field(field) do |
||||||
|
field |> decode_integer_field |> Timex.from_unix |
||||||
|
end |
||||||
|
end |
@ -0,0 +1,15 @@ |
|||||||
|
defmodule Explorer.LatestBlock do |
||||||
|
alias Explorer.Fetcher |
||||||
|
import Ethereumex.HttpClient, only: [eth_block_number: 0] |
||||||
|
|
||||||
|
@moduledoc false |
||||||
|
|
||||||
|
def fetch do |
||||||
|
get_latest_block() |> Fetcher.fetch |
||||||
|
end |
||||||
|
|
||||||
|
def get_latest_block do |
||||||
|
{:ok, block_number} = eth_block_number() |
||||||
|
block_number |
||||||
|
end |
||||||
|
end |
@ -1,72 +1,12 @@ |
|||||||
defmodule Mix.Tasks.Scrape do |
defmodule Mix.Tasks.Scrape do |
||||||
use Mix.Task |
use Mix.Task |
||||||
alias Explorer.Block |
alias Explorer.LatestBlock |
||||||
alias Explorer.Repo |
|
||||||
import Ethereumex.HttpClient, only: [ |
|
||||||
eth_block_number: 0, |
|
||||||
eth_get_block_by_number: 2 |
|
||||||
] |
|
||||||
|
|
||||||
@shortdoc "Scrape the blockchain." |
@shortdoc "Scrape the blockchain." |
||||||
@moduledoc false |
@moduledoc false |
||||||
|
|
||||||
def run(_) do |
def run(_) do |
||||||
persist() |
|
||||||
end |
|
||||||
|
|
||||||
def persist do |
|
||||||
{:ok, _} = Repo.insert(changeset()) |
|
||||||
end |
|
||||||
|
|
||||||
def changeset do |
|
||||||
Block.changeset(attributes(), %{}) |
|
||||||
end |
|
||||||
|
|
||||||
def attributes do |
|
||||||
%Block{ |
|
||||||
hash: hash(), |
|
||||||
number: number(), |
|
||||||
timestamp: timestamp(), |
|
||||||
gas_used: gas_used(), |
|
||||||
parent_hash: "0x0", |
|
||||||
nonce: "0", |
|
||||||
miner: "0x0", |
|
||||||
difficulty: 0, |
|
||||||
total_difficulty: 0, |
|
||||||
size: 0, |
|
||||||
gas_limit: 0, |
|
||||||
} |
|
||||||
end |
|
||||||
|
|
||||||
def hash do |
|
||||||
latest_block()["hash"] |
|
||||||
end |
|
||||||
|
|
||||||
def number do |
|
||||||
decode_integer_field(latest_block()["number"]) |
|
||||||
end |
|
||||||
|
|
||||||
def timestamp do |
|
||||||
epoch_to_datetime(decode_integer_field(latest_block()["timestamp"])) |
|
||||||
end |
|
||||||
|
|
||||||
def gas_used do |
|
||||||
decode_integer_field(latest_block()["gasUsed"]) |
|
||||||
end |
|
||||||
|
|
||||||
def latest_block do |
|
||||||
Mix.Task.run "app.start" |
Mix.Task.run "app.start" |
||||||
{:ok, latest_block_number} = eth_block_number() |
LatestBlock.fetch() |
||||||
{:ok, latest_block} = eth_get_block_by_number(latest_block_number, true) |
|
||||||
latest_block |
|
||||||
end |
|
||||||
|
|
||||||
def decode_integer_field(field) do |
|
||||||
{"0x", base_16} = String.split_at(field, 2) |
|
||||||
String.to_integer(base_16, 16) |
|
||||||
end |
|
||||||
|
|
||||||
def epoch_to_datetime(epoch) do |
|
||||||
Timex.from_unix(epoch) |
|
||||||
end |
end |
||||||
end |
end |
||||||
|
@ -0,0 +1,91 @@ |
|||||||
|
defmodule Explorer.FetcherTest do |
||||||
|
use Explorer.DataCase |
||||||
|
|
||||||
|
alias Explorer.Block |
||||||
|
alias Explorer.Repo |
||||||
|
alias Explorer.Fetcher |
||||||
|
|
||||||
|
describe "fetch/1" do |
||||||
|
test "the latest block is copied over from the blockchain" do |
||||||
|
use_cassette "fetcher_fetch" do |
||||||
|
Fetcher.fetch("0x89923") |
||||||
|
|
||||||
|
last_block = Block |
||||||
|
|> order_by(desc: :inserted_at) |
||||||
|
|> limit(1) |
||||||
|
|> Repo.all |
||||||
|
|> List.first |
||||||
|
|
||||||
|
assert last_block.number == 563491 |
||||||
|
end |
||||||
|
end |
||||||
|
end |
||||||
|
|
||||||
|
describe "download_block/1" do |
||||||
|
test "returns a block for a given block number" do |
||||||
|
use_cassette "fetcher_download_block" do |
||||||
|
assert Fetcher.download_block("0x89923")["hash"] == "0x342878f5a2c06bc6146f9440910bab9c5ddae5dbd13c9a01d8adaf51ff5593ae" |
||||||
|
end |
||||||
|
end |
||||||
|
end |
||||||
|
|
||||||
|
describe "extract_block/1" do |
||||||
|
def raw_block(nonce \\ %{}) do |
||||||
|
Map.merge(%{ |
||||||
|
"difficulty" => "0xfffffffffffffffffffffffffffffffe", |
||||||
|
"gasLimit" => "0x02", |
||||||
|
"gasUsed" => "0x19522", |
||||||
|
"hash" => "bananas", |
||||||
|
"miner" => "0xdb1207770e0a4258d7a4ce49ab037f92564fea85", |
||||||
|
"number" => "0x7f2fb", |
||||||
|
"parentHash" => "0x70029f66ea5a3b2b1ede95079d95a2ab74b649b5b17cdcf6f29b6317e7c7efa6", |
||||||
|
"size" => "0x10", |
||||||
|
"timestamp" => "0x12", |
||||||
|
"totalDifficulty" => "0xff", |
||||||
|
}, nonce) |
||||||
|
end |
||||||
|
|
||||||
|
test "returns the struct of a block" do |
||||||
|
processed_block = %Block{ |
||||||
|
difficulty: 340282366920938463463374607431768211454, |
||||||
|
gas_limit: 2, |
||||||
|
gas_used: 103714, |
||||||
|
hash: "bananas", |
||||||
|
nonce: "0xfb6e1a62d119228b", |
||||||
|
miner: "0xdb1207770e0a4258d7a4ce49ab037f92564fea85", |
||||||
|
number: 520955, |
||||||
|
parent_hash: "0x70029f66ea5a3b2b1ede95079d95a2ab74b649b5b17cdcf6f29b6317e7c7efa6", |
||||||
|
size: 16, |
||||||
|
timestamp: Timex.parse!("1970-01-01T00:00:18-00:00", "{ISO:Extended}"), |
||||||
|
total_difficulty: 255, |
||||||
|
} |
||||||
|
assert Fetcher.extract_block(raw_block(%{"nonce" => "0xfb6e1a62d119228b"})) == processed_block |
||||||
|
end |
||||||
|
|
||||||
|
test "when there is no nonce" do |
||||||
|
assert Fetcher.extract_block(raw_block()).nonce == "0" |
||||||
|
end |
||||||
|
end |
||||||
|
|
||||||
|
describe "decode_integer_field/1" do |
||||||
|
test "returns the integer value of a hex value" do |
||||||
|
assert(Fetcher.decode_integer_field("0x7f2fb") == 520955) |
||||||
|
end |
||||||
|
end |
||||||
|
|
||||||
|
describe "decode_time_field/1" do |
||||||
|
test "returns the date value of a hex value" do |
||||||
|
the_seventies = Timex.parse!("1970-01-01T00:00:18-00:00", "{ISO:Extended}") |
||||||
|
assert(Fetcher.decode_time_field("0x12") == the_seventies) |
||||||
|
end |
||||||
|
end |
||||||
|
|
||||||
|
describe "validate_block/1" do |
||||||
|
test "returns a valid changeset for an extracted block" do |
||||||
|
use_cassette "fetcher_validate_block" do |
||||||
|
changeset = Fetcher.download_block("0x89923") |> Fetcher.extract_block |> Fetcher.validate_block |
||||||
|
assert(changeset.valid?) |
||||||
|
end |
||||||
|
end |
||||||
|
end |
||||||
|
end |
@ -0,0 +1,31 @@ |
|||||||
|
defmodule Explorer.LatestBlockTest do |
||||||
|
use Explorer.DataCase |
||||||
|
|
||||||
|
alias Explorer.Block |
||||||
|
alias Explorer.Repo |
||||||
|
alias Explorer.LatestBlock |
||||||
|
|
||||||
|
describe "fetch/0" do |
||||||
|
test "the latest block is copied over from the blockchain" do |
||||||
|
use_cassette "latest_block_fetch" do |
||||||
|
LatestBlock.fetch() |
||||||
|
|
||||||
|
last_block = Block |
||||||
|
|> order_by(desc: :inserted_at) |
||||||
|
|> limit(1) |
||||||
|
|> Repo.all |
||||||
|
|> List.first |
||||||
|
|
||||||
|
assert(last_block.number) |
||||||
|
end |
||||||
|
end |
||||||
|
end |
||||||
|
|
||||||
|
describe "get_latest_block/0" do |
||||||
|
test "returns the number of the latest block" do |
||||||
|
use_cassette "fetcher_get_latest_block" do |
||||||
|
assert LatestBlock.get_latest_block() == "0x89923" |
||||||
|
end |
||||||
|
end |
||||||
|
end |
||||||
|
end |
@ -0,0 +1,30 @@ |
|||||||
|
[ |
||||||
|
{ |
||||||
|
"request": { |
||||||
|
"body": "{\"params\":[\"0x89923\",true],\"method\":\"eth_getBlockByNumber\",\"jsonrpc\":\"2.0\",\"id\":0}", |
||||||
|
"headers": { |
||||||
|
"Content-Type": "application/json" |
||||||
|
}, |
||||||
|
"method": "post", |
||||||
|
"options": [], |
||||||
|
"request_body": "", |
||||||
|
"url": "https://sokol.poa.network:443" |
||||||
|
}, |
||||||
|
"response": { |
||||||
|
"binary": false, |
||||||
|
"body": "{\"jsonrpc\":\"2.0\",\"result\":{\"author\":\"0xdb1207770e0a4258d7a4ce49ab037f92564fea85\",\"difficulty\":\"0xfffffffffffffffffffffffffffffffe\",\"extraData\":\"0xd5830108048650617269747986312e32322e31826c69\",\"gasLimit\":\"0x7a1200\",\"gasUsed\":\"0x0\",\"hash\":\"0x342878f5a2c06bc6146f9440910bab9c5ddae5dbd13c9a01d8adaf51ff5593ae\",\"logsBloom\":\"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\",\"miner\":\"0xdb1207770e0a4258d7a4ce49ab037f92564fea85\",\"number\":\"0x89923\",\"parentHash\":\"0x70029f66ea5a3b2b1ede95079d95a2ab74b649b5b17cdcf6f29b6317e7c7efa6\",\"receiptsRoot\":\"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421\",\"sealFields\":[\"0x8412147192\",\"0xb841db669d5b8d22ef69c849a914682c242cde9492cbf1de381d0d4f1857d871963767470f38b1f63031fe47614175609989552ac5e8a6c2844f2d48dfdc48e9df4001\"],\"sha3Uncles\":\"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347\",\"signature\":\"db669d5b8d22ef69c849a914682c242cde9492cbf1de381d0d4f1857d871963767470f38b1f63031fe47614175609989552ac5e8a6c2844f2d48dfdc48e9df4001\",\"size\":\"0x243\",\"stateRoot\":\"0x1ce8bea4dc0a87b99af15a65bb79980cb337e5bf4d1f5ad7d2d263572d177f1a\",\"step\":\"303329682\",\"timestamp\":\"0x5a6637da\",\"totalDifficulty\":\"0x89922ffffffffffffffffffffffffede4f54b\",\"transactions\":[],\"transactionsRoot\":\"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421\",\"uncles\":[]},\"id\":0}\n", |
||||||
|
"headers": { |
||||||
|
"Date": "Tue, 23 Jan 2018 00:39:56 GMT", |
||||||
|
"Content-Type": "application/json", |
||||||
|
"Transfer-Encoding": "chunked", |
||||||
|
"Connection": "keep-alive", |
||||||
|
"Set-Cookie": "__cfduid=da35df504d925fe5d76380c5a13de56671516667996; expires=Wed, 23-Jan-19 00:39:56 GMT; path=/; domain=.poa.network; HttpOnly; Secure", |
||||||
|
"Expect-CT": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", |
||||||
|
"Server": "cloudflare", |
||||||
|
"CF-RAY": "3e16b2e0dd9c93ae-SJC" |
||||||
|
}, |
||||||
|
"status_code": 200, |
||||||
|
"type": "ok" |
||||||
|
} |
||||||
|
} |
||||||
|
] |
@ -0,0 +1,30 @@ |
|||||||
|
[ |
||||||
|
{ |
||||||
|
"request": { |
||||||
|
"body": "{\"params\":[\"0x89923\",true],\"method\":\"eth_getBlockByNumber\",\"jsonrpc\":\"2.0\",\"id\":0}", |
||||||
|
"headers": { |
||||||
|
"Content-Type": "application/json" |
||||||
|
}, |
||||||
|
"method": "post", |
||||||
|
"options": [], |
||||||
|
"request_body": "", |
||||||
|
"url": "https://sokol.poa.network:443" |
||||||
|
}, |
||||||
|
"response": { |
||||||
|
"binary": false, |
||||||
|
"body": "{\"jsonrpc\":\"2.0\",\"result\":{\"author\":\"0xdb1207770e0a4258d7a4ce49ab037f92564fea85\",\"difficulty\":\"0xfffffffffffffffffffffffffffffffe\",\"extraData\":\"0xd5830108048650617269747986312e32322e31826c69\",\"gasLimit\":\"0x7a1200\",\"gasUsed\":\"0x0\",\"hash\":\"0x342878f5a2c06bc6146f9440910bab9c5ddae5dbd13c9a01d8adaf51ff5593ae\",\"logsBloom\":\"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\",\"miner\":\"0xdb1207770e0a4258d7a4ce49ab037f92564fea85\",\"number\":\"0x89923\",\"parentHash\":\"0x70029f66ea5a3b2b1ede95079d95a2ab74b649b5b17cdcf6f29b6317e7c7efa6\",\"receiptsRoot\":\"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421\",\"sealFields\":[\"0x8412147192\",\"0xb841db669d5b8d22ef69c849a914682c242cde9492cbf1de381d0d4f1857d871963767470f38b1f63031fe47614175609989552ac5e8a6c2844f2d48dfdc48e9df4001\"],\"sha3Uncles\":\"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347\",\"signature\":\"db669d5b8d22ef69c849a914682c242cde9492cbf1de381d0d4f1857d871963767470f38b1f63031fe47614175609989552ac5e8a6c2844f2d48dfdc48e9df4001\",\"size\":\"0x243\",\"stateRoot\":\"0x1ce8bea4dc0a87b99af15a65bb79980cb337e5bf4d1f5ad7d2d263572d177f1a\",\"step\":\"303329682\",\"timestamp\":\"0x5a6637da\",\"totalDifficulty\":\"0x89922ffffffffffffffffffffffffede4f54b\",\"transactions\":[],\"transactionsRoot\":\"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421\",\"uncles\":[]},\"id\":0}\n", |
||||||
|
"headers": { |
||||||
|
"Date": "Mon, 22 Jan 2018 19:14:51 GMT", |
||||||
|
"Content-Type": "application/json", |
||||||
|
"Transfer-Encoding": "chunked", |
||||||
|
"Connection": "keep-alive", |
||||||
|
"Set-Cookie": "__cfduid=d6d7bf13bce28ec88dc130f482acb91ab1516648491; expires=Tue, 22-Jan-19 19:14:51 GMT; path=/; domain=.poa.network; HttpOnly; Secure", |
||||||
|
"Expect-CT": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", |
||||||
|
"Server": "cloudflare", |
||||||
|
"CF-RAY": "3e14d6ad693128be-SJC" |
||||||
|
}, |
||||||
|
"status_code": 200, |
||||||
|
"type": "ok" |
||||||
|
} |
||||||
|
} |
||||||
|
] |
@ -0,0 +1,30 @@ |
|||||||
|
[ |
||||||
|
{ |
||||||
|
"request": { |
||||||
|
"body": "{\"params\":[\"0x89923\",true],\"method\":\"eth_getBlockByNumber\",\"jsonrpc\":\"2.0\",\"id\":0}", |
||||||
|
"headers": { |
||||||
|
"Content-Type": "application/json" |
||||||
|
}, |
||||||
|
"method": "post", |
||||||
|
"options": [], |
||||||
|
"request_body": "", |
||||||
|
"url": "https://sokol.poa.network:443" |
||||||
|
}, |
||||||
|
"response": { |
||||||
|
"binary": false, |
||||||
|
"body": "{\"jsonrpc\":\"2.0\",\"result\":{\"author\":\"0xdb1207770e0a4258d7a4ce49ab037f92564fea85\",\"difficulty\":\"0xfffffffffffffffffffffffffffffffe\",\"extraData\":\"0xd5830108048650617269747986312e32322e31826c69\",\"gasLimit\":\"0x7a1200\",\"gasUsed\":\"0x0\",\"hash\":\"0x342878f5a2c06bc6146f9440910bab9c5ddae5dbd13c9a01d8adaf51ff5593ae\",\"logsBloom\":\"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\",\"miner\":\"0xdb1207770e0a4258d7a4ce49ab037f92564fea85\",\"number\":\"0x89923\",\"parentHash\":\"0x70029f66ea5a3b2b1ede95079d95a2ab74b649b5b17cdcf6f29b6317e7c7efa6\",\"receiptsRoot\":\"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421\",\"sealFields\":[\"0x8412147192\",\"0xb841db669d5b8d22ef69c849a914682c242cde9492cbf1de381d0d4f1857d871963767470f38b1f63031fe47614175609989552ac5e8a6c2844f2d48dfdc48e9df4001\"],\"sha3Uncles\":\"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347\",\"signature\":\"db669d5b8d22ef69c849a914682c242cde9492cbf1de381d0d4f1857d871963767470f38b1f63031fe47614175609989552ac5e8a6c2844f2d48dfdc48e9df4001\",\"size\":\"0x243\",\"stateRoot\":\"0x1ce8bea4dc0a87b99af15a65bb79980cb337e5bf4d1f5ad7d2d263572d177f1a\",\"step\":\"303329682\",\"timestamp\":\"0x5a6637da\",\"totalDifficulty\":\"0x89922ffffffffffffffffffffffffede4f54b\",\"transactions\":[],\"transactionsRoot\":\"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421\",\"uncles\":[]},\"id\":0}\n", |
||||||
|
"headers": { |
||||||
|
"Date": "Mon, 22 Jan 2018 19:14:51 GMT", |
||||||
|
"Content-Type": "application/json", |
||||||
|
"Transfer-Encoding": "chunked", |
||||||
|
"Connection": "keep-alive", |
||||||
|
"Set-Cookie": "__cfduid=d6d7bf13bce28ec88dc130f482acb91ab1516648491; expires=Tue, 22-Jan-19 19:14:51 GMT; path=/; domain=.poa.network; HttpOnly; Secure", |
||||||
|
"Expect-CT": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", |
||||||
|
"Server": "cloudflare", |
||||||
|
"CF-RAY": "3e14d6ad693128be-SJC" |
||||||
|
}, |
||||||
|
"status_code": 200, |
||||||
|
"type": "ok" |
||||||
|
} |
||||||
|
} |
||||||
|
] |
@ -0,0 +1,30 @@ |
|||||||
|
[ |
||||||
|
{ |
||||||
|
"request": { |
||||||
|
"body": "{\"params\":[],\"method\":\"eth_blockNumber\",\"jsonrpc\":\"2.0\",\"id\":0}", |
||||||
|
"headers": { |
||||||
|
"Content-Type": "application/json" |
||||||
|
}, |
||||||
|
"method": "post", |
||||||
|
"options": [], |
||||||
|
"request_body": "", |
||||||
|
"url": "https://sokol.poa.network:443" |
||||||
|
}, |
||||||
|
"response": { |
||||||
|
"binary": false, |
||||||
|
"body": "{\"jsonrpc\":\"2.0\",\"result\":\"0x89923\",\"id\":0}\n", |
||||||
|
"headers": { |
||||||
|
"Date": "Mon, 22 Jan 2018 19:13:30 GMT", |
||||||
|
"Content-Type": "application/json", |
||||||
|
"Transfer-Encoding": "chunked", |
||||||
|
"Connection": "keep-alive", |
||||||
|
"Set-Cookie": "__cfduid=d5537ec24d731578ee1e6c5d48a0d252d1516648410; expires=Tue, 22-Jan-19 19:13:30 GMT; path=/; domain=.poa.network; HttpOnly; Secure", |
||||||
|
"Expect-CT": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", |
||||||
|
"Server": "cloudflare", |
||||||
|
"CF-RAY": "3e14d4b5ce139607-SJC" |
||||||
|
}, |
||||||
|
"status_code": 200, |
||||||
|
"type": "ok" |
||||||
|
} |
||||||
|
} |
||||||
|
] |
@ -0,0 +1,30 @@ |
|||||||
|
[ |
||||||
|
{ |
||||||
|
"request": { |
||||||
|
"body": "{\"params\":[\"0x89923\",true],\"method\":\"eth_getBlockByNumber\",\"jsonrpc\":\"2.0\",\"id\":0}", |
||||||
|
"headers": { |
||||||
|
"Content-Type": "application/json" |
||||||
|
}, |
||||||
|
"method": "post", |
||||||
|
"options": [], |
||||||
|
"request_body": "", |
||||||
|
"url": "https://sokol.poa.network:443" |
||||||
|
}, |
||||||
|
"response": { |
||||||
|
"binary": false, |
||||||
|
"body": "{\"jsonrpc\":\"2.0\",\"result\":{\"author\":\"0xdb1207770e0a4258d7a4ce49ab037f92564fea85\",\"difficulty\":\"0xfffffffffffffffffffffffffffffffe\",\"extraData\":\"0xd5830108048650617269747986312e32322e31826c69\",\"gasLimit\":\"0x7a1200\",\"gasUsed\":\"0x0\",\"hash\":\"0x342878f5a2c06bc6146f9440910bab9c5ddae5dbd13c9a01d8adaf51ff5593ae\",\"logsBloom\":\"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\",\"miner\":\"0xdb1207770e0a4258d7a4ce49ab037f92564fea85\",\"number\":\"0x89923\",\"parentHash\":\"0x70029f66ea5a3b2b1ede95079d95a2ab74b649b5b17cdcf6f29b6317e7c7efa6\",\"receiptsRoot\":\"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421\",\"sealFields\":[\"0x8412147192\",\"0xb841db669d5b8d22ef69c849a914682c242cde9492cbf1de381d0d4f1857d871963767470f38b1f63031fe47614175609989552ac5e8a6c2844f2d48dfdc48e9df4001\"],\"sha3Uncles\":\"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347\",\"signature\":\"db669d5b8d22ef69c849a914682c242cde9492cbf1de381d0d4f1857d871963767470f38b1f63031fe47614175609989552ac5e8a6c2844f2d48dfdc48e9df4001\",\"size\":\"0x243\",\"stateRoot\":\"0x1ce8bea4dc0a87b99af15a65bb79980cb337e5bf4d1f5ad7d2d263572d177f1a\",\"step\":\"303329682\",\"timestamp\":\"0x5a6637da\",\"totalDifficulty\":\"0x89922ffffffffffffffffffffffffede4f54b\",\"transactions\":[],\"transactionsRoot\":\"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421\",\"uncles\":[]},\"id\":0}\n", |
||||||
|
"headers": { |
||||||
|
"Date": "Mon, 22 Jan 2018 19:14:51 GMT", |
||||||
|
"Content-Type": "application/json", |
||||||
|
"Transfer-Encoding": "chunked", |
||||||
|
"Connection": "keep-alive", |
||||||
|
"Set-Cookie": "__cfduid=d6d7bf13bce28ec88dc130f482acb91ab1516648491; expires=Tue, 22-Jan-19 19:14:51 GMT; path=/; domain=.poa.network; HttpOnly; Secure", |
||||||
|
"Expect-CT": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", |
||||||
|
"Server": "cloudflare", |
||||||
|
"CF-RAY": "3e14d6ad693128be-SJC" |
||||||
|
}, |
||||||
|
"status_code": 200, |
||||||
|
"type": "ok" |
||||||
|
} |
||||||
|
} |
||||||
|
] |
@ -0,0 +1,58 @@ |
|||||||
|
[ |
||||||
|
{ |
||||||
|
"request": { |
||||||
|
"body": "{\"params\":[],\"method\":\"eth_blockNumber\",\"jsonrpc\":\"2.0\",\"id\":0}", |
||||||
|
"headers": { |
||||||
|
"Content-Type": "application/json" |
||||||
|
}, |
||||||
|
"method": "post", |
||||||
|
"options": [], |
||||||
|
"request_body": "", |
||||||
|
"url": "https://sokol.poa.network:443" |
||||||
|
}, |
||||||
|
"response": { |
||||||
|
"binary": false, |
||||||
|
"body": "{\"jsonrpc\":\"2.0\",\"result\":\"0x89923\",\"id\":0}\n", |
||||||
|
"headers": { |
||||||
|
"Date": "Mon, 22 Jan 2018 19:13:30 GMT", |
||||||
|
"Content-Type": "application/json", |
||||||
|
"Transfer-Encoding": "chunked", |
||||||
|
"Connection": "keep-alive", |
||||||
|
"Set-Cookie": "__cfduid=d5537ec24d731578ee1e6c5d48a0d252d1516648410; expires=Tue, 22-Jan-19 19:13:30 GMT; path=/; domain=.poa.network; HttpOnly; Secure", |
||||||
|
"Expect-CT": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", |
||||||
|
"Server": "cloudflare", |
||||||
|
"CF-RAY": "3e14d4b5ce139607-SJC" |
||||||
|
}, |
||||||
|
"status_code": 200, |
||||||
|
"type": "ok" |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
"request": { |
||||||
|
"body": "{\"params\":[\"0x89923\",true],\"method\":\"eth_getBlockByNumber\",\"jsonrpc\":\"2.0\",\"id\":0}", |
||||||
|
"headers": { |
||||||
|
"Content-Type": "application/json" |
||||||
|
}, |
||||||
|
"method": "post", |
||||||
|
"options": [], |
||||||
|
"request_body": "", |
||||||
|
"url": "https://sokol.poa.network:443" |
||||||
|
}, |
||||||
|
"response": { |
||||||
|
"binary": false, |
||||||
|
"body": "{\"jsonrpc\":\"2.0\",\"result\":{\"author\":\"0xdb1207770e0a4258d7a4ce49ab037f92564fea85\",\"difficulty\":\"0xfffffffffffffffffffffffffffffffe\",\"extraData\":\"0xd5830108048650617269747986312e32322e31826c69\",\"gasLimit\":\"0x7a1200\",\"gasUsed\":\"0x0\",\"hash\":\"0x342878f5a2c06bc6146f9440910bab9c5ddae5dbd13c9a01d8adaf51ff5593ae\",\"logsBloom\":\"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\",\"miner\":\"0xdb1207770e0a4258d7a4ce49ab037f92564fea85\",\"number\":\"0x89923\",\"parentHash\":\"0x70029f66ea5a3b2b1ede95079d95a2ab74b649b5b17cdcf6f29b6317e7c7efa6\",\"receiptsRoot\":\"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421\",\"sealFields\":[\"0x8412147192\",\"0xb841db669d5b8d22ef69c849a914682c242cde9492cbf1de381d0d4f1857d871963767470f38b1f63031fe47614175609989552ac5e8a6c2844f2d48dfdc48e9df4001\"],\"sha3Uncles\":\"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347\",\"signature\":\"db669d5b8d22ef69c849a914682c242cde9492cbf1de381d0d4f1857d871963767470f38b1f63031fe47614175609989552ac5e8a6c2844f2d48dfdc48e9df4001\",\"size\":\"0x243\",\"stateRoot\":\"0x1ce8bea4dc0a87b99af15a65bb79980cb337e5bf4d1f5ad7d2d263572d177f1a\",\"step\":\"303329682\",\"timestamp\":\"0x5a6637da\",\"totalDifficulty\":\"0x89922ffffffffffffffffffffffffede4f54b\",\"transactions\":[],\"transactionsRoot\":\"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421\",\"uncles\":[]},\"id\":0}\n", |
||||||
|
"headers": { |
||||||
|
"Date": "Mon, 22 Jan 2018 19:14:51 GMT", |
||||||
|
"Content-Type": "application/json", |
||||||
|
"Transfer-Encoding": "chunked", |
||||||
|
"Connection": "keep-alive", |
||||||
|
"Set-Cookie": "__cfduid=d6d7bf13bce28ec88dc130f482acb91ab1516648491; expires=Tue, 22-Jan-19 19:14:51 GMT; path=/; domain=.poa.network; HttpOnly; Secure", |
||||||
|
"Expect-CT": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", |
||||||
|
"Server": "cloudflare", |
||||||
|
"CF-RAY": "3e14d6ad693128be-SJC" |
||||||
|
}, |
||||||
|
"status_code": 200, |
||||||
|
"type": "ok" |
||||||
|
} |
||||||
|
} |
||||||
|
] |
@ -0,0 +1,58 @@ |
|||||||
|
[ |
||||||
|
{ |
||||||
|
"request": { |
||||||
|
"body": "{\"params\":[],\"method\":\"eth_blockNumber\",\"jsonrpc\":\"2.0\",\"id\":0}", |
||||||
|
"headers": { |
||||||
|
"Content-Type": "application/json" |
||||||
|
}, |
||||||
|
"method": "post", |
||||||
|
"options": [], |
||||||
|
"request_body": "", |
||||||
|
"url": "https://sokol.poa.network:443" |
||||||
|
}, |
||||||
|
"response": { |
||||||
|
"binary": false, |
||||||
|
"body": "{\"jsonrpc\":\"2.0\",\"result\":\"0x89923\",\"id\":0}\n", |
||||||
|
"headers": { |
||||||
|
"Date": "Mon, 22 Jan 2018 19:13:30 GMT", |
||||||
|
"Content-Type": "application/json", |
||||||
|
"Transfer-Encoding": "chunked", |
||||||
|
"Connection": "keep-alive", |
||||||
|
"Set-Cookie": "__cfduid=d5537ec24d731578ee1e6c5d48a0d252d1516648410; expires=Tue, 22-Jan-19 19:13:30 GMT; path=/; domain=.poa.network; HttpOnly; Secure", |
||||||
|
"Expect-CT": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", |
||||||
|
"Server": "cloudflare", |
||||||
|
"CF-RAY": "3e14d4b5ce139607-SJC" |
||||||
|
}, |
||||||
|
"status_code": 200, |
||||||
|
"type": "ok" |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
"request": { |
||||||
|
"body": "{\"params\":[\"0x89923\",true],\"method\":\"eth_getBlockByNumber\",\"jsonrpc\":\"2.0\",\"id\":0}", |
||||||
|
"headers": { |
||||||
|
"Content-Type": "application/json" |
||||||
|
}, |
||||||
|
"method": "post", |
||||||
|
"options": [], |
||||||
|
"request_body": "", |
||||||
|
"url": "https://sokol.poa.network:443" |
||||||
|
}, |
||||||
|
"response": { |
||||||
|
"binary": false, |
||||||
|
"body": "{\"jsonrpc\":\"2.0\",\"result\":{\"author\":\"0xdb1207770e0a4258d7a4ce49ab037f92564fea85\",\"difficulty\":\"0xfffffffffffffffffffffffffffffffe\",\"extraData\":\"0xd5830108048650617269747986312e32322e31826c69\",\"gasLimit\":\"0x7a1200\",\"gasUsed\":\"0x0\",\"hash\":\"0x342878f5a2c06bc6146f9440910bab9c5ddae5dbd13c9a01d8adaf51ff5593ae\",\"logsBloom\":\"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\",\"miner\":\"0xdb1207770e0a4258d7a4ce49ab037f92564fea85\",\"number\":\"0x89923\",\"parentHash\":\"0x70029f66ea5a3b2b1ede95079d95a2ab74b649b5b17cdcf6f29b6317e7c7efa6\",\"receiptsRoot\":\"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421\",\"sealFields\":[\"0x8412147192\",\"0xb841db669d5b8d22ef69c849a914682c242cde9492cbf1de381d0d4f1857d871963767470f38b1f63031fe47614175609989552ac5e8a6c2844f2d48dfdc48e9df4001\"],\"sha3Uncles\":\"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347\",\"signature\":\"db669d5b8d22ef69c849a914682c242cde9492cbf1de381d0d4f1857d871963767470f38b1f63031fe47614175609989552ac5e8a6c2844f2d48dfdc48e9df4001\",\"size\":\"0x243\",\"stateRoot\":\"0x1ce8bea4dc0a87b99af15a65bb79980cb337e5bf4d1f5ad7d2d263572d177f1a\",\"step\":\"303329682\",\"timestamp\":\"0x5a6637da\",\"totalDifficulty\":\"0x89922ffffffffffffffffffffffffede4f54b\",\"transactions\":[],\"transactionsRoot\":\"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421\",\"uncles\":[]},\"id\":0}\n", |
||||||
|
"headers": { |
||||||
|
"Date": "Mon, 22 Jan 2018 19:14:51 GMT", |
||||||
|
"Content-Type": "application/json", |
||||||
|
"Transfer-Encoding": "chunked", |
||||||
|
"Connection": "keep-alive", |
||||||
|
"Set-Cookie": "__cfduid=d6d7bf13bce28ec88dc130f482acb91ab1516648491; expires=Tue, 22-Jan-19 19:14:51 GMT; path=/; domain=.poa.network; HttpOnly; Secure", |
||||||
|
"Expect-CT": "max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"", |
||||||
|
"Server": "cloudflare", |
||||||
|
"CF-RAY": "3e14d6ad693128be-SJC" |
||||||
|
}, |
||||||
|
"status_code": 200, |
||||||
|
"type": "ok" |
||||||
|
} |
||||||
|
} |
||||||
|
] |
Loading…
Reference in new issue