{"id":24478508,"url":"https://github.com/chaunsin/fgc","last_synced_at":"2026-05-06T23:32:20.180Z","repository":{"id":171688534,"uuid":"648270556","full_name":"chaunsin/fgc","owner":"chaunsin","description":"根据Fabric公私钥目录生成连接sdk配置文件","archived":false,"fork":false,"pushed_at":"2025-01-14T07:49:40.000Z","size":66,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-29T12:16:42.252Z","etag":null,"topics":["config","fabric","fabric-sdk-go","go","golang","sdk"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chaunsin.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-01T15:25:11.000Z","updated_at":"2025-01-14T07:49:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"b1613fcc-416e-4930-8049-6b2cba1f18db","html_url":"https://github.com/chaunsin/fgc","commit_stats":null,"previous_names":["chaunsin/fabric-gen-config"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaunsin%2Ffgc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaunsin%2Ffgc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaunsin%2Ffgc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaunsin%2Ffgc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chaunsin","download_url":"https://codeload.github.com/chaunsin/fgc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245220812,"owners_count":20579842,"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":["config","fabric","fabric-sdk-go","go","golang","sdk"],"created_at":"2025-01-21T10:12:35.427Z","updated_at":"2026-05-06T23:32:15.160Z","avatar_url":"https://github.com/chaunsin.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fgc(Fabric Generate Config)\n\n[![Qodana](https://github.com/chaunsin/fgc/actions/workflows/qodana_code_quality.yml/badge.svg?branch=master)](https://github.com/chaunsin/fgc/actions/workflows/qodana_code_quality.yml)\n\n由于fabric证书配置复杂编写配置容易搞错,本人想着便捷于是诞生了此工具,用于生成sdk链接配置文件.\n\n# 注意！！！\n\n目前此库还不完善不过可以生成golang可用的配置\n\n# 安装\n\n方式一\n\n```shell\ngo install github.com/chaunsin/fgc@latest \n```\n\n此方式生成的`fgc`二进制可执行程序会放到$GOBIN目录下\n\n方式二\n\n```shell\ngit clone https://github.com/chaunsin/fgc.git\ncd fgc\nmake install\n```\n\n执行之后会在fgc目录下生成`fgc`可执行文件,推荐放入到全局可引导的目录位置比如`/usr/local/bin`目录下\n\n# 使用\n\n生成fabric-sdk-go sdk链接配置证书\n\n```shell\n# tips: crypto-config为fabric证书目录\nfgc go -i ./crypto-config\n```\n\n帮助\n\n```shell\nfgc -h\n```\n\n# 功能\n\n- [ ] 支持生成普通配置文件生成\n    - [x] 支持golang普通配置文件生成\n    - [ ] 支持java普通配置文件生成\n    - [ ] 支持nodejs普通配置文件生成\n- [ ] 配置文件格式\n    - [x] 支持生成yaml配置文件\n    - [ ] 支持生成json配置文件(目前能生成但是配置文件未必能使用)\n- [ ] 支持生成gateway连接配置文件\n    - [ ] golang网关钱包配置生成\n    - [ ] java网关钱包配置生成\n    - [ ] nodejs网关钱包配置生成\n- [ ] 支持sftp读取配置文件\n- [ ] 支持ftp读取配置文件\n\n细节功能：\n\n- [x] 可控制生成双tls认证连接方式\n- [ ] 生成 Metrics Operations CA模块配置\n- [ ] 可控生成文件是硬编码方式还是路径方式,以及golang环境魔法变量${FABRIC_SDK_GO_PROJECT_PATH}/${CRYPTOCONFIG_FIXTURES_PATH}\n- [ ] 支持魔法变量导入路径或者参数例如:$(pwd)或者${pwd}\n- [ ] 增加配置注释内容\n\n# 问题\n\n由于fabric组织节点服务较多,关系配置复杂,天生自带分布式属性多机部署,在实际环境中会更加恶劣,因此此工具也面临着一些配置文件需要二次修改的问题,目前碰到的痛点有如下\n\n1. mspid 不太容易获取\n    1. docker命令方式获取?\n    2. 配置区块中获取?\n    3. configtx.yaml?\n    4. 进入容器读取环境变量 CORE_PEER_LOCALMSPID?\n    5. 使用Discover服务来获取相关配置信息,但也面临着二次配置证书公私钥等信息?\n2. 获取组织服务的真实ip、域名或端口问题\n    1. 使用docker命令获取\n       `docker ps --format \"table{{.Image}}\\t{{.Names}}\\t{{.Ports}}\" | grep \"hyperledger/fabric-peer\\|hyperledger/fabric-orderer\" | awk '{print $2,$3}'`\n3. peer下面有两个组织每个组织有两个节点,但是每个组织只生成一个节点需要排查修改(貌似没问题)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaunsin%2Ffgc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchaunsin%2Ffgc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaunsin%2Ffgc/lists"}