mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-03-30 15:08:33 +00:00

* Add stability-tests * Fix requires * Fix golint errors * Update README.md * Remove payloadHash from everywhere * don't run vet on kaspad in stability-tests/install_and_test
21 lines
478 B
Go
21 lines
478 B
Go
package main
|
|
|
|
import (
|
|
"github.com/kaspanet/kaspad/infrastructure/network/rpcclient/grpcclient"
|
|
"github.com/pkg/errors"
|
|
)
|
|
|
|
func sendCommands(rpcClient *grpcclient.GRPCClient, commandsChan <-chan string) error {
|
|
for command := range commandsChan {
|
|
log.Infof("Sending command %s", command)
|
|
response, err := rpcClient.PostJSON(command)
|
|
if err != nil {
|
|
return errors.Wrap(err, "error sending message")
|
|
}
|
|
|
|
log.Infof("-> Got response: %s", response)
|
|
}
|
|
|
|
return nil
|
|
}
|