chainlib-eth

Ethereum implementation of the chainlib interface
Log | Files | Refs | README | LICENSE

commit edf8c4b60485a3bfedcec2379c1bafa25cb52aee
parent f61ac91205a7a15d0fcedf6007ca66239cac39de
Author: lash <dev@holbrook.no>
Date:   Thu, 24 Feb 2022 11:40:35 +0000

Add chain spec example for eth-gas

Diffstat:
MMakefile | 8++++----
Mchainlib/eth/runnable/flags.py | 1+
Mman/eth-gas.examples.groff | 21+++++++++++++++++++++
3 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile @@ -3,9 +3,9 @@ BUILD_DIR = build/$(PREFIX)/share/man man: mkdir -vp $(BUILD_DIR) - chainlib-man.py -b `PYTHONPATH=. python chainlib/eth/runnable/flags.py gas` -v -n eth-gas -d $(BUILD_DIR)/ man/gas.head.groff - chainlib-man.py -b `PYTHONPATH=. python chainlib/eth/runnable/flags.py info` -v -n eth-info -d $(BUILD_DIR)/ man/info.head.groff - chainlib-man.py -b `PYTHONPATH=. python chainlib/eth/runnable/flags.py get` -v -n eth-get -d $(BUILD_DIR)/ man/get.head.groff - + chainlib-man.py -b `PYTHONPATH=. python chainlib/eth/runnable/flags.py gas` -v -n eth-gas -d $(BUILD_DIR)/ man + chainlib-man.py -b `PYTHONPATH=. python chainlib/eth/runnable/flags.py info` -v -n eth-info -d $(BUILD_DIR)/ man + chainlib-man.py -b `PYTHONPATH=. python chainlib/eth/runnable/flags.py get` -v -n eth-get -d $(BUILD_DIR)/ man + chainlib-man.py -b `PYTHONPATH=. python chainlib/eth/runnable/flags.py decode` -v -n eth-decode -d $(BUILD_DIR)/ man .PHONY: man diff --git a/chainlib/eth/runnable/flags.py b/chainlib/eth/runnable/flags.py @@ -9,6 +9,7 @@ cmds = { 'gas': chainlib.eth.cli.argflag_std_write | chainlib.eth.cli.Flag.WALLET, 'info': chainlib.eth.cli.argflag_reset(chainlib.cli.argflag_std_base_read, chainlib.eth.cli.Flag.CHAIN_SPEC), 'get': chainlib.eth.cli.argflag_reset(chainlib.cli.argflag_std_base_read, chainlib.eth.cli.Flag.CHAIN_SPEC), + 'decode': chainlib.cli.argflag_std_base | chainlib.eth.cli.Flag.CHAIN_SPEC, } if __name__ == '__main__': diff --git a/man/eth-gas.examples.groff b/man/eth-gas.examples.groff @@ -50,5 +50,26 @@ $ PYTHONPATH=. python chainlib/eth/runnable/gas.py -y <\fIkey_file_path\fP> -a 0 0xf8662a85174876e8008252089400000000000000000000000000000000deadbeef8204008025a00c97432d4db724e66a56f7ced04174cf6129e2555709f206dd6d3a156b4af23aa0287862548314a59c7ca6139eee8b51400eb40a67b08b8dc13d67302abecccae0 .EE +.SS Sign transaction for a different network + +.EX +$ PYTHONPATH=. python chainlib/eth/runnable/gas.py -i evm:london:3:rinkeby -y /home/lash/src/contrib/grassrootseconomics/cic-dev/UTC--2021-01-08T17-18-44.521011372Z--eb3907ecad74a0013c259d5874ae7f22dcbcc95c -a 00000000000000000000000000000000DeaDBeef --fee-price 100000000000 --fee-limit 21000 --nonce 42 --data 0x2a 1024 +from: Eb3907eCad74a0013c259D5874AE7f22DcBcC95C +to: 00000000000000000000000000000000DeaDBeef +nonce: 42 +gasPrice: 100000000000 (100 gwei) +gas: 21000 +value: 1024 (0.000000000000001024 eth) +data: 0x2a +v: 41 +recovery_byte: 0 +r: 0xe522c25784111a512cbf46f883e3bdacffc2cdbd465fa1042892c28fc10ee054 +s: 0x5f84eb51a0c9871cfcedaba4e6274b300014899b3a2fec9292de6fe5919bcd07 +chainId: 3 +hash: 0x771200a20072294a6a843b89b98d5f868c9aa94da75dacf6a9f5834dfd241199 +hash_unsigned: 0xa5f9e8a5cda6985d81f4129955b7529f48ecb54728badac16ec550384e3a2bcc +src: 0xf8662a85174876e8008252089400000000000000000000000000000000deadbeef8204002a29a0e522c25784111a512cbf46f883e3bdacffc2cdbd465fa1042892c28fc10ee054a05f84eb51a0c9871cfcedaba4e6274b300014899b3a2fec9292de6fe5919bcd07 +.EE + .P The wire-format can in turn be decoded using the \fBeth-decode\fP tool)