News for hackers. Stuff that matters.
Re:How to access Ethereum-based applications? by rthomas6 on Wednesday January 31, 2018 @02:40PM (#16276864)
Python:

    from web3 import Web3, HTTPProvider
    
    web3 = Web3(HTTPProvider('http://localhost:8545')) #Assuming you're running your own ETH node
    your_eth_wallet_address = web3.eth.accounts[0] #Assuming you want to use your node's first wallet
    web3.eth.defaultAccount = your_eth_wallet_address

    dapp_contract = web3.eth.contract(contract_address)

    #Read data from the dapp or execute a function locally (No transaction cost):
    dapp_contract.call().function_name(*function_arguments)

    #Send an ETH transaction (Pay for gas, plus whatever this transaction does):
    dapp_contract.transact().function_name(*function_arguments)

There are no comments on this comment yet.