Commit 3fee0e8d authored by pm-bernhard's avatar pm-bernhard
Browse files

deploy and test on rinkeby (needs 2ETH)

parent 386b5c76
# How to run
Needs truffle installed: `npm install -g truffle`
Start testrpc: `truffle-testrpc`
Needs truffle and testrpc installed: `npm install -g truffle ethereumjs-testrpc`
Start testrpc: `testrpc`
Then, in another tab run `./contract-changed.sh` whenever the contract should be re-compiled JS bindings updated.
TODO: Add watcher option.
......@@ -62,4 +62,4 @@ A possibility could be to have *openStream()* measure the complexity of the depe
Whenever a transaction takes place, it can be used for some bookkeeping.
Most importantly, a kind of intermediate settlement can be done for open streams. This can be seen as persisting the results of calculations.
Since dynamically calculated status snapshots depending on the current time are guaranteed / final, such states can as well be persisted.
\ No newline at end of file
Since dynamically calculated status snapshots depending on the current time are guaranteed / final, such states can as well be persisted.
#!/bin/bash
# Invokes 'truffle migrate' (compile, re-deploy)
# and tells the node script in frontend to update the JS file representing the contract
set -e
set -u
# --reset makes sure a new instance of the contract is deployed
truffle migrate --reset
node apply_contract_update.js build/contracts/Streem.json ../frontend/js/streem_contract.js
node apply_contract_update.js build/contracts/StreemETH.json ../frontend/js/streemETH_contract.js
echo "deployment on rinkeby finished"
#!/bin/bash
set -e
set -u
# run the deployed test-contract with all tests (needs 1.61 ETH!)
truffle --network rinkeby test
echo "testing on rinkeby finished"
......@@ -5,18 +5,27 @@ import "truffle/DeployedAddresses.sol";
import "../contracts/Streem.sol";
contract TestStreem {
address owner;
function testInitialBalanceUsingDeployedContract() {
owner = tx.origin;
Streem streem = Streem(DeployedAddresses.Streem());
uint expected = 100000000;
uint expected = 10000;
//// issue some tokens to the owner
//streem.dev_issueTo(owner, expected);
//streem.dev_issueTo(tx.origin, 10000);
//uint balance = streem.balanceOf(tx.origin);
Assert.equal(streem.balanceOf(tx.origin), expected, "Owner should have 10000 STR initially");
}
function testTotalSupplyWithNewContract() {
uint expected = 10000;
Streem streem = new Streem(expected);
Streem streem = new Streem(expected, "UnitTestStreem", "TEST-STR", 0);
Assert.equal(streem.totalSupply(), expected, "totalSupply should be 10000");
}
......
......@@ -4,6 +4,16 @@ module.exports = {
host: "localhost",
port: 8545,
network_id: "*" // Match any network id
},
rinkeby: {
host: "rinkeby.eth.lab10.io", // Connect to geth on the specified
port: 80,
//from: "0xc6aa5459ef1cbbc4dce38c7bba5e01fd12b521a4", // default address to use for any transaction Truffle makes during migrations
from: "0xc6AA5459eF1CBBc4DcE38C7bBa5E01Fd12B521a4", // default address to use for any transaction Truffle makes during migrations
// needed to be unlocked permanently (timeout 0) in geth: personal.unlockAccount("0xc6aa5459ef1cbbc4dce38c7bba5e01fd12b521a4", "bernhard", 0)
network_id: 4,
// gas: 4612388 // Gas limit used for deploys
gas: 4700000 // Gas limit used for deploys
}
}
};
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment