Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- event documentAdded(
- uint id
- );
- function sendDocument(
- string memory _ipfsLocation,
- uint256 _uploadDate
- )
- public
- {
- documentCount ++;
- ListOfDocuments[documentCount] = documentStore(documentCount, _ipfsLocation, msg.sender, _uploadDate);
- emit documentAdded(documentCount);
- }
- var event = storehash.events.documentAdded()
- event.watch(
- function(error, result) {
- if (!error)
- this.setState({idForBlockchain: result.args.id.toString()})
- }
- );
- //call the smart contract method to create a new document
- const documentId = await storehash.methods.sendDocument(this.state.IPFSlink, newDate).send({from: this.state.account})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement