From 4b1cbbd0f7540b11ef638c53c86a27905ff47d05 Mon Sep 17 00:00:00 2001 From: bumi Date: Sun, 15 Apr 2018 21:03:12 +0200 Subject: [PATCH 1/3] Persist ganache DB and use fixed Mnemonic This persists the state of the ganache db and uses a fixed mnemonic code to create accounts. It now acts more like a local presistent database and no need to send funds to the accounts after restart. --- .gitignore | 3 ++- package.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 48912d2..697f31a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ build -node_modules \ No newline at end of file +node_modules +.ganache-db \ No newline at end of file diff --git a/package.json b/package.json index b97dd9c..f5c22e7 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "scripts": { "build-json": "truffle compile && node ./scripts/build-json.js", "bootstrap": "truffle migrate --reset && truffle exec scripts/seeds.js && npm run build-json", - "ganache": "ganache-cli -p 7545 -i 100", + "ganache": "ganache-cli -p 7545 -i 100 --db=./.ganache-db -m kredits", "dev": "truffle migrate && npm run build-json", "test": "echo \"Error: no test specified\" && exit 1" }, From 64ce554c492c11b4ef200a7a995d63801e9d0e8b Mon Sep 17 00:00:00 2001 From: bumi Date: Mon, 16 Apr 2018 11:01:43 +0200 Subject: [PATCH 2/3] readme --- README.mdown | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/README.mdown b/README.mdown index 48517ef..95143bc 100644 --- a/README.mdown +++ b/README.mdown @@ -22,11 +22,18 @@ We use following solidity contract libraries: For local development it is recommended to use [ganache-cli](https://github.com/trufflesuite/ganache-cli) (or the [ganache GUI](http://truffleframework.com/ganache/) to run a local development chain. Using the ganache simulator no full Ethereum node is required. -We default to the port 7545 for development to not get in conflict with the default Ethereum RPC port. Have a look at `ganache-cli` for more configuration options. +We default to: + +* port 7545 for development to not get in conflict with the default Ethereum RPC port. +* network ID 100 to stay on the same network id +* store ganache data in .ganache-db to presist the chain data across restarts +* use a fixed Mnemonic code to get the same accounts across restarts + +Have a look at `ganache-cli` for more configuration options. Run your ganache simulator before using Kredits locally: - $ ganache-cli -p 7545 + $ npm run ganache (which is: ganache-cli -p 7545 -i 100 --db=./.ganache-db -m kredits) ### Truffle console From f2fc9fd1610b17bd8e032f9a80970fe7d524c474 Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Tue, 17 Apr 2018 13:13:52 +0200 Subject: [PATCH 3/3] Add empty Ganache DB directory --- .ganache-db/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .ganache-db/.gitkeep diff --git a/.ganache-db/.gitkeep b/.ganache-db/.gitkeep new file mode 100644 index 0000000..e69de29