Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added cardano connector plugin #1636

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
bf9b6c4
Add WIP cardano support
SupernaviX May 30, 2024
0b47496
Fix WS connection to cardano connector
SupernaviX Jun 2, 2024
7b9e934
Pass-through FFI validation
SupernaviX Jun 2, 2024
fb574c6
Fix signature of cardano plugin
SupernaviX Oct 31, 2024
b9b766a
Update tags for cardano images
SupernaviX Oct 31, 2024
0238a58
feat: implement invoking cardano contracts
SupernaviX Nov 6, 2024
2e9baf2
feat: support DeployContract
SupernaviX Dec 6, 2024
67c8b1c
fix: pass namespace to HandleReceipt
SupernaviX Feb 6, 2025
ef68f8e
feat: support contract listeners
SupernaviX Feb 7, 2025
89c1a24
fix: correct linter error
SupernaviX Feb 8, 2025
1e5f445
fix: correct image paths
SupernaviX Feb 8, 2025
a95c7af
fix: correct copyright year
SupernaviX Feb 8, 2025
07f4dbd
fix: fix documentation
SupernaviX Feb 8, 2025
dba31c7
test: add coverage
SupernaviX Feb 10, 2025
89dd513
fix: use newer curl version
SupernaviX Feb 10, 2025
8a1372f
fix: use same curl version everywhere
SupernaviX Feb 10, 2025
e992174
fix: downgrade to older curl version everywhere
SupernaviX Feb 10, 2025
b4e295f
test: add test on invalid input to reach 100% coverage
SupernaviX Feb 10, 2025
1f4d2f9
feat: use different websockets for different namespaces
SupernaviX Feb 11, 2025
4efbdd8
feat: copy event signature logic to error signatures
SupernaviX Feb 11, 2025
581623f
fix: use proper i18n errors
SupernaviX Feb 11, 2025
77b0e82
Merge branch 'main' into cardano
SupernaviX Feb 20, 2025
d219791
fix: remove unneeded dockerfile change
SupernaviX Feb 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions doc-site/docs/reference/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,82 @@ title: Configuration Reference
|name|The name of the configured Blockchain plugin|`string`|`<nil>`
|type|The type of the configured Blockchain Connector plugin|`string`|`<nil>`

## plugins.blockchain[].cardano.cardanoconnect

