Create application side code to invoke smartcode
castvote.go
wallet, err := gateway.NewFileSystemWallet("wallet")
gw, err := gateway.Connect(
gateway.WithConfig(config.FromFile(configFilePath)),
gateway.WithIdentity(wallet, "user"),
)
network, err := gw.GetNetwork("votingchannel")
contract := network.GetContract("voternetchaincode")
result, err := contract.SubmitTransaction("Cast", voter, time.Now().String(), candidate, uuid.New().String())
Last updated