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

Map namespace between local name and remote name #895

Merged
merged 10 commits into from
Jul 13, 2022
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ endef
$(eval $(call makemock, $$(WSCLIENT_PATH), WSClient, wsmocks))
$(eval $(call makemock, pkg/blockchain, Plugin, blockchainmocks))
$(eval $(call makemock, pkg/blockchain, Callbacks, blockchainmocks))
$(eval $(call makemock, pkg/core, OperationCallbacks, coremocks))
$(eval $(call makemock, pkg/database, Plugin, databasemocks))
$(eval $(call makemock, pkg/database, Callbacks, databasemocks))
$(eval $(call makemock, pkg/sharedstorage, Plugin, sharedstoragemocks))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
BEGIN;
ALTER TABLE messages DROP COLUMN namespace_local;
ALTER TABLE groups DROP COLUMN namespace_local;
COMMIT;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
BEGIN;
ALTER TABLE messages ADD COLUMN namespace_local VARCHAR(64);
UPDATE messages SET namespace_local = namespace;
ALTER TABLE messages ALTER COLUMN namespace_local SET NOT NULL;

ALTER TABLE groups ADD COLUMN namespace_local VARCHAR(64);
UPDATE groups SET namespace_local = namespace;
ALTER TABLE groups ALTER COLUMN namespace_local SET NOT NULL;
COMMIT;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE messages DROP COLUMN namespace_local;
ALTER TABLE groups DROP COLUMN namespace_local;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ALTER TABLE messages ADD COLUMN namespace_local VARCHAR(64);
UPDATE messages SET namespace_local = namespace;

ALTER TABLE groups ADD COLUMN namespace_local VARCHAR(64);
UPDATE groups SET namespace_local = namespace;
4 changes: 3 additions & 1 deletion docs/reference/types/group.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ nav_order: 18
"node": "61a99af8-c1f7-48ea-8fcc-489e4822a0ed"
}
],
"localNamespace": "ns1",
"message": "0b9dfb76-103d-443d-92fd-b114fe07c54d",
"hash": "c52ad6c034cf5c7382d9a294f49297096a52eb55cc2da696c564b2a276633b95",
"created": "2022-05-16T01:23:16Z"
Expand All @@ -46,9 +47,10 @@ nav_order: 18

| Field Name | Description | Type |
|------------|-------------|------|
| `namespace` | The namespace of the group | `string` |
| `namespace` | The namespace of the group within the multiparty network | `string` |
| `name` | The optional name of the group, allowing multiple unique groups to exist with the same list of recipients | `string` |
| `members` | The list of members in this privacy group | [`Member[]`](#member) |
| `localNamespace` | The local namespace of the group | `string` |
| `message` | The message used to broadcast this group privately to the members | [`UUID`](simpletypes#uuid) |
| `hash` | The identifier hash of this group. Derived from the name and group members | `Bytes32` |
| `created` | The time when the group was first used to send a message in the network | [`FFTime`](simpletypes#fftime) |
Expand Down
4 changes: 3 additions & 1 deletion docs/reference/types/message.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ nav_order: 15
"tag": "blue_message",
"datahash": "c07be180b147049baced0b6219d9ce7a84ab48f2ca7ca7ae949abb3fe6491b54"
},
"localNamespace": "ns1",
"state": "confirmed",
"confirmed": "2022-05-16T01:23:16Z",
"data": [
Expand All @@ -56,6 +57,7 @@ nav_order: 15
| Field Name | Description | Type |
|------------|-------------|------|
| `header` | The message header contains all fields that are used to build the message hash | [`MessageHeader`](#messageheader) |
| `localNamespace` | The local namespace of the message | `string` |
| `hash` | The hash of the message. Derived from the header, which includes the data hash | `Bytes32` |
| `batch` | The UUID of the batch in which the message was pinned/transferred | [`UUID`](simpletypes#uuid) |
| `state` | The current state of the message | `FFEnum`:<br/>`"staged"`<br/>`"ready"`<br/>`"sent"`<br/>`"pending"`<br/>`"confirmed"`<br/>`"rejected"` |
Expand All @@ -74,7 +76,7 @@ nav_order: 15
| `author` | The DID of identity of the submitter | `string` |
| `key` | The on-chain signing key used to sign the transaction | `string` |
| `created` | The creation time of the message | [`FFTime`](simpletypes#fftime) |
| `namespace` | The namespace of the message | `string` |
| `namespace` | The namespace of the message within the multiparty network | `string` |
| `topics` | A message topic associates this message with an ordered stream of data. A custom topic should be assigned - using the default topic is discouraged | `string[]` |
| `tag` | The message tag indicates the purpose of the message to the applications that process it | `string` |
| `datahash` | A single hash representing all data in the message. Derived from the array of data ids+hashes attached to this message | `Bytes32` |
Expand Down
Loading