Skip to content

Commit

Permalink
Merge branch 'main' of github.com:hyperledger/firefly into org-prop
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbroadhurst committed Jan 19, 2024
2 parents 4cf5c88 + 2d92165 commit bca6aa1
Show file tree
Hide file tree
Showing 401 changed files with 31,914 additions and 7,786 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@
/smart_contracts/ethereum/solidity_firefly/cache
/firefly
/firefly-nocgo
/docs/vendor
/docs/_site
coverage.txt
codecov.yml
14 changes: 7 additions & 7 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ jobs:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: 1.18
go-version: 1.21

- name: Build and Test
run: make
Expand All @@ -36,9 +36,9 @@ jobs:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: 1.18
go-version: 1.21

- name: Build Docker image
run: make docker
Expand Down Expand Up @@ -117,7 +117,7 @@ jobs:

- stack-type: ethereum
blockchain-connector: ethconnect
test-suite: TestEthereumGatewayE2ESuite
test-suite: TestEthereumGatewayLegacyEthE2ESuite
database-type: sqlite3
token-provider: erc1155
multiparty-enabled: false
Expand All @@ -128,9 +128,9 @@ jobs:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: 1.18
go-version: 1.21

- name: Download Docker image
uses: actions/download-artifact@v3
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ jobs:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: 1.18
go-version: 1.21

- name: Update manifest to latest commit for every service
run: ./manifestgen.sh head
Expand Down Expand Up @@ -89,9 +89,9 @@ jobs:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: 1.18
go-version: 1.21

- name: Update manifest to latest commit for every service
run: ./manifestgen.sh head
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/solidity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ jobs:
solidity-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '16.x'
node-version: "16.x"
- run: npm ci
working-directory: ./smart_contracts/ethereum/solidity_firefly
- run: npm run test
Expand Down
7 changes: 5 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ run:
skip-dirs:
- "mocks"
- "ffconfig"
- "test/e2e"
linters-settings:
golint: {}
gocritic:
Expand All @@ -12,7 +13,10 @@ linters-settings:
revive:
rules:
- name: unused-parameter
disabled: true
disabled: true
gosec:
excludes:
- G601 # Appears not to handle taking an address of a sub-structure, within a pointer to a structure within a loop. Which is valid and safe.
goheader:
values:
regexp:
Expand All @@ -38,7 +42,6 @@ linters:
disable:
- structcheck
enable:
- depguard
- dogsled
- errcheck
- goconst
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"mytag",
"NATS",
"nextpins",
"openapi",
"opid",
"optype",
"opupdate",
Expand Down
6 changes: 1 addition & 5 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# SPDX-License-Identifier: Apache-2.0

# FireFly Core Maintainers
* @peterbroadhurst @nguyer @awrichar @shorsher

# FireFly Documentation Maintainers
/docs @peterbroadhurst @nguyer @awrichar @shorsher @nickgaski
* @hyperledger/firefly-core-maintainers
43 changes: 2 additions & 41 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Maintainers
# firefly-core-maintainers

The following is the list of current maintainers this repo:

Expand All @@ -9,45 +9,6 @@ The following is the list of current maintainers this repo:
| Andrew Richardson | awrichar | [email protected] | Andrew.Richardson |
| Alex Shorsher | shorsher | [email protected] | shorsher |


This list is to be kept up to date as maintainers are added or removed.

# Expectations of Maintainers

Maintainers are expected to regularly:

- Make contributions to FireFly code repositories including code or documentation
- Review pull requests
- Investigate open GitHub issues
- Participate in Community Calls

# Becoming a Maintainer

The FireFly Project welcomes and encourages people to become maintainers of the project if they are interested and meet the following criteria:

## Criteria for becoming a member

- Expressed interest and commitment to meet the expectations of a maintainer for at least 6 months
- A consistent track record of contributions to FireFly code repositories which could be:
- Enhancements
- Bug fixes
- Tests
- Documentation
- A consistent track record of helpful code reviews on FireFly code repositories
- Regular participation in Community Calls
- A demonstrated interest and aptitude in thought leadership within the FireFly Project
- Sponsorship from an existing maintainer

There is no specific quantity of contributions or pull requests, or a specific time period over which the candidate must prove their track record. This will be left up to the discretion of the existing maintainers.

## Process for becoming a maintainer

Once the above criteria have been met, the sponsoring maintainer shall propose the addition of the new maintainer at a public Community Call. Existing maintainers shall vote at the next public Community Call whether the new maintainer should be added or not. Proxy votes may be submitted via email _before_ the meeting. A simple majority of the existing maintainers is required for the vote to pass.

## Maintainer resignation

