-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #271 from logion-network/feature/decentralize-dir
Decentralized directory.
- Loading branch information
Showing
29 changed files
with
241 additions
and
283 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,8 @@ services: | |
# ----------------------------------------- Logion node 1 -------------------------------------------------------------- | ||
private-database1: | ||
image: logionnetwork/logion-postgres:${PG_TAG:-latest} | ||
ports: | ||
- 127.0.0.1:5432:5432 | ||
environment: | ||
- POSTGRES_PASSWORD=secret | ||
backend1: | ||
|
@@ -17,7 +19,6 @@ services: | |
- TYPEORM_HOST=private-database1 | ||
- WS_PROVIDER_URL=ws://$RPC_WS | ||
- OWNER=5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY | ||
- DIRECTORY_URL=http://directory:8080 | ||
- SMTP_ENABLED=false | ||
- IPFS_CLUSTER_HOST=/dns4/ipfs-cluster1/tcp/9094 | ||
- IPFS_HOST=/dns4/ipfs1/tcp/5001 | ||
|
@@ -61,6 +62,8 @@ services: | |
# ----------------------------------------- Logion node 2 -------------------------------------------------------------- | ||
private-database2: | ||
image: logionnetwork/logion-postgres:${PG_TAG:-latest} | ||
ports: | ||
- 127.0.0.1:5433:5432 | ||
environment: | ||
- POSTGRES_PASSWORD=secret | ||
backend2: | ||
|
@@ -71,7 +74,6 @@ services: | |
- TYPEORM_HOST=private-database2 | ||
- WS_PROVIDER_URL=ws://$RPC_WS | ||
- OWNER=5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty | ||
- DIRECTORY_URL=http://directory:8080 | ||
- SMTP_ENABLED=false | ||
- IPFS_CLUSTER_HOST=/dns4/ipfs-cluster2/tcp/9094 | ||
- IPFS_HOST=/dns4/ipfs2/tcp/5001 | ||
|
@@ -111,74 +113,3 @@ services: | |
volumes: | ||
- ./config/ipfs-cluster2/identity.json:/data/ipfs-cluster/identity.json:ro | ||
- ./config/ipfs-cluster2/service.json:/data/ipfs-cluster/service.json:ro | ||
# ----------------------------------------- Logion node 3 -------------------------------------------------------------- | ||
private-database3: | ||
image: logionnetwork/logion-postgres:${PG_TAG:-latest} | ||
environment: | ||
- POSTGRES_PASSWORD=secret | ||
backend3: | ||
image: logionnetwork/logion-backend:${BACKEND_TAG:-latest} | ||
environment: | ||
- JWT_SECRET=3a9d5b35b9fb4c42aafadeca046f6bf56107bd2579687f069b42646684b94d9e | ||
- JWT_ISSUER=12D3KooWJvyP3VJYymTqG7eH4PM5rN4T2agk5cdNCfNymAqwqcvZ | ||
- TYPEORM_HOST=private-database3 | ||
- WS_PROVIDER_URL=ws://$RPC_WS | ||
- OWNER=5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y | ||
- DIRECTORY_URL=http://directory:8080 | ||
- SMTP_ENABLED=false | ||
- IPFS_CLUSTER_HOST=/dns4/ipfs-cluster3/tcp/9094 | ||
- IPFS_HOST=/dns4/ipfs3/tcp/5001 | ||
- IPFS_MIN_REPLICA=1 | ||
- IPFS_MAX_REPLICA=2 | ||
- ENC_PASSWORD=test | ||
depends_on: | ||
- private-database3 | ||
- ipfs-cluster3 | ||
frontend3: | ||
image: logionnetwork/logion-frontend:${FRONTEND_TAG:-latest} | ||
ports: | ||
- 127.0.0.1:8082:80 | ||
volumes: | ||
- ./front_config.js:/usr/share/nginx/html/config.js | ||
- ./front_web3.conf:/etc/nginx/conf.d/default.conf | ||
depends_on: | ||
- backend3 | ||
environment: | ||
- [email protected] | ||
- BACKEND_HOST_PORT=backend3:8080 | ||
- NODE_HOST_PORT=$RPC_WS | ||
ipfs3: | ||
image: ipfs/go-ipfs:v0.12.0 | ||
volumes: | ||
- ./config/ipfs3/config:/data/ipfs/config:ro | ||
- ./config/ipfs3/datastore_spec:/data/ipfs/datastore_spec:ro | ||
- ./config/ipfs3/swarm.key:/data/ipfs/swarm.key:ro | ||
- ./config/ipfs3/version:/data/ipfs/version:ro | ||
depends_on: | ||
- ipfs1 | ||
ipfs-cluster3: | ||
image: ipfs/ipfs-cluster:v0.14.5 | ||
depends_on: | ||
- ipfs-cluster1 | ||
- ipfs3 | ||
volumes: | ||
- ./config/ipfs-cluster3/identity.json:/data/ipfs-cluster/identity.json:ro | ||
- ./config/ipfs-cluster3/service.json:/data/ipfs-cluster/service.json:ro | ||
# ----------------------------------------- Logion directory -------------------------------------------------------------- | ||
directory-database: | ||
image: postgres:12 | ||
ports: | ||
- 127.0.0.1:5432:5432 | ||
environment: | ||
- POSTGRES_PASSWORD=secret | ||
directory: | ||
image: logionnetwork/logion-directory:${DIRECTORY_TAG:-latest} | ||
ports: | ||
- 127.0.0.1:8090:8080 | ||
environment: | ||
- JWT_SECRET=c12b6d18942f5ee8528c8e2baf4e147b5c5c18710926ea492d09cbd9f6c9f82a | ||
- JWT_ISSUER=12D3KooWBmAwcd4PJNJvfV89HwE48nwkRmAgo8Vy3uQEyNNHBox2 | ||
- WS_PROVIDER_URL=ws://$RPC_WS | ||
- TYPEORM_HOST=directory-database | ||
depends_on: | ||
- directory-database |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import { State } from "./Utils.js"; | ||
import { LegalOfficer } from "@logion/client/dist/Types.js"; | ||
export async function backendConfig(state: State) { | ||
const { client, requesterAccount, alice } = state; | ||
|
||
|
@@ -19,3 +20,33 @@ export async function workload(state: State) { | |
expect(workload).toBe(0); | ||
} | ||
} | ||
|
||
export async function updateLegalOfficer(state: State) { | ||
const { client, alice } = state; | ||
const updatedAlice: LegalOfficer = { | ||
node: alice.node, | ||
userIdentity: { | ||
firstName: "Alice", | ||
lastName: "updated-last-name", | ||
email: "[email protected]", | ||
phoneNumber: "updated-phone-number", | ||
}, | ||
postalAddress: { | ||
company: "updated-company", | ||
line1: "updated-line1", | ||
line2: "updated-line2", | ||
postalCode: "updated-postal-code", | ||
city: "updated-city", | ||
country: "updated-country", | ||
}, | ||
account: alice.account, | ||
additionalDetails: "Some new details", | ||
} as LegalOfficer; | ||
const aliceClient = client.withCurrentAccount(alice.account); | ||
await aliceClient.legalOfficerClient.createOrUpdate(updatedAlice); | ||
const legalOfficers = await client.legalOfficerClient.getLegalOfficers(); | ||
const legalOfficer = legalOfficers.find(legalOfficer => legalOfficer.account.equals(alice.account)) | ||
expect(legalOfficer?.userIdentity).toEqual(updatedAlice.userIdentity); | ||
expect(legalOfficer?.postalAddress).toEqual(updatedAlice.postalAddress); | ||
expect(legalOfficer?.additionalDetails).toEqual(updatedAlice.additionalDetails); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,5 @@ TRUNCATE TABLE public.legal_officer; | |
INSERT INTO public.legal_officer (address, first_name, last_name, email, phone_number, company, line1, line2, postal_code, city, country, additional_details) | ||
VALUES ('5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY', 'Alice', '', '[email protected]', '+1234', 'Alice''s Company', 'Line 1', 'Line 2', '1000', 'City', 'Country', null); | ||
|
||
INSERT INTO public.legal_officer (address, first_name, last_name, email, phone_number, company, line1, line2, postal_code, city, country, additional_details) | ||
VALUES ('5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty', 'Bob', '', '[email protected]', '+1234', 'Bob''s Company', 'Line 1', 'Line 2', '1000', 'City', 'Country', null); | ||
|
||
INSERT INTO public.legal_officer (address, first_name, last_name, email, phone_number, company, line1, line2, postal_code, city, country, additional_details) | ||
VALUES ('5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y', 'Charlie', '', '[email protected]', '+1234', 'Charlie''s Company', 'Line 1', 'Line 2', '1000', 'City', 'Country', null); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
TRUNCATE TABLE public.legal_officer; | ||
|
||
INSERT INTO public.legal_officer (address, first_name, last_name, email, phone_number, company, line1, line2, postal_code, city, country, additional_details) | ||
VALUES ('5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty', 'Bob', '', '[email protected]', '+1234', 'Bob''s Company', 'Line 1', 'Line 2', '1000', 'City', 'Country', null); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@logion/client", | ||
"version": "0.46.0-1", | ||
"version": "0.46.0-2", | ||
"description": "logion SDK for client applications", | ||
"main": "dist/index.js", | ||
"packageManager": "[email protected]", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.