{"id":26448582,"url":"https://github.com/scorum/network-client-go","last_synced_at":"2025-03-18T14:35:06.529Z","repository":{"id":197029891,"uuid":"655848786","full_name":"scorum/network-client-go","owner":"scorum","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-31T16:16:51.000Z","size":115,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-10-31T17:23:49.731Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scorum.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-19T18:23:35.000Z","updated_at":"2024-10-31T16:16:55.000Z","dependencies_parsed_at":"2024-04-17T11:48:50.007Z","dependency_job_id":"7776257b-d5af-4ec6-9549-47ae14f2bf71","html_url":"https://github.com/scorum/network-client-go","commit_stats":null,"previous_names":["scorum/network-client-go"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scorum%2Fnetwork-client-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scorum%2Fnetwork-client-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scorum%2Fnetwork-client-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scorum%2Fnetwork-client-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scorum","download_url":"https://codeload.github.com/scorum/network-client-go/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244240941,"owners_count":20421555,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-18T14:35:05.933Z","updated_at":"2025-03-18T14:35:06.524Z","avatar_url":"https://github.com/scorum.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# network-client-go\n\nBoth fetcher and broadcaster client  \nThis library is always up-to-date with `main` branch of [https://github.com/scorum/cosmos-network](Scorum Cosmos Network)\n\n## Broadcaster\n\nThis package is used to broadcast messages from go code.\n\nBroadcaster instance requires keyring provided\n\n### Usage\n```\nb, err := broadcaster.New(Config{\n    KeyringRootDir:     \"test\",\n    KeyringBackend:     \"file\",\n    KeyringPromptInput: \"1qaz2wsX\",\n    NodeURI:            \"localhost:26657\",\n    BroadcastMode:      \"block\",\n    From:               \"keyringKey\",\n    ChainID:            \"test\",\n})\nif err != nil {\n    return fmt.Errorf(\"failed to create broadcaster: %w\", err)\n}\n\nmsg := NewSomeScorumMsg(from)\ntx, err := b.BroadcastMsg(msg, \"memo\")\nif err != nil {\n    return fmt.Errorf(\"failed to broadcast: %w\", err)\n}\n\nlog.Info(tx.TxHash)\n```\n\n## Fetcher\n\nThis package is used to listen blockchain. Note: fetcher's FetchBlocks call is blocking.\n\n### Usage\n```\nf, err := fetcher.New(ctx, \"localhost:9090\", time.Second)\nif err != nil {\n    return fmt.Errorf(\"failed to create fetcher: %w\", err)\n}\n\nf.FetchBlocks(\n    ctx,\n    from,\n    func(b Block) error {\n        fmt.Printf(\"%+v\", b)\n\n        return nil\n    },\n    WithErrHandler(func(height uint64, err error) {\n        log.Error(\"failed to fetch\", height, err)\n    }),\n    WithRetryInterval(time.Minute),\n    WithSkipError(false),\n    WithRetryLastBlockInterval(time.Second*5),\n)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscorum%2Fnetwork-client-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscorum%2Fnetwork-client-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscorum%2Fnetwork-client-go/lists"}