add --contract argument
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
58f3e524f9
commit
6e9fbf0496
13
main.py
13
main.py
|
@ -12,11 +12,6 @@ from log import setup_custom_logger
|
|||
from watch import ContractWatcher
|
||||
from contract import StickerPackContract
|
||||
|
||||
SPACK_CONTRACT = "0x0577215622f43a39F4Bc9640806DFea9b10D2A36"
|
||||
#SPACK_CONTRACT = "0x8cc272396Be7583c65BEe82CD7b743c69A87287D" # Goerli
|
||||
with open("./abi.json", "r") as f:
|
||||
STICKER_PACK_ABI = json.load(f)
|
||||
|
||||
HELP_DESCRIPTION='Utility for pinning images from Status Sticker packs.'
|
||||
HELP_EXAMPLE='Example: ./main.py -TODO'
|
||||
|
||||
|
@ -31,6 +26,8 @@ def parse_opts():
|
|||
help='If all packs should be pinned on start.')
|
||||
parser.add_option('-e', '--events', default=['ContenthashChanged', 'Register'],
|
||||
help='Contract events to watch for.')
|
||||
parser.add_option('-c', '--contract', default='0x0577215622f43a39F4Bc9640806DFea9b10D2A36',
|
||||
help='Sticker Pack contract address.')
|
||||
parser.add_option('-I', '--log-level', default='INFO',
|
||||
help='Level of logging.')
|
||||
|
||||
|
@ -50,8 +47,12 @@ def main():
|
|||
# for talking to IPFS cluster and pinning images
|
||||
ipfs = IpfsPinner(opts.ipfs_addr)
|
||||
|
||||
# Read Sticker Pack contract ABI
|
||||
with open("./abi.json", "r") as f:
|
||||
contract_abi = json.load(f)
|
||||
|
||||
# Get instance of sticker pack contract
|
||||
contract = StickerPackContract(SPACK_CONTRACT, STICKER_PACK_ABI, w3)
|
||||
contract = StickerPackContract(opts.contract, contract_abi, w3)
|
||||
|
||||
if opts.pin_all:
|
||||
LOG.info('Pinning all existing packs...')
|
||||
|
|
Loading…
Reference in New Issue