diff --git a/demo/acp-large/alice.seed b/demo/acp-large/alice.seed new file mode 100644 index 0000000..87f2262 --- /dev/null +++ b/demo/acp-large/alice.seed @@ -0,0 +1 @@ +dial high permit royal surprise sail worry order hospital add dynamic ghost will drive mobile onion tourist excuse round town caught riot gun acid \ No newline at end of file diff --git a/demo/acp-large/bob.seed b/demo/acp-large/bob.seed new file mode 100644 index 0000000..c69b31e --- /dev/null +++ b/demo/acp-large/bob.seed @@ -0,0 +1 @@ +math strong powder vivid remind awful rapid vanish sell victory minor guitar peanut accident resist crew time outside train point book combine sunset bullet \ No newline at end of file diff --git a/demo/acp-large/compose.yaml b/demo/acp-large/compose.yaml new file mode 100644 index 0000000..8bb78fc --- /dev/null +++ b/demo/acp-large/compose.yaml @@ -0,0 +1,135 @@ +version: "3.9" + +volumes: + demo-data: + driver: local + driver_opts: + type: none + device: ../acp-large + o: bind + sourcehub-data: + driver: local + driver_opts: + type: none + device: $HOME/.sourcehub + o: bind + +x-orbisd: &orbisd + depends_on: + sourcehubd: + condition: service_started + tty: true + stdin_open: true + image: ko.local/orbisd + volumes: + - demo-data:/demo + - sourcehub-data:/root/.sourcehub + # For Linux platforms to access the host machine using the host.docker.internal DNS name. + extra_hosts: + - "host.docker.internal:host-gateway" + +services: + orbisd1: + <<: *orbisd + command: ["start", "--config", "/demo/orbis.1.yaml"] + ports: + - "9001:9001" + - "8081:8081" + - "8091:8091" + + orbisd2: + <<: *orbisd + depends_on: + orbisd1: + condition: service_started + command: ["start", "--config", "/demo/orbis.2.yaml"] + ports: + - "9002:9002" + - "8082:8082" + - "8092:8092" + + orbisd3: + <<: *orbisd + depends_on: + orbisd1: + condition: service_started + command: ["start", "--config", "/demo/orbis.3.yaml"] + ports: + - "9003:9003" + - "8083:8083" + - "8093:8093" + + orbisd4: + <<: *orbisd + depends_on: + orbisd1: + condition: service_started + command: ["start", "--config", "/demo/orbis.4.yaml"] + ports: + - "9004:9004" + - "8084:8084" + - "8094:8094" + + orbisd5: + <<: *orbisd + depends_on: + orbisd1: + condition: service_started + command: ["start", "--config", "/demo/orbis.5.yaml"] + ports: + - "9005:9005" + - "8085:8085" + - "8095:8095" + + orbisd6: + <<: *orbisd + depends_on: + orbisd1: + condition: service_started + command: ["start", "--config", "/demo/orbis.6.yaml"] + ports: + - "9006:9006" + - "8086:8086" + - "8096:8096" + + orbisd7: + <<: *orbisd + depends_on: + orbisd1: + condition: service_started + command: ["start", "--config", "/demo/orbis.7.yaml"] + ports: + - "9007:9007" + - "8087:8087" + - "8097:8097" + + sourcehubd-init: + image: ko.local/sourcehubd + volumes: + - demo-data:/demo + - sourcehub-data:/root/.sourcehub + entrypoint: /demo/sourcehub-init.sh + + sourcehubd: + depends_on: + sourcehubd-init: + condition: service_completed_successfully + tty: true + stdin_open: true + image: ko.local/sourcehubd + volumes: + - demo-data:/demo + - sourcehub-data:/root/.sourcehub + command: + - start + - --rpc.laddr + - tcp://0.0.0.0:26657 + - --log_level + - warn + - --minimum-gas-prices + - 0.0001stake + ports: + - "26657:26657" + - "26658:26658" + - "1317:1317" + - "4500:4500" diff --git a/demo/acp-large/manifest.json b/demo/acp-large/manifest.json new file mode 100644 index 0000000..b89eaec --- /dev/null +++ b/demo/acp-large/manifest.json @@ -0,0 +1,15 @@ +{ + "manifest": { + "n": 3, + "t": 2, + "dkg": "rabin", + "pss": "avpss", + "pre": "elgamal", + "bulletin": "sourcehub", + "transport": "p2p", + "authentication": "jws-did", + "authorization": "ACP", + "nodes": [{"id":"16Uiu2HAm35sSr96x1TJHBTkWdcDH9P8twhTw92iDyq38XvyGzgZN","address":"/ip4/127.0.0.1/tcp/9001"},{"id":"16Uiu2HAmAVcM6V1PY8DdvzobyK5QZbwX5z3AA6wCSrCm6xUA79Xn","address":"/ip4/127.0.0.1/tcp/9002"},{"id":"16Uiu2HAkzjLLosHcV4LGvLY4vskda5NgMW4qmtfQ2uMbgFAoqghX","address":"/ip4/127.0.0.1/tcp/9003"}], + "nonce": 0 + } +} \ No newline at end of file diff --git a/demo/acp-large/orbis.1.yaml b/demo/acp-large/orbis.1.yaml new file mode 100644 index 0000000..acd7336 --- /dev/null +++ b/demo/acp-large/orbis.1.yaml @@ -0,0 +1,29 @@ +grpc: + grpcURL: "0.0.0.0:8081" + restURL: "0.0.0.0:8091" + logging: true + utility: true + +logger: + level: "debug" + +host: + crypto: + seed: 1 + type: secp256k1 + listenAddresses: + - /ip4/0.0.0.0/tcp/9001 + +transport: + rendezvous: "orbis-transport" + +db: + path: "data1" + +cosmos: + chainId: sourcehub-testnet1 + accountName: validator1 + keyringBackend: test + addressPrefix: source + fees: 30stake + rpcAddress: http://host.docker.internal:26657 \ No newline at end of file diff --git a/demo/acp-large/orbis.2.yaml b/demo/acp-large/orbis.2.yaml new file mode 100644 index 0000000..72a7496 --- /dev/null +++ b/demo/acp-large/orbis.2.yaml @@ -0,0 +1,31 @@ +grpc: + grpcURL: "0.0.0.0:8082" + restURL: "0.0.0.0:8092" + logging: true + utility: true + +logger: + level: "debug" + +host: + crypto: + seed: 2 + type: secp256k1 + listenAddresses: + - /ip4/0.0.0.0/tcp/9002 + bootstrap_peers: + - /dns4/orbisd1/tcp/9001/p2p/16Uiu2HAm35sSr96x1TJHBTkWdcDH9P8twhTw92iDyq38XvyGzgZN + +transport: + rendezvous: "orbis-transport" + +db: + path: "data2" + +cosmos: + chainId: sourcehub-testnet1 + accountName: validator2 + keyringBackend: test + addressPrefix: source + fees: 30stake + rpcAddress: http://host.docker.internal:26657 \ No newline at end of file diff --git a/demo/acp-large/orbis.3.yaml b/demo/acp-large/orbis.3.yaml new file mode 100644 index 0000000..0b050c5 --- /dev/null +++ b/demo/acp-large/orbis.3.yaml @@ -0,0 +1,36 @@ +grpc: + grpcURL: "0.0.0.0:8083" + restURL: "0.0.0.0:8093" + logging: true + utility: true + +logger: + level: "debug" + +host: + crypto: + seed: 3 + type: secp256k1 + listenAddresses: + - /ip4/0.0.0.0/tcp/9003 + bootstrap_peers: + - /dns4/orbisd1/tcp/9001/p2p/16Uiu2HAm35sSr96x1TJHBTkWdcDH9P8twhTw92iDyq38XvyGzgZN + +bulletin: + p2p: + rendezvous: "orbis-bulletin" + persistentPeers: "/dns4/orbisd1/tcp/9001/p2p/16Uiu2HAm35sSr96x1TJHBTkWdcDH9P8twhTw92iDyq38XvyGzgZN" + +transport: + rendezvous: "orbis-transport" + +db: + path: "data3" + +cosmos: + chainId: sourcehub-testnet1 + accountName: validator3 + keyringBackend: test + addressPrefix: source + fees: 30stake + rpcAddress: http://host.docker.internal:26657 \ No newline at end of file diff --git a/demo/acp-large/orbis.4.yaml b/demo/acp-large/orbis.4.yaml new file mode 100644 index 0000000..86261aa --- /dev/null +++ b/demo/acp-large/orbis.4.yaml @@ -0,0 +1,31 @@ +grpc: + grpcURL: "0.0.0.0:8084" + restURL: "0.0.0.0:8094" + logging: true + utility: true + +logger: + level: "debug" + +host: + crypto: + seed: 4 + type: secp256k1 + listenAddresses: + - /ip4/0.0.0.0/tcp/9004 + bootstrap_peers: + - /dns4/orbisd1/tcp/9001/p2p/16Uiu2HAm35sSr96x1TJHBTkWdcDH9P8twhTw92iDyq38XvyGzgZN + +transport: + rendezvous: "orbis-transport" + +db: + path: "data4" + +cosmos: + chainId: sourcehub-testnet1 + accountName: validator4 + keyringBackend: test + addressPrefix: source + fees: 30stake + rpcAddress: http://host.docker.internal:26657 \ No newline at end of file diff --git a/demo/acp-large/orbis.5.yaml b/demo/acp-large/orbis.5.yaml new file mode 100644 index 0000000..6a16b18 --- /dev/null +++ b/demo/acp-large/orbis.5.yaml @@ -0,0 +1,31 @@ +grpc: + grpcURL: "0.0.0.0:8085" + restURL: "0.0.0.0:8095" + logging: true + utility: true + +logger: + level: "debug" + +host: + crypto: + seed: 5 + type: secp256k1 + listenAddresses: + - /ip4/0.0.0.0/tcp/9005 + bootstrap_peers: + - /dns4/orbisd1/tcp/9001/p2p/16Uiu2HAm35sSr96x1TJHBTkWdcDH9P8twhTw92iDyq38XvyGzgZN + +transport: + rendezvous: "orbis-transport" + +db: + path: "data5" + +cosmos: + chainId: sourcehub-testnet1 + accountName: validator5 + keyringBackend: test + addressPrefix: source + fees: 30stake + rpcAddress: http://host.docker.internal:26657 \ No newline at end of file diff --git a/demo/acp-large/orbis.6.yaml b/demo/acp-large/orbis.6.yaml new file mode 100644 index 0000000..2e61443 --- /dev/null +++ b/demo/acp-large/orbis.6.yaml @@ -0,0 +1,31 @@ +grpc: + grpcURL: "0.0.0.0:8086" + restURL: "0.0.0.0:8096" + logging: true + utility: true + +logger: + level: "debug" + +host: + crypto: + seed: 6 + type: secp256k1 + listenAddresses: + - /ip4/0.0.0.0/tcp/9006 + bootstrap_peers: + - /dns4/orbisd1/tcp/9001/p2p/16Uiu2HAm35sSr96x1TJHBTkWdcDH9P8twhTw92iDyq38XvyGzgZN + +transport: + rendezvous: orbis-transport + +db: + path: data6 + +cosmos: + chainId: sourcehub-testnet1 + accountName: validator6 + keyringBackend: test + addressPrefix: source + fees: 30stake + rpcAddress: http://host.docker.internal:26657 \ No newline at end of file diff --git a/demo/acp-large/orbis.7.yaml b/demo/acp-large/orbis.7.yaml new file mode 100644 index 0000000..789ce4c --- /dev/null +++ b/demo/acp-large/orbis.7.yaml @@ -0,0 +1,31 @@ +grpc: + grpcURL: 0.0.0.0:8087 + restURL: 0.0.0.0:8097 + logging: true + utility: true + +logger: + level: debug + +host: + crypto: + seed: 7 + type: secp256k1 + listenAddresses: + - /ip4/0.0.0.0/tcp/9007 + bootstrap_peers: + - /dns4/orbisd1/tcp/9001/p2p/16Uiu2HAm35sSr96x1TJHBTkWdcDH9P8twhTw92iDyq38XvyGzgZN + +transport: + rendezvous: orbis-transport + +db: + path: data7 + +cosmos: + chainId: sourcehub-testnet1 + accountName: validator7 + keyringBackend: test + addressPrefix: source + fees: 30stake + rpcAddress: http://host.docker.internal:26657 \ No newline at end of file diff --git a/demo/acp-large/secret-policy.yaml b/demo/acp-large/secret-policy.yaml new file mode 100644 index 0000000..78a5ade --- /dev/null +++ b/demo/acp-large/secret-policy.yaml @@ -0,0 +1,20 @@ +id: 1 +name: test +doc: test policy + +resources: + secret: + doc: sensitive secret + relations: + owner: + expr: _this + types: + - '*' + collaborator: + expr: _this + types: + - user + read: + expr: owner + collaborator + types: [] + user: \ No newline at end of file diff --git a/demo/acp-large/sourcehub-init.sh b/demo/acp-large/sourcehub-init.sh new file mode 100755 index 0000000..c89675e --- /dev/null +++ b/demo/acp-large/sourcehub-init.sh @@ -0,0 +1,62 @@ +#!/bin/sh + +MONIKER=demo +VALIDATOR1=validator1 +VALIDATOR2=validator2 +VALIDATOR3=validator3 +VALIDATOR4=validator4 +VALIDATOR5=validator5 +VALIDATOR6=validator6 +VALIDATOR7=validator7 +ALICE=alice +BOB=bob + +sourcehubd init $MONIKER --chain-id sourcehub + +sourcehubd keys add ${VALIDATOR1} --keyring-backend test +sourcehubd keys add ${VALIDATOR2} --keyring-backend test +sourcehubd keys add ${VALIDATOR3} --keyring-backend test +sourcehubd keys add ${VALIDATOR4} --keyring-backend test +sourcehubd keys add ${VALIDATOR5} --keyring-backend test +sourcehubd keys add ${VALIDATOR6} --keyring-backend test +sourcehubd keys add ${VALIDATOR7} --keyring-backend test + +# Static keys for testing +# Alice Address source16dgy2uw5p74a0pzuwmq0hpl44xzn2yfauxfc70 +# private Key: puNSnlhhQVzhxcST+EjI+kln+tKIh0tRct29BY9mgQ4= +# public Key: Ay181c7HWcRib08KMzYNRLqN3kwTFhsfSScAScSX6uDs + +# Bob Address source1c30ctscyfhudwpaw3jdfjnc6vhzeqygjwt39zy +# private Key: U7UHuJYs+xF7fACCsKrthBb6nMQ0MA+IpRiD2Xza78o= +# public Key: ArndsH/I2tiTRAgvhT8yU5YMwpZnt3EKy6VtIdF8nXqJ +cat /demo/alice.seed | sourcehubd keys add ${ALICE} --recover --keyring-backend test +cat /demo/bob.seed | sourcehubd keys add ${BOB} --recover --keyring-backend test + +VALIDATOR1_ADDRESS=$(sourcehubd keys show ${VALIDATOR1} --address --keyring-backend test) +VALIDATOR2_ADDRESS=$(sourcehubd keys show ${VALIDATOR2} --address --keyring-backend test) +VALIDATOR3_ADDRESS=$(sourcehubd keys show ${VALIDATOR3} --address --keyring-backend test) +VALIDATOR4_ADDRESS=$(sourcehubd keys show ${VALIDATOR4} --address --keyring-backend test) +VALIDATOR5_ADDRESS=$(sourcehubd keys show ${VALIDATOR5} --address --keyring-backend test) +VALIDATOR6_ADDRESS=$(sourcehubd keys show ${VALIDATOR6} --address --keyring-backend test) +VALIDATOR7_ADDRESS=$(sourcehubd keys show ${VALIDATOR7} --address --keyring-backend test) + +ALICE_ADDRESS=$(sourcehubd keys show ${ALICE} --address --keyring-backend test) +BOB_ADDRESS=$(sourcehubd keys show ${BOB} --address --keyring-backend test) + +sourcehubd genesis add-genesis-account $VALIDATOR1_ADDRESS 100000000stake + +sourcehubd genesis add-genesis-account $VALIDATOR2_ADDRESS 100000stake +sourcehubd genesis add-genesis-account $VALIDATOR3_ADDRESS 100000stake +sourcehubd genesis add-genesis-account $VALIDATOR4_ADDRESS 100000stake +sourcehubd genesis add-genesis-account $VALIDATOR5_ADDRESS 100000stake +sourcehubd genesis add-genesis-account $VALIDATOR6_ADDRESS 100000stake +sourcehubd genesis add-genesis-account $VALIDATOR7_ADDRESS 100000stake + +sourcehubd genesis add-genesis-account $ALICE_ADDRESS 100000stake +sourcehubd genesis add-genesis-account $BOB_ADDRESS 100000stake + +sourcehubd genesis gentx ${VALIDATOR1} 70000000stake --chain-id sourcehub --keyring-backend test + +sourcehubd genesis collect-gentxs + +sed -i -e 's/timeout_commit = "5s"/timeout_commit = "1s"/g' /root/.sourcehub/config/config.toml