Skip to content

Develop #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.idea/
.idea/
node_modules/
76 changes: 76 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# DeTweet smart contract

## Deployment

This contract is deployed to Ropsten at `0x43f62f79e0943135186a689fbc26ac4366e52ae5`.

### Deploying contract to testnet - Ropsten

1. Get a Ropsten network eth address and some eth
- open metamask extension and select Ropsten test network
- go to https://faucet.metamask.io/ You should be recognized on the page shortly (user) through metamask.
- request 1 ether from Ropsten. You will get a tx hash.
Click on it to check the transaction status @ https://ropsten.etherscan.io. Waiting time is approx. 30sec.
Repeat the request for some more eth :)

2. In the project folder run

```$ npm init```

```$ npm install truffle-hdwallet-provider --save```

3. Sign up to Infura @ https://infura.io/signup
On the next page, you will find the link to the Ropsten network with your access token as the last segment.
Add that token to the truffle.js config file, along with the seed words from Metamask.

4. Deploy your smart contract

```$ truffle migrate --network ropsten```

You will get the deployed contract address (ContractName: 0x469e800fdaef46a43b913d4db047be115b290bef)

5. Check that the contract is live on the network by visiting
https://ropsten.etherscan.io/address/YourContractAddress


Congratulations!


### Deploy with geth - requires node sync on localhost (too much time/space)

1. Install geth
- https://github.com/ethereum/go-ethereum

OSX example:

```$ brew tap ethereum/ethereum```

```$ brew install ethereum```

2. Run geth

```$ geth --testnet account new```

Choose a password, and you will create a new ropsten account.

Run the geth instance with permissions opened up

```$ geth --testnet --fast --rpc --rpcapi eth,net,web3,personal```

In a new terminal window, open up the geth console

```$ geth attach http://127.0.0.1:8545```

You will see your ropsten eth address in the console info.

From the geth console, unlock your account so you can spend the ropsten eth

```$ personal.unlockAccount(eth.accounts[0])```

At this point, you will need to enter your account passphrase you chose when creating the account.

From metamask, transfer some eth to this account address.

3. Deploy the contract

```$ truffle migrate --network ropsten```
9 changes: 7 additions & 2 deletions build/contracts/DeTweet.json
Original file line number Diff line number Diff line change
Expand Up @@ -2080,10 +2080,15 @@
"version": "0.4.18+commit.9cf6e910.Emscripten.clang"
},
"networks": {
"3": {
"events": {},
"links": {},
"address": "0x43f62f79e0943135186a689fbc26ac4366e52ae5"
},
"4447": {
"events": {},
"links": {},
"address": "0x30753e4a8aad7f8597332e813735def5dd395028"
"address": "0x345ca3e014aaf5dca488057592ee47305d9b3e10"
},
"5777": {
"events": {},
Expand All @@ -2092,5 +2097,5 @@
}
},
"schemaVersion": "1.0.1",
"updatedAt": "2018-02-05T23:17:58.559Z"
"updatedAt": "2018-02-11T11:05:37.603Z"
}
9 changes: 7 additions & 2 deletions build/contracts/Migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -816,10 +816,15 @@
"version": "0.4.18+commit.9cf6e910.Emscripten.clang"
},
"networks": {
"3": {
"events": {},
"links": {},
"address": "0x9e9f6c28137a43c4e769d38956e812ca7e7aa589"
},
"4447": {
"events": {},
"links": {},
"address": "0x9fbda871d559710256a2502a2517b794b482db40"
"address": "0x8cdaf0cd259887258bc13a92c0a6da92698644c0"
},
"5777": {
"events": {},
Expand All @@ -828,5 +833,5 @@
}
},
"schemaVersion": "1.0.1",
"updatedAt": "2018-02-05T23:17:58.560Z"
"updatedAt": "2018-02-11T11:05:37.600Z"
}
Loading