mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-17 07:25:10 +00:00
Compare commits
3 commits
7e284b5aa3
...
917873be2d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
917873be2d | ||
|
|
a2c40e6522 | ||
|
|
e4e7122a5f |
2 changed files with 18 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
|||
package web
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
|
|
@ -18,6 +19,22 @@ func (setup *OrgSetup) Invoke(w http.ResponseWriter, r *http.Request) {
|
|||
channelID := r.FormValue("channelid")
|
||||
function := r.FormValue("function")
|
||||
args := r.Form["args"]
|
||||
|
||||
if len(args) == 1 {
|
||||
var parsed []string
|
||||
err := json.Unmarshal([]byte(args[0]), &parsed)
|
||||
if err == nil {
|
||||
args = parsed
|
||||
} else {
|
||||
fmt.Printf("Warning: failed to parse args as JSON: %s\n", err)
|
||||
}
|
||||
}
|
||||
|
||||
if len(args) == 0 {
|
||||
fmt.Fprintf(w, "Error: args is empty")
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Printf("channel: %s, chaincode: %s, function: %s, args: %s\n", channelID, chainCodeName, function, args)
|
||||
network := setup.Gateway.GetNetwork(channelID)
|
||||
contract := network.GetContract(chainCodeName)
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ context CLUSTER_RUNTIME kind # or k3s for Rancher
|
|||
context CONTAINER_CLI docker # or nerdctl for containerd
|
||||
context CONTAINER_NAMESPACE "" # or "--namespace k8s.io" for containerd / nerdctl
|
||||
|
||||
context FABRIC_CONTAINER_REGISTRY hyperledger
|
||||
context FABRIC_CONTAINER_REGISTRY ghcr.io/hyperledger
|
||||
context FABRIC_PEER_IMAGE ${FABRIC_CONTAINER_REGISTRY}/fabric-peer:${FABRIC_VERSION}
|
||||
context COUCHDB_VERSION 3.4.2
|
||||
context NETWORK_NAME test-network
|
||||
|
|
|
|||
Loading…
Reference in a new issue