Skip to content

shankarganesh1234/tiny-eth-contract

Repository files navigation

Tinybit.link Dapp

Installation

  • Geth
brew install ethereum
  • Rinkeby Testnet
geth --rinkeby --syncmode "fast" --rpc --rpcapi db,eth,net,web3,personal --cache=1024  --rpcport 8545 --rpcaddr 127.0.0.1 --rpccorsdomain "*"
  • Truffle Installation
npm install -g truffle
  • __Truffle project setup
mkdir tiny
cd tiny
npm install -g webpack
truffle unbox webpack

The 'Tiny Contract' and the 2_deploy_contracts.js have already been modified to deploy tiny contract.

  • Deploy to Rinkeby
truffle console
web3.personal.newAccount('')
web3.eth.getBalance('')
web3.personal.unlockAccount('', '', 15000)

For existing account
web3.personal.importRawKey("private key", "password")
web3.personal.unlockAccount('account', '', 15000)
  • Get test ether

Use the address from the previous step, to get test ether from rinkeby faucet : https://faucet.rinkeby.io/

  • Deploy contract to Rinkeby
truffle migrate
  • Contract address
Contract - 0x481053B400252324B9601308d21e602a4e2Bf935
  • Interact with contract
truffle console

// create
Tiny.deployed().then(function(contractInstance) {contractInstance.addKv('0x5e3b184a67285b67ba3577cf9e8eb2c7209366f9', '0x4b6167652042756e7368696e204a75747375').then(function(v) {console.log(v)})})

// get
Tiny.deployed().then(function(contractInstance) {contractInstance.getKv('0x5e3b184a67285b67ba3577cf9e8eb2c7209366f9').then(function(v) {console.log(v)})})

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published