While maintainers are expected in good faith to be committed to the project for a significant period of time, they are under no binding obligation to do so. Maintainers may resign at any time for any reason. If a maintainer wishes to resign they shall open a pull request to update the maintainers list removing themselves from the list.

## Maintainer inactivity

If a maintainer has remained inactive (not meeting the expectations of a maintainer) for a period of time (at least several months), an email should be sent to that maintainer noting their inactivity and asking if they still wish to be a maintainer. If they continue to be inactive after being notified via email, an existing maintainer may propose to remove the inactive maintainer at a public Community Call. Existing maintainers shall vote at the next public Community Call whether the inactive maintainer should be removed or not. Proxy votes may be submitted via email _before_ the meeting. A simple majority of the existing maintainers is required for the vote to pass.
For the full list of maintainers across all repos, the expectations of a maintainer and the process for becoming a maintainer, please see the [FireFly Maintainers page on the Hyperledger Wiki](https://wiki.hyperledger.org/display/FIR/Maintainers).
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ lint: ${LINT}
${MOCKERY}:
$(VGO) install github.com/vektra/mockery/v2@latest
${LINT}:
$(VGO) install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.47.3
$(VGO) install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.54.0
ffcommon:
$(eval WSCLIENT_PATH := $(shell $(VGO) list -f '{{.Dir}}' github.com/hyperledger/firefly-common/pkg/wsclient))

Expand Down Expand Up @@ -52,6 +52,7 @@ $(eval $(call makemock, pkg/dataexchange, Callbacks, dataex
$(eval $(call makemock, pkg/tokens, Plugin, tokenmocks))
$(eval $(call makemock, pkg/tokens, Callbacks, tokenmocks))
$(eval $(call makemock, internal/txcommon, Helper, txcommonmocks))
$(eval $(call makemock, internal/txwriter, Writer, txwritermocks))
$(eval $(call makemock, internal/identity, Manager, identitymanagermocks))
$(eval $(call makemock, internal/syncasync, Sender, syncasyncmocks))
$(eval $(call makemock, internal/syncasync, Bridge, syncasyncmocks))
Expand All @@ -72,12 +73,13 @@ $(eval $(call makemock, internal/assets, Manager, assetm
$(eval $(call makemock, internal/contracts, Manager, contractmocks))
$(eval $(call makemock, internal/spievents, Manager, spieventsmocks))
$(eval $(call makemock, internal/orchestrator, Orchestrator, orchestratormocks))
$(eval $(call makemock, internal/apiserver, FFISwaggerGen, apiservermocks))
$(eval $(call makemock, internal/apiserver, Server, apiservermocks))
$(eval $(call makemock, internal/cache, Manager, cachemocks))
$(eval $(call makemock, internal/metrics, Manager, metricsmocks))
$(eval $(call makemock, internal/operations, Manager, operationmocks))
$(eval $(call makemock, internal/multiparty, Manager, multipartymocks))
$(eval $(call makemock, internal/apiserver, FFISwaggerGen, apiservermocks))
$(eval $(call makemock, internal/apiserver, Server, apiservermocks))
$(eval $(call makemock, internal/events/websockets, WebSocketsNamespaced, websocketsmocks))

firefly-nocgo: ${GOFILES}
CGO_ENABLED=0 $(VGO) build -o ${BINARY_NAME}-nocgo -ldflags "-X main.buildDate=$(DATE) -X main.buildVersion=$(BUILD_VERSION) -X 'github.com/hyperledger/firefly/cmd.BuildVersionOverride=$(BUILD_VERSION)' -X 'github.com/hyperledger/firefly/cmd.BuildDate=$(DATE)' -X 'github.com/hyperledger/firefly/cmd.BuildCommit=$(GIT_REF)'" -tags=prod -tags=prod -v
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[![Go Report Card](https://goreportcard.com/badge/github.com/hyperledger/firefly)](https://goreportcard.com/report/github.com/hyperledger/firefly)
[![FireFy Documentation](https://img.shields.io/static/v1?label=FireFly&message=documentation&color=informational)](https://hyperledger.github.io/firefly//)
![build](https://github.com/hyperledger/firefly/actions/workflows/docker_main.yml/badge.svg?branch=main)
[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/7826/badge)](https://www.bestpractices.dev/projects/7826)

![Hyperledger FireFly](./images/hyperledger_firefly_logo.png)

Expand All @@ -26,7 +27,7 @@ FireFly CLI | FireFly Explorer UI | FireFly Sa

## Engage with the community

- [Join us on Discord](https://discord.gg/Fy7MJuqw86)
- [Join us on Discord](https://discord.gg/hyperledger)

## Technical architecture

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-- no down migration
7 changes: 7 additions & 0 deletions db/migrations/postgres/000109_fix_tokentransfer_index.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
BEGIN;
DROP INDEX tokentransfer_protocolid;
DROP INDEX tokenapproval_protocolid;

CREATE UNIQUE INDEX tokentransfer_protocolid ON tokentransfer(namespace, connector, protocol_id);
CREATE UNIQUE INDEX tokenapproval_protocolid ON tokenapproval(namespace, connector, protocol_id);
COMMIT;
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
BEGIN;
DROP INDEX tokenpool_networkname;
ALTER TABLE tokenpool DROP COLUMN published;
ALTER TABLE tokenpool DROP COLUMN network_name;
ALTER TABLE tokenpool DROP COLUMN plugin_data;
COMMIT;
12 changes: 12 additions & 0 deletions db/migrations/postgres/000110_add_tokenpool_networkname.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
BEGIN;
ALTER TABLE tokenpool ADD COLUMN published BOOLEAN DEFAULT false;
UPDATE tokenpool SET published = true WHERE message_id IS NOT NULL;

ALTER TABLE tokenpool ADD COLUMN network_name VARCHAR(64);
UPDATE tokenpool SET network_name = name WHERE message_id IS NOT NULL;

ALTER TABLE tokenpool ADD COLUMN plugin_data TEXT;
UPDATE tokenpool SET plugin_data = namespace;

CREATE UNIQUE INDEX tokenpool_networkname ON tokenpool(namespace,network_name);
COMMIT;
8 changes: 8 additions & 0 deletions db/migrations/postgres/000111_adjust_token_indexes.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
BEGIN;
DROP INDEX tokentransfer_protocolid;
DROP INDEX tokenapproval_protocolid;

CREATE UNIQUE INDEX tokentransfer_protocolid ON tokentransfer(namespace, connector, protocol_id);
CREATE UNIQUE INDEX tokenapproval_protocolid ON tokenapproval(namespace, connector, protocol_id);
CREATE INDEX tokenpool_locator ON tokenpool(namespace, connector, locator);
COMMIT;
8 changes: 8 additions & 0 deletions db/migrations/postgres/000111_adjust_token_indexes.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
BEGIN;
DROP INDEX tokenpool_locator;
DROP INDEX tokentransfer_protocolid;
DROP INDEX tokenapproval_protocolid;

CREATE UNIQUE INDEX tokentransfer_protocolid ON tokentransfer(namespace, pool_id, protocol_id);
CREATE UNIQUE INDEX tokenapproval_protocolid ON tokenapproval(namespace, pool_id, protocol_id);
COMMIT;
5 changes: 5 additions & 0 deletions db/migrations/postgres/000112_add_ffi_networkname.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
BEGIN;
DROP INDEX ffi_networkname;
ALTER TABLE ffi DROP COLUMN published;
ALTER TABLE ffi DROP COLUMN network_name;
COMMIT;
7 changes: 7 additions & 0 deletions db/migrations/postgres/000112_add_ffi_networkname.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
BEGIN;
ALTER TABLE ffi ADD COLUMN published BOOLEAN DEFAULT false;
UPDATE ffi SET published = true WHERE message_id IS NOT NULL;
ALTER TABLE ffi ADD COLUMN network_name VARCHAR(64);
UPDATE ffi SET network_name = name WHERE message_id IS NOT NULL;
CREATE UNIQUE INDEX ffi_networkname ON ffi(namespace,network_name,version);
COMMIT;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
BEGIN;
DROP INDEX contractapis_networkname;
ALTER TABLE contractapis DROP COLUMN published;
ALTER TABLE contractapis DROP COLUMN network_name;
COMMIT;
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
BEGIN;
ALTER TABLE contractapis ADD COLUMN published BOOLEAN DEFAULT false;
UPDATE contractapis SET published = true WHERE message_id IS NOT NULL;
ALTER TABLE contractapis ADD COLUMN network_name VARCHAR(64);
UPDATE contractapis SET network_name = name WHERE message_id IS NOT NULL;
CREATE UNIQUE INDEX contractapis_networkname ON contractapis(namespace,network_name);
COMMIT;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
BEGIN;
ALTER TABLE messages DROP COLUMN reject_reason;
COMMIT;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
BEGIN;
ALTER TABLE messages ADD COLUMN reject_reason TEXT DEFAULT '';
COMMIT;
5 changes: 5 additions & 0 deletions db/migrations/postgres/000115_rename_tokenpool_state.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
BEGIN;
ALTER TABLE tokenpool ADD COLUMN state VARCHAR(64);
UPDATE tokenpool SET state = (CASE WHEN active = true THEN 'confirmed' ELSE 'pending' END);
ALTER TABLE tokenpool DROP COLUMN active;
COMMIT;
5 changes: 5 additions & 0 deletions db/migrations/postgres/000115_rename_tokenpool_state.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
BEGIN;
ALTER TABLE tokenpool ADD COLUMN active BOOLEAN;
UPDATE tokenpool SET active = (CASE WHEN state = 'confirmed' THEN true ELSE false END);
ALTER TABLE tokenpool DROP COLUMN state;
COMMIT;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-- no down migration
5 changes: 5 additions & 0 deletions db/migrations/sqlite/000109_fix_tokentransfer_index.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
DROP INDEX tokentransfer_protocolid;
DROP INDEX tokenapproval_protocolid;

CREATE UNIQUE INDEX tokentransfer_protocolid ON tokentransfer(namespace, connector, protocol_id);
CREATE UNIQUE INDEX tokenapproval_protocolid ON tokenapproval(namespace, connector, protocol_id);
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
DROP INDEX tokenpool_networkname;
ALTER TABLE tokenpool DROP COLUMN published;
ALTER TABLE tokenpool DROP COLUMN network_name;
ALTER TABLE tokenpool DROP COLUMN plugin_data;
10 changes: 10 additions & 0 deletions db/migrations/sqlite/000110_add_tokenpool_networkname.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
ALTER TABLE tokenpool ADD COLUMN published BOOLEAN DEFAULT false;
UPDATE tokenpool SET published = true WHERE message_id IS NOT NULL;

ALTER TABLE tokenpool ADD COLUMN network_name VARCHAR(64);
UPDATE tokenpool SET network_name = name WHERE message_id IS NOT NULL;

ALTER TABLE tokenpool ADD COLUMN plugin_data TEXT;
UPDATE tokenpool SET plugin_data = namespace;

CREATE UNIQUE INDEX tokenpool_networkname ON tokenpool(namespace,network_name);
6 changes: 6 additions & 0 deletions db/migrations/sqlite/000111_adjust_token_indexes.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
DROP INDEX tokentransfer_protocolid;
DROP INDEX tokenapproval_protocolid;

CREATE UNIQUE INDEX tokentransfer_protocolid ON tokentransfer(namespace, connector, protocol_id);
CREATE UNIQUE INDEX tokenapproval_protocolid ON tokenapproval(namespace, connector, protocol_id);
CREATE INDEX tokenpool_locator ON tokenpool(namespace, connector, locator);
6 changes: 6 additions & 0 deletions db/migrations/sqlite/000111_adjust_token_indexes.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
DROP INDEX tokenpool_locator;
DROP INDEX tokentransfer_protocolid;
DROP INDEX tokenapproval_protocolid;

CREATE UNIQUE INDEX tokentransfer_protocolid ON tokentransfer(namespace, pool_id, protocol_id);
CREATE UNIQUE INDEX tokenapproval_protocolid ON tokenapproval(namespace, pool_id, protocol_id);
3 changes: 3 additions & 0 deletions db/migrations/sqlite/000112_add_ffi_networkname.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DROP INDEX ffi_networkname;
ALTER TABLE ffi DROP COLUMN published;
ALTER TABLE ffi DROP COLUMN network_name;
5 changes: 5 additions & 0 deletions db/migrations/sqlite/000112_add_ffi_networkname.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ALTER TABLE ffi ADD COLUMN published BOOLEAN DEFAULT false;
UPDATE ffi SET published = true WHERE message_id IS NOT NULL;
ALTER TABLE ffi ADD COLUMN network_name VARCHAR(64);
UPDATE ffi SET network_name = name WHERE message_id IS NOT NULL;
CREATE UNIQUE INDEX ffi_networkname ON ffi(namespace,network_name,version);
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DROP INDEX contractapis_networkname;
ALTER TABLE contractapis DROP COLUMN published;
ALTER TABLE contractapis DROP COLUMN network_name;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ALTER TABLE contractapis ADD COLUMN published BOOLEAN DEFAULT false;
UPDATE contractapis SET published = true WHERE message_id IS NOT NULL;
ALTER TABLE contractapis ADD COLUMN network_name VARCHAR(64);
UPDATE contractapis SET network_name = name WHERE message_id IS NOT NULL;
CREATE UNIQUE INDEX contractapis_networkname ON contractapis(namespace,network_name);
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE messages DROP COLUMN reject_reason;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE messages ADD COLUMN reject_reason TEXT DEFAULT '';
Loading

0 comments on commit bca6aa1

Please sign in to comment.