|Key|Description|Type|Default Value|
|---|-----------|----|-------------|
|batchSize|The number of events Cardanoconnect should batch together for delivery to FireFly core. Only applies when automatically creating a new event stream|`int`|`50`
|batchTimeout|How long Cardanoconnect should wait for new events to arrive and fill a batch, before sending the batch to FireFly core. Only applies when automatically creating a new event stream|[`time.Duration`](https://pkg.go.dev/time#Duration)|`500`
|connectionTimeout|The maximum amount of time that a connection is allowed to remain with no data transmitted|[`time.Duration`](https://pkg.go.dev/time#Duration)|`30s`
|expectContinueTimeout|See [ExpectContinueTimeout in the Go docs](https://pkg.go.dev/net/http#Transport)|[`time.Duration`](https://pkg.go.dev/time#Duration)|`1s`
|headers|Adds custom headers to HTTP requests|`map[string]string`|`<nil>`
|idleTimeout|The max duration to hold a HTTP keepalive connection between calls|[`time.Duration`](https://pkg.go.dev/time#Duration)|`475ms`
|maxConnsPerHost|The max number of connections, per unique hostname. Zero means no limit|`int`|`0`
|maxIdleConns|The max number of idle connections to hold pooled|`int`|`100`
|maxIdleConnsPerHost|The max number of idle connections, per unique hostname. Zero means net/http uses the default of only 2.|`int`|`100`
|passthroughHeadersEnabled|Enable passing through the set of allowed HTTP request headers|`boolean`|`false`
|requestTimeout|The maximum amount of time that a request is allowed to remain open|[`time.Duration`](https://pkg.go.dev/time#Duration)|`30s`
|tlsHandshakeTimeout|The maximum amount of time to wait for a successful TLS handshake|[`time.Duration`](https://pkg.go.dev/time#Duration)|`10s`
|topic|The websocket listen topic that the node should register on, which is important if there are multiple nodes using a single cardanoconnect|`string`|`<nil>`
|url|The URL of the Cardanoconnect instance|URL `string`|`<nil>`

## plugins.blockchain[].cardano.cardanoconnect.auth

|Key|Description|Type|Default Value|
|---|-----------|----|-------------|
|password|Password|`string`|`<nil>`
|username|Username|`string`|`<nil>`

## plugins.blockchain[].cardano.cardanoconnect.proxy

|Key|Description|Type|Default Value|
|---|-----------|----|-------------|
|url|Optional HTTP proxy server to connect through|`string`|`<nil>`

## plugins.blockchain[].cardano.cardanoconnect.retry

|Key|Description|Type|Default Value|
|---|-----------|----|-------------|
|count|The maximum number of times to retry|`int`|`5`
|enabled|Enables retries|`boolean`|`false`
|errorStatusCodeRegex|The regex that the error response status code must match to trigger retry|`string`|`<nil>`
|initWaitTime|The initial retry delay|[`time.Duration`](https://pkg.go.dev/time#Duration)|`250ms`
|maxWaitTime|The maximum retry delay|[`time.Duration`](https://pkg.go.dev/time#Duration)|`30s`

## plugins.blockchain[].cardano.cardanoconnect.throttle

|Key|Description|Type|Default Value|
|---|-----------|----|-------------|
|burst|The maximum number of requests that can be made in a short period of time before the throttling kicks in.|`int`|`<nil>`
|requestsPerSecond|The average rate at which requests are allowed to pass through over time.|`int`|`<nil>`

## plugins.blockchain[].cardano.cardanoconnect.tls

|Key|Description|Type|Default Value|
|---|-----------|----|-------------|
|ca|The TLS certificate authority in PEM format (this option is ignored if caFile is also set)|`string`|`<nil>`
|caFile|The path to the CA file for TLS on this API|`string`|`<nil>`
|cert|The TLS certificate in PEM format (this option is ignored if certFile is also set)|`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`
|insecureSkipHostVerify|When to true in unit test development environments to disable TLS verification. Use with extreme caution|`boolean`|`<nil>`
|key|The TLS certificate key in PEM format (this option is ignored if keyFile is also set)|`string`|`<nil>`
|keyFile|The path to the private key file for TLS on this API|`string`|`<nil>`
|requiredDNAttributes|A set of required subject DN attributes. Each entry is a regular expression, and the subject certificate must have a matching attribute of the specified type (CN, C, O, OU, ST, L, STREET, POSTALCODE, SERIALNUMBER are valid attributes)|`map[string]string`|`<nil>`

## plugins.blockchain[].cardano.cardanoconnect.ws

|Key|Description|Type|Default Value|
|---|-----------|----|-------------|
|connectionTimeout|The amount of time to wait while establishing a connection (or auto-reconnection)|[`time.Duration`](https://pkg.go.dev/time#Duration)|`45s`
|heartbeatInterval|The amount of time to wait between heartbeat signals on the WebSocket connection|[`time.Duration`](https://pkg.go.dev/time#Duration)|`30s`
|initialConnectAttempts|The number of attempts FireFly will make to connect to the WebSocket when starting up, before failing|`int`|`5`
|path|The WebSocket sever URL to which FireFly should connect|WebSocket URL `string`|`<nil>`
|readBufferSize|The size in bytes of the read buffer for the WebSocket connection|[`BytesSize`](https://pkg.go.dev/github.com/docker/go-units#BytesSize)|`16Kb`
|url|URL to use for WebSocket - overrides url one level up (in the HTTP config)|`string`|`<nil>`
|writeBufferSize|The size in bytes of the write buffer for the WebSocket connection|[`BytesSize`](https://pkg.go.dev/github.com/docker/go-units#BytesSize)|`16Kb`

## plugins.blockchain[].ethereum.addressResolver

|Key|Description|Type|Default Value|
Expand Down
2 changes: 1 addition & 1 deletion doc-site/docs/reference/types/verifier.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ title: Verifier
| `hash` | Hash used as a globally consistent identifier for this namespace + type + value combination on every node in the network | `Bytes32` |
| `identity` | The UUID of the parent identity that has claimed this verifier | [`UUID`](simpletypes.md#uuid) |
| `namespace` | The namespace of the verifier | `string` |
| `type` | The type of the verifier | `FFEnum`:<br/>`"ethereum_address"`<br/>`"tezos_address"`<br/>`"fabric_msp_id"`<br/>`"dx_peer_id"` |
| `type` | The type of the verifier | `FFEnum`:<br/>`"cardano_address"`<br/>`"ethereum_address"`<br/>`"tezos_address"`<br/>`"fabric_msp_id"`<br/>`"dx_peer_id"` |
| `value` | The verifier string, such as an Ethereum address, or Fabric MSP identifier | `string` |
| `created` | The time this verifier was created on this node | [`FFTime`](simpletypes.md#fftime) |

18 changes: 18 additions & 0 deletions doc-site/docs/swagger/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9396,6 +9396,7 @@ paths:
type:
description: The type of the verifier
enum:
- cardano_address
- ethereum_address
- tezos_address
- fabric_msp_id
Expand Down Expand Up @@ -10098,6 +10099,7 @@ paths:
type:
description: The type of the verifier
enum:
- cardano_address
- ethereum_address
- tezos_address
- fabric_msp_id
Expand Down Expand Up @@ -22859,6 +22861,7 @@ paths:
type:
description: The type of the verifier
enum:
- cardano_address
- ethereum_address
- tezos_address
- fabric_msp_id
Expand Down Expand Up @@ -23596,6 +23599,7 @@ paths:
type:
description: The type of the verifier
enum:
- cardano_address
- ethereum_address
- tezos_address
- fabric_msp_id
Expand Down Expand Up @@ -26379,6 +26383,7 @@ paths:
type:
description: The type of the verifier
enum:
- cardano_address
- ethereum_address
- tezos_address
- fabric_msp_id
Expand Down Expand Up @@ -26514,6 +26519,7 @@ paths:
type:
description: The type of the verifier
enum:
- cardano_address
- ethereum_address
- tezos_address
- fabric_msp_id
Expand Down Expand Up @@ -28617,6 +28623,7 @@ paths:
type:
description: The type of the verifier
enum:
- cardano_address
- ethereum_address
- tezos_address
- fabric_msp_id
Expand Down Expand Up @@ -35331,6 +35338,7 @@ paths:
type:
description: The type of the verifier
enum:
- cardano_address
- ethereum_address
- tezos_address
- fabric_msp_id
Expand Down Expand Up @@ -35400,6 +35408,7 @@ paths:
type:
description: The type of the verifier
enum:
- cardano_address
- ethereum_address
- tezos_address
- fabric_msp_id
Expand Down Expand Up @@ -35442,6 +35451,7 @@ paths:
type:
description: The type of the verifier
enum:
- cardano_address
- ethereum_address
- tezos_address
- fabric_msp_id
Expand All @@ -35461,6 +35471,7 @@ paths:
type:
description: The type of the verifier
enum:
- cardano_address
- ethereum_address
- tezos_address
- fabric_msp_id
Expand Down Expand Up @@ -35792,6 +35803,7 @@ paths:
type:
description: The type of the verifier
enum:
- cardano_address
- ethereum_address
- tezos_address
- fabric_msp_id
Expand Down Expand Up @@ -35920,6 +35932,7 @@ paths:
type:
description: The type of the verifier
enum:
- cardano_address
- ethereum_address
- tezos_address
- fabric_msp_id
Expand Down Expand Up @@ -37925,6 +37938,7 @@ paths:
type:
description: The type of the verifier
enum:
- cardano_address
- ethereum_address
- tezos_address
- fabric_msp_id
Expand Down Expand Up @@ -44421,6 +44435,7 @@ paths:
type:
description: The type of the verifier
enum:
- cardano_address
- ethereum_address
- tezos_address
- fabric_msp_id
Expand Down Expand Up @@ -44483,6 +44498,7 @@ paths:
type:
description: The type of the verifier
enum:
- cardano_address
- ethereum_address
- tezos_address
- fabric_msp_id
Expand Down Expand Up @@ -44518,6 +44534,7 @@ paths:
type:
description: The type of the verifier
enum:
- cardano_address
- ethereum_address
- tezos_address
- fabric_msp_id
Expand All @@ -44537,6 +44554,7 @@ paths:
type:
description: The type of the verifier
enum:
- cardano_address
- ethereum_address
- tezos_address
- fabric_msp_id
Expand Down
4 changes: 3 additions & 1 deletion internal/blockchain/bifactory/factory.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2023 Kaleido, Inc.
// Copyright © 2025 Kaleido, Inc.
//
// SPDX-License-Identifier: Apache-2.0
//
Expand All @@ -21,6 +21,7 @@ import (

"github.com/hyperledger/firefly-common/pkg/config"
"github.com/hyperledger/firefly-common/pkg/i18n"
"github.com/hyperledger/firefly/internal/blockchain/cardano"
"github.com/hyperledger/firefly/internal/blockchain/ethereum"
"github.com/hyperledger/firefly/internal/blockchain/fabric"
"github.com/hyperledger/firefly/internal/blockchain/tezos"
Expand All @@ -30,6 +31,7 @@ import (
)

var pluginsByType = map[string]func() blockchain.Plugin{
(*cardano.Cardano)(nil).Name(): func() blockchain.Plugin { return &cardano.Cardano{} },
(*ethereum.Ethereum)(nil).Name(): func() blockchain.Plugin { return &ethereum.Ethereum{} },
(*fabric.Fabric)(nil).Name(): func() blockchain.Plugin { return &fabric.Fabric{} },
(*tezos.Tezos)(nil).Name(): func() blockchain.Plugin { return &tezos.Tezos{} },
Expand Down
Loading