Skip to content

Commit

Permalink
Update docs to reflect FFTM 1.1.6
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Whitehead <matthew.whitehead@kaleido.io>
  • Loading branch information
matthew1001 committed Dec 20, 2022
1 parent 6622905 commit a82084e
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 5 deletions.
35 changes: 35 additions & 0 deletions config.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,41 @@
|message|Configures the JSON key containing the log message|`string`|`message`
|timestamp|Configures the JSON key containing the timestamp of the log|`string`|`@timestamp`

## metrics

|Key|Description|Type|Default Value|
|---|-----------|----|-------------|
|address|The IP address on which the metrics HTTP API should listen|`int`|`127.0.0.1`
|enabled|Enables the metrics API|`boolean`|`false`
|path|The path from which to serve the Prometheus metrics|`string`|`/metrics`
|port|The port on which the metrics HTTP API should listen|`int`|`6000`
|publicURL|The fully qualified public URL for the metrics API. This is used for building URLs in HTTP responses and in OpenAPI Spec generation|URL `string`|`<nil>`
|readTimeout|The maximum time to wait when reading from an HTTP connection|[`time.Duration`](https://pkg.go.dev/time#Duration)|`15s`
|shutdownTimeout|The maximum amount of time to wait for any open HTTP requests to finish before shutting down the HTTP server|[`time.Duration`](https://pkg.go.dev/time#Duration)|`10s`
|writeTimeout|The maximum time to wait when writing to an HTTP connection|[`time.Duration`](https://pkg.go.dev/time#Duration)|`15s`

## metrics.auth

|Key|Description|Type|Default Value|
|---|-----------|----|-------------|
|type|The auth plugin to use for server side authentication of requests|`string`|`<nil>`

## metrics.auth.basic

|Key|Description|Type|Default Value|
|---|-----------|----|-------------|
|passwordfile|The path to a .htpasswd file to use for authenticating requests. Passwords should be hashed with bcrypt.|`string`|`<nil>`

## metrics.tls

|Key|Description|Type|Default Value|
|---|-----------|----|-------------|
|caFile|The path to the CA file for TLS on this API|`string`|`<nil>`
|certFile|The path to the certificate file for TLS on this API|`string`|`<nil>`
|clientAuth|Enables or disables client auth for TLS on this API|`string`|`<nil>`
|enabled|Enables or disables TLS on this API|`boolean`|`false`
|keyFile|The path to the private key file for TLS on this API|`string`|`<nil>`

## persistence

|Key|Description|Type|Default Value|
Expand Down
6 changes: 3 additions & 3 deletions internal/ethereum/get_address_balance.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ func (c *ethConnector) AddressBalance(ctx context.Context, req *ffcapi.AddressBa
if blockTag == "" {
blockTag = "latest"
}
err := c.backend.CallRPC(ctx, &addressBalance, "eth_getBalance", req.Address, blockTag)
if err != nil {
return nil, "", err.Error()
rpcErr := c.backend.CallRPC(ctx, &addressBalance, "eth_getBalance", req.Address, blockTag)
if rpcErr != nil {
return nil, "", rpcErr.Error()
}

return &ffcapi.AddressBalanceResponse{
Expand Down
4 changes: 2 additions & 2 deletions internal/ethereum/get_address_balance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ package ethereum

import (
"encoding/json"
"fmt"
"testing"

"github.com/hyperledger/firefly-signer/pkg/ethtypes"
"github.com/hyperledger/firefly-signer/pkg/rpcbackend"
"github.com/hyperledger/firefly-transaction-manager/pkg/ffcapi"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
Expand Down Expand Up @@ -64,7 +64,7 @@ func TestGetAddressBalanceFail(t *testing.T) {
defer done()

mRPC.On("CallRPC", mock.Anything, mock.Anything, "eth_getBalance", "0x4a8c8f1717570f9774652075e249ded38124d708", "latest").
Return(fmt.Errorf("pop"))
Return(&rpcbackend.RPCError{Message: "pop"})

var req ffcapi.AddressBalanceRequest
err := json.Unmarshal([]byte(sampleGetBalance), &req)
Expand Down

0 comments on commit a82084e

Please sign in to comment.