Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supports loading of config values for Orderer.Endpoints #249

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

smallsixFight
Copy link

@smallsixFight smallsixFight commented Nov 7, 2022

fabric version: release-2.2

configtx.yaml(release-2.2): configtx.yaml

sdk_config file : config_e2e.yaml without certificateAuthorities config

When I call the chaincode transaction using the code below, fabric-sdk-go returns 'orderers is nil'. I found out that this is due to the channel configuration of the application channel with Orderer.Endpoints but not OrdererAddresses, and the loadConfigValue function does not support "Endpoints" configuration loading.

func main() {
	sdk, err := fabsdk.New(config.FromFile("config_e2e.yaml"))
	if err != nil {
		log.Fatalln(err)
	}
	defer sdk.Close()
	cli, err := channel.New(sdk.ChannelContext("mychannel", fabsdk.WithUser("Admin"), fabsdk.WithOrg("Org1"),
	))
	if err != nil {
		log.Fatalln(err)
	}
	resp, err := cli.Execute(channel.Request{
		ChaincodeID: "abstore",
		Fcn:         "init",
		Args:        [][]byte{[]byte("a"), []byte("100"), []byte("b"), []byte("200")},
		IsInit:      true,
	})
	if err != nil {
		log.Fatalln(err)
	}
	log.Println(string(resp.TransactionID))
}

Signed-off-by: smallsixFight [email protected]

@smallsixFight smallsixFight requested a review from a team as a code owner November 7, 2022 03:27
@codecov
Copy link

codecov bot commented Nov 7, 2022

Codecov Report

Merging #249 (09958cf) into main (7af45ce) will increase coverage by 0.04%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #249      +/-   ##
==========================================
+ Coverage   76.22%   76.26%   +0.04%     
==========================================
  Files         193      193              
  Lines       14103    14103              
==========================================
+ Hits        10750    10756       +6     
+ Misses       2385     2381       -4     
+ Partials      968      966       -2     
Impacted Files Coverage Δ
pkg/fab/chconfig/chconfig.go 68.51% <100.00%> (ø)
pkg/util/concurrent/lazycache/lazycache.go 94.17% <0.00%> (+5.82%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@stale
Copy link

stale bot commented Jun 8, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant