Initializes the Web3 client that connects to the blockchain and creates the contract object.
Local Smart Contract object that we can invoke methods on which will automatically invoke methods on the actual Smart Contract in the blockchain.
Web3 is the main JavaScript client that allows us to interact with nodes in the blockchain. It is what Truffle uses in the backend, but we can invoke it directly to get more control and not rely too much on the Truffle framework. https://web3js.readthedocs.io/en/v1.2.0/getting-started.html
USER_DESCRIPTOR_ABI_PATH is the path to the JSON that has information about the SmartContract that web3js can read. This allows Web3JS to add methods to a contract object that we can invoke from JavaScript.
Gets all the accounts in the blockchain and returns the ID of the account at a certain index in the returned array.
Abstraction for UserDescriptors (smart contract) method, getAllAvailableUnitForUser(): string[] See ./contracts/UserDescriptors.sol for the actual contract method
ID of the account sending the request (Local blockchain autogenerates 10 accounts to use)
Optional paramter, defaults to 5,000,000. Need gas to perform any sort of operation.
Abstraction for UserDescriptors (smart contract) method, getAllValuesRecordedForUnit(unit: string): number[] See ./contracts/UserDescriptors.sol for the actual contract method
ID of the account sending the request (Local blockchain autogenerates 10 accounts to use)
A unit such as lb, cm, miles, kilometer, etc
Optional paramter, defaults to 5,000,000. Need gas to perform any sort of operation.
This allows Web3JS to add methods to a contract object that we can invoke for our using the JSON ABI (Application Binary Interface). The JSON ABI has the contract methods that can be invoked with input paramters/types, and output paramters/types.
Abstraction for UserDescriptors (smart contract) method, getLatestValueForUnit(unit: string): number See ./contracts/UserDescriptors.sol for the actual contract method
ID of the account sending the request (Local blockchain autogenerates 10 accounts to use)
A unit such as lb, cm, miles, kilometer, etc
Optional paramter, defaults to 5,000,000. Need gas to perform any sort of operation.
Abstraction for UserDescriptors (smart contract) method, insertValue(unit: string, value: number) See ./contracts/UserDescriptors.sol for the actual contract method
ID of the account sending the request (Local blockchain autogenerates 10 accounts to use)
Data needed to enter itno blockchain
Optional paramter, defaults to 5,000,000. Need gas to perform any sort of operation.
Generated using TypeDoc
This class's purpose is to be an abstraction for interacting with the Blockchain, and in particular, the UserDescriptors Smart Contract. This class implements methods that are in the smart contract and executes it on behalf of the invoker of this class. The actual smart contract can be found in ./contracts/UserDescriptors.sol
We want to create a class like this for every smart contract.