From e6e3eda2c947460f54db2ed1f6bbdca8dcaded00 Mon Sep 17 00:00:00 2001 From: XingQiang Bai Date: Fri, 22 Dec 2023 11:01:34 +0800 Subject: [PATCH] add some tx method and update c-sdk (#242) --- .ci/integration_test.sh | 23 +- .github/workflows/coverage.yml | 2 +- .github/workflows/workflow.yml | 2 +- .gitignore | 9 + client/connection.go | 76 ++--- client/go_client.go | 57 +++- client/go_client_test.go | 291 +++++++++++++++++- examples/hello_world/HelloWorld.sol | 25 ++ examples/hello_world/manual/main.go | 155 ++++++++++ examples/hello_world/wrapper/HelloWorld.go | 339 +++++++++++++++++++++ examples/hello_world/wrapper/main.go | 86 ++++++ go.mod | 74 ++++- go.sum | 83 +---- tools/download_csdk_lib.sh | 8 +- 14 files changed, 1070 insertions(+), 160 deletions(-) create mode 100644 examples/hello_world/HelloWorld.sol create mode 100644 examples/hello_world/manual/main.go create mode 100644 examples/hello_world/wrapper/HelloWorld.go create mode 100644 examples/hello_world/wrapper/main.go diff --git a/.ci/integration_test.sh b/.ci/integration_test.sh index be367e16..5d8e75f0 100755 --- a/.ci/integration_test.sh +++ b/.ci/integration_test.sh @@ -2,7 +2,7 @@ set -e -c_sdk_version="v3.4.0" +c_sdk_version="v3.5.0" start_time=15 macOS= ldflags="-ldflags=\"-r /usr/local/lib/\"" @@ -336,7 +336,9 @@ integration_std() head build_chain.sh bash build_chain.sh -l 127.0.0.1:2 -o nodes -a 0x83309d045a19c44dc3722d15a6abd472f95866ac bash nodes/127.0.0.1/start_all.sh && sleep "${start_time}" + mkdir -p conf cp nodes/127.0.0.1/sdk/* ./ + cp nodes/127.0.0.1/sdk/* ./conf/ cp nodes/127.0.0.1/sdk/* ./client/ # abigen std @@ -364,6 +366,7 @@ integration_std() if [[ "${check_amop}" == "true" ]];then integration_amop fi + integration_examples bash nodes/127.0.0.1/stop_all.sh LOG_INFO "integration_std testing pass." } @@ -376,6 +379,8 @@ integration_gm() bash build_chain.sh -l 127.0.0.1:2 -s -o nodes_gm -a 0x791a0073e6dfd9dc5e5061aebc43ab4f7aa4ae8b cp -r nodes_gm/127.0.0.1/sdk/* ./conf/ bash nodes_gm/127.0.0.1/start_all.sh && sleep "${start_time}" + mkdir -p conf + cp nodes/127.0.0.1/sdk/* ./conf cp nodes/127.0.0.1/sdk/* ./ cp nodes/127.0.0.1/sdk/* ./client/ @@ -399,20 +404,28 @@ integration_gm() integration_amop() { # nodes should be started LOG_INFO "amop unicast testing..." - execute_cmd "go build ${ldflags} -o subscriber examples/amop/sub/subscriber.go" - execute_cmd "go build ${ldflags} -o unicast_publisher examples/amop/unicast_pub/publisher.go" + execute_cmd "go build ${ldflags} -o subscriber ./examples/amop/sub/subscriber.go" + execute_cmd "go build ${ldflags} -o unicast_publisher ./examples/amop/unicast_pub/publisher.go" ./subscriber 127.0.0.1:20201 hello & sleep 2 ./unicast_publisher 127.0.0.1:20200 hello LOG_INFO "amop broadcast testing..." - execute_cmd "go build ${ldflags} -o broadcast_publisher examples/amop/broadcast_pub/publisher.go" - execute_cmd "go build ${ldflags} -o broadcast_publisher examples/amop/broadcast_pub/publisher.go" + execute_cmd "go build ${ldflags} -o broadcast_publisher ./examples/amop/broadcast_pub/publisher.go" + execute_cmd "go build ${ldflags} -o broadcast_publisher ./examples/amop/broadcast_pub/publisher.go" ./subscriber 127.0.0.1:20201 hello1 & sleep 2 ./broadcast_publisher 127.0.0.1:20200 hello1 } +integration_examples() { + # nodes should be started + execute_cmd "go build ${ldflags} -o hello ./examples/hello_world/wrapper/" + ./hello + execute_cmd "go build ${ldflags} -o hello ./examples/hello_world/manual/" + ./hello +} + parse_params() { echo "parse_params $#" diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 3f260294..06573711 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -16,7 +16,7 @@ jobs: fetch-depth: 1 - uses: actions/setup-go@v2 with: - go-version: 1.19 + go-version: 1.21 - name: mod tidy run: go mod tidy - name: generate code coverage report diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 07054f17..9c255e8f 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -21,7 +21,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest] - go: ["1.17", "1.19"] + go: ["1.21"] steps: - uses: actions/checkout@v2 with: diff --git a/.gitignore b/.gitignore index 2514bab4..fe2b3378 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,8 @@ conf sdk.crt sdk.key ca.crt +*.nodeid +*.cnf # Test binary, built with `go test -c` *.test @@ -62,3 +64,10 @@ config.toml # library libs lib + +# csdk log +*.log + +# solc output +*.bin +*.abi diff --git a/client/connection.go b/client/connection.go index 25c0e691..8ef736c8 100644 --- a/client/connection.go +++ b/client/connection.go @@ -104,15 +104,8 @@ type Connection struct { writeConn jsonWriter // for dispatch - close chan struct{} - closing chan struct{} // closed when client is quitting didClose chan struct{} // closed when client quits reconnected chan ServerCodec // where write/reconnect sends the new connection - readOp chan readOp // read messages - readErr chan error // errors from read - reqInit chan *requestOp // register response IDs, takes write lock - reqSent chan error // signals write completion, releases write lock - reqTimeout chan *requestOp // removes response IDs when call timeout expires } type reconnectFunc func(ctx context.Context) (ServerCodec, error) @@ -131,11 +124,6 @@ func (cc *clientConn) close(err error, inflightReq *requestOp) { cc.codec.Close() } -type readOp struct { - msgs []*jsonrpcMessage - batch bool -} - type requestOp struct { ids []json.RawMessage err error @@ -266,15 +254,8 @@ func NewConnection(config *Config) (*Connection, error) { func initClient(conn ServerCodec) *Connection { c := &Connection{ writeConn: conn, - close: make(chan struct{}), - closing: make(chan struct{}), didClose: make(chan struct{}), reconnected: make(chan ServerCodec), - readOp: make(chan readOp), - readErr: make(chan error), - reqInit: make(chan *requestOp), - reqSent: make(chan error, 1), - reqTimeout: make(chan *requestOp), } return c } @@ -455,15 +436,29 @@ func (c *Connection) CallContext(ctx context.Context, result interface{}, method case "getPendingTxSize": c.csdk.GetPendingTxSize(op.respChanData) case "sendTransaction": - data := hexutil.Encode(args[0].([]byte)) - contractAddress := args[1].(string) + fallthrough + case "SendEncodedTransaction": var handler func(*types.Receipt, error) - if len(args) >= 3 { - handler = args[2].(func(*types.Receipt, error)) - } - _, err := c.csdk.CreateAndSendTransaction(op.respChanData, contractAddress, data, "", true) - if err != nil { - return err + if method == "sendTransaction" { + data := hexutil.Encode(args[0].([]byte)) + contractAddress := args[1].(string) + if len(args) >= 3 { + handler = args[2].(func(*types.Receipt, error)) + } + _, err := c.csdk.CreateAndSendTransaction(op.respChanData, contractAddress, data, "", true) + if err != nil { + return err + } + } else { // SendEncodedTransaction + encodedTransaction := args[0].([]byte) + withProof := args[1].(bool) + if len(args) >= 3 { + handler = args[2].(func(*types.Receipt, error)) + } + err := c.csdk.SendEncodedTransaction(op.respChanData, encodedTransaction, withProof) + if err != nil { + return err + } } // async send transaction if handler != nil { @@ -509,22 +504,6 @@ func (c *Connection) CallContext(ctx context.Context, result interface{}, method } } -//func (c *Connection) UnsubscribeBlockNumberNotify(groupID uint64) error { -// hc := c.writeConn.(*channelSession) -// return hc.unSubscribeBlockNumberNotify(groupID) -//} - -//func (c *Connection) newMessage(method string, paramsIn ...interface{}) (*jsonrpcMessage, error) { -// msg := &jsonrpcMessage{Version: vsn, ID: c.nextID(), Method: method} -// if paramsIn != nil { // prevent sending "params":null -// var err error -// if msg.Params, err = json.Marshal(paramsIn); err != nil { -// return nil, err -// } -// } -// return msg, nil -//} - func (c *Connection) reconnect(ctx context.Context) error { if c.reconnectFunc == nil { return errDead @@ -549,14 +528,3 @@ func (c *Connection) reconnect(ctx context.Context) error { return ErrClientQuit } } - -// drainRead drops read messages until an error occurs. -func (c *Connection) drainRead() { - for { - select { - case <-c.readOp: - case <-c.readErr: - return - } - } -} diff --git a/client/go_client.go b/client/go_client.go index 09561762..1e484ea4 100644 --- a/client/go_client.go +++ b/client/go_client.go @@ -149,7 +149,7 @@ func (c *Client) WaitMined(tx *types.Transaction) (*types.Receipt, error) { // SMCrypto returns true if use sm crypto func (c *Client) SMCrypto() bool { - return c.smCrypto + return c.conn.GetCSDK().SMCrypto() } // CodeAt returns the contract code of the given account. @@ -194,10 +194,7 @@ func (c *Client) CallContract(ctx context.Context, msg ethereum.CallMsg, blockNu if cr.Status != 0 { var errorMessage string if len(cr.Output) >= 138 { - outputBytes, err := hex.DecodeString(cr.Output[2:]) - if err != nil { - return nil, fmt.Errorf("call error of status %d, hex.DecodeString failed", cr.Status) - } + outputBytes := common.FromHex(cr.Output) errorMessage = string(outputBytes[68:]) } return nil, fmt.Errorf("call error of status %d, %v", cr.Status, errorMessage) @@ -273,6 +270,56 @@ func (c *Client) AsyncSendTransaction(ctx context.Context, tx *types.Transaction return nil } +func (c *Client) CreateEncodedTransactionDataV1(to *common.Address, input []byte, blockLimit int64, abi string) ([]byte, []byte, error) { + addressHex := "" + if to != nil { + addressHex = strings.ToLower(to.String()[2:]) + } + return c.conn.GetCSDK().CreateEncodedTransactionDataV1(blockLimit, addressHex, input, abi) +} + +func (c *Client) CreateEncodedSignature(hash []byte) ([]byte, error) { + return c.conn.GetCSDK().CreateEncodedSignature(hash) +} + +func (c *Client) CreateEncodedTransaction(transactionData, transactionDataHash, signature []byte, attribute int32, extraData string) ([]byte, error) { + return c.conn.GetCSDK().CreateEncodedTransaction(transactionData, transactionDataHash, signature, attribute, extraData) +} + +func (c *Client) SendEncodedTransaction(ctx context.Context, encodedTransaction []byte, withProof bool) (*types.Receipt, error) { + var err error + var anonymityReceipt = &struct { + types.Receipt + }{} + err = c.conn.CallContext(ctx, anonymityReceipt, "SendEncodedTransaction", encodedTransaction, withProof) + if err != nil { + errorStr := fmt.Sprintf("%s", err) + if strings.Contains(errorStr, "connection refused") { + log.Println("connection refused err:", err) + return nil, err + } + return nil, err + } + return &anonymityReceipt.Receipt, nil +} + +func (c *Client) AsyncSendEncodedTransaction(ctx context.Context, encodedTransaction []byte, withProof bool, handler func(*types.Receipt, error)) error { + err := c.conn.CallContext(ctx, nil, "SendEncodedTransaction", encodedTransaction, withProof, handler) + if err != nil { + errorStr := fmt.Sprintf("%s", err) + if strings.Contains(errorStr, "connection refused") { + log.Println("connection refused err:", err) + return err + } + return err + } + return nil +} + +func (c *Client) SetPrivateKey(privateKey []byte) error { + return c.conn.GetCSDK().SetPrivateKey(privateKey) +} + // TransactionReceipt returns the receipt of a transaction by transaction hash. // Note that the receipt is not available for pending transactions. func (c *Client) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error) { diff --git a/client/go_client_test.go b/client/go_client_test.go index 7a9febee..4971a29d 100644 --- a/client/go_client_test.go +++ b/client/go_client_test.go @@ -5,11 +5,14 @@ import ( "encoding/hex" "encoding/json" "fmt" + "strconv" "strings" + "sync" "testing" "github.com/FISCO-BCOS/go-sdk/abi" "github.com/FISCO-BCOS/go-sdk/abi/bind" + "github.com/FISCO-BCOS/go-sdk/core/types" "github.com/ethereum/go-ethereum/common" ) @@ -25,7 +28,7 @@ func GetClient(t *testing.T) *Client { t.Fatalf("decode hex failed of %v", err) } config := &Config{IsSMCrypto: false, GroupID: "group0", - PrivateKey: privateKey, Host: "127.0.0.1", Port: 20200, TLSCaFile: "./ca.crt", TLSKeyFile: "./sdk.key", TLSCertFile: "./sdk.crt"} + PrivateKey: privateKey, Host: "127.0.0.1", Port: 20200, TLSCaFile: "./ca.crt", TLSKeyFile: "./sdk.key", TLSCertFile: "./sdk.crt", DisableSsl: false} c, err := DialContext(context.Background(), config) if err != nil { t.Fatalf("Dial to %s:%d failed of %v", config.Host, config.Port, err) @@ -33,7 +36,7 @@ func GetClient(t *testing.T) *Client { return c } -// Get contractAddress、transactionHash、blockHash by this test +// Get contractAddress, transactionHash, blockHash by this test func TestBlockHashByNumber(t *testing.T) { deployedAddress, txHash := deployHelloWorld(t) c := GetClient(t) @@ -334,3 +337,287 @@ func TestSystemConfigByKey(t *testing.T) { t.Logf("the value got by the key:\n%s", raw.GetValue()) } + +func TestCreateEncodedTransactionAndSend(t *testing.T) { + c := GetClient(t) + // deploy helloworld contract + currentNumber, err := c.GetBlockNumber(context.Background()) + if err != nil { + t.Fatalf("GetBlockNumber error: %v", err) + } + blockLimit := currentNumber + 500 + // 1. create txData + txData, txHash, err := c.CreateEncodedTransactionDataV1(nil, common.FromHex(HelloWorldBin), blockLimit, HelloWorldABI) + if err != nil { + t.Fatalf("CreateEncodedTransactionDataV1 error: %v", err) + } + t.Logf("txHash: %x", txHash) + // 2. sign txData + signature, err := c.CreateEncodedSignature(txHash) + if err != nil { + t.Fatalf("CreateEncodedSignature error: %v", err) + } + // 3. create tx, tx include txData, txHash, signature, arrtibute, extraData + tx, err := c.CreateEncodedTransaction(txData, txHash, signature, 0, "") + if err != nil { + t.Fatalf("CreateEncodedTransaction error: %v", err) + } + // 4. send tx + receipt, err := c.SendEncodedTransaction(context.Background(), tx, true) + if err != nil { + t.Fatalf("SendEncodedTransaction error: %v", err) + } + t.Logf("receipt: %v", receipt) + if receipt.Status != 0 { + t.Fatalf("receipt status error: %v", receipt.Status) + } + // call helloworld set + address := common.HexToAddress(receipt.ContractAddress) + parsed, err := abi.JSON(strings.NewReader(HelloWorldABI)) + if err != nil { + t.Fatalf("abi.JSON error: %v", err) + } + input, err := parsed.Pack("set", "hello, world") + if err != nil { + t.Fatalf("parsed.Pack error: %v", err) + } + txData, txHash, err = c.CreateEncodedTransactionDataV1(&address, input, blockLimit, "") + if err != nil { + t.Fatalf("CreateEncodedTransactionDataV1 error: %v", err) + } + t.Logf("txHash: %x", txHash) + signature, err = c.CreateEncodedSignature(txHash) + if err != nil { + t.Fatalf("CreateEncodedSignature error: %v", err) + } + tx, err = c.CreateEncodedTransaction(txData, txHash, signature, 0, "") + if err != nil { + t.Fatalf("CreateEncodedTransaction error: %v", err) + } + receipt, err = c.SendEncodedTransaction(context.Background(), tx, true) + if err != nil { + t.Fatalf("SendEncodedTransaction error: %v", err) + } + t.Logf("receipt: %v", receipt) + if receipt.Status != 0 { + t.Fatalf("receipt status error: %v", receipt.Status) + } + + // call helloworld set async + input, err = parsed.Pack("set", "hello, world async") + if err != nil { + t.Fatalf("parsed.Pack error: %v", err) + } + txData, txHash, err = c.CreateEncodedTransactionDataV1(&address, input, blockLimit, "") + if err != nil { + t.Fatalf("CreateEncodedTransactionDataV1 error: %v", err) + } + t.Logf("txHash: %x", txHash) + signature, err = c.CreateEncodedSignature(txHash) + if err != nil { + t.Fatalf("CreateEncodedSignature error: %v", err) + } + tx, err = c.CreateEncodedTransaction(txData, txHash, signature, 0, "") + if err != nil { + t.Fatalf("CreateEncodedTransaction error: %v", err) + } + var wg sync.WaitGroup + + err = c.AsyncSendEncodedTransaction(context.Background(), tx, true, func(receipt *types.Receipt, err error) { + if err != nil { + t.Fatalf("AsyncSendEncodedTransaction error: %v", err) + } + if receipt.Status != 0 { + t.Fatalf("receipt status error: %v", receipt.Status) + } + wg.Done() + }) + if err != nil { + t.Fatalf("SendEncodedTransaction error: %v", err) + } + wg.Add(1) + wg.Wait() +} + +func TestAsnycHelloWorldSet(t *testing.T) { + c := GetClient(t) + parsed, _ := abi.JSON(strings.NewReader(HelloWorldABI)) + address, receipt, _, err := bind.DeployContract(c.GetTransactOpts(), parsed, common.FromHex(HelloWorldBin), c) + if err != nil { + t.Fatalf("DeployHelloWorld failed: %v", err) + } + if receipt.Status != 0 { + t.Fatalf("receipt status error: %v", receipt.Status) + } + input, err := parsed.Pack("set", "hello, world") + if err != nil { + t.Fatalf("parsed.Pack error: %v", err) + } + var wg sync.WaitGroup + count := 100 + for i := 0; i < count; i++ { + err = c.AsyncSendTransaction(context.Background(), nil, &address, input, func(receipt *types.Receipt, err error) { + wg.Done() + if err != nil { + t.Fatalf("SendTransaction error: %v", err) + } + if receipt.Status != 0 { + t.Fatalf("receipt status error: %v", receipt.Status) + } + }) + if err != nil { + t.Fatalf("SendTransaction error: %v", err) + } + wg.Add(1) + } + wg.Wait() +} + +func TestHelloWorldSet(t *testing.T) { + c := GetClient(t) + parsed, _ := abi.JSON(strings.NewReader(HelloWorldABI)) + address, receipt, _, err := bind.DeployContract(c.GetTransactOpts(), parsed, common.FromHex(HelloWorldBin), c) + if err != nil { + t.Fatalf("DeployHelloWorld failed: %v", err) + } + if receipt.Status != 0 { + t.Fatalf("receipt status error: %v", receipt.Status) + } + input, err := parsed.Pack("set", "hello, world") + if err != nil { + t.Fatalf("parsed.Pack error: %v", err) + } + count := 5 + for i := 0; i < count; i++ { + receipt, err = c.SendTransaction(context.Background(), nil, &address, input) + if err != nil { + t.Fatalf("SendTransaction error: %v", err) + } + if receipt.Status != 0 { + t.Fatalf("receipt status error: %v", receipt.Status) + } + } +} + +func TestSetPrivateKey(t *testing.T) { + c := GetClient(t) + parsed, _ := abi.JSON(strings.NewReader(HelloWorldABI)) + address, receipt, _, err := bind.DeployContract(c.GetTransactOpts(), parsed, common.FromHex(HelloWorldBin), c) + if err != nil { + t.Fatalf("DeployHelloWorld failed: %v", err) + } + if receipt.Status != 0 { + t.Fatalf("receipt status error: %v", receipt.Status) + } + tx, err := c.GetTransactionByHash(context.Background(), common.HexToHash(receipt.TransactionHash), true) + if err != nil { + t.Fatalf("GetTransactionByHash failed: %v", err) + } + t.Logf("tx: %v", tx) + from := receipt.From + input, err := parsed.Pack("set", "hello, world") + if err != nil { + t.Fatalf("parsed.Pack error: %v", err) + } + receipt, err = c.SendTransaction(context.Background(), nil, &address, input) + if err != nil { + t.Fatalf("SendTransaction error: %v", err) + } + from2 := receipt.From + if from != from2 { + t.Fatalf("from not equal") + } + privateKey, err := hex.DecodeString("145e247e170ba3afd6ae97e88f00dbc976c2345d511b0f6713355d19d8b80b57") + if err != nil { + t.Fatalf("decode hex failed of %v", err) + } + err = c.SetPrivateKey(privateKey) + if err != nil { + t.Fatalf("SetPrivateKey failed of %v", err) + } + receipt, err = c.SendTransaction(context.Background(), nil, &address, input) + if err != nil { + t.Fatalf("SendTransaction error: %v", err) + } + if receipt.Status != 0 { + t.Fatalf("receipt status error: %v", receipt.Status) + } + from3 := receipt.From + if from == from3 { + t.Fatalf("from not change") + } +} + +func GetClientForBench(b *testing.B) *Client { + privateKey, err := hex.DecodeString("145e247e170ba3afd6ae97e88f00dbc976c2345d511b0f6713355d19d8b80b58") + if err != nil { + b.Fatalf("decode hex failed of %v", err) + } + config := &Config{IsSMCrypto: false, GroupID: "group0", + PrivateKey: privateKey, Host: "127.0.0.1", Port: 20200, TLSCaFile: "./ca.crt", TLSKeyFile: "./sdk.key", TLSCertFile: "./sdk.crt", DisableSsl: false} + c, err := DialContext(context.Background(), config) + if err != nil { + b.Fatalf("Dial to %s:%d failed of %v", config.Host, config.Port, err) + } + return c +} + +func BenchmarkHelloWorldSet(b *testing.B) { + c := GetClientForBench(b) + parsed, _ := abi.JSON(strings.NewReader(HelloWorldABI)) + address, receipt, _, err := bind.DeployContract(c.GetTransactOpts(), parsed, common.FromHex(HelloWorldBin), c) + if err != nil { + b.Fatalf("DeployHelloWorld failed: %v", err) + } + if receipt.Status != 0 { + b.Fatalf("receipt status error: %v", receipt.Status) + } + input, err := parsed.Pack("set", "hello, world") + if err != nil { + b.Fatalf("parsed.Pack error: %v", err) + } + b.ResetTimer() + for i := 0; i < b.N; i++ { + receipt, err = c.SendTransaction(context.Background(), nil, &address, input) + if err != nil { + b.Fatalf("SendTransaction error: %v", err) + } + if receipt.Status != 0 { + b.Fatalf("receipt status error: %v", receipt.Status) + } + } +} + +func BenchmarkAsyncHelloWorldSet(b *testing.B) { + c := GetClientForBench(b) + parsed, _ := abi.JSON(strings.NewReader(HelloWorldABI)) + address, receipt, _, err := bind.DeployContract(c.GetTransactOpts(), parsed, common.FromHex(HelloWorldBin), c) + if err != nil { + b.Fatalf("DeployHelloWorld failed: %v", err) + } + if receipt.Status != 0 { + b.Fatalf("receipt status error: %v", receipt.Status) + } + b.ResetTimer() + var wg sync.WaitGroup + for i := 0; i < b.N; i++ { + input, err := parsed.Pack("set", "hello, world"+strconv.Itoa(i)) + if err != nil { + b.Fatalf("parsed.Pack error: %v", err) + } + err = c.AsyncSendTransaction(context.Background(), nil, &address, input, func(receipt *types.Receipt, err error) { + wg.Done() + if err != nil { + b.Fatalf("SendTransaction error: %v", err) + } + if receipt.Status != 0 { + b.Fatalf("receipt status error: %v", receipt.Status) + } + }) + if err != nil { + b.Fatalf("SendTransaction error: %v", err) + } + wg.Add(1) + } + wg.Wait() +} diff --git a/examples/hello_world/HelloWorld.sol b/examples/hello_world/HelloWorld.sol new file mode 100644 index 00000000..dcd46a2e --- /dev/null +++ b/examples/hello_world/HelloWorld.sol @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity >=0.6.10 <0.8.20; + +contract HelloWorld { + string value; + event setValue(string v, address indexed from, address indexed to, int256 value); + int public version; + + constructor(string memory initValue) { + value = initValue; + version = 0; + } + + function get() public view returns (string memory) { + return value; + } + + function set(string calldata v) public returns (string memory) { + string memory old = value; + value = v; + version = version + 1; + emit setValue(v, tx.origin, msg.sender, version); + return old; + } +} diff --git a/examples/hello_world/manual/main.go b/examples/hello_world/manual/main.go new file mode 100644 index 00000000..e1d33166 --- /dev/null +++ b/examples/hello_world/manual/main.go @@ -0,0 +1,155 @@ +package main + +import ( + "context" + "encoding/hex" + "fmt" + "log" + "math/big" + "strings" + "sync" + "time" + + "github.com/FISCO-BCOS/go-sdk/abi" + "github.com/FISCO-BCOS/go-sdk/abi/bind" + "github.com/FISCO-BCOS/go-sdk/client" + "github.com/FISCO-BCOS/go-sdk/core/types" + "github.com/ethereum/go-ethereum/common" +) + +// HelloWorldABI is the input ABI used to generate the binding from. +const HelloWorldABI = "[{\"inputs\":[{\"internalType\":\"string\",\"name\":\"initValue\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"v\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"value\",\"type\":\"int256\"}],\"name\":\"setValue\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"get\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"v\",\"type\":\"string\"}],\"name\":\"set\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]" + +// HelloWorldBin is the compiled bytecode used for deploying new contracts. +var HelloWorldBin = "0x60806040523480156200001157600080fd5b50604051620009fd380380620009fd8339818101604052810190620000379190620002ac565b80600090805190602001906200004f9291906200005f565b5060006001819055505062000362565b8280546200006d906200032c565b90600052602060002090601f016020900481019282620000915760008555620000dd565b82601f10620000ac57805160ff1916838001178555620000dd565b82800160010185558215620000dd579182015b82811115620000dc578251825591602001919060010190620000bf565b5b509050620000ec9190620000f0565b5090565b5b808211156200010b576000816000905550600101620000f1565b5090565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b62000178826200012d565b810181811067ffffffffffffffff821117156200019a57620001996200013e565b5b80604052505050565b6000620001af6200010f565b9050620001bd82826200016d565b919050565b600067ffffffffffffffff821115620001e057620001df6200013e565b5b620001eb826200012d565b9050602081019050919050565b60005b8381101562000218578082015181840152602081019050620001fb565b8381111562000228576000848401525b50505050565b6000620002456200023f84620001c2565b620001a3565b90508281526020810184848401111562000264576200026362000128565b5b62000271848285620001f8565b509392505050565b600082601f83011262000291576200029062000123565b5b8151620002a38482602086016200022e565b91505092915050565b600060208284031215620002c557620002c462000119565b5b600082015167ffffffffffffffff811115620002e657620002e56200011e565b5b620002f48482850162000279565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806200034557607f821691505b602082108114156200035c576200035b620002fd565b5b50919050565b61068b80620003726000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80634ed3885e1461004657806354fd4d50146100765780636d4ce63c14610094575b600080fd5b610060600480360381019061005b9190610387565b6100b2565b60405161006d919061046d565b60405180910390f35b61007e6101dd565b60405161008b91906104a8565b60405180910390f35b61009c6101e3565b6040516100a9919061046d565b60405180910390f35b606060008080546100c2906104f2565b80601f01602080910402602001604051908101604052809291908181526020018280546100ee906104f2565b801561013b5780601f106101105761010080835404028352916020019161013b565b820191906000526020600020905b81548152906001019060200180831161011e57829003601f168201915b50505050509050838360009190610153929190610275565b50600180546101629190610553565b6001819055503373ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff167fc3bf5911f8e0476e774566ef3fa1259f04156ba5c61ea5ff35c0201390381f9686866001546040516101cb93929190610623565b60405180910390a38091505092915050565b60015481565b6060600080546101f2906104f2565b80601f016020809104026020016040519081016040528092919081815260200182805461021e906104f2565b801561026b5780601f106102405761010080835404028352916020019161026b565b820191906000526020600020905b81548152906001019060200180831161024e57829003601f168201915b5050505050905090565b828054610281906104f2565b90600052602060002090601f0160209004810192826102a357600085556102ea565b82601f106102bc57803560ff19168380011785556102ea565b828001600101855582156102ea579182015b828111156102e95782358255916020019190600101906102ce565b5b5090506102f791906102fb565b5090565b5b808211156103145760008160009055506001016102fc565b5090565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f84011261034757610346610322565b5b8235905067ffffffffffffffff81111561036457610363610327565b5b6020830191508360018202830111156103805761037f61032c565b5b9250929050565b6000806020838503121561039e5761039d610318565b5b600083013567ffffffffffffffff8111156103bc576103bb61031d565b5b6103c885828601610331565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561040e5780820151818401526020810190506103f3565b8381111561041d576000848401525b50505050565b6000601f19601f8301169050919050565b600061043f826103d4565b61044981856103df565b93506104598185602086016103f0565b61046281610423565b840191505092915050565b600060208201905081810360008301526104878184610434565b905092915050565b6000819050919050565b6104a28161048f565b82525050565b60006020820190506104bd6000830184610499565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061050a57607f821691505b6020821081141561051e5761051d6104c3565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061055e8261048f565b91506105698361048f565b9250817f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038313600083121516156105a4576105a3610524565b5b817f80000000000000000000000000000000000000000000000000000000000000000383126000831216156105dc576105db610524565b5b828201905092915050565b82818337600083830152505050565b600061060283856103df565b935061060f8385846105e7565b61061883610423565b840190509392505050565b6000604082019050818103600083015261063e8185876105f6565b905061064d6020830184610499565b94935050505056fea2646970667358221220f474bd1d28e84751caca4356bb3cca5453b846289fe3aed4ecbc8cd022fb484464736f6c634300080b0033" + +func main() { + privateKey, _ := hex.DecodeString("145e247e170ba3afd6ae97e88f00dbc976c2345d511b0f6713355d19d8b80b58") + // disable ssl of node rpc + config := &client.Config{IsSMCrypto: false, GroupID: "group0", DisableSsl: false, + PrivateKey: privateKey, Host: "127.0.0.1", Port: 20200, TLSCaFile: "./conf/ca.crt", TLSKeyFile: "./conf/sdk.key", TLSCertFile: "./conf/sdk.crt"} + client, err := client.DialContext(context.Background(), config) + if err != nil { + log.Fatal(err) + } + // deploy helloworld contract + currentNumber, err := client.GetBlockNumber(context.Background()) + if err != nil { + log.Fatalf("GetBlockNumber error: %v", err) + } + parsed, err := abi.JSON(strings.NewReader(HelloWorldABI)) + if err != nil { + log.Fatalf("abi.JSON error: %v", err) + } + input, err := parsed.Pack("", "hello, world init") + if err != nil { + log.Fatalf("parsed.Pack error: %v", err) + } + blockLimit := currentNumber + 500 + // 1. create txData + input = append(common.FromHex(HelloWorldBin), input...) + txData, txHash, err := client.CreateEncodedTransactionDataV1(nil, input, blockLimit, HelloWorldABI) + if err != nil { + log.Fatalf("CreateEncodedTransactionDataV1 error: %v", err) + } + log.Printf("txHash: %x\n", txHash) + // 2. sign txData + signature, err := client.CreateEncodedSignature(txHash) + if err != nil { + log.Fatalf("CreateEncodedSignature error: %v", err) + } + // 3. create tx, tx include txData, txHash, signature, arrtibute, extraData + tx, err := client.CreateEncodedTransaction(txData, txHash, signature, 0, "") + if err != nil { + log.Fatalf("CreateEncodedTransaction error: %v", err) + } + // 4. send tx + receipt, err := client.SendEncodedTransaction(context.Background(), tx, true) + if err != nil { + log.Fatalf("SendEncodedTransaction error: %v", err) + } + if receipt.Status != 0 { + log.Fatalf("receipt status error: %v", receipt.Status) + } + // call helloworld set + address := common.HexToAddress(receipt.ContractAddress) + // SubscribeEventLogs + hello := bind.NewBoundContract(address, parsed, client, client, client) + fromBlock := uint64(0) + hello.WatchLogs(&fromBlock, func(ret int, logs []types.Log) { + setValue := &struct { + V string + From common.Address + To common.Address + Value *big.Int + Raw types.Log // Blockchain specific contextual infos + }{} + hello.UnpackLog(setValue, "setValue", logs[0]) + if err != nil { + fmt.Printf("WatchAllSetValue() failed: %v", err) + panic("WatchAllSetValue failed") + } + fmt.Printf("receive setValue event: value:%s ,from:%s\n", setValue.V, setValue.From.Hex()) + }, "setValue") + + // call helloworld set + input, err = parsed.Pack("set", "hello, world") + if err != nil { + log.Fatalf("parsed.Pack error: %v", err) + } + // create tx and send + txData, txHash, err = client.CreateEncodedTransactionDataV1(&address, input, blockLimit, "") + if err != nil { + log.Fatalf("CreateEncodedTransactionDataV1 error: %v", err) + } + fmt.Printf("txHash: %x\n", txHash) + signature, err = client.CreateEncodedSignature(txHash) + if err != nil { + log.Fatalf("CreateEncodedSignature error: %v", err) + } + tx, err = client.CreateEncodedTransaction(txData, txHash, signature, 0, "") + if err != nil { + log.Fatalf("CreateEncodedTransaction error: %v", err) + } + receipt, err = client.SendEncodedTransaction(context.Background(), tx, true) + if err != nil { + log.Fatalf("SendEncodedTransaction error: %v", err) + } + if receipt.Status != 0 { + log.Fatalf("receipt status error: %v", receipt.Status) + } + // call helloworld set async + input, err = parsed.Pack("set", "hello, world async") + if err != nil { + log.Fatalf("parsed.Pack error: %v", err) + } + txData, txHash, err = client.CreateEncodedTransactionDataV1(&address, input, blockLimit, "") + if err != nil { + log.Fatalf("CreateEncodedTransactionDataV1 error: %v", err) + } + fmt.Printf("txHash: %x\n", txHash) + signature, err = client.CreateEncodedSignature(txHash) + if err != nil { + log.Fatalf("CreateEncodedSignature error: %v", err) + } + tx, err = client.CreateEncodedTransaction(txData, txHash, signature, 0, "") + if err != nil { + log.Fatalf("CreateEncodedTransaction error: %v", err) + } + var wg sync.WaitGroup + err = client.AsyncSendEncodedTransaction(context.Background(), tx, true, func(receipt *types.Receipt, err error) { + if err != nil { + log.Fatalf("AsyncSendEncodedTransaction error: %v", err) + } + if receipt.Status != 0 { + log.Fatalf("receipt status error: %v", receipt.Status) + } + wg.Done() + }) + if err != nil { + log.Fatalf("SendEncodedTransaction error: %v", err) + } + wg.Add(1) + wg.Wait() + time.Sleep(3 * time.Second) +} diff --git a/examples/hello_world/wrapper/HelloWorld.go b/examples/hello_world/wrapper/HelloWorld.go new file mode 100644 index 00000000..ba3d97d9 --- /dev/null +++ b/examples/hello_world/wrapper/HelloWorld.go @@ -0,0 +1,339 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package main + +import ( + "math/big" + "strings" + + "github.com/FISCO-BCOS/go-sdk/abi" + "github.com/FISCO-BCOS/go-sdk/abi/bind" + "github.com/FISCO-BCOS/go-sdk/core/types" + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/common" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = abi.U256 + _ = bind.Bind + _ = common.Big1 +) + +// HelloWorldABI is the input ABI used to generate the binding from. +const HelloWorldABI = "[{\"inputs\":[{\"internalType\":\"string\",\"name\":\"initValue\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"v\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"value\",\"type\":\"int256\"}],\"name\":\"setValue\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"get\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"v\",\"type\":\"string\"}],\"name\":\"set\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]" + +// HelloWorldBin is the compiled bytecode used for deploying new contracts. +var HelloWorldBin = "0x60806040523480156200001157600080fd5b50604051620009fd380380620009fd8339818101604052810190620000379190620002ac565b80600090805190602001906200004f9291906200005f565b5060006001819055505062000362565b8280546200006d906200032c565b90600052602060002090601f016020900481019282620000915760008555620000dd565b82601f10620000ac57805160ff1916838001178555620000dd565b82800160010185558215620000dd579182015b82811115620000dc578251825591602001919060010190620000bf565b5b509050620000ec9190620000f0565b5090565b5b808211156200010b576000816000905550600101620000f1565b5090565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b62000178826200012d565b810181811067ffffffffffffffff821117156200019a57620001996200013e565b5b80604052505050565b6000620001af6200010f565b9050620001bd82826200016d565b919050565b600067ffffffffffffffff821115620001e057620001df6200013e565b5b620001eb826200012d565b9050602081019050919050565b60005b8381101562000218578082015181840152602081019050620001fb565b8381111562000228576000848401525b50505050565b6000620002456200023f84620001c2565b620001a3565b90508281526020810184848401111562000264576200026362000128565b5b62000271848285620001f8565b509392505050565b600082601f83011262000291576200029062000123565b5b8151620002a38482602086016200022e565b91505092915050565b600060208284031215620002c557620002c462000119565b5b600082015167ffffffffffffffff811115620002e657620002e56200011e565b5b620002f48482850162000279565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806200034557607f821691505b602082108114156200035c576200035b620002fd565b5b50919050565b61068b80620003726000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80634ed3885e1461004657806354fd4d50146100765780636d4ce63c14610094575b600080fd5b610060600480360381019061005b9190610387565b6100b2565b60405161006d919061046d565b60405180910390f35b61007e6101dd565b60405161008b91906104a8565b60405180910390f35b61009c6101e3565b6040516100a9919061046d565b60405180910390f35b606060008080546100c2906104f2565b80601f01602080910402602001604051908101604052809291908181526020018280546100ee906104f2565b801561013b5780601f106101105761010080835404028352916020019161013b565b820191906000526020600020905b81548152906001019060200180831161011e57829003601f168201915b50505050509050838360009190610153929190610275565b50600180546101629190610553565b6001819055503373ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff167fc3bf5911f8e0476e774566ef3fa1259f04156ba5c61ea5ff35c0201390381f9686866001546040516101cb93929190610623565b60405180910390a38091505092915050565b60015481565b6060600080546101f2906104f2565b80601f016020809104026020016040519081016040528092919081815260200182805461021e906104f2565b801561026b5780601f106102405761010080835404028352916020019161026b565b820191906000526020600020905b81548152906001019060200180831161024e57829003601f168201915b5050505050905090565b828054610281906104f2565b90600052602060002090601f0160209004810192826102a357600085556102ea565b82601f106102bc57803560ff19168380011785556102ea565b828001600101855582156102ea579182015b828111156102e95782358255916020019190600101906102ce565b5b5090506102f791906102fb565b5090565b5b808211156103145760008160009055506001016102fc565b5090565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f84011261034757610346610322565b5b8235905067ffffffffffffffff81111561036457610363610327565b5b6020830191508360018202830111156103805761037f61032c565b5b9250929050565b6000806020838503121561039e5761039d610318565b5b600083013567ffffffffffffffff8111156103bc576103bb61031d565b5b6103c885828601610331565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561040e5780820151818401526020810190506103f3565b8381111561041d576000848401525b50505050565b6000601f19601f8301169050919050565b600061043f826103d4565b61044981856103df565b93506104598185602086016103f0565b61046281610423565b840191505092915050565b600060208201905081810360008301526104878184610434565b905092915050565b6000819050919050565b6104a28161048f565b82525050565b60006020820190506104bd6000830184610499565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061050a57607f821691505b6020821081141561051e5761051d6104c3565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061055e8261048f565b91506105698361048f565b9250817f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038313600083121516156105a4576105a3610524565b5b817f80000000000000000000000000000000000000000000000000000000000000000383126000831216156105dc576105db610524565b5b828201905092915050565b82818337600083830152505050565b600061060283856103df565b935061060f8385846105e7565b61061883610423565b840190509392505050565b6000604082019050818103600083015261063e8185876105f6565b905061064d6020830184610499565b94935050505056fea2646970667358221220f474bd1d28e84751caca4356bb3cca5453b846289fe3aed4ecbc8cd022fb484464736f6c634300080b0033" + +// DeployHelloWorld deploys a new contract, binding an instance of HelloWorld to it. +func DeployHelloWorld(auth *bind.TransactOpts, backend bind.ContractBackend, initValue string) (common.Address, *types.Receipt, *HelloWorld, error) { + parsed, err := abi.JSON(strings.NewReader(HelloWorldABI)) + if err != nil { + return common.Address{}, nil, nil, err + } + + address, receipt, contract, err := bind.DeployContract(auth, parsed, common.FromHex(HelloWorldBin), backend, initValue) + if err != nil { + return common.Address{}, nil, nil, err + } + return address, receipt, &HelloWorld{HelloWorldCaller: HelloWorldCaller{contract: contract}, HelloWorldTransactor: HelloWorldTransactor{contract: contract}, HelloWorldFilterer: HelloWorldFilterer{contract: contract}}, nil +} + +func AsyncDeployHelloWorld(auth *bind.TransactOpts, handler func(*types.Receipt, error), backend bind.ContractBackend, initValue string) (*types.Transaction, error) { + parsed, err := abi.JSON(strings.NewReader(HelloWorldABI)) + if err != nil { + return nil, err + } + + tx, err := bind.AsyncDeployContract(auth, handler, parsed, common.FromHex(HelloWorldBin), backend, initValue) + if err != nil { + return nil, err + } + return tx, nil +} + +// HelloWorld is an auto generated Go binding around a Solidity contract. +type HelloWorld struct { + HelloWorldCaller // Read-only binding to the contract + HelloWorldTransactor // Write-only binding to the contract + HelloWorldFilterer // Log filterer for contract events +} + +// HelloWorldCaller is an auto generated read-only Go binding around a Solidity contract. +type HelloWorldCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// HelloWorldTransactor is an auto generated write-only Go binding around a Solidity contract. +type HelloWorldTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// HelloWorldFilterer is an auto generated log filtering Go binding around a Solidity contract events. +type HelloWorldFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// HelloWorldSession is an auto generated Go binding around a Solidity contract, +// with pre-set call and transact options. +type HelloWorldSession struct { + Contract *HelloWorld // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// HelloWorldCallerSession is an auto generated read-only Go binding around a Solidity contract, +// with pre-set call options. +type HelloWorldCallerSession struct { + Contract *HelloWorldCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// HelloWorldTransactorSession is an auto generated write-only Go binding around a Solidity contract, +// with pre-set transact options. +type HelloWorldTransactorSession struct { + Contract *HelloWorldTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// HelloWorldRaw is an auto generated low-level Go binding around a Solidity contract. +type HelloWorldRaw struct { + Contract *HelloWorld // Generic contract binding to access the raw methods on +} + +// HelloWorldCallerRaw is an auto generated low-level read-only Go binding around a Solidity contract. +type HelloWorldCallerRaw struct { + Contract *HelloWorldCaller // Generic read-only contract binding to access the raw methods on +} + +// HelloWorldTransactorRaw is an auto generated low-level write-only Go binding around a Solidity contract. +type HelloWorldTransactorRaw struct { + Contract *HelloWorldTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewHelloWorld creates a new instance of HelloWorld, bound to a specific deployed contract. +func NewHelloWorld(address common.Address, backend bind.ContractBackend) (*HelloWorld, error) { + contract, err := bindHelloWorld(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &HelloWorld{HelloWorldCaller: HelloWorldCaller{contract: contract}, HelloWorldTransactor: HelloWorldTransactor{contract: contract}, HelloWorldFilterer: HelloWorldFilterer{contract: contract}}, nil +} + +// NewHelloWorldCaller creates a new read-only instance of HelloWorld, bound to a specific deployed contract. +func NewHelloWorldCaller(address common.Address, caller bind.ContractCaller) (*HelloWorldCaller, error) { + contract, err := bindHelloWorld(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &HelloWorldCaller{contract: contract}, nil +} + +// NewHelloWorldTransactor creates a new write-only instance of HelloWorld, bound to a specific deployed contract. +func NewHelloWorldTransactor(address common.Address, transactor bind.ContractTransactor) (*HelloWorldTransactor, error) { + contract, err := bindHelloWorld(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &HelloWorldTransactor{contract: contract}, nil +} + +// NewHelloWorldFilterer creates a new log filterer instance of HelloWorld, bound to a specific deployed contract. +func NewHelloWorldFilterer(address common.Address, filterer bind.ContractFilterer) (*HelloWorldFilterer, error) { + contract, err := bindHelloWorld(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &HelloWorldFilterer{contract: contract}, nil +} + +// bindHelloWorld binds a generic wrapper to an already deployed contract. +func bindHelloWorld(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(HelloWorldABI)) + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_HelloWorld *HelloWorldRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _HelloWorld.Contract.HelloWorldCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_HelloWorld *HelloWorldRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, *types.Receipt, error) { + return _HelloWorld.Contract.HelloWorldTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_HelloWorld *HelloWorldRaw) TransactWithResult(opts *bind.TransactOpts, result interface{}, method string, params ...interface{}) (*types.Transaction, *types.Receipt, error) { + return _HelloWorld.Contract.HelloWorldTransactor.contract.TransactWithResult(opts, result, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_HelloWorld *HelloWorldCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _HelloWorld.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_HelloWorld *HelloWorldTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, *types.Receipt, error) { + return _HelloWorld.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_HelloWorld *HelloWorldTransactorRaw) TransactWithResult(opts *bind.TransactOpts, result interface{}, method string, params ...interface{}) (*types.Transaction, *types.Receipt, error) { + return _HelloWorld.Contract.contract.TransactWithResult(opts, result, method, params...) +} + +// Get is a free data retrieval call binding the contract method 0x6d4ce63c. +// +// Solidity: function get() constant returns(string) +func (_HelloWorld *HelloWorldCaller) Get(opts *bind.CallOpts) (string, error) { + var ( + ret0 = new(string) + ) + out := ret0 + err := _HelloWorld.contract.Call(opts, out, "get") + return *ret0, err +} + +// Get is a free data retrieval call binding the contract method 0x6d4ce63c. +// +// Solidity: function get() constant returns(string) +func (_HelloWorld *HelloWorldSession) Get() (string, error) { + return _HelloWorld.Contract.Get(&_HelloWorld.CallOpts) +} + +// Get is a free data retrieval call binding the contract method 0x6d4ce63c. +// +// Solidity: function get() constant returns(string) +func (_HelloWorld *HelloWorldCallerSession) Get() (string, error) { + return _HelloWorld.Contract.Get(&_HelloWorld.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() constant returns(int256) +func (_HelloWorld *HelloWorldCaller) Version(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _HelloWorld.contract.Call(opts, out, "version") + return *ret0, err +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() constant returns(int256) +func (_HelloWorld *HelloWorldSession) Version() (*big.Int, error) { + return _HelloWorld.Contract.Version(&_HelloWorld.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() constant returns(int256) +func (_HelloWorld *HelloWorldCallerSession) Version() (*big.Int, error) { + return _HelloWorld.Contract.Version(&_HelloWorld.CallOpts) +} + +// Set is a paid mutator transaction binding the contract method 0x4ed3885e. +// +// Solidity: function set(string v) returns(string) +func (_HelloWorld *HelloWorldTransactor) Set(opts *bind.TransactOpts, v string) (string, *types.Transaction, *types.Receipt, error) { + var ( + ret0 = new(string) + ) + out := ret0 + transaction, receipt, err := _HelloWorld.contract.TransactWithResult(opts, out, "set", v) + return *ret0, transaction, receipt, err +} + +func (_HelloWorld *HelloWorldTransactor) AsyncSet(handler func(*types.Receipt, error), opts *bind.TransactOpts, v string) (*types.Transaction, error) { + return _HelloWorld.contract.AsyncTransact(opts, handler, "set", v) +} + +// Set is a paid mutator transaction binding the contract method 0x4ed3885e. +// +// Solidity: function set(string v) returns(string) +func (_HelloWorld *HelloWorldSession) Set(v string) (string, *types.Transaction, *types.Receipt, error) { + return _HelloWorld.Contract.Set(&_HelloWorld.TransactOpts, v) +} + +func (_HelloWorld *HelloWorldSession) AsyncSet(handler func(*types.Receipt, error), v string) (*types.Transaction, error) { + return _HelloWorld.Contract.AsyncSet(handler, &_HelloWorld.TransactOpts, v) +} + +// Set is a paid mutator transaction binding the contract method 0x4ed3885e. +// +// Solidity: function set(string v) returns(string) +func (_HelloWorld *HelloWorldTransactorSession) Set(v string) (string, *types.Transaction, *types.Receipt, error) { + return _HelloWorld.Contract.Set(&_HelloWorld.TransactOpts, v) +} + +func (_HelloWorld *HelloWorldTransactorSession) AsyncSet(handler func(*types.Receipt, error), v string) (*types.Transaction, error) { + return _HelloWorld.Contract.AsyncSet(handler, &_HelloWorld.TransactOpts, v) +} + +// HelloWorldSetValue represents a SetValue event raised by the HelloWorld contract. +type HelloWorldSetValue struct { + V string + From common.Address + To common.Address + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// WatchSetValue is a free log subscription operation binding the contract event 0xc3bf5911f8e0476e774566ef3fa1259f04156ba5c61ea5ff35c0201390381f96. +// +// Solidity: event setValue(string v, address indexed from, address indexed to, int256 value) +func (_HelloWorld *HelloWorldFilterer) WatchSetValue(fromBlock *uint64, handler func(int, []types.Log), from common.Address, to common.Address) (string, error) { + return _HelloWorld.contract.WatchLogs(fromBlock, handler, "setValue", from, to) +} + +func (_HelloWorld *HelloWorldFilterer) WatchAllSetValue(fromBlock *uint64, handler func(int, []types.Log)) (string, error) { + return _HelloWorld.contract.WatchLogs(fromBlock, handler, "setValue") +} + +// ParseSetValue is a log parse operation binding the contract event 0xc3bf5911f8e0476e774566ef3fa1259f04156ba5c61ea5ff35c0201390381f96. +// +// Solidity: event setValue(string v, address indexed from, address indexed to, int256 value) +func (_HelloWorld *HelloWorldFilterer) ParseSetValue(log types.Log) (*HelloWorldSetValue, error) { + event := new(HelloWorldSetValue) + if err := _HelloWorld.contract.UnpackLog(event, "setValue", log); err != nil { + return nil, err + } + return event, nil +} + +// WatchSetValue is a free log subscription operation binding the contract event 0xc3bf5911f8e0476e774566ef3fa1259f04156ba5c61ea5ff35c0201390381f96. +// +// Solidity: event setValue(string v, address indexed from, address indexed to, int256 value) +func (_HelloWorld *HelloWorldSession) WatchSetValue(fromBlock *uint64, handler func(int, []types.Log), from common.Address, to common.Address) (string, error) { + return _HelloWorld.Contract.WatchSetValue(fromBlock, handler, from, to) +} + +func (_HelloWorld *HelloWorldSession) WatchAllSetValue(fromBlock *uint64, handler func(int, []types.Log)) (string, error) { + return _HelloWorld.Contract.WatchAllSetValue(fromBlock, handler) +} + +// ParseSetValue is a log parse operation binding the contract event 0xc3bf5911f8e0476e774566ef3fa1259f04156ba5c61ea5ff35c0201390381f96. +// +// Solidity: event setValue(string v, address indexed from, address indexed to, int256 value) +func (_HelloWorld *HelloWorldSession) ParseSetValue(log types.Log) (*HelloWorldSetValue, error) { + return _HelloWorld.Contract.ParseSetValue(log) +} diff --git a/examples/hello_world/wrapper/main.go b/examples/hello_world/wrapper/main.go new file mode 100644 index 00000000..535c531a --- /dev/null +++ b/examples/hello_world/wrapper/main.go @@ -0,0 +1,86 @@ +package main + +import ( + "context" + "encoding/hex" + "fmt" + "log" + + "github.com/FISCO-BCOS/go-sdk/client" + "github.com/FISCO-BCOS/go-sdk/core/types" +) + +func main() { + privateKey, _ := hex.DecodeString("145e247e170ba3afd6ae97e88f00dbc976c2345d511b0f6713355d19d8b80b58") + // disable ssl of node rpc + config := &client.Config{IsSMCrypto: false, GroupID: "group0", DisableSsl: false, + PrivateKey: privateKey, Host: "127.0.0.1", Port: 20200, TLSCaFile: "./conf/ca.crt", TLSKeyFile: "./conf/sdk.key", TLSCertFile: "./conf/sdk.crt"} + client, err := client.DialContext(context.Background(), config) + if err != nil { + log.Fatal(err) + } + input := "HelloWorld deployment 1.0" + fmt.Println("=================DeployHelloWorld===============") + address, receipt, instance, err := DeployHelloWorld(client.GetTransactOpts(), client, input) + if err != nil { + log.Fatal(err) + } + fmt.Println("contract address: ", address.Hex()) // the address should be saved, will use in next example + fmt.Println("transaction hash: ", receipt.TransactionHash) + + // load the contract + // contractAddress := common.HexToAddress("contract address in hex String") + // instance, err := NewStore(contractAddress, client) + // if err != nil { + // log.Fatal(err) + // } + + fmt.Println("================================") + helloSession := &HelloWorldSession{Contract: instance, CallOpts: *client.GetCallOpts(), TransactOpts: *client.GetTransactOpts()} + + version, err := helloSession.Version() + if err != nil { + log.Fatal(err) + } + + fmt.Println("version :", version) // "HelloWorld deployment 1.0" + + ret, err := helloSession.Get() + if err != nil { + fmt.Printf("Get() failed: %v", err) + return + } + done := make(chan bool) + _, err = helloSession.WatchAllSetValue(nil, func(ret int, logs []types.Log) { + fmt.Printf("receive event SetValue: %d, logs: %v\n", ret, logs) + setValue, err := helloSession.ParseSetValue(logs[0]) + if err != nil { + fmt.Printf("WatchAllSetValue() failed: %v", err) + panic("WatchAllSetValue failed") + } + fmt.Printf("receive setValue: %+v\n", *setValue) + done <- true + }) + if err != nil { + fmt.Printf("WatchAllSetValue() failed: %v", err) + return + } + fmt.Printf("Get: %s\n", ret) + fmt.Println("================================") + + oldValue, _, receipt, err := helloSession.Set("hello world") + fmt.Println("old value is: ", oldValue) + if err != nil { + log.Fatal(err) + } + + fmt.Printf("transaction hash of receipt: %s\n", receipt.GetTransactionHash()) + + ret, err = helloSession.Get() + if err != nil { + fmt.Printf("Get() failed: %v", err) + return + } + fmt.Printf("Get: %s\n", ret) + <-done +} diff --git a/go.mod b/go.mod index 26e826a8..ea4900ed 100644 --- a/go.mod +++ b/go.mod @@ -1,25 +1,85 @@ module github.com/FISCO-BCOS/go-sdk -go 1.16 +go 1.21.5 replace ( + // github.com/FISCO-BCOS/bcos-c-sdk v0.0.0-20231221132830-c0cfb1d98eec => ../bcos-c-sdk golang.org/x/net => github.com/golang/net v0.0.0-20190415214537-1da14a5a36f2 golang.org/x/sync => github.com/golang/sync v0.0.0-20190412183630-56d357773e84 ) require ( - github.com/FISCO-BCOS/bcos-c-sdk v0.0.0-20230725031339-eabad8cdbaeb + github.com/FISCO-BCOS/bcos-c-sdk v0.0.0-20231221132830-c0cfb1d98eec github.com/FISCO-BCOS/crypto v0.0.0-20200202032121-bd8ab0b5d4f1 - github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect github.com/ethereum/go-ethereum v1.10.21 - github.com/go-kit/kit v0.9.0 // indirect - github.com/go-ole/go-ole v1.2.5 // indirect - github.com/patrickmn/go-cache v2.1.0+incompatible // indirect github.com/sirupsen/logrus v1.4.2 github.com/spf13/cobra v1.0.0 - github.com/spf13/pflag v1.0.5 // indirect github.com/urfave/cli/v2 v2.10.2 golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 +) + +require ( + github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect + github.com/VictoriaMetrics/fastcache v1.6.0 // indirect + github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.1.1 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/deckarep/golang-set v1.8.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect + github.com/deepmap/oapi-codegen v1.8.2 // indirect + github.com/edsrzf/mmap-go v1.0.0 // indirect + github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 // indirect + github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff // indirect + github.com/go-kit/kit v0.9.0 // indirect + github.com/go-ole/go-ole v1.2.5 // indirect + github.com/go-stack/stack v1.8.0 // indirect + github.com/golang-jwt/jwt/v4 v4.3.0 // indirect + github.com/golang/snappy v0.0.4 // indirect + github.com/google/go-cmp v0.5.5 // indirect + github.com/google/uuid v1.2.0 // indirect + github.com/gorilla/websocket v1.4.2 // indirect + github.com/graph-gophers/graphql-go v1.3.0 // indirect + github.com/hashicorp/go-bexpr v0.1.10 // indirect + github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect + github.com/holiman/bloomfilter/v2 v2.0.3 // indirect + github.com/holiman/uint256 v1.2.0 // indirect + github.com/huin/goupnp v1.0.3 // indirect + github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/influxdata/influxdb v1.8.3 // indirect + github.com/influxdata/influxdb-client-go/v2 v2.4.0 // indirect + github.com/influxdata/line-protocol v0.0.0-20210311194329-9aa0e372d097 // indirect + github.com/jackpal/go-nat-pmp v1.0.2 // indirect + github.com/konsorten/go-windows-terminal-sequences v1.0.1 // indirect + github.com/kr/text v0.2.0 // indirect + github.com/mattn/go-colorable v0.1.8 // indirect + github.com/mattn/go-isatty v0.0.12 // indirect + github.com/mattn/go-runewidth v0.0.9 // indirect + github.com/mitchellh/mapstructure v1.4.1 // indirect + github.com/mitchellh/pointerstructure v1.2.0 // indirect + github.com/olekukonko/tablewriter v0.0.5 // indirect + github.com/opentracing/opentracing-go v1.1.0 // indirect + github.com/patrickmn/go-cache v2.1.0+incompatible // indirect + github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/prometheus/tsdb v0.7.1 // indirect + github.com/rjeczalik/notify v0.9.1 // indirect + github.com/rs/cors v1.7.0 // indirect + github.com/russross/blackfriday/v2 v2.1.0 // indirect + github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4 // indirect + github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect + github.com/tklauser/go-sysconf v0.3.5 // indirect + github.com/tklauser/numcpus v0.2.2 // indirect + github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef // indirect + github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect golang.org/x/net v0.2.0 // indirect golang.org/x/sync v0.1.0 // indirect + golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect + golang.org/x/text v0.3.7 // indirect + golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba // indirect + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect + gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect ) diff --git a/go.sum b/go.sum index 2ce5d9ba..9650445f 100644 --- a/go.sum +++ b/go.sum @@ -18,21 +18,14 @@ cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiy cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= -github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0/go.mod h1:tPaiy8S5bQ+S5sOiDlINkp7+Ef339+Nz5L5XO+cnOHo= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= -github.com/FISCO-BCOS/bcos-c-sdk v0.0.0-20230720102808-34f03aa15ebe h1:3QIFR9WIwl2Pp3DHqlssJzGXV5znpsJPkSw0ewMsKTs= -github.com/FISCO-BCOS/bcos-c-sdk v0.0.0-20230720102808-34f03aa15ebe/go.mod h1:7kTVptunvfx0JH/XIuFj0ybRq0MLAsK4daizrE9RvN0= -github.com/FISCO-BCOS/bcos-c-sdk v0.0.0-20230725031339-eabad8cdbaeb h1:c06WCmpcxNeKR5yVjM6paTPK4fBXNYVjHpmCoC8OfPc= -github.com/FISCO-BCOS/bcos-c-sdk v0.0.0-20230725031339-eabad8cdbaeb/go.mod h1:7kTVptunvfx0JH/XIuFj0ybRq0MLAsK4daizrE9RvN0= +github.com/FISCO-BCOS/bcos-c-sdk v0.0.0-20231221132830-c0cfb1d98eec h1:flo/0fBn5dYHy41gIPZNiiFVN/Fc5KfnfQStgYOuiCI= +github.com/FISCO-BCOS/bcos-c-sdk v0.0.0-20231221132830-c0cfb1d98eec/go.mod h1:7kTVptunvfx0JH/XIuFj0ybRq0MLAsK4daizrE9RvN0= github.com/FISCO-BCOS/crypto v0.0.0-20200202032121-bd8ab0b5d4f1 h1:ThPht4qK10+cMZC5COIjHPq0INm5HAMVYqrez5zEgFI= github.com/FISCO-BCOS/crypto v0.0.0-20200202032121-bd8ab0b5d4f1/go.mod h1:UrLdwsFrjiaCsvdcPLcH6B7s/FUmym3qfM93u2ziR+4= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d h1:G0m3OIz70MZUWq3EgK3CesDbo8upS2Vm9/P3FtgI+Jk= github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= github.com/VictoriaMetrics/fastcache v1.6.0 h1:C/3Oi3EiBCqufydp1neRZkqcwmEiuRT9c3fqvvgKm5o= @@ -45,15 +38,6 @@ github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/apache/arrow/go/arrow v0.0.0-20191024131854-af6fa24be0db/go.mod h1:VTxUBvSJ3s3eHAg65PNgrsn5BtqCRPdmyXh6rAfdxN0= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/aws/aws-sdk-go-v2 v1.2.0/go.mod h1:zEQs02YRBw1DjK0PoJv3ygDYOFTre1ejlJWl8FwAuQo= -github.com/aws/aws-sdk-go-v2/config v1.1.1/go.mod h1:0XsVy9lBI/BCXm+2Tuvt39YmdHwS5unDQmxZOYe8F5Y= -github.com/aws/aws-sdk-go-v2/credentials v1.1.1/go.mod h1:mM2iIjwl7LULWtS6JCACyInboHirisUUdkBPoTHMOUo= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.2/go.mod h1:3hGg3PpiEjHnrkrlasTfxFqUsZ2GCk/fMUn4CbKgSkM= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.2/go.mod h1:45MfaXZ0cNbeuT0KQ1XJylq8A6+OpVV2E5kvY/Kq+u8= -github.com/aws/aws-sdk-go-v2/service/route53 v1.1.1/go.mod h1:rLiOUrPLW/Er5kRcQ7NkwbjlijluLsrIbu/iyl35RO4= -github.com/aws/aws-sdk-go-v2/service/sso v1.1.1/go.mod h1:SuZJxklHxLAXgLTc1iFXbEWkXs7QRTQpCLGaKIprQW0= -github.com/aws/aws-sdk-go-v2/service/sts v1.1.1/go.mod h1:Wi0EBZwiz/K44YliU0EKxqTCJGUfYTWXrrBwkq736bM= -github.com/aws/smithy-go v1.1.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= @@ -62,13 +46,10 @@ github.com/btcsuite/btcd/btcec/v2 v2.2.0 h1:fzn1qaOt32TuLjFlkzYSsBC35Q3KUjT1SwPx github.com/btcsuite/btcd/btcec/v2 v2.2.0/go.mod h1:U7MHm051Al6XmscBQ0BoNydpOTsFAn707034b5nY8zU= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= -github.com/bxq2011hust/bcos-c-sdk v0.0.0-20230720083004-b56e530a5f99 h1:SG+L4VWkxJe7RtL0dLygd3/Vi55H1FFJQaInmKbt+ow= -github.com/bxq2011hust/bcos-c-sdk v0.0.0-20230720083004-b56e530a5f99/go.mod h1:q+Z2r9GYaR3GEquonSj8HNou7hDMNvaKjsClnNvJxLg= github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk= github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= @@ -76,15 +57,11 @@ github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWR github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudflare/cloudflare-go v0.14.0/go.mod h1:EnwdgGMaFOruiPZRFSgn+TsQ3hQ7C/YWzIGLeu5c304= -github.com/consensys/bavard v0.1.8-0.20210406032232-f3452dc9b572/go.mod h1:Bpd0/3mZuaj6Sj+PqrmIquiOKy397AKGThQPaGzNXAQ= -github.com/consensys/gnark-crypto v0.4.1-0.20210426202927-39ac3d4b3f1f/go.mod h1:815PAHg3wvysy0SyIqanF8gZ0Y1wjk/hrDHD/iT88+Q= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= @@ -106,13 +83,8 @@ github.com/deepmap/oapi-codegen v1.8.2/go.mod h1:YLgSKSDv/bZQB7N4ws6luhozi3cEdRk github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8/go.mod h1:VMaSuZ+SZcx/wljOQKvp5srsbCiKDEb6K2wC4+PiBmQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= -github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= -github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= github.com/docker/docker v1.6.2 h1:HlFGsy+9/xrgMmhmN+NGhCc5SHGJ7I+kHosRR1xc/aI= github.com/docker/docker v1.6.2/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/dop251/goja v0.0.0-20220405120441-9037c2b61cbf/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= -github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y= github.com/eclipse/paho.mqtt.golang v1.2.0/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7joQ8SYLhZwfeOo6Ts= github.com/edsrzf/mmap-go v1.0.0 h1:CEBF7HpRnUCSJgGUb5h1Gm7e3VkmVDrR8lvWVLtrOFw= github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= @@ -120,15 +92,12 @@ github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.m github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/ethereum/go-ethereum v1.10.21 h1:5lqsEx92ZaZzRyOqBEXux4/UR06m296RGzN3ol3teJY= github.com/ethereum/go-ethereum v1.10.21/go.mod h1:EYFyF19u3ezGLD4RqOkLq+ZCXzYbLoNDdZlMt7kyKFg= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fjl/gencodec v0.0.0-20220412091415-8bb9e558978c/go.mod h1:AzA8Lj6YtixmJWL+wkKoBGsLWy9gFrAzi4g+5bCKwpY= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61/go.mod h1:Q0X6pkwTILDlzrGEckF6HKjXe48EgsY/l7K7vhY4MW8= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/getkin/kin-openapi v0.53.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= @@ -145,12 +114,10 @@ github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2 github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0 h1:MP4Eh7ZCb31lleYCFuwm0oe4/YGak+5l1vA2NOE80nA= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= github.com/go-ole/go-ole v1.2.5 h1:t4MGB5xEDZvXI+0rMjjsfBsD7yAgp/s9ZDkL1JndXwY= github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= @@ -180,8 +147,6 @@ github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrU github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= @@ -196,11 +161,8 @@ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5a github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -254,9 +216,6 @@ github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9/go.mod h1:Js0mq github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368/go.mod h1:Wbbw6tYNvwa5dlB6304Sd+82Z3f7PmVZHVKU637d4po= github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= -github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= -github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= -github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= @@ -267,7 +226,6 @@ github.com/julienschmidt/httprouter v1.2.0 h1:TDTW5Yz1mjftljbcKqRcrYhd4XeOoI98t+ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F6iIOGgxJ5npU/IUOhOhqlVrGjyIZc8/MagT0= -github.com/karalabe/usb v0.0.2/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= @@ -286,11 +244,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kylelemons/godebug v0.0.0-20170224010052-a616ab194758/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/labstack/echo/v4 v4.2.1/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4FW1e6jwpg= github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= -github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= @@ -320,18 +275,14 @@ github.com/mitchellh/pointerstructure v1.2.0 h1:O+i9nHnXS3l/9Wu7r4NrEdwA2VFTicjU github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= -github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= @@ -418,7 +369,6 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2 h1:4jaiDzPyXQvSd7D0EjG45355tLlV3VOECpq10pLC+8s= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= -github.com/supranational/blst v0.3.8-0.20220526154634-513d2456b344/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= @@ -430,7 +380,6 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1 github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef h1:wHSqTBrZW24CsNJDfeh9Ex6Pm0Rcpc7qrgKBiL44vF4= github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= -github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= github.com/urfave/cli/v2 v2.10.2 h1:x3p8awjp/2arX+Nl/G2040AZpOCHS/eMJJ1/a+mye4Y= github.com/urfave/cli/v2 v2.10.2/go.mod h1:f8iq5LtQ/bLxafbdBSLPPNsgaW0l/2fYYEHhAyPlwvo= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= @@ -442,8 +391,6 @@ github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6Ut github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= @@ -457,11 +404,9 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190909091759-094676da4a83/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -474,7 +419,6 @@ golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm0 golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20220426173459-3bcf042a4bf5/go.mod h1:lgLbSvA5ygNOMpwM/9anMpWVlVJ7Z+cHWq/eFuinpGE= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -491,10 +435,6 @@ golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCc golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= -golang.org/x/mod v0.6.0-dev.0.20211013180041-c96bc1413d57/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -529,26 +469,17 @@ golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210420205809-ac73e9fd8988/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -578,14 +509,10 @@ golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191126055441-b0650ceb63d9/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200108203644-89082a384178/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.8-0.20211029000441-d6a9af8af023/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -636,8 +563,6 @@ google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQ google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -653,14 +578,11 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWD gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -668,6 +590,5 @@ honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= diff --git a/tools/download_csdk_lib.sh b/tools/download_csdk_lib.sh index 3c81df94..3431159c 100755 --- a/tools/download_csdk_lib.sh +++ b/tools/download_csdk_lib.sh @@ -2,9 +2,9 @@ set -e install_path="/usr/local/lib/" -version="3.4.0" +version="3.5.0" OS="linux" -versions=(3.2.0 3.4.0) +versions=(3.2.0 3.4.0 3.5.0) LOG_WARN() { @@ -21,7 +21,7 @@ LOG_INFO() help() { cat << EOF Usage: - -v Default v3.4.0 + -v Default v3.5.0 -o Default /usr/loacl/lib -h Help e.g @@ -35,7 +35,7 @@ parse_params() { while getopts "v:o:h" option;do case $option in - v) [ -n "$OPTARG" ] && version="$OPTARG" + v) [ -n "$OPTARG" ] && version="${OPTARG//[vV]/}" if ! echo "${versions[*]}" | grep -i "${version}" &>/dev/null; then LOG_WARN "${version} is not supported. Please set one of ${versions[*]}" exit 1;