This repository has been archived by the owner on Mar 14, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
125 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// ChainInfo.swift | ||
// CKB | ||
// | ||
// Created by James Chen on 2019/05/09. | ||
// Copyright © 2019 Nervos Foundation. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
public struct ChainInfo: Codable { | ||
public let chain: String | ||
public let medianTime: Timestamp | ||
public let epoch: EpochNumber | ||
public let difficulty: UInt256 | ||
public let isInitialBlockDownload: Bool | ||
public let warnings: String | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case chain | ||
case medianTime = "median_time" | ||
case epoch | ||
case difficulty | ||
case isInitialBlockDownload = "is_initial_block_download" | ||
case warnings | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// | ||
// PeerState.swift | ||
// CKB | ||
// | ||
// Created by James Chen on 2019/05/09. | ||
// Copyright © 2019 Nervos Foundation. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
public struct PeerState: Codable { | ||
public let peer: String | ||
public let lastUpdated: Timestamp | ||
public let blocksInFlight: String | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case peer | ||
case lastUpdated = "last_updated" | ||
case blocksInFlight = "blocks_in_flight" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"jsonrpc": "2.0", | ||
"result": { | ||
"chain": "ckb_dev", | ||
"difficulty": "0x100", | ||
"epoch": "0", | ||
"is_initial_block_download": false, | ||
"median_time": "1557368872854", | ||
"warnings": "" | ||
}, | ||
"id": 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"result" : [ | ||
{ | ||
"last_updated" : "1557289448237", | ||
"blocks_in_flight" : "86", | ||
"peer" : "1" | ||
} | ||
], | ||
"jsonrpc" : "2.0", | ||
"id" : 1 | ||
} |