Fix show issues

This commit is contained in:
Mariano Sorgente 2021-02-10 18:16:28 +09:00 committed by Gene Hoffman
parent dc891f65e6
commit 5052eb730c
4 changed files with 10 additions and 10 deletions

View File

@ -150,7 +150,7 @@ async def show_async(args, parser):
if peak is not None:
if peak.is_block:
peak_time = peak.foliage_block.timestamp
peak_time = peak.timestamp
else:
peak_hash = peak.header_hash
curr = await client.get_sub_block_record(peak_hash)
@ -176,7 +176,7 @@ async def show_async(args, parser):
print(f"Current VDF sub_slot_iters: {sub_slot_iters}")
print("Total iterations since the start of the blockchain:", total_iters)
print("")
print("SB Height | Height | Hash:")
print("SB Height | Hash:")
added_blocks: List[SubBlockRecord] = []
curr = await client.get_sub_block_record(peak.header_hash)

View File

@ -44,9 +44,7 @@ class FullNodeRpcClient(RpcClient):
return None
except Exception:
return None
json_res = response["sub_block_record"]
del json_res["reward_claims_incorporated"]
return SubBlockRecord.from_json_dict(json_res)
return SubBlockRecord.from_json_dict(response["sub_block_record"])
async def get_unfinished_sub_block_headers(self) -> List[UnfinishedHeaderBlock]:
response = await self.fetch("get_unfinished_sub_block_headers", {})

View File

@ -318,7 +318,9 @@ class ChiaServer:
cert_bytes = transport._ssl_protocol._extra["ssl_object"].getpeercert(True) # type: ignore
der_cert = x509.load_der_x509_certificate(cert_bytes, default_backend())
peer_id = bytes32(der_cert.fingerprint(hashes.SHA256()))
assert peer_id != self.node_id
if peer_id == self.node_id:
raise RuntimeError(f"Trying to connect to a peer ({target_node}) with the same peer_id: {peer_id}")
connection = WSChiaConnection(
self._local_type,
ws,

View File

@ -29,10 +29,10 @@ echo "Note that this simulation will not work if connected to external nodes."
# Please note that the simulation is meant to be run locally and not connected to external nodes.
# NOTE: you must run install.sh when changing this file
# _run_bg_cmd chia_farmer --logging.log_stdout=True --logging.log_level=INFO
# _run_bg_cmd chia_harvester --logging.log_stdout=True --logging.log_level=INFO
# _run_bg_cmd chia_timelord --logging.log_stdout=True --logging.log_level=INFO
# _run_bg_cmd chia_timelord_launcher --logging.log_stdout=True --logging.log_level=INFO
_run_bg_cmd chia_farmer --logging.log_stdout=True --logging.log_level=INFO
_run_bg_cmd chia_harvester --logging.log_stdout=True --logging.log_level=INFO
_run_bg_cmd chia_timelord --logging.log_stdout=True --logging.log_level=INFO
_run_bg_cmd chia_timelord_launcher --logging.log_stdout=True --logging.log_level=INFO
_run_bg_cmd chia_introducer --logging.log_stdout=True --logging.log_level=INFO
_run_bg_cmd chia_full_node --port=8444 --database_path="simulation_1.db" --rpc_port=8555 --introducer_peer.host="127.0.0.1" --introducer_peer.port=8445 --logging.log_stdout=True --logging.log_level=INFO --logging.log_level=INFO
sleep 1