https://github.com/bunsdev/simple-dapp-example
https://github.com/bunsdev/simple-dapp-example
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/bunsdev/simple-dapp-example
- Owner: BunsDev
- Created: 2022-03-01T12:27:13.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-03-01T12:27:22.000Z (over 4 years ago)
- Last Synced: 2025-07-04T16:34:26.775Z (12 months ago)
- Language: JavaScript
- Homepage: simple-dapp-example.vercel.app
- Size: 8.79 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ðapp example
This example showcases the basic principles of a Ðapp build in Meteor:
- Separate the ethereum logic from you dapp
- Receive Logs from contracts
- Call contract funcitons
## Getting started
Start a geth node on a testnet:
$ geth --rpccorsdomain "*" --rpc --networkid 8545 --minerthreads "1" --datadir /testChain --mine
Add `--unlock ` if you want to use your account to setNumbers in the contract.
To start this on your own you need to deploy the contract code from inside `client/lib/contract.js` first and replace the address in line 4 (`GuessNumberInstance = GuessNumber.at(...)`).
## Play around
### To deploy the contract on your own call:
```js
var contractInstance = GuessNumber.new({from: web3.eth.accounts[0], gas: 200000, data: contractCode});
```
### To get the address use:
```js
contractInstance.address;
```
### Set the number use:
```js
GuessNumberInstance.setNumber(10, {from: , gas: 50000})
```
### To send money to the contract use:
```js
web3.eth.sendTransaction({from: web3.eth.accounts[0], to: , value: 123000000000})
```
### A workshop explaining how to build Ðapps with Meteor using this project as an example can be found here:
https://www.youtube.com/watch?v=SayS1dcMVWU