From 216ddda2d29212fa170fc81b29f5a89744ee1319 Mon Sep 17 00:00:00 2001 From: Steve Ashman Date: Mon, 19 Jun 2017 14:32:28 -0400 Subject: [PATCH 1/3] fix "BTC" to "ERC20 wallet" in example config --- example/farmer.config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/farmer.config.json b/example/farmer.config.json index ec77efd..ed572a7 100644 --- a/example/farmer.config.json +++ b/example/farmer.config.json @@ -1,5 +1,5 @@ { - // Set the STORJ/BTC address for receiving contract payments + // Set the STORJ/ERC20 wallet address for receiving contract payments "paymentAddress": "", // Subscribes to the given contract topics // See https://storj.github.io/core/tutorial-contract-topics.html From 496bea670b66453fc1f36e3db0d23698e3d6c528 Mon Sep 17 00:00:00 2001 From: Steve Ashman Date: Mon, 19 Jun 2017 14:59:14 -0400 Subject: [PATCH 2/3] add ETH address checking in storjshare_create also update readme.md to reflect what an ETH address will look like instead of a BTC address --- README.md | 6 +++--- bin/storjshare-create.js | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index bebb679..43528ab 100644 --- a/README.md +++ b/README.md @@ -250,14 +250,14 @@ information and go on with Step 1 and 2. "tabs": [ { "key": "4154e85e87b323611cba45ab1cd51203f2508b1da8455cdff8b641cce827f3d6", - "address": "1K1rPg...", + "address": "0xfB691...", "storage": { "dataDir": "D:\\Storj\\storjshare-5f4722" } }, { "key": "0b0341a9913bb84b51485152a1b0a8a6ed68fa4f9a4fedb26c61ff778ce61ec8", - "address": "1K1rPg...", + "address": "0xfB691...", "storage": { "dataDir": "D:\\Storj\\storjshare-48a1c4" } @@ -302,7 +302,7 @@ Now that you have Storj Share installed, use the `create` command to generate your configuration. ``` -storjshare create --key 4154e8... --storj 1K1rPg... --storage -o +storjshare create --key 4154e8... --storj 0xfB691... --storage -o ``` This will generate your configuration file given the parameters you passed in, diff --git a/bin/storjshare-create.js b/bin/storjshare-create.js index 271bae5..cad9df6 100755 --- a/bin/storjshare-create.js +++ b/bin/storjshare-create.js @@ -12,6 +12,7 @@ const mkdirp = require('mkdirp'); const stripJsonComments = require('strip-json-comments'); const storjshare_create = require('commander'); const {execSync} = require('child_process'); +const utils = require('../lib/utils'); const defaultConfig = JSON.parse(stripJsonComments(fs.readFileSync( path.join(__dirname, '../example/farmer.config.json') @@ -49,6 +50,11 @@ if (!storjshare_create.storj) { process.exit(1); } +if (!utils.isValidEthereumAddress(storjshare_create.storj)) { + console.error('\n SJCX addresses are no longer supported. Please enter ERC20 compatible ETH wallet address'); + process.exit(1); +} + if (!storjshare_create.key) { storjshare_create.key = storj.KeyPair().getPrivateKey(); } From f956433478a6891242a699d593482023060e91fd Mon Sep 17 00:00:00 2001 From: Steve Ashman Date: Mon, 19 Jun 2017 15:06:24 -0400 Subject: [PATCH 3/3] linter --- bin/storjshare-create.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/storjshare-create.js b/bin/storjshare-create.js index cad9df6..35b35de 100755 --- a/bin/storjshare-create.js +++ b/bin/storjshare-create.js @@ -51,7 +51,8 @@ if (!storjshare_create.storj) { } if (!utils.isValidEthereumAddress(storjshare_create.storj)) { - console.error('\n SJCX addresses are no longer supported. Please enter ERC20 compatible ETH wallet address'); + console.error('\n SJCX addresses are no longer supported. \ +Please enter ERC20 compatible ETH wallet address'); process.exit(1); }