Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Integration with Hedera Hashgraph #156

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
db/
.env
external-initiator
.DS_STORE
.idea
13 changes: 12 additions & 1 deletion blockchain/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ var blockchains = []string{
BIRITA,
Agoric,
Klaytn,
HEDERA,
}

type Params struct {
Expand Down Expand Up @@ -98,6 +99,8 @@ func CreateClientManager(sub store.Subscription) (subscriber.ISubscriber, error)
return createKeeperSubscriber(sub)
case BIRITA:
return createBSNIritaSubscriber(sub)
case HEDERA:
return createHederaSubscriber(sub)
}

return nil, errors.New("unknown blockchain type for Client subscription")
Expand All @@ -106,7 +109,7 @@ func CreateClientManager(sub store.Subscription) (subscriber.ISubscriber, error)
func GetConnectionType(endpoint store.Endpoint) (subscriber.Type, error) {
switch endpoint.Type {
// Add blockchain implementations that encapsulate entire connection here
case XTZ, ONT, IOTX, Keeper, BIRITA:
case XTZ, ONT, IOTX, Keeper, BIRITA, HEDERA:
return subscriber.Client, nil
default:
u, err := url.Parse(endpoint.Url)
Expand Down Expand Up @@ -177,6 +180,10 @@ func GetValidations(t string, params Params) []int {
return []int{
1,
}
case HEDERA:
return []int{
len(params.AccountIds),
}
}

return nil
Expand Down Expand Up @@ -228,6 +235,10 @@ func CreateSubscription(sub *store.Subscription, params Params) {
}
case Agoric:
sub.Agoric = store.AgoricSubscription{}
case HEDERA:
sub.Hedera = store.HederaSubscription{
AccountIds: params.AccountIds,
}
}
}

Expand Down
Loading