Connection
Connect to a node to start interacting with the chain.
>>> from cheb3 import Connection
>>> conn = Connection('http://localhost:8545')
- class cheb3.Connection(endpoint_uri: str)
Creates a connection to an HTTP provider.
- Parameters:
endpoint_uri (str) – The full URI to the RPC endpoint.
- account(private_key: Optional[str] = None) Account
Creates an account associated with this connection.
- contract(signer: Optional[Account] = None, contract_name: str = '', address: Optional[str] = None, **kwargs: Any) Contract
Creates a contract instance associated with this connection.
- Parameters:
signer (
<cheb3.account.Account>
) – The account that will sign the following transactions interacting with the contract, defaults toNone
.contract_name (str) – The name of the contract, defaults to
""
.address – Set the address of the contract if it is deployed, defaults to
None
.
- Keyword Arguments:
abi (ABI) – The ABI of the contract.
bytecode (HexStr) – The bytecode of the contract.
- Return type: