mirror of
git://holbrook.no/eth-contract-registry
synced 2024-12-22 12:27:31 +01:00
Upgrade chainlib
This commit is contained in:
parent
dca45e4c47
commit
c4725d8a97
@ -16,7 +16,7 @@ from chainlib.eth.constant import (
|
|||||||
ZERO_CONTENT,
|
ZERO_CONTENT,
|
||||||
MAX_UINT,
|
MAX_UINT,
|
||||||
)
|
)
|
||||||
from chainlib.eth.rpc import (
|
from chainlib.jsonrpc import (
|
||||||
jsonrpc_template,
|
jsonrpc_template,
|
||||||
)
|
)
|
||||||
from hexathon import (
|
from hexathon import (
|
||||||
|
@ -35,7 +35,7 @@ argparser = argparse.ArgumentParser()
|
|||||||
argparser.add_argument('-p', '--provider', dest='p', default='http://localhost:8545', type=str, help='Web3 provider url (http only)')
|
argparser.add_argument('-p', '--provider', dest='p', default='http://localhost:8545', type=str, help='Web3 provider url (http only)')
|
||||||
argparser.add_argument('-w', action='store_true', help='Wait for the last transaction to be confirmed')
|
argparser.add_argument('-w', action='store_true', help='Wait for the last transaction to be confirmed')
|
||||||
argparser.add_argument('-ww', action='store_true', help='Wait for every transaction to be confirmed')
|
argparser.add_argument('-ww', action='store_true', help='Wait for every transaction to be confirmed')
|
||||||
argparser.add_argument('-i', '--chain-spec', dest='i', type=str, default='Ethereum:1', help='Chain specification string')
|
argparser.add_argument('-i', '--chain-spec', dest='i', type=str, default='evm:ethereum:1', help='Chain specification string')
|
||||||
argparser.add_argument('-y', '--key-file', dest='y', type=str, help='Ethereum keystore file to use for signing')
|
argparser.add_argument('-y', '--key-file', dest='y', type=str, help='Ethereum keystore file to use for signing')
|
||||||
argparser.add_argument('-v', action='store_true', help='Be verbose')
|
argparser.add_argument('-v', action='store_true', help='Be verbose')
|
||||||
argparser.add_argument('-vv', action='store_true', help='Be more verbose')
|
argparser.add_argument('-vv', action='store_true', help='Be more verbose')
|
||||||
@ -68,7 +68,6 @@ if args.y != None:
|
|||||||
signer = EIP155Signer(keystore)
|
signer = EIP155Signer(keystore)
|
||||||
|
|
||||||
chain_spec = ChainSpec.from_chain_str(args.i)
|
chain_spec = ChainSpec.from_chain_str(args.i)
|
||||||
chain_id = chain_spec.network_id()
|
|
||||||
|
|
||||||
rpc = EthHTTPConnection(args.p)
|
rpc = EthHTTPConnection(args.p)
|
||||||
nonce_oracle = RPCNonceOracle(signer_address, rpc)
|
nonce_oracle = RPCNonceOracle(signer_address, rpc)
|
||||||
@ -79,7 +78,7 @@ if 'ContractRegistry' not in identifiers:
|
|||||||
logg.debug('adding identifiers {}'.format(identifiers))
|
logg.debug('adding identifiers {}'.format(identifiers))
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
c = Registry(signer=signer, gas_oracle=gas_oracle, nonce_oracle=nonce_oracle, chain_id=chain_id)
|
c = Registry(chain_spec, signer=signer, gas_oracle=gas_oracle, nonce_oracle=nonce_oracle)
|
||||||
(tx_hash_hex, o) = c.constructor(signer_address, identifiers)
|
(tx_hash_hex, o) = c.constructor(signer_address, identifiers)
|
||||||
rpc.do(o)
|
rpc.do(o)
|
||||||
if block_last:
|
if block_last:
|
||||||
|
@ -37,7 +37,7 @@ default_format = 'terminal'
|
|||||||
|
|
||||||
argparser = argparse.ArgumentParser()
|
argparser = argparse.ArgumentParser()
|
||||||
argparser.add_argument('-p', '--provider', dest='p', default='http://localhost:8545', type=str, help='RPC provider url (http only)')
|
argparser.add_argument('-p', '--provider', dest='p', default='http://localhost:8545', type=str, help='RPC provider url (http only)')
|
||||||
argparser.add_argument('-i', '--chain-spec', dest='i', type=str, default='Ethereum:1', help='Chain specification string')
|
argparser.add_argument('-i', '--chain-spec', dest='i', type=str, default='evm:ethereum:1', help='Chain specification string')
|
||||||
argparser.add_argument('-r', '--registry', dest='r', required=True, type=str, help='Contract registry address')
|
argparser.add_argument('-r', '--registry', dest='r', required=True, type=str, help='Contract registry address')
|
||||||
argparser.add_argument('-f', '--format', dest='f', type=str, default=default_format, help='Output format [human, brief]')
|
argparser.add_argument('-f', '--format', dest='f', type=str, default=default_format, help='Output format [human, brief]')
|
||||||
argparser.add_argument('-v', action='store_true', help='Be verbose')
|
argparser.add_argument('-v', action='store_true', help='Be verbose')
|
||||||
@ -52,7 +52,6 @@ elif args.v:
|
|||||||
logg.setLevel(logging.INFO)
|
logg.setLevel(logging.INFO)
|
||||||
|
|
||||||
chain_spec = ChainSpec.from_chain_str(args.i)
|
chain_spec = ChainSpec.from_chain_str(args.i)
|
||||||
chain_id = chain_spec.network_id()
|
|
||||||
|
|
||||||
rpc = EthHTTPConnection(args.p)
|
rpc = EthHTTPConnection(args.p)
|
||||||
registry_address = args.r
|
registry_address = args.r
|
||||||
@ -89,7 +88,7 @@ def ls(ifc, fmt=default_format, w=sys.stdout):
|
|||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
c = Registry()
|
c = Registry(chain_spec)
|
||||||
if identifier != None:
|
if identifier != None:
|
||||||
element(c, identifier, fmt=fmt, w=sys.stdout)
|
element(c, identifier, fmt=fmt, w=sys.stdout)
|
||||||
else:
|
else:
|
||||||
|
@ -36,7 +36,7 @@ argparser = argparse.ArgumentParser()
|
|||||||
argparser.add_argument('-p', '--provider', dest='p', default='http://localhost:8545', type=str, help='Web3 provider url (http only)')
|
argparser.add_argument('-p', '--provider', dest='p', default='http://localhost:8545', type=str, help='Web3 provider url (http only)')
|
||||||
argparser.add_argument('-w', action='store_true', help='Wait for the last transaction to be confirmed')
|
argparser.add_argument('-w', action='store_true', help='Wait for the last transaction to be confirmed')
|
||||||
argparser.add_argument('-ww', action='store_true', help='Wait for every transaction to be confirmed')
|
argparser.add_argument('-ww', action='store_true', help='Wait for every transaction to be confirmed')
|
||||||
argparser.add_argument('-i', '--chain-spec', dest='i', type=str, default='Ethereum:1', help='Chain specification string')
|
argparser.add_argument('-i', '--chain-spec', dest='i', type=str, default='evm:ethereum:1', help='Chain specification string')
|
||||||
argparser.add_argument('-y', '--key-file', dest='y', type=str, help='Ethereum keystore file to use for signing')
|
argparser.add_argument('-y', '--key-file', dest='y', type=str, help='Ethereum keystore file to use for signing')
|
||||||
argparser.add_argument('-r', '--registry', dest='r', type=str, help='Contract registry address')
|
argparser.add_argument('-r', '--registry', dest='r', type=str, help='Contract registry address')
|
||||||
argparser.add_argument('-v', action='store_true', help='Be verbose')
|
argparser.add_argument('-v', action='store_true', help='Be verbose')
|
||||||
@ -71,7 +71,6 @@ if args.y != None:
|
|||||||
signer = EIP155Signer(keystore)
|
signer = EIP155Signer(keystore)
|
||||||
|
|
||||||
chain_spec = ChainSpec.from_chain_str(args.i)
|
chain_spec = ChainSpec.from_chain_str(args.i)
|
||||||
chain_id = chain_spec.network_id()
|
|
||||||
|
|
||||||
rpc = EthHTTPConnection(args.p)
|
rpc = EthHTTPConnection(args.p)
|
||||||
nonce_oracle = RPCNonceOracle(signer_address, rpc)
|
nonce_oracle = RPCNonceOracle(signer_address, rpc)
|
||||||
@ -86,7 +85,7 @@ address = args.address
|
|||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
c = Registry(signer=signer, gas_oracle=gas_oracle, nonce_oracle=nonce_oracle, chain_id=chain_id)
|
c = Registry(chain_spec, signer=signer, gas_oracle=gas_oracle, nonce_oracle=nonce_oracle)
|
||||||
(tx_hash_hex, o) = c.set(registry_address, signer_address, identifier, address, chain_spec, ZERO_CONTENT)
|
(tx_hash_hex, o) = c.set(registry_address, signer_address, identifier, address, chain_spec, ZERO_CONTENT)
|
||||||
rpc.do(o)
|
rpc.do(o)
|
||||||
if block_last:
|
if block_last:
|
||||||
|
BIN
python/gmon.out
BIN
python/gmon.out
Binary file not shown.
@ -1,3 +1,3 @@
|
|||||||
confini~=0.3.6rc3
|
confini~=0.3.6rc3
|
||||||
crypto-dev-signer~=0.4.14a9
|
crypto-dev-signer~=0.4.14a17
|
||||||
chainlib~=0.0.1a34
|
chainlib~=0.0.2a1
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[metadata]
|
[metadata]
|
||||||
name = eth-contract-registry
|
name = eth-contract-registry
|
||||||
version = 0.5.4a5
|
version = 0.5.4a7
|
||||||
description = Ethereum Smart Contract key-value registry
|
description = Ethereum Smart Contract key-value registry
|
||||||
author = Louis Holbrook
|
author = Louis Holbrook
|
||||||
author_email = dev@holbrook.no
|
author_email = dev@holbrook.no
|
||||||
|
Loading…
Reference in New Issue
Block a user