{"action":"created","comment":{"url":"https://api.github.com/repos/solana-labs/solana/pulls/comments/208075662","pull_request_review_id":143814099,"id":208075662,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwODA3NTY2Mg==","diff_hunk":"@@ -17,17 +21,38 @@ fn main() {\n                 .required(true)\n                 .help(\"use DIR for ledger location\"),\n         )\n+        .subcommand(SubCommand::with_name(\"print\").about(\"Print the ledger\"))\n+        .subcommand(SubCommand::with_name(\"verify\").about(\"Verify the ledger\"))\n         .get_matches();\n \n     let ledger_path = matches.value_of(\"ledger\").unwrap();\n+    let entries = match read_ledger(ledger_path) {","path":"src/bin/ledger-tool.rs","position":28,"original_position":28,"commit_id":"a2bbd1776e0c6e669fbdbda800468fcbd3cedb18","original_commit_id":"a2bbd1776e0c6e669fbdbda800468fcbd3cedb18","user":{"login":"mvines","id":1281082,"node_id":"MDQ6VXNlcjEyODEwODI=","avatar_url":"https://avatars1.githubusercontent.com/u/1281082?v=4","gravatar_id":"","url":"https://api.github.com/users/mvines","html_url":"https://github.com/mvines","followers_url":"https://api.github.com/users/mvines/followers","following_url":"https://api.github.com/users/mvines/following{/other_user}","gists_url":"https://api.github.com/users/mvines/gists{/gist_id}","starred_url":"https://api.github.com/users/mvines/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mvines/subscriptions","organizations_url":"https://api.github.com/users/mvines/orgs","repos_url":"https://api.github.com/users/mvines/repos","events_url":"https://api.github.com/users/mvines/events{/privacy}","received_events_url":"https://api.github.com/users/mvines/received_events","type":"User","site_admin":false},"body":"I think it's pretty gnarly myself, notably it doesn't tell you *what* file or directory was not found so you need to think harder unnecessarily.\r\n\r\nContrast:\r\n```bash\r\n$ cargo run --bin solana-ledger-tool -- --ledger garbage_path\r\n    Finished dev [unoptimized + debuginfo] target(s) in 0.24s\r\n     Running `target/debug/solana-ledger-tool --ledger garbage_path`\r\nError: Os { code: 2, kind: NotFound, message: \"No such file or directory\" }\r\n```\r\nvs.\r\n```bash\r\n$ cargo run --bin solana-ledger-tool -- --ledger garbage_path\r\n    Finished dev [unoptimized + debuginfo] target(s) in 0.26s\r\n     Running `target/debug/solana-ledger-tool --ledger garbage_path`\r\nFailed to open ledger at garbage_path: No such file or directory (os error 2)\r\n```","created_at":"2018-08-07T01:37:41Z","updated_at":"2018-08-07T01:37:41Z","html_url":"https://github.com/solana-labs/solana/pull/884#discussion_r208075662","pull_request_url":"https://api.github.com/repos/solana-labs/solana/pulls/884","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/solana-labs/solana/pulls/comments/208075662"},"html":{"href":"https://github.com/solana-labs/solana/pull/884#discussion_r208075662"},"pull_request":{"href":"https://api.github.com/repos/solana-labs/solana/pulls/884"}},"in_reply_to_id":208074631},"pull_request":{"url":"https://api.github.com/repos/solana-labs/solana/pulls/884","id":206540399,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA2NTQwMzk5","html_url":"https://github.com/solana-labs/solana/pull/884","diff_url":"https://github.com/solana-labs/solana/pull/884.diff","patch_url":"https://github.com/solana-labs/solana/pull/884.patch","issue_url":"https://api.github.com/repos/solana-labs/solana/issues/884","number":884,"state":"open","locked":false,"title":"ledger-tool: Add verify subcommand","user":{"login":"mvines","id":1281082,"node_id":"MDQ6VXNlcjEyODEwODI=","avatar_url":"https://avatars1.githubusercontent.com/u/1281082?v=4","gravatar_id":"","url":"https://api.github.com/users/mvines","html_url":"https://github.com/mvines","followers_url":"https://api.github.com/users/mvines/followers","following_url":"https://api.github.com/users/mvines/following{/other_user}","gists_url":"https://api.github.com/users/mvines/gists{/gist_id}","starred_url":"https://api.github.com/users/mvines/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mvines/subscriptions","organizations_url":"https://api.github.com/users/mvines/orgs","repos_url":"https://api.github.com/users/mvines/repos","events_url":"https://api.github.com/users/mvines/events{/privacy}","received_events_url":"https://api.github.com/users/mvines/received_events","type":"User","site_admin":false},"body":"Old:\r\n```bash\r\n$ cargo run --bin solana-ledger-tool -- --ledger config/ledger\r\n```\r\n\r\nNew:\r\n```bash\r\n$ cargo run --bin solana-ledger-tool -- --ledger config/ledger verify\r\n$ cargo run --bin solana-ledger-tool -- --ledger config/ledger print\r\n```","created_at":"2018-08-06T23:14:30Z","updated_at":"2018-08-07T01:37:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"93e47e058b2721f557b8caa957af0e6dec6442a0","assignee":null,"assignees":[],"requested_reviewers":[{"login":"rob-solana","id":40183961,"node_id":"MDQ6VXNlcjQwMTgzOTYx","avatar_url":"https://avatars0.githubusercontent.com/u/40183961?v=4","gravatar_id":"","url":"https://api.github.com/users/rob-solana","html_url":"https://github.com/rob-solana","followers_url":"https://api.github.com/users/rob-solana/followers","following_url":"https://api.github.com/users/rob-solana/following{/other_user}","gists_url":"https://api.github.com/users/rob-solana/gists{/gist_id}","starred_url":"https://api.github.com/users/rob-solana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rob-solana/subscriptions","organizations_url":"https://api.github.com/users/rob-solana/orgs","repos_url":"https://api.github.com/users/rob-solana/repos","events_url":"https://api.github.com/users/rob-solana/events{/privacy}","received_events_url":"https://api.github.com/users/rob-solana/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/solana-labs/solana/pulls/884/commits","review_comments_url":"https://api.github.com/repos/solana-labs/solana/pulls/884/comments","review_comment_url":"https://api.github.com/repos/solana-labs/solana/pulls/comments{/number}","comments_url":"https://api.github.com/repos/solana-labs/solana/issues/884/comments","statuses_url":"https://api.github.com/repos/solana-labs/solana/statuses/a2bbd1776e0c6e669fbdbda800468fcbd3cedb18","head":{"label":"mvines:tool","ref":"tool","sha":"a2bbd1776e0c6e669fbdbda800468fcbd3cedb18","user":{"login":"mvines","id":1281082,"node_id":"MDQ6VXNlcjEyODEwODI=","avatar_url":"https://avatars1.githubusercontent.com/u/1281082?v=4","gravatar_id":"","url":"https://api.github.com/users/mvines","html_url":"https://github.com/mvines","followers_url":"https://api.github.com/users/mvines/followers","following_url":"https://api.github.com/users/mvines/following{/other_user}","gists_url":"https://api.github.com/users/mvines/gists{/gist_id}","starred_url":"https://api.github.com/users/mvines/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mvines/subscriptions","organizations_url":"https://api.github.com/users/mvines/orgs","repos_url":"https://api.github.com/users/mvines/repos","events_url":"https://api.github.com/users/mvines/events{/privacy}","received_events_url":"https://api.github.com/users/mvines/received_events","type":"User","site_admin":false},"repo":{"id":133611947,"node_id":"MDEwOlJlcG9zaXRvcnkxMzM2MTE5NDc=","name":"solana","full_name":"mvines/solana","owner":{"login":"mvines","id":1281082,"node_id":"MDQ6VXNlcjEyODEwODI=","avatar_url":"https://avatars1.githubusercontent.com/u/1281082?v=4","gravatar_id":"","url":"https://api.github.com/users/mvines","html_url":"https://github.com/mvines","followers_url":"https://api.github.com/users/mvines/followers","following_url":"https://api.github.com/users/mvines/following{/other_user}","gists_url":"https://api.github.com/users/mvines/gists{/gist_id}","starred_url":"https://api.github.com/users/mvines/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mvines/subscriptions","organizations_url":"https://api.github.com/users/mvines/orgs","repos_url":"https://api.github.com/users/mvines/repos","events_url":"https://api.github.com/users/mvines/events{/privacy}","received_events_url":"https://api.github.com/users/mvines/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mvines/solana","description":null,"fork":true,"url":"https://api.github.com/repos/mvines/solana","forks_url":"https://api.github.com/repos/mvines/solana/forks","keys_url":"https://api.github.com/repos/mvines/solana/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mvines/solana/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mvines/solana/teams","hooks_url":"https://api.github.com/repos/mvines/solana/hooks","issue_events_url":"https://api.github.com/repos/mvines/solana/issues/events{/number}","events_url":"https://api.github.com/repos/mvines/solana/events","assignees_url":"https://api.github.com/repos/mvines/solana/assignees{/user}","branches_url":"https://api.github.com/repos/mvines/solana/branches{/branch}","tags_url":"https://api.github.com/repos/mvines/solana/tags","blobs_url":"https://api.github.com/repos/mvines/solana/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mvines/solana/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mvines/solana/git/refs{/sha}","trees_url":"https://api.github.com/repos/mvines/solana/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mvines/solana/statuses/{sha}","languages_url":"https://api.github.com/repos/mvines/solana/languages","stargazers_url":"https://api.github.com/repos/mvines/solana/stargazers","contributors_url":"https://api.github.com/repos/mvines/solana/contributors","subscribers_url":"https://api.github.com/repos/mvines/solana/subscribers","subscription_url":"https://api.github.com/repos/mvines/solana/subscription","commits_url":"https://api.github.com/repos/mvines/solana/commits{/sha}","git_commits_url":"https://api.github.com/repos/mvines/solana/git/commits{/sha}","comments_url":"https://api.github.com/repos/mvines/solana/comments{/number}","issue_comment_url":"https://api.github.com/repos/mvines/solana/issues/comments{/number}","contents_url":"https://api.github.com/repos/mvines/solana/contents/{+path}","compare_url":"https://api.github.com/repos/mvines/solana/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mvines/solana/merges","archive_url":"https://api.github.com/repos/mvines/solana/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mvines/solana/downloads","issues_url":"https://api.github.com/repos/mvines/solana/issues{/number}","pulls_url":"https://api.github.com/repos/mvines/solana/pulls{/number}","milestones_url":"https://api.github.com/repos/mvines/solana/milestones{/number}","notifications_url":"https://api.github.com/repos/mvines/solana/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mvines/solana/labels{/name}","releases_url":"https://api.github.com/repos/mvines/solana/releases{/id}","deployments_url":"https://api.github.com/repos/mvines/solana/deployments","created_at":"2018-05-16T04:50:24Z","updated_at":"2018-08-03T21:14:42Z","pushed_at":"2018-08-07T00:34:24Z","git_url":"git://github.com/mvines/solana.git","ssh_url":"git@github.com:mvines/solana.git","clone_url":"https://github.com/mvines/solana.git","svn_url":"https://github.com/mvines/solana","homepage":"http://solana.com/","size":10170,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"solana-labs:master","ref":"master","sha":"7c31f217d5b85f8d6e96412ab1517f457e22b1ab","user":{"login":"solana-labs","id":35608259,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1NjA4MjU5","avatar_url":"https://avatars3.githubusercontent.com/u/35608259?v=4","gravatar_id":"","url":"https://api.github.com/users/solana-labs","html_url":"https://github.com/solana-labs","followers_url":"https://api.github.com/users/solana-labs/followers","following_url":"https://api.github.com/users/solana-labs/following{/other_user}","gists_url":"https://api.github.com/users/solana-labs/gists{/gist_id}","starred_url":"https://api.github.com/users/solana-labs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/solana-labs/subscriptions","organizations_url":"https://api.github.com/users/solana-labs/orgs","repos_url":"https://api.github.com/users/solana-labs/repos","events_url":"https://api.github.com/users/solana-labs/events{/privacy}","received_events_url":"https://api.github.com/users/solana-labs/received_events","type":"Organization","site_admin":false},"repo":{"id":121470383,"node_id":"MDEwOlJlcG9zaXRvcnkxMjE0NzAzODM=","name":"solana","full_name":"solana-labs/solana","owner":{"login":"solana-labs","id":35608259,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM1NjA4MjU5","avatar_url":"https://avatars3.githubusercontent.com/u/35608259?v=4","gravatar_id":"","url":"https://api.github.com/users/solana-labs","html_url":"https://github.com/solana-labs","followers_url":"https://api.github.com/users/solana-labs/followers","following_url":"https://api.github.com/users/solana-labs/following{/other_user}","gists_url":"https://api.github.com/users/solana-labs/gists{/gist_id}","starred_url":"https://api.github.com/users/solana-labs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/solana-labs/subscriptions","organizations_url":"https://api.github.com/users/solana-labs/orgs","repos_url":"https://api.github.com/users/solana-labs/repos","events_url":"https://api.github.com/users/solana-labs/events{/privacy}","received_events_url":"https://api.github.com/users/solana-labs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/solana-labs/solana","description":"Blockchain, Rebuilt for Scale","fork":false,"url":"https://api.github.com/repos/solana-labs/solana","forks_url":"https://api.github.com/repos/solana-labs/solana/forks","keys_url":"https://api.github.com/repos/solana-labs/solana/keys{/key_id}","collaborators_url":"https://api.github.com/repos/solana-labs/solana/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/solana-labs/solana/teams","hooks_url":"https://api.github.com/repos/solana-labs/solana/hooks","issue_events_url":"https://api.github.com/repos/solana-labs/solana/issues/events{/number}","events_url":"https://api.github.com/repos/solana-labs/solana/events","assignees_url":"https://api.github.com/repos/solana-labs/solana/assignees{/user}","branches_url":"https://api.github.com/repos/solana-labs/solana/branches{/branch}","tags_url":"https://api.github.com/repos/solana-labs/solana/tags","blobs_url":"https://api.github.com/repos/solana-labs/solana/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/solana-labs/solana/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/solana-labs/solana/git/refs{/sha}","trees_url":"https://api.github.com/repos/solana-labs/solana/git/trees{/sha}","statuses_url":"https://api.github.com/repos/solana-labs/solana/statuses/{sha}","languages_url":"https://api.github.com/repos/solana-labs/solana/languages","stargazers_url":"https://api.github.com/repos/solana-labs/solana/stargazers","contributors_url":"https://api.github.com/repos/solana-labs/solana/contributors","subscribers_url":"https://api.github.com/repos/solana-labs/solana/subscribers","subscription_url":"https://api.github.com/repos/solana-labs/solana/subscription","commits_url":"https://api.github.com/repos/solana-labs/solana/commits{/sha}","git_commits_url":"https://api.github.com/repos/solana-labs/solana/git/commits{/sha}","comments_url":"https://api.github.com/repos/solana-labs/solana/comments{/number}","issue_comment_url":"https://api.github.com/repos/solana-labs/solana/issues/comments{/number}","contents_url":"https://api.github.com/repos/solana-labs/solana/contents/{+path}","compare_url":"https://api.github.com/repos/solana-labs/solana/compare/{base}...{head}","merges_url":"https://api.github.com/repos/solana-labs/solana/merges","archive_url":"https://api.github.com/repos/solana-labs/solana/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/solana-labs/solana/downloads","issues_url":"https://api.github.com/repos/solana-labs/solana/issues{/number}","pulls_url":"https://api.github.com/repos/solana-labs/solana/pulls{/number}","milestones_url":"https://api.github.com/repos/solana-labs/solana/milestones{/number}","notifications_url":"https://api.github.com/repos/solana-labs/solana/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/solana-labs/solana/labels{/name}","releases_url":"https://api.github.com/repos/solana-labs/solana/releases{/id}","deployments_url":"https://api.github.com/repos/solana-labs/solana/deployments","created_at":"2018-02-14T04:26:27Z","updated_at":"2018-08-06T22:58:13Z","pushed_at":"2018-08-07T01:33:09Z","git_url":"git://github.com/solana-labs/solana.git","ssh_url":"git@github.com:solana-labs/solana.git","clone_url":"https://github.com/solana-labs/solana.git","svn_url":"https://github.com/solana-labs/solana","homepage":"https://solana.com","size":10121,"stargazers_count":290,"watchers_count":290,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":49,"mirror_url":null,"archived":false,"open_issues_count":80,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":49,"open_issues":80,"watchers":290,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/solana-labs/solana/pulls/884"},"html":{"href":"https://github.com/solana-labs/solana/pull/884"},"issue":{"href":"https://api.github.com/repos/solana-labs/solana/issues/884"},"comments":{"href":"https://api.github.com/repos/solana-labs/solana/issues/884/comments"},"review_comments":{"href":"https://api.github.com/repos/solana-labs/solana/pulls/884/comments"},"review_comment":{"href":"https://api.github.com/repos/solana-labs/solana/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/solana-labs/solana/pulls/884/commits"},"statuses":{"href":"https://api.github.com/repos/solana-labs/solana/statuses/a2bbd1776e0c6e669fbdbda800468fcbd3cedb18"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"mvines"}}