Module: TezosClient::ClientInterface::Misc

Included in:
TezosClient::ClientInterface
Defined in:
lib/tezos_client/client_interface/misc.rb

Instance Method Summary collapse

Instance Method Details

#bootstrappedObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/tezos_client/client_interface/misc.rb', line 9

def bootstrapped
  call_client("bootstrapped") do |output|
    output_format = /Current head: ([^ ]+) \(timestamp: ([^,]+), validation: (.+)\)/
    res = output_format.match(output)
    head = res[1]
    timestamp = DateTime.parse(res[2])
    validation = DateTime.parse(res[3])

    {
        "block" => head,
        "timestamp" => timestamp,
        "validated_at" => validation
    }
  end
end