dapplib. Therefore, it is important to reference
dapplibin your client from where you’d be interacting with the blockchain. (In the starter projects for Hyperhack, we've already imported DappLib for you.)
dapplibby adding the following import line. This import line will change depending upon the file structure you create within the
Dapplibis a library of all the functions the Smart Module has implemented. So instead of interacting directly with the smart modules, we use
TribesSmart Module and within that we want to read the current Tribe of a user. The corresponding
dapplibfunction to that is
TribesGetCurrentTribe. We can call this dapplib function like and get the result like so:
returnValwill contain the data that is returned by the smart module function. If the function is writing to the blockchain, the
returnValwill contain the transaction hash. If the function is reading from the blockchain, the
returnVal.resultwill contain the value that is returned. In the case above, we are reading from the blockchain, so we
TribesGetCurrentTribe), there are comments above each function specifying what parameters you must pass in.
TribesSmart Module once again. Within that module, we want to call the
TribesJoinTribemethod in order to join a Tribe. So within your client, you'd write code like this.
tribefrom the Birbal account under the Admin's Tenant.
resultwill contain the transaction hash, verifying that you are truly awesome!