{"action":"closed","issue":{"url":"https://api.github.com/repos/ipfs/go-ipfs/issues/5143","repository_url":"https://api.github.com/repos/ipfs/go-ipfs","labels_url":"https://api.github.com/repos/ipfs/go-ipfs/issues/5143/labels{/name}","comments_url":"https://api.github.com/repos/ipfs/go-ipfs/issues/5143/comments","events_url":"https://api.github.com/repos/ipfs/go-ipfs/issues/5143/events","html_url":"https://github.com/ipfs/go-ipfs/issues/5143","id":334343525,"node_id":"MDU6SXNzdWUzMzQzNDM1MjU=","number":5143,"title":"failed to parse hardcoded bootstrap peers: no protocol with name dnsaddr This is a problem with the ipfs codebase. Please report it to the dev team.","user":{"login":"postables","id":17089485,"node_id":"MDQ6VXNlcjE3MDg5NDg1","avatar_url":"https://avatars1.githubusercontent.com/u/17089485?v=4","gravatar_id":"","url":"https://api.github.com/users/postables","html_url":"https://github.com/postables","followers_url":"https://api.github.com/users/postables/followers","following_url":"https://api.github.com/users/postables/following{/other_user}","gists_url":"https://api.github.com/users/postables/gists{/gist_id}","starred_url":"https://api.github.com/users/postables/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/postables/subscriptions","organizations_url":"https://api.github.com/users/postables/orgs","repos_url":"https://api.github.com/users/postables/repos","events_url":"https://api.github.com/users/postables/events{/privacy}","received_events_url":"https://api.github.com/users/postables/received_events","type":"User","site_admin":false},"labels":[{"id":129070658,"node_id":"MDU6TGFiZWwxMjkwNzA2NTg=","url":"https://api.github.com/repos/ipfs/go-ipfs/labels/in%20progress","name":"in progress","color":"ededed","default":false}],"state":"closed","locked":false,"assignee":{"login":"Stebalien","id":310393,"node_id":"MDQ6VXNlcjMxMDM5Mw==","avatar_url":"https://avatars2.githubusercontent.com/u/310393?v=4","gravatar_id":"","url":"https://api.github.com/users/Stebalien","html_url":"https://github.com/Stebalien","followers_url":"https://api.github.com/users/Stebalien/followers","following_url":"https://api.github.com/users/Stebalien/following{/other_user}","gists_url":"https://api.github.com/users/Stebalien/gists{/gist_id}","starred_url":"https://api.github.com/users/Stebalien/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Stebalien/subscriptions","organizations_url":"https://api.github.com/users/Stebalien/orgs","repos_url":"https://api.github.com/users/Stebalien/repos","events_url":"https://api.github.com/users/Stebalien/events{/privacy}","received_events_url":"https://api.github.com/users/Stebalien/received_events","type":"User","site_admin":false},"assignees":[{"login":"Stebalien","id":310393,"node_id":"MDQ6VXNlcjMxMDM5Mw==","avatar_url":"https://avatars2.githubusercontent.com/u/310393?v=4","gravatar_id":"","url":"https://api.github.com/users/Stebalien","html_url":"https://github.com/Stebalien","followers_url":"https://api.github.com/users/Stebalien/followers","following_url":"https://api.github.com/users/Stebalien/following{/other_user}","gists_url":"https://api.github.com/users/Stebalien/gists{/gist_id}","starred_url":"https://api.github.com/users/Stebalien/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Stebalien/subscriptions","organizations_url":"https://api.github.com/users/Stebalien/orgs","repos_url":"https://api.github.com/users/Stebalien/repos","events_url":"https://api.github.com/users/Stebalien/events{/privacy}","received_events_url":"https://api.github.com/users/Stebalien/received_events","type":"User","site_admin":false}],"milestone":null,"comments":7,"created_at":"2018-06-21T05:26:54Z","updated_at":"2018-06-21T22:14:00Z","closed_at":"2018-06-21T22:13:59Z","author_association":"NONE","body":"#### Version information:\r\n```\r\ngo-ipfs version: 0.4.15-Repo version: 6\r\nSystem version: amd64/linux\r\nGolang version: go1.10.2\r\n```\r\n\r\n#### Type:\r\nBug\r\n\r\n#### Description:\r\nI'm attempting to generate a custom IPFS configuration file utilizing `github.com/ipfs/go-ipfs/repo/config`\r\n\r\nWhile writing a test case, and in attempting to generate a default configuration file using `config.Init` I am given the following errors message\r\n```\r\n        rtfsp_test.go:47: failed to parse hardcoded bootstrap peers: no protocol with name dnsaddr\r\n                This is a problem with the ipfs codebase. Please report it to the dev team.\r\n```\r\n\r\n\r\nHere's the code causing the issue:\r\n\r\n`test file`:\r\n```\r\npackage rtfsp_test\r\n\r\nimport (\r\n\t\"fmt\"\r\n\t\"testing\"\r\n\r\n\t\"github.com/RTradeLtd/Temporal/rtfsp\"\r\n)\r\n\r\nvar ipfsConfigPath = \"/ipfs/config\"\r\nvar testIpfsMultiAddrString = \"/ip4/192.168.1.242/tcp/4001/ipfs/QmXivHtDyAe8nS7cbQiS7ri9haUM2wGvbinjKws3a4EstT\"\r\nvar expectedPeerID = \"QmXivHtDyAe8nS7cbQiS7ri9haUM2wGvbinjKws3a4EstT\"\r\n\r\nfunc TestPrivateConfig(t *testing.T) {\r\n\tpcm, err := rtfsp.GenerateConfigManager(ipfsConfigPath)\r\n\tif err != nil {\r\n\t\tt.Fatal(err)\r\n\t}\r\n\taddr, err := pcm.GenerateIPFSMultiAddr(testIpfsMultiAddrString)\r\n\tif err != nil {\r\n\t\tt.Fatal(err)\r\n\t}\r\n\tpeerID := addr.ID().Pretty()\r\n\tif peerID != expectedPeerID {\r\n\t\tt.Fatal(\"unexpected peer id returned\")\r\n\t}\r\n\r\n\t_, err = pcm.GenerateBootstrapPeer(testIpfsMultiAddrString)\r\n\tif err != nil {\r\n\t\tt.Fatal(err)\r\n\t}\r\n\tbpCfg, err := pcm.ConfigureBootstrap(testIpfsMultiAddrString)\r\n\tif err != nil {\r\n\t\tt.Fatal(err)\r\n\t}\r\n\tfmt.Println(bpCfg)\r\n\tfmt.Println(pcm.Config.Bootstrap)\r\n}\r\n\r\nfunc TestConfigGeneration(t *testing.T) {\r\n\tpcm, err := rtfsp.GenerateConfigManager(rtfsp.ConfigFilePath)\r\n\tif err != nil {\r\n\t\tt.Fatal(err)\r\n\t}\r\n\terr = pcm.ParseConfigAndWrite()\r\n\tif err != nil {\r\n\t\tt.Fatal(err)\r\n\t}\r\n}\r\n```\r\n\r\n`Implementation File`\r\n```\r\npackage rtfsp\r\n\r\nimport (\r\n\t\"encoding/json\"\r\n\t\"fmt\"\r\n\t\"os\"\r\n\r\n\taddrUtil \"github.com/ipfs/go-ipfs-addr\"\r\n\tcg \"github.com/ipfs/go-ipfs/repo/config\"\r\n)\r\n\r\ntype PrivateConfigManager struct {\r\n\tConfig *cg.Config\r\n}\r\n\r\nconst (\r\n\t// ConfigFilePath is where the ipfs config file is located\r\n\tConfigFilePath = \"/ipfs/config\"\r\n\t// SwarmKeyPath is the location of our swarm key\r\n\tSwarmKeyPath = \"/ipfs/swarm.key\"\r\n)\r\n\r\n// GenerateConfigManager generates the config manager for our private\r\nfunc GenerateConfigManager(configFilePath string) (*PrivateConfigManager, error) {\r\n\tvar conf cg.Config\r\n\tfile, err := os.Open(configFilePath)\r\n\tif err != nil {\r\n\t\treturn nil, err\r\n\t}\r\n\terr = json.NewDecoder(file).Decode(&conf)\r\n\tpcm := PrivateConfigManager{Config: &conf}\r\n\treturn &pcm, err\r\n}\r\n\r\nfunc (pcm *PrivateConfigManager) GenerateIPFSMultiAddr(address string) (addrUtil.IPFSAddr, error) {\r\n\tipfsAddr, err := addrUtil.ParseString(address)\r\n\tif err != nil {\r\n\t\treturn nil, err\r\n\t}\r\n\treturn ipfsAddr, nil\r\n}\r\n\r\nfunc (pcm *PrivateConfigManager) GenerateBootstrapPeer(address string) (cg.BootstrapPeer, error) {\r\n\tbpeer, err := cg.ParseBootstrapPeer(address)\r\n\tif err != nil {\r\n\t\treturn nil, err\r\n\t}\r\n\treturn bpeer, nil\r\n}\r\n\r\n// ConfigureBootstrap is a variadic function used to generate a list of bootstrap peers\r\n// it will validate all provided peers, and fail if it detects an error\r\nfunc (pcm *PrivateConfigManager) ConfigureBootstrap(peers ...string) ([]cg.BootstrapPeer, error) {\r\n\tvar bpeers []cg.BootstrapPeer\r\n\tfor _, v := range peers {\r\n\t\tbpeer, err := pcm.GenerateBootstrapPeer(v)\r\n\t\tif err != nil {\r\n\t\t\treturn nil, err\r\n\t\t}\r\n\t\tbpeers = append(bpeers, bpeer)\r\n\t}\r\n\tpcm.Config.SetBootstrapPeers(bpeers)\r\n\treturn bpeers, nil\r\n}\r\n\r\n// ParseConfigAndWrite is used to parse a configuration object and write it\r\nfunc (pcm *PrivateConfigManager) ParseConfigAndWrite() error {\r\n\t// Create file, truncating if it exists\r\n\tcFilePath, err := os.Create(ConfigFilePath)\r\n\tif err != nil {\r\n\t\treturn err\r\n\t}\r\n\tcfg, err := cg.Init(cFilePath, 4192)\r\n\tif err != nil {\r\n\t\treturn err\r\n\t}\r\n\tfmt.Println(cfg)\r\n\treturn nil\r\n}\r\n```\r\n\r\nI'm using the following versioned go-ipfs dependencies\r\n```\r\n[[projects]]\r\n  branch = \"master\"\r\n  name = \"github.com/ipfs/go-ipfs\"\r\n  packages = [\r\n    \"blockservice\",\r\n    \"merkledag\",\r\n    \"merkledag/pb\",\r\n    \"merkledag/utils\",\r\n    \"namesys\",\r\n    \"namesys/opts\",\r\n    \"path\",\r\n    \"pin\",\r\n    \"pin/internal/pb\",\r\n    \"thirdparty/verifcid\",\r\n    \"unixfs\",\r\n    \"unixfs/pb\"\r\n  ]\r\n  revision = \"2a9de81e64d563c5bd86b058aa251cbe94faf86f\"\r\n```"}}
{"actor":{"display_login":"postables"}}