{"action":"created","comment":{"url":"https://api.github.com/repos/iotaledger/iri/pulls/comments/208174023","pull_request_review_id":143928329,"id":208174023,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwODE3NDAyMw==","diff_hunk":"@@ -40,90 +39,48 @@\n     public final Node node;\n     public final UDPReceiver udpReceiver;\n     public final Replicator replicator;\n-    public final Configuration configuration;\n-    public final Hash coordinator;\n+    public final IotaConfig configuration;\n     public final TipsViewModel tipsViewModel;\n     public final MessageQ messageQ;\n     public final TipSelector tipsSelector;\n \n-    public final boolean testnet;\n-    public final int maxPeers;\n-    public final int udpPort;\n-    public final int tcpPort;\n-    public final int maxTipSearchDepth;\n-\n-    public Iota(Configuration configuration) throws IOException {\n+    public Iota(IotaConfig configuration) throws IOException {\n         this.configuration = configuration;\n-        testnet = configuration.booling(Configuration.DefaultConfSettings.TESTNET);\n-        maxPeers = configuration.integer(Configuration.DefaultConfSettings.MAX_PEERS);\n-        udpPort = configuration.integer(Configuration.DefaultConfSettings.UDP_RECEIVER_PORT);\n-        tcpPort = configuration.integer(Configuration.DefaultConfSettings.TCP_RECEIVER_PORT);\n-\n-        String snapshotFile = configuration.string(Configuration.DefaultConfSettings.SNAPSHOT_FILE);\n-        String snapshotSigFile = configuration.string(Configuration.DefaultConfSettings.SNAPSHOT_SIGNATURE_FILE);\n-        Snapshot initialSnapshot = Snapshot.init(snapshotFile, snapshotSigFile, testnet).clone();\n-        long snapshotTimestamp = configuration.longNum(Configuration.DefaultConfSettings.SNAPSHOT_TIME);\n-        int milestoneStartIndex = configuration.integer(Configuration.DefaultConfSettings.MILESTONE_START_INDEX);\n-        int numKeysMilestone = configuration.integer(Configuration.DefaultConfSettings.NUMBER_OF_KEYS_IN_A_MILESTONE);\n-        double alpha = configuration.doubling(Configuration.DefaultConfSettings.TIPSELECTION_ALPHA.name());\n-        int belowMaxDepthTxLimit = configuration.integer(\n-                Configuration.DefaultConfSettings.BELOW_MAX_DEPTH_TRANSACTION_LIMIT);\n-\n-        boolean dontValidateMilestoneSig = configuration.booling(Configuration.DefaultConfSettings\n-                .DONT_VALIDATE_TESTNET_MILESTONE_SIG);\n-        int transactionPacketSize = configuration.integer(Configuration.DefaultConfSettings.TRANSACTION_PACKET_SIZE);\n-\n-        maxTipSearchDepth = configuration.integer(Configuration.DefaultConfSettings.MAX_DEPTH);\n-        if(testnet) {\n-            String coordinatorTrytes = configuration.string(Configuration.DefaultConfSettings.COORDINATOR);\n-            if(StringUtils.isNotEmpty(coordinatorTrytes)) {\n-                coordinator = new Hash(coordinatorTrytes);\n-            } else {\n-                log.warn(\"No coordinator address given for testnet. Defaulting to \"\n-                        + Configuration.TESTNET_COORDINATOR_ADDRESS);\n-                coordinator = new Hash(Configuration.TESTNET_COORDINATOR_ADDRESS);\n-            }\n-        } else {\n-            coordinator = new Hash(Configuration.MAINNET_COORDINATOR_ADDRESS);\n-        }\n+        Snapshot initialSnapshot = Snapshot.init(configuration.getSnapshotFile(),","path":"src/main/java/com/iota/iri/Iota.java","position":73,"original_position":73,"commit_id":"855b64afb26ee8198c997252f2cff707f577f862","original_commit_id":"deeea884c574a484faaf70f26cb34fdeb6160e65","user":{"login":"GalRogozinski","id":7954839,"node_id":"MDQ6VXNlcjc5NTQ4Mzk=","avatar_url":"https://avatars3.githubusercontent.com/u/7954839?v=4","gravatar_id":"","url":"https://api.github.com/users/GalRogozinski","html_url":"https://github.com/GalRogozinski","followers_url":"https://api.github.com/users/GalRogozinski/followers","following_url":"https://api.github.com/users/GalRogozinski/following{/other_user}","gists_url":"https://api.github.com/users/GalRogozinski/gists{/gist_id}","starred_url":"https://api.github.com/users/GalRogozinski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GalRogozinski/subscriptions","organizations_url":"https://api.github.com/users/GalRogozinski/orgs","repos_url":"https://api.github.com/users/GalRogozinski/repos","events_url":"https://api.github.com/users/GalRogozinski/events{/privacy}","received_events_url":"https://api.github.com/users/GalRogozinski/received_events","type":"User","site_admin":false},"body":":+1: ","created_at":"2018-08-07T10:13:39Z","updated_at":"2018-08-07T10:13:39Z","html_url":"https://github.com/iotaledger/iri/pull/910#discussion_r208174023","pull_request_url":"https://api.github.com/repos/iotaledger/iri/pulls/910","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/iotaledger/iri/pulls/comments/208174023"},"html":{"href":"https://github.com/iotaledger/iri/pull/910#discussion_r208174023"},"pull_request":{"href":"https://api.github.com/repos/iotaledger/iri/pulls/910"}},"in_reply_to_id":207942798},"pull_request":{"url":"https://api.github.com/repos/iotaledger/iri/pulls/910","id":206378530,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA2Mzc4NTMw","html_url":"https://github.com/iotaledger/iri/pull/910","diff_url":"https://github.com/iotaledger/iri/pull/910.diff","patch_url":"https://github.com/iotaledger/iri/pull/910.patch","issue_url":"https://api.github.com/repos/iotaledger/iri/issues/910","number":910,"state":"open","locked":false,"title":"Refactor Configuration","user":{"login":"GalRogozinski","id":7954839,"node_id":"MDQ6VXNlcjc5NTQ4Mzk=","avatar_url":"https://avatars3.githubusercontent.com/u/7954839?v=4","gravatar_id":"","url":"https://api.github.com/users/GalRogozinski","html_url":"https://github.com/GalRogozinski","followers_url":"https://api.github.com/users/GalRogozinski/followers","following_url":"https://api.github.com/users/GalRogozinski/following{/other_user}","gists_url":"https://api.github.com/users/GalRogozinski/gists{/gist_id}","starred_url":"https://api.github.com/users/GalRogozinski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GalRogozinski/subscriptions","organizations_url":"https://api.github.com/users/GalRogozinski/orgs","repos_url":"https://api.github.com/users/GalRogozinski/repos","events_url":"https://api.github.com/users/GalRogozinski/events{/privacy}","received_events_url":"https://api.github.com/users/GalRogozinski/received_events","type":"User","site_admin":false},"body":"<!---\r\nHints for a successful PR:\r\n1. It is recommended that before you submit a PR to IOTA, to open an issue first and assign yourself.\r\nThis way you may get inputs and discover parallel PRs to the one you want to submit.\r\n2. In case of a big PR, consider breaking it up into smaller PRs. This will help to get it merged in an incremental process.\r\n3. Note that a PR should have a *single* area of responsibility. If your PR does more than one thing than it should be split into several PRs!!!!!\r\n4. It will be helpful if you make additional comments on the code via GitHub PR review to explain the choices you made\r\n-->\r\n\r\n# Description\r\n - This changes the way IRI loads configurations internally.\r\n - Testnet and Mainnet Configs are now separated to different classes that implement the same interfaces.\r\n - Interface segregation is used so that different \"modules\" won't have access to configurations they don't need.\r\n- Now with the `--help` flag one can print instructions to what the different configurations do.\r\n- Note that when one adds the `--testnet` flag new configs are available. One can see them by entering `--testnet --help`.\r\n- Jcommander  is used to parse CLI args.\r\n- Jackson is used to parse the ini file.\r\n\r\nFixes #724 \r\n\r\n## Type of change\r\n- Enhancement (a non-breaking change which adds functionality)\r\n\r\n# How Has This Been Tested?\r\n\r\nRan sanity tests on the following configs:\r\n - port (API)\r\n - neighbors\r\n - tcp port\r\n - udp port\r\n\r\n# Checklist:\r\n- [x] My code follows the style guidelines for this project\r\n- [x] I have performed a self-review of my own code\r\n- [x] I have commented my code, particularly in hard-to-understand areas\r\n- [ ] I have made corresponding changes to the documentation\r\n- [ ] I have added tests that prove my fix is effective or that my feature works\r\n- [x] New and existing unit tests pass locally with my changes\r\n","created_at":"2018-08-06T12:10:44Z","updated_at":"2018-08-07T10:13:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2e8d1ee62c851f806e9450a0916540d0d095a46f","assignee":null,"assignees":[],"requested_reviewers":[{"login":"alon-e","id":25587995,"node_id":"MDQ6VXNlcjI1NTg3OTk1","avatar_url":"https://avatars3.githubusercontent.com/u/25587995?v=4","gravatar_id":"","url":"https://api.github.com/users/alon-e","html_url":"https://github.com/alon-e","followers_url":"https://api.github.com/users/alon-e/followers","following_url":"https://api.github.com/users/alon-e/following{/other_user}","gists_url":"https://api.github.com/users/alon-e/gists{/gist_id}","starred_url":"https://api.github.com/users/alon-e/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alon-e/subscriptions","organizations_url":"https://api.github.com/users/alon-e/orgs","repos_url":"https://api.github.com/users/alon-e/repos","events_url":"https://api.github.com/users/alon-e/events{/privacy}","received_events_url":"https://api.github.com/users/alon-e/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/iotaledger/iri/pulls/910/commits","review_comments_url":"https://api.github.com/repos/iotaledger/iri/pulls/910/comments","review_comment_url":"https://api.github.com/repos/iotaledger/iri/pulls/comments{/number}","comments_url":"https://api.github.com/repos/iotaledger/iri/issues/910/comments","statuses_url":"https://api.github.com/repos/iotaledger/iri/statuses/855b64afb26ee8198c997252f2cff707f577f862","head":{"label":"GalRogozinski:configuration-refactor3","ref":"configuration-refactor3","sha":"855b64afb26ee8198c997252f2cff707f577f862","user":{"login":"GalRogozinski","id":7954839,"node_id":"MDQ6VXNlcjc5NTQ4Mzk=","avatar_url":"https://avatars3.githubusercontent.com/u/7954839?v=4","gravatar_id":"","url":"https://api.github.com/users/GalRogozinski","html_url":"https://github.com/GalRogozinski","followers_url":"https://api.github.com/users/GalRogozinski/followers","following_url":"https://api.github.com/users/GalRogozinski/following{/other_user}","gists_url":"https://api.github.com/users/GalRogozinski/gists{/gist_id}","starred_url":"https://api.github.com/users/GalRogozinski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GalRogozinski/subscriptions","organizations_url":"https://api.github.com/users/GalRogozinski/orgs","repos_url":"https://api.github.com/users/GalRogozinski/repos","events_url":"https://api.github.com/users/GalRogozinski/events{/privacy}","received_events_url":"https://api.github.com/users/GalRogozinski/received_events","type":"User","site_admin":false},"repo":{"id":111612948,"node_id":"MDEwOlJlcG9zaXRvcnkxMTE2MTI5NDg=","name":"iri","full_name":"GalRogozinski/iri","owner":{"login":"GalRogozinski","id":7954839,"node_id":"MDQ6VXNlcjc5NTQ4Mzk=","avatar_url":"https://avatars3.githubusercontent.com/u/7954839?v=4","gravatar_id":"","url":"https://api.github.com/users/GalRogozinski","html_url":"https://github.com/GalRogozinski","followers_url":"https://api.github.com/users/GalRogozinski/followers","following_url":"https://api.github.com/users/GalRogozinski/following{/other_user}","gists_url":"https://api.github.com/users/GalRogozinski/gists{/gist_id}","starred_url":"https://api.github.com/users/GalRogozinski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GalRogozinski/subscriptions","organizations_url":"https://api.github.com/users/GalRogozinski/orgs","repos_url":"https://api.github.com/users/GalRogozinski/repos","events_url":"https://api.github.com/users/GalRogozinski/events{/privacy}","received_events_url":"https://api.github.com/users/GalRogozinski/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/GalRogozinski/iri","description":"IOTA Reference Implementation","fork":true,"url":"https://api.github.com/repos/GalRogozinski/iri","forks_url":"https://api.github.com/repos/GalRogozinski/iri/forks","keys_url":"https://api.github.com/repos/GalRogozinski/iri/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GalRogozinski/iri/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GalRogozinski/iri/teams","hooks_url":"https://api.github.com/repos/GalRogozinski/iri/hooks","issue_events_url":"https://api.github.com/repos/GalRogozinski/iri/issues/events{/number}","events_url":"https://api.github.com/repos/GalRogozinski/iri/events","assignees_url":"https://api.github.com/repos/GalRogozinski/iri/assignees{/user}","branches_url":"https://api.github.com/repos/GalRogozinski/iri/branches{/branch}","tags_url":"https://api.github.com/repos/GalRogozinski/iri/tags","blobs_url":"https://api.github.com/repos/GalRogozinski/iri/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GalRogozinski/iri/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GalRogozinski/iri/git/refs{/sha}","trees_url":"https://api.github.com/repos/GalRogozinski/iri/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GalRogozinski/iri/statuses/{sha}","languages_url":"https://api.github.com/repos/GalRogozinski/iri/languages","stargazers_url":"https://api.github.com/repos/GalRogozinski/iri/stargazers","contributors_url":"https://api.github.com/repos/GalRogozinski/iri/contributors","subscribers_url":"https://api.github.com/repos/GalRogozinski/iri/subscribers","subscription_url":"https://api.github.com/repos/GalRogozinski/iri/subscription","commits_url":"https://api.github.com/repos/GalRogozinski/iri/commits{/sha}","git_commits_url":"https://api.github.com/repos/GalRogozinski/iri/git/commits{/sha}","comments_url":"https://api.github.com/repos/GalRogozinski/iri/comments{/number}","issue_comment_url":"https://api.github.com/repos/GalRogozinski/iri/issues/comments{/number}","contents_url":"https://api.github.com/repos/GalRogozinski/iri/contents/{+path}","compare_url":"https://api.github.com/repos/GalRogozinski/iri/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GalRogozinski/iri/merges","archive_url":"https://api.github.com/repos/GalRogozinski/iri/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GalRogozinski/iri/downloads","issues_url":"https://api.github.com/repos/GalRogozinski/iri/issues{/number}","pulls_url":"https://api.github.com/repos/GalRogozinski/iri/pulls{/number}","milestones_url":"https://api.github.com/repos/GalRogozinski/iri/milestones{/number}","notifications_url":"https://api.github.com/repos/GalRogozinski/iri/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GalRogozinski/iri/labels{/name}","releases_url":"https://api.github.com/repos/GalRogozinski/iri/releases{/id}","deployments_url":"https://api.github.com/repos/GalRogozinski/iri/deployments","created_at":"2017-11-21T23:27:08Z","updated_at":"2018-07-17T10:05:33Z","pushed_at":"2018-08-07T06:41:11Z","git_url":"git://github.com/GalRogozinski/iri.git","ssh_url":"git@github.com:GalRogozinski/iri.git","clone_url":"https://github.com/GalRogozinski/iri.git","svn_url":"https://github.com/GalRogozinski/iri","homepage":null,"size":100923,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":0,"open_issues":4,"watchers":0,"default_branch":"dev"}},"base":{"label":"iotaledger:dev","ref":"dev","sha":"5566cbcc322a18a0d12a1ae425b4510de6bc8be8","user":{"login":"iotaledger","id":20126597,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwMTI2NTk3","avatar_url":"https://avatars3.githubusercontent.com/u/20126597?v=4","gravatar_id":"","url":"https://api.github.com/users/iotaledger","html_url":"https://github.com/iotaledger","followers_url":"https://api.github.com/users/iotaledger/followers","following_url":"https://api.github.com/users/iotaledger/following{/other_user}","gists_url":"https://api.github.com/users/iotaledger/gists{/gist_id}","starred_url":"https://api.github.com/users/iotaledger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iotaledger/subscriptions","organizations_url":"https://api.github.com/users/iotaledger/orgs","repos_url":"https://api.github.com/users/iotaledger/repos","events_url":"https://api.github.com/users/iotaledger/events{/privacy}","received_events_url":"https://api.github.com/users/iotaledger/received_events","type":"Organization","site_admin":false},"repo":{"id":71836159,"node_id":"MDEwOlJlcG9zaXRvcnk3MTgzNjE1OQ==","name":"iri","full_name":"iotaledger/iri","owner":{"login":"iotaledger","id":20126597,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwMTI2NTk3","avatar_url":"https://avatars3.githubusercontent.com/u/20126597?v=4","gravatar_id":"","url":"https://api.github.com/users/iotaledger","html_url":"https://github.com/iotaledger","followers_url":"https://api.github.com/users/iotaledger/followers","following_url":"https://api.github.com/users/iotaledger/following{/other_user}","gists_url":"https://api.github.com/users/iotaledger/gists{/gist_id}","starred_url":"https://api.github.com/users/iotaledger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iotaledger/subscriptions","organizations_url":"https://api.github.com/users/iotaledger/orgs","repos_url":"https://api.github.com/users/iotaledger/repos","events_url":"https://api.github.com/users/iotaledger/events{/privacy}","received_events_url":"https://api.github.com/users/iotaledger/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/iotaledger/iri","description":"IOTA Reference Implementation","fork":false,"url":"https://api.github.com/repos/iotaledger/iri","forks_url":"https://api.github.com/repos/iotaledger/iri/forks","keys_url":"https://api.github.com/repos/iotaledger/iri/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iotaledger/iri/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iotaledger/iri/teams","hooks_url":"https://api.github.com/repos/iotaledger/iri/hooks","issue_events_url":"https://api.github.com/repos/iotaledger/iri/issues/events{/number}","events_url":"https://api.github.com/repos/iotaledger/iri/events","assignees_url":"https://api.github.com/repos/iotaledger/iri/assignees{/user}","branches_url":"https://api.github.com/repos/iotaledger/iri/branches{/branch}","tags_url":"https://api.github.com/repos/iotaledger/iri/tags","blobs_url":"https://api.github.com/repos/iotaledger/iri/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iotaledger/iri/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iotaledger/iri/git/refs{/sha}","trees_url":"https://api.github.com/repos/iotaledger/iri/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iotaledger/iri/statuses/{sha}","languages_url":"https://api.github.com/repos/iotaledger/iri/languages","stargazers_url":"https://api.github.com/repos/iotaledger/iri/stargazers","contributors_url":"https://api.github.com/repos/iotaledger/iri/contributors","subscribers_url":"https://api.github.com/repos/iotaledger/iri/subscribers","subscription_url":"https://api.github.com/repos/iotaledger/iri/subscription","commits_url":"https://api.github.com/repos/iotaledger/iri/commits{/sha}","git_commits_url":"https://api.github.com/repos/iotaledger/iri/git/commits{/sha}","comments_url":"https://api.github.com/repos/iotaledger/iri/comments{/number}","issue_comment_url":"https://api.github.com/repos/iotaledger/iri/issues/comments{/number}","contents_url":"https://api.github.com/repos/iotaledger/iri/contents/{+path}","compare_url":"https://api.github.com/repos/iotaledger/iri/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iotaledger/iri/merges","archive_url":"https://api.github.com/repos/iotaledger/iri/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iotaledger/iri/downloads","issues_url":"https://api.github.com/repos/iotaledger/iri/issues{/number}","pulls_url":"https://api.github.com/repos/iotaledger/iri/pulls{/number}","milestones_url":"https://api.github.com/repos/iotaledger/iri/milestones{/number}","notifications_url":"https://api.github.com/repos/iotaledger/iri/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iotaledger/iri/labels{/name}","releases_url":"https://api.github.com/repos/iotaledger/iri/releases{/id}","deployments_url":"https://api.github.com/repos/iotaledger/iri/deployments","created_at":"2016-10-24T22:06:06Z","updated_at":"2018-08-06T14:13:59Z","pushed_at":"2018-08-07T08:22:08Z","git_url":"git://github.com/iotaledger/iri.git","ssh_url":"git@github.com:iotaledger/iri.git","clone_url":"https://github.com/iotaledger/iri.git","svn_url":"https://github.com/iotaledger/iri","homepage":null,"size":100672,"stargazers_count":1003,"watchers_count":1003,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":348,"mirror_url":null,"archived":false,"open_issues_count":199,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":348,"open_issues":199,"watchers":1003,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/iotaledger/iri/pulls/910"},"html":{"href":"https://github.com/iotaledger/iri/pull/910"},"issue":{"href":"https://api.github.com/repos/iotaledger/iri/issues/910"},"comments":{"href":"https://api.github.com/repos/iotaledger/iri/issues/910/comments"},"review_comments":{"href":"https://api.github.com/repos/iotaledger/iri/pulls/910/comments"},"review_comment":{"href":"https://api.github.com/repos/iotaledger/iri/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/iotaledger/iri/pulls/910/commits"},"statuses":{"href":"https://api.github.com/repos/iotaledger/iri/statuses/855b64afb26ee8198c997252f2cff707f577f862"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"GalRogozinski"}}