Closed nellyb4 closed 7 months ago
This requires nodejs
and the ganache-cli
and truffle
packages installed globally:
npm i -g ganache-cli truffle
blockchain-chat/backend
directoryganahce-cli
to start a private blockchain.Chat
smart contract truffle deploy --network development
truffle console --network development
to acquire a command line interface to the deployed contract.<blockchain account>
should be one of the ten "Available Accounts" listed on the ganache-cli
terminal, and <contract account>
is the address to which the Chat
smart contract was deployed to, listed after the command from step 3.
web3.eth.sendTransaction({from: <blockchain account>, to: <contract account>, data: web3.eth.abi.encodeFunctionCall({name: "create", type: "function", inputs: []}, []), gas: 1000000})
web3.eth.sendTransaction({from: <blockchain account, to: <contract account>, data: web3.eth.abi.encodeFunctionCall({name: "put", type: "function", inputs: [{name: "id", type: "uint256"}, {name: "message", type: "string"}]}, [0, "hi"]), gas: 1000000})
ganche-cli
with Ctrl-C
.npm uninstall -g ganache-cli truffle
count = web3.call(getCount, [id])
for i = 1 to count
sender = web3.call(getSender, [id, i])
message = web3.call(getMsg, [id, i])
timestamp = web3.call(getTime, [id, i])
displayMessage(sender, message, timestamp)
Priority: High Risk: Low Story points: 8
User should be able to message another user on the Ethereum blockchain whilst still being able to enjoy the moderation benefits of the main platform.