[Hyperledger Iroha] When I execute a query from the Python library, [bad timestamp: sent from future] is returned.

Contents

It's a little bit, but note how to deal with it

error contents

Run a query to get Roles using the Hyperledger Iroha library

from iroha import Iroha, IrohaCrypto, IrohaGrpc
import iroha_config

net = IrohaGrpc(iroha_config.IROHA_HOST)

iroha = Iroha(iroha_config.ADMIN_ACCOUNT)
admin_priv_key = iroha_config.ADMIN_PRIV_KEY

# Creating a Query
get_block_query = iroha.query(
    'GetRoles'
)

# Sign Transaction
IrohaCrypto.sign_query(get_block_query, iroha_config.ADMIN_PRIV_KEY)

# Send Transaction
response = net.send_query(get_block_query)
print(response)

Details of the error

error_response {
  message: "Query: [[bad timestamp: sent from future, timestamp: 1594256328577, now: 1594147827999 ]]\n"
}
query_hash: "e4567087a82943225e0a774cf4b4349a62f35854f947b8ecf78039a945ae3858"

Causes of errors and remedies

Caused by a time lag between the client running Python and the VM running iroha

Set the time with the following command

 ntpdate ntp.nict.jp
 9 Jul 10:18:36 ntpdate[8383]: step time server 133.243.238.244 offset 108402.649465 sec

Execution result

Execution result after error handling

roles_response {
  roles: "admin"
  roles: "user"
  roles: "money_creator"
}
query_hash: "9b27f830f9a388590a9131f7960b4d3aca8908614cc89fa6631c11d5365196b8"

Recommended Posts

[Hyperledger Iroha] When I execute a query from the Python library, [bad timestamp: sent from future] is returned.
[Hyperledger Iroha] Query with Python library
I wanted to use the Python library from MATLAB
I tried using the Python library from Ruby with PyCall
About the error I encountered when trying to use Adafruit_DHT from Python on a Raspberry Pi
I created a Python library to call the LINE WORKS API
After researching the Python library, I understood a little about egg.info.
A story I was addicted to when inserting from Python to a PostgreSQL table
I want to prevent the speaker connected to the Raspberry Pi (jessie) from bouncing when the OS is restarted (Python script)