From f742401495573adfc4dc74bbb42f3f85a5a34092 Mon Sep 17 00:00:00 2001 From: Ryan Beck-Buysse Date: Fri, 14 Feb 2020 10:16:45 -0600 Subject: [PATCH 01/69] Initial commit Signed-off-by: Ryan Beck-Buysse --- .gitignore | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..e69de29bb2 From a5099b1f27f314b96825d569cc987b52086bac18 Mon Sep 17 00:00:00 2001 From: Ryan Beck-Buysse Date: Fri, 14 Feb 2020 10:19:06 -0600 Subject: [PATCH 02/69] Initial commit Signed-off-by: Ryan Beck-Buysse --- .gitignore | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..e69de29bb2 From 052d113ae0cd75e889c8ee686ef76ba7bb7198e0 Mon Sep 17 00:00:00 2001 From: Darian Plumb Date: Mon, 17 Feb 2020 10:02:10 -0600 Subject: [PATCH 03/69] Remove unnecessary files and update paths Removes all files not necessary to SaplingJS, and update any paths for unit tests. Signed-off-by: Darian Plumb --- .dockerignore | 44 +- canopy/saplingjs/.eslintrc => .eslintrc | 0 .gitignore | 65 +- canopy/app/.prettierrc => .prettierrc | 0 .travis.yml | 56 +- Cargo.toml | 30 - canopy/saplingjs/Dockerfile => Dockerfile | 0 README.md | 130 - RELEASE_NOTES.md | 679 ---- .../diagram-splinter-circuits+3companies.svg | 152 - ...agram-splinter-smartcontractdeployment.svg | 129 - assets/diagram-splinter-twopartycircuit.svg | 241 -- bin/run_lint_rust | 54 - canopy/app/.eslintignore | 16 - canopy/app/.eslintrc | 23 - canopy/app/.lintstagedrc | 4 - canopy/app/Dockerfile | 27 - canopy/app/README.md | 47 - canopy/app/package.json | 65 - canopy/app/public/index.html | 48 - canopy/app/public/manifest.json | 9 - canopy/app/public/robots.txt | 2 - canopy/app/saplings/configSaplings | 18 - canopy/app/saplings/loginRegisterSapling.js | 3 - canopy/app/saplings/profile.js | 26 - canopy/app/saplings/userSaplings | 12 - canopy/app/saplings/vanilla.js | 20 - canopy/app/src/App.js | 39 - canopy/app/src/App.scss | 31 - canopy/app/src/App.test.js | 25 - canopy/app/src/images/default.svg | 8 - canopy/app/src/index.css | 41 - canopy/app/src/index.js | 22 - canopy/canopyjs/.babelrc | 6 - canopy/canopyjs/.eslintignore | 16 - canopy/canopyjs/.eslintrc | 23 - canopy/canopyjs/.prettierrc | 5 - canopy/canopyjs/README.md | 125 - canopy/canopyjs/package.json | 73 - canopy/canopyjs/rollup.config.js | 107 - canopy/canopyjs/src/CanopyContext.js | 113 - canopy/canopyjs/src/components/index.js | 19 - .../src/components/navigation/NavItem.js | 40 - .../src/components/navigation/SideNav.js | 69 - .../src/components/navigation/SideNav.scss | 115 - .../src/components/progress/Progress.js | 27 - .../src/components/progress/Progress.scss | 79 - .../canopyjs/src/components/tabBox/TabBox.js | 73 - .../src/components/tabBox/TabBox.scss | 62 - canopy/canopyjs/src/index.js | 19 - canopy/canopyjs/src/loadSaplings.js | 85 - canopy/canopyjs/src/promiseLoader.js | 32 - canopy/canopyjs/src/request.js | 55 - canopy/canopyjs/src/styleLoader.js | 30 - canopy/canopyjs/src/styles/colors.scss | 52 - canopy/canopyjs/src/styles/components.scss | 19 - canopy/canopyjs/src/styles/core.scss | 85 - canopy/canopyjs/src/styles/layout.scss | 112 - canopy/canopyjs/src/styles/mixins.scss | 23 - canopy/canopyjs/src/styles/navigation.scss | 75 - .../canopyjs/src/themes/default/colors.scss | 96 - canopy/canopyjs/src/themes/default/index.js | 16 - canopy/canopyjs/src/themes/default/index.scss | 17 - canopy/canopyjs/src/themes/default/sizes.scss | 23 - .../canopyjs/src/themes/default/timings.scss | 18 - .../src/themes/default/typography.scss | 102 - .../src/themes/default/variables.scss | 19 - canopy/saplingjs/.prettierrc | 5 - canopy/saplings/notifier/.keep | 0 ci/publish-docker | 59 - ci/publish-splinter-crates | 53 - ci/splinter-dev | 123 - cli/Cargo.toml | 101 - cli/Dockerfile-installed-bionic | 46 - cli/packaging/ubuntu/postinst | 25 - cli/src/action/admin.rs | 285 -- cli/src/action/certs.rs | 734 ---- cli/src/action/circuit/api.rs | 428 --- cli/src/action/circuit/builder.rs | 293 -- cli/src/action/circuit/defaults.rs | 146 - cli/src/action/circuit/mod.rs | 555 --- cli/src/action/circuit/payload.rs | 134 - cli/src/action/database.rs | 76 - cli/src/action/health.rs | 44 - cli/src/action/keygen.rs | 159 - cli/src/action/mod.rs | 98 - cli/src/action/node.rs | 150 - cli/src/error.rs | 42 - cli/src/main.rs | 621 ---- cli/src/store/default_value/error.rs | 56 - cli/src/store/default_value/mod.rs | 56 - cli/src/store/default_value/yaml_store.rs | 182 - cli/src/store/mod.rs | 19 - cli/src/store/node/error.rs | 56 - cli/src/store/node/mod.rs | 61 - cli/src/store/node/yaml_store.rs | 182 - client/Cargo.toml | 39 - client/src/error.rs | 70 - client/src/lib.rs | 18 - client/src/splinter_client.rs | 107 - docker-compose-installed.yaml | 130 - docker-compose.yaml | 76 - docker/compose/copy-debs.yaml | 93 - docker/compose/run-lint.yaml | 53 +- docker/kubernetes/README.md | 260 -- docker/kubernetes/arcade.yaml | 359 -- docker/kubernetes/create-gameroom-keys.yaml | 36 - docker/kubernetes/images/acme-1-launch.png | Bin 535809 -> 0 bytes docker/kubernetes/images/acme-2-register.png | Bin 589214 -> 0 bytes docker/kubernetes/images/acme-3-loggedin.png | Bin 550575 -> 0 bytes .../kubernetes/images/acme-4-newgameroom.png | Bin 599496 -> 0 bytes .../images/acme-5-invitationsent.png | Bin 561898 -> 0 bytes .../images/acme-6-invitationlist.png | Bin 603432 -> 0 bytes .../kubernetes/images/acme-7-creategame.png | Bin 635690 -> 0 bytes docker/kubernetes/images/acme-8-joingame.png | Bin 645610 -> 0 bytes docker/kubernetes/images/acme-9-takespace.png | Bin 639159 -> 0 bytes docker/kubernetes/images/bubba-1-launch.png | Bin 553737 -> 0 bytes docker/kubernetes/images/bubba-2-register.png | Bin 611386 -> 0 bytes docker/kubernetes/images/bubba-3-loggedin.png | Bin 568412 -> 0 bytes .../images/bubba-4-invitationnotification.png | Bin 596117 -> 0 bytes .../kubernetes/images/bubba-5-invitation.png | Bin 625953 -> 0 bytes docker/kubernetes/images/bubba-6-gameroom.png | Bin 626369 -> 0 bytes docker/kubernetes/images/bubba-7-joingame.png | Bin 657203 -> 0 bytes .../kubernetes/images/bubba-8-takespace.png | Bin 653714 -> 0 bytes docker/kubernetes/key-registry.yaml | 27 - docker/kubernetes/node-registry.yaml | 26 - docker/lint | 21 - docker/lint-client | 25 - examples/gameroom/.dockerignore | 17 - examples/gameroom/README.md | 68 - examples/gameroom/cli/Cargo.toml | 42 - examples/gameroom/cli/src/action/database.rs | 63 - examples/gameroom/cli/src/action/mod.rs | 15 - examples/gameroom/cli/src/error.rs | 35 - examples/gameroom/cli/src/main.rs | 82 - examples/gameroom/daemon/Cargo.toml | 87 - .../daemon/Dockerfile-installed-bionic | 69 - examples/gameroom/daemon/openapi.yml | 1114 ------ .../daemon/packaging/systemd/gameroomd | 15 - .../packaging/systemd/gameroomd.service | 28 - .../gameroom/daemon/packaging/ubuntu/postinst | 43 - .../daemon/src/application_metadata/error.rs | 48 - .../daemon/src/application_metadata/mod.rs | 51 - .../daemon/src/authorization_handler/error.rs | 175 - .../daemon/src/authorization_handler/mod.rs | 1505 -------- .../daemon/src/authorization_handler/sabre.rs | 457 --- .../src/authorization_handler/state_delta.rs | 207 -- examples/gameroom/daemon/src/config.rs | 210 -- examples/gameroom/daemon/src/error.rs | 149 - examples/gameroom/daemon/src/main.rs | 157 - .../gameroom/daemon/src/rest_api/error.rs | 121 - examples/gameroom/daemon/src/rest_api/mod.rs | 224 -- .../src/rest_api/routes/authenticate.rs | 134 - .../daemon/src/rest_api/routes/gameroom.rs | 482 --- .../src/rest_api/routes/gameroom_websocket.rs | 96 - .../daemon/src/rest_api/routes/key.rs | 64 - .../daemon/src/rest_api/routes/mod.rs | 283 -- .../daemon/src/rest_api/routes/node.rs | 298 -- .../src/rest_api/routes/notification.rs | 191 - .../daemon/src/rest_api/routes/proposal.rs | 282 -- .../daemon/src/rest_api/routes/submit.rs | 352 -- .../daemon/src/rest_api/routes/xo_games.rs | 155 - examples/gameroom/database/Cargo.toml | 37 - .../gameroom/database/Dockerfile-installed | 32 - .../down.sql | 6 - .../up.sql | 36 - .../down.sql | 16 - .../up.sql | 17 - examples/gameroom/database/src/error.rs | 46 - .../gameroom/database/src/helpers/gameroom.rs | 318 -- .../database/src/helpers/gameroom_user.rs | 35 - examples/gameroom/database/src/helpers/mod.rs | 39 - .../database/src/helpers/notification.rs | 103 - .../gameroom/database/src/helpers/xo_games.rs | 73 - examples/gameroom/database/src/lib.rs | 66 - examples/gameroom/database/src/models.rs | 208 -- examples/gameroom/database/src/schema.rs | 120 - .../database/tables/gameroom_tables.sql | 106 - .../gameroom/docker-compose-dockerhub.yaml | 210 -- examples/gameroom/docker-compose.yaml | 264 -- .../gameroom/gameroom-app/.browserslistrc | 2 - examples/gameroom/gameroom-app/.gitignore | 36 - .../gameroom-app/Dockerfile-installed | 57 - examples/gameroom/gameroom-app/README.md | 29 - .../gameroom/gameroom-app/babel.config.js | 19 - examples/gameroom/gameroom-app/package.json | 51 - .../gameroom/gameroom-app/postcss.config.js | 19 - .../gameroom-app/public/img/logo-acme.png | Bin 24428 -> 0 bytes .../gameroom-app/public/img/logo-bubba.png | Bin 37448 -> 0 bytes .../gameroom-app/public/img/logo-generic.png | Bin 56141 -> 0 bytes .../gameroom/gameroom-app/public/index.html | 35 - .../sabre_proto/sabre_payload.proto | 153 - .../gameroom/gameroom-app/sawtooth-sdk.d.ts | 18 - .../gameroom-app/scripts/compile_protobuf.js | 50 - examples/gameroom/gameroom-app/src/App.vue | 36 - .../src/assets/acme/logo_wide.png | Bin 67271 -> 0 bytes .../gameroom-app/src/assets/acme/xo/omark.svg | 3 - .../gameroom-app/src/assets/acme/xo/xmark.svg | 3 - .../src/assets/bubba/logo_wide.png | Bin 76792 -> 0 bytes .../src/assets/bubba/xo/omark.svg | 3 - .../src/assets/bubba/xo/xmark.svg | 3 - .../src/assets/generic/logo_wide.png | Bin 120615 -> 0 bytes .../src/assets/generic/xo/omark.svg | 3 - .../src/assets/generic/xo/xmark.svg | 3 - .../gameroom-app/src/class-component-hooks.ts | 23 - .../gameroom-app/src/components/AppNavbar.vue | 74 - .../gameroom-app/src/components/Dropdown.vue | 86 - .../src/components/DropdownNotification.vue | 128 - .../gameroom-app/src/components/GameCard.vue | 179 - .../src/components/GameInfoPanel.vue | 153 - .../src/components/InvitationCard.vue | 157 - .../gameroom-app/src/components/Loading.vue | 35 - .../gameroom-app/src/components/Modal.vue | 44 - .../gameroom-app/src/components/TabButton.vue | 45 - .../gameroom-app/src/components/Tabs.vue | 74 - .../gameroom-app/src/components/Toast.vue | 51 - .../components/sidebar/GameroomSidebar.vue | 113 - .../src/components/sidebar/SidebarSection.vue | 62 - .../src/components/xo/XOBoard.vue | 190 - .../gameroom-app/src/components/xo/XOCell.vue | 56 - examples/gameroom/gameroom-app/src/main.ts | 46 - .../gameroom-app/src/protobuf/index.ts | 25 - examples/gameroom/gameroom-app/src/router.ts | 118 - .../src/scss/components/_app-navbar.scss | 52 - .../src/scss/components/_dashboard.scss | 29 - .../components/_dropdown-notification.scss | 75 - .../src/scss/components/_dropdown.scss | 94 - .../src/scss/components/_game-card.scss | 152 - .../src/scss/components/_game-info-panel.scss | 79 - .../scss/components/_gameroom-details.scss | 167 - .../src/scss/components/_invitation-card.scss | 90 - .../src/scss/components/_loading.scss | 20 - .../src/scss/components/_modal.scss | 64 - .../src/scss/components/_toast.scss | 66 - .../sidebar/_sidebar-container.scss | 37 - .../components/sidebar/_sidebar-section.scss | 88 - .../src/scss/components/xo/_xo-board.scss | 46 - .../src/scss/components/xo/_xo-cell.scss | 73 - .../gameroom/gameroom-app/src/scss/main.scss | 27 - .../src/scss/modules/_colors.scss | 23 - .../src/scss/modules/_mixins.scss | 120 - .../src/scss/modules/_typography.scss | 19 - .../scss/modules/themes/acme/variables.scss | 31 - .../scss/modules/themes/bubba/variables.scss | 31 - .../modules/themes/generic/variables.scss | 31 - .../src/scss/partials/_animations.scss | 37 - .../gameroom-app/src/scss/partials/_base.scss | 65 - .../src/scss/partials/_buttons.scss | 86 - .../src/scss/partials/_forms.scss | 143 - .../src/scss/partials/_icons.scss | 36 - .../src/scss/partials/_links.scss | 22 - .../src/scss/vendor/_multiselect.scss | 524 --- .../src/scss/vendor/_normalize.scss | 349 -- .../gameroom/gameroom-app/src/shims-tsx.d.ts | 13 - .../gameroom/gameroom-app/src/shims-vue.d.ts | 4 - .../gameroom/gameroom-app/src/store/api.ts | 280 -- .../gameroom/gameroom-app/src/store/index.ts | 77 - .../gameroom/gameroom-app/src/store/models.ts | 149 - .../src/store/modules/gamerooms.ts | 69 - .../gameroom-app/src/store/modules/games.ts | 113 - .../gameroom-app/src/store/modules/nodes.ts | 52 - .../src/store/modules/notifications.ts | 83 - .../src/store/modules/pageLoading.ts | 51 - .../src/store/modules/proposals.ts | 71 - .../src/store/modules/selectedGameroom.ts | 56 - .../gameroom-app/src/store/modules/user.ts | 101 - .../gameroom-app/src/store/modules/votes.ts | 48 - .../gameroom-app/src/utils/addressing.ts | 52 - .../gameroom/gameroom-app/src/utils/crypto.ts | 121 - .../gameroom-app/src/utils/transactions.ts | 105 - .../gameroom-app/src/utils/xo-games.ts | 43 - .../gameroom-app/src/views/Dashboard.vue | 192 - .../gameroom-app/src/views/DashboardHome.vue | 33 - .../gameroom-app/src/views/GameDetail.vue | 141 - .../gameroom-app/src/views/GameroomDetail.vue | 251 -- .../gameroom/gameroom-app/src/views/Home.vue | 26 - .../gameroom-app/src/views/Invitations.vue | 194 - .../gameroom/gameroom-app/src/views/Login.vue | 108 - .../gameroom-app/src/views/NotFound.vue | 56 - .../gameroom-app/src/views/Register.vue | 145 - examples/gameroom/gameroom-app/tsconfig.json | 41 - examples/gameroom/gameroom-app/tslint.json | 24 - .../gameroom/gameroom-app/vue-clickaway.d.ts | 17 - .../gameroom-app/vue-native-websocket.d.ts | 32 - examples/gameroom/gameroom-app/vue.config.js | 56 - .../gameroom-app/whitelabel.config.js | 33 - .../key_registry/key_registry_spec.yaml | 25 - examples/gameroom/node_registry/nodes.yaml | 25 - .../splinterd-config/splinterd-node-acme.toml | 45 - .../splinterd-node-bubba.toml | 45 - examples/gameroom/tests/.gitignore | 16 - examples/gameroom/tests/Dockerfile | 21 - examples/gameroom/tests/bin/run_tests | 38 - examples/gameroom/tests/cypress/Dockerfile | 39 - examples/gameroom/tests/cypress/cypress.json | 6 - .../tests/cypress/docker-compose.yaml | 123 - .../tests/cypress/fixtures/credentials.json | 6 - .../tests/cypress/fixtures/views.json | 4 - .../tests/cypress/integration/index.spec.js | 17 - .../tests/cypress/integration/login.spec.js | 58 - .../cypress/integration/register.spec.js | 91 - examples/gameroom/tests/cypress/package.json | 15 - .../tests/cypress/scripts/clear_db.sh | 17 - .../tests/cypress/support/commands.js | 28 - .../gameroom/tests/cypress/support/index.d.ts | 21 - .../gameroom/tests/cypress/support/index.js | 15 - examples/gameroom/tests/docker-compose.yaml | 75 - .../gameroom/tests/sample_node_registry.yaml | 24 - .../tests/splinterd-node-0-docker.toml | 45 - examples/private_counter/README.md | 60 - examples/private_counter/cli/Cargo.toml | 40 - .../cli/Dockerfile-installed-bionic | 47 - examples/private_counter/cli/src/actions.rs | 61 - examples/private_counter/cli/src/error.rs | 53 - examples/private_counter/cli/src/main.rs | 71 - .../private_counter/demo_state/circuits.yaml | 54 - examples/private_counter/docker-compose.yaml | 182 - .../private_counter/node_registry/nodes.yaml | 20 - .../protos/private_counter.proto | 33 - examples/private_counter/service/Cargo.toml | 54 - .../service/Dockerfile-installed-bionic | 49 - examples/private_counter/service/build.rs | 82 - .../private_counter/service/src/consensus.rs | 257 -- examples/private_counter/service/src/error.rs | 110 - examples/private_counter/service/src/main.rs | 832 ----- .../private_counter/service/src/protos/mod.rs | 15 - examples/private_xo/Cargo.toml | 59 - .../private_xo/Dockerfile-installed-bionic | 47 - examples/private_xo/README.md | 47 - examples/private_xo/build.rs | 82 - examples/private_xo/demo_state/circuits.yaml | 44 - examples/private_xo/docker-compose.yaml | 124 - examples/private_xo/node_registry/nodes.yaml | 18 - examples/private_xo/protos/private_xo.proto | 33 - examples/private_xo/src/error.rs | 31 - examples/private_xo/src/main.rs | 405 --- examples/private_xo/src/protos/mod.rs | 15 - examples/private_xo/src/routes/batches.rs | 113 - examples/private_xo/src/routes/error.rs | 160 - examples/private_xo/src/routes/mod.rs | 139 - examples/private_xo/src/routes/state.rs | 173 - examples/private_xo/src/service/consensus.rs | 300 -- examples/private_xo/src/service/error.rs | 48 - examples/private_xo/src/service/mod.rs | 450 --- examples/private_xo/src/transaction/mod.rs | 308 -- .../jest.config.js => jest.config.js | 0 libsplinter/Cargo.toml | 137 - libsplinter/build.rs | 82 - libsplinter/examples/mesh-echo-peer.rs | 149 - libsplinter/protos/admin.proto | 304 -- libsplinter/protos/authorization.proto | 105 - libsplinter/protos/circuit.proto | 187 - libsplinter/protos/consensus.proto | 37 - libsplinter/protos/network.proto | 45 - libsplinter/protos/scabbard.proto | 52 - libsplinter/protos/two_phase.proto | 49 - .../sample_files/circuits.yaml.example | 42 - libsplinter/src/admin/error.rs | 15 - libsplinter/src/admin/messages.rs | 23 - libsplinter/src/admin/mod.rs | 19 - .../src/admin/rest_api/actix/circuits.rs | 367 -- .../rest_api/actix/circuits_circuit_id.rs | 206 -- libsplinter/src/admin/rest_api/actix/mod.rs | 24 - .../admin/rest_api/actix/proposals_read.rs | 171 - .../actix/proposals_read_circuit_id.rs | 77 - .../src/admin/rest_api/actix/submit.rs | 58 - .../admin/rest_api/actix/ws_register_type.rs | 149 - libsplinter/src/admin/rest_api/error.rs | 71 - libsplinter/src/admin/rest_api/mod.rs | 82 - .../src/admin/rest_api/resources/circuits.rs | 34 - .../rest_api/resources/circuits_circuit_id.rs | 27 - .../src/admin/rest_api/resources/mod.rs | 20 - .../rest_api/resources/proposals_read.rs | 22 - libsplinter/src/admin/service/consensus.rs | 385 -- libsplinter/src/admin/service/error.rs | 360 -- libsplinter/src/admin/service/mailbox.rs | 340 -- .../src/admin/service/messages/builders.rs | 349 -- libsplinter/src/admin/service/messages/mod.rs | 439 --- libsplinter/src/admin/service/mod.rs | 837 ----- .../src/admin/service/open_proposals.rs | 172 - libsplinter/src/admin/service/shared.rs | 3114 ----------------- libsplinter/src/biome/credentials/mod.rs | 20 - .../src/biome/credentials/rest_resources.rs | 536 --- .../src/biome/credentials/store/diesel/mod.rs | 112 - .../biome/credentials/store/diesel/models.rs | 34 - .../diesel/operations/add_credentials.rs | 61 - .../operations/fetch_credential_by_id.rs | 57 - .../fetch_credential_by_username.rs | 57 - .../store/diesel/operations/fetch_username.rs | 52 - .../store/diesel/operations/get_usernames.rs | 52 - .../store/diesel/operations/mod.rs | 34 - .../diesel/operations/remove_credentials.rs | 58 - .../diesel/operations/update_credentials.rs | 83 - .../down.sql | 16 - .../up.sql | 22 - .../credentials/store/diesel/postgres/mod.rs | 35 - .../biome/credentials/store/diesel/schema.rs | 22 - .../src/biome/credentials/store/error.rs | 173 - .../src/biome/credentials/store/mod.rs | 240 -- .../src/biome/key_management/database/mod.rs | 15 - .../database/postgres/helpers/keys.rs | 43 - .../database/postgres/helpers/mod.rs | 17 - .../2019-12-12-200956_create-keys/down.sql | 16 - .../2019-12-12-200956_create-keys/up.sql | 22 - .../down.sql | 16 - .../up.sql | 17 - .../key_management/database/postgres/mod.rs | 39 - .../database/postgres/models.rs | 25 - .../database/postgres/schema.rs | 22 - libsplinter/src/biome/key_management/mod.rs | 81 - .../biome/key_management/rest_resources.rs | 332 -- .../src/biome/key_management/store/error.rs | 98 - .../src/biome/key_management/store/mod.rs | 72 - .../key_management/store/postgres/mod.rs | 127 - libsplinter/src/biome/mod.rs | 37 - .../down.sql | 16 - .../up.sql | 37 - .../src/biome/notifications/database/mod.rs | 33 - .../biome/notifications/database/models.rs | 47 - .../biome/notifications/database/schema.rs | 47 - libsplinter/src/biome/notifications/mod.rs | 17 - libsplinter/src/biome/rest_api/config.rs | 121 - libsplinter/src/biome/rest_api/error.rs | 77 - libsplinter/src/biome/rest_api/mod.rs | 243 -- .../src/biome/secrets/auto_secret_manager.rs | 50 - libsplinter/src/biome/secrets/error.rs | 45 - libsplinter/src/biome/secrets/mod.rs | 30 - libsplinter/src/biome/sessions/claims.rs | 125 - libsplinter/src/biome/sessions/error.rs | 148 - libsplinter/src/biome/sessions/mod.rs | 86 - .../src/biome/sessions/token_issuer.rs | 45 - libsplinter/src/biome/user/mod.rs | 18 - .../src/biome/user/store/diesel/mod.rs | 68 - .../src/biome/user/store/diesel/models.rs | 35 - .../user/store/diesel/operations/add_user.rs | 42 - .../store/diesel/operations/delete_user.rs | 58 - .../store/diesel/operations/fetch_user.rs | 47 - .../store/diesel/operations/list_users.rs | 50 - .../biome/user/store/diesel/operations/mod.rs | 32 - .../store/diesel/operations/update_user.rs | 61 - .../2019-11-13-213120_create_users/down.sql | 16 - .../2019-11-13-213120_create_users/up.sql | 18 - .../biome/user/store/diesel/postgres/mod.rs | 35 - .../src/biome/user/store/diesel/schema.rs | 19 - libsplinter/src/biome/user/store/error.rs | 87 - libsplinter/src/biome/user/store/mod.rs | 89 - libsplinter/src/channel/crossbeam.rs | 70 - libsplinter/src/channel/error.rs | 80 - libsplinter/src/channel/mock.rs | 67 - libsplinter/src/channel/mod.rs | 46 - libsplinter/src/channel/mpsc.rs | 67 - libsplinter/src/circuit/directory.rs | 87 - .../src/circuit/handlers/admin_message.rs | 505 --- .../src/circuit/handlers/circuit_error.rs | 326 -- .../src/circuit/handlers/circuit_message.rs | 103 - .../src/circuit/handlers/direct_message.rs | 807 ----- libsplinter/src/circuit/handlers/mod.rs | 46 - .../src/circuit/handlers/service_handlers.rs | 739 ---- libsplinter/src/circuit/mod.rs | 772 ---- libsplinter/src/circuit/service.rs | 90 - libsplinter/src/circuit/store.rs | 65 - libsplinter/src/collections/mod.rs | 298 -- libsplinter/src/consensus/error.rs | 140 - libsplinter/src/consensus/mod.rs | 487 --- libsplinter/src/consensus/two_phase/mod.rs | 1329 ------- libsplinter/src/consensus/two_phase/timing.rs | 62 - libsplinter/src/database/error.rs | 46 - .../down.sql | 6 - .../up.sql | 36 - libsplinter/src/database/mod.rs | 70 - libsplinter/src/events/error.rs | 222 -- libsplinter/src/events/mod.rs | 21 - libsplinter/src/events/reactor.rs | 230 -- libsplinter/src/events/ws.rs | 623 ---- libsplinter/src/hex.rs | 156 - libsplinter/src/keys/error.rs | 72 - libsplinter/src/keys/insecure.rs | 26 - libsplinter/src/keys/mod.rs | 224 -- libsplinter/src/keys/rest_api.rs | 233 -- libsplinter/src/keys/storage.rs | 342 -- libsplinter/src/lib.rs | 90 - libsplinter/src/matrix.rs | 125 - libsplinter/src/mesh/control.rs | 184 - libsplinter/src/mesh/incoming.rs | 58 - libsplinter/src/mesh/matrix.rs | 74 - libsplinter/src/mesh/mod.rs | 458 --- libsplinter/src/mesh/outgoing.rs | 58 - libsplinter/src/mesh/pool.rs | 372 -- libsplinter/src/mesh/reactor.rs | 161 - libsplinter/src/network/auth/handlers.rs | 714 ---- libsplinter/src/network/auth/mod.rs | 657 ---- .../src/network/connection_manager/error.rs | 65 - .../network/connection_manager/messages.rs | 82 - .../src/network/connection_manager/mod.rs | 750 ---- .../network/connection_manager/pacemaker.rs | 103 - libsplinter/src/network/dispatch.rs | 615 ---- libsplinter/src/network/dispatch_proto.rs | 28 - libsplinter/src/network/handlers.rs | 137 - libsplinter/src/network/mod.rs | 550 --- libsplinter/src/network/peer.rs | 391 --- libsplinter/src/network/reply.rs | 213 -- libsplinter/src/network/sender.rs | 232 -- libsplinter/src/node_registry/error.rs | 108 - libsplinter/src/node_registry/mod.rs | 227 -- libsplinter/src/node_registry/noop.rs | 62 - libsplinter/src/node_registry/rest_api.rs | 774 ---- libsplinter/src/node_registry/unified.rs | 353 -- libsplinter/src/node_registry/yaml/error.rs | 66 - libsplinter/src/node_registry/yaml/mod.rs | 777 ---- libsplinter/src/orchestrator/error.rs | 147 - libsplinter/src/orchestrator/mod.rs | 599 ---- libsplinter/src/orchestrator/rest_api.rs | 110 - libsplinter/src/protocol/mod.rs | 69 - libsplinter/src/protos/mod.rs | 15 - libsplinter/src/rest_api/errors.rs | 105 - libsplinter/src/rest_api/events.rs | 187 - libsplinter/src/rest_api/mod.rs | 614 ---- libsplinter/src/rest_api/paging.rs | 160 - libsplinter/src/rest_api/response_models.rs | 50 - libsplinter/src/service/error.rs | 343 -- libsplinter/src/service/factory.rs | 36 - libsplinter/src/service/mod.rs | 305 -- libsplinter/src/service/processor.rs | 1128 ------ libsplinter/src/service/registry.rs | 303 -- libsplinter/src/service/rest_api.rs | 68 - .../src/service/scabbard/client/error.rs | 55 - .../src/service/scabbard/client/mod.rs | 209 -- .../src/service/scabbard/client/scar.rs | 408 --- .../src/service/scabbard/client/submit.rs | 159 - libsplinter/src/service/scabbard/consensus.rs | 477 --- libsplinter/src/service/scabbard/error.rs | 169 - libsplinter/src/service/scabbard/factory.rs | 245 -- libsplinter/src/service/scabbard/mod.rs | 433 --- libsplinter/src/service/scabbard/rest_api.rs | 428 --- libsplinter/src/service/scabbard/shared.rs | 198 -- libsplinter/src/service/scabbard/state.rs | 921 ----- libsplinter/src/service/sender.rs | 587 ---- libsplinter/src/signing/error.rs | 50 - libsplinter/src/signing/hash.rs | 65 - libsplinter/src/signing/mod.rs | 55 - libsplinter/src/signing/sawtooth.rs | 156 - libsplinter/src/signing/ursa.rs | 183 - libsplinter/src/storage/memory.rs | 133 - libsplinter/src/storage/mod.rs | 193 - libsplinter/src/storage/sets/mem.rs | 526 --- libsplinter/src/storage/sets/mod.rs | 208 -- libsplinter/src/storage/yaml.rs | 610 ---- libsplinter/src/transport/inproc.rs | 278 -- libsplinter/src/transport/mod.rs | 338 -- libsplinter/src/transport/multi.rs | 239 -- libsplinter/src/transport/raw.rs | 163 - libsplinter/src/transport/rw.rs | 94 - libsplinter/src/transport/tls.rs | 496 --- libsplinter/src/transport/zmq.rs | 755 ---- canopy/saplingjs/package.json => package.json | 0 services/health/Cargo.toml | 36 - services/health/src/lib.rs | 95 - services/scabbard/Cargo.toml | 70 - services/scabbard/Dockerfile-installed-bionic | 47 - services/scabbard/packaging/ubuntu/postinst | 13 - services/scabbard/src/cli/error.rs | 146 - services/scabbard/src/cli/key.rs | 200 -- services/scabbard/src/cli/main.rs | 1521 -------- services/scabbard/src/cli/transaction.rs | 407 --- services/scabbard/src/lib.rs | 13 - splinterd/Cargo.toml | 97 - splinterd/Dockerfile-installed-bionic | 62 - splinterd/api/openapi.dockerfile | 50 - splinterd/api/static/openapi.yml | 1464 -------- splinterd/packaging/nodes.yaml.example | 29 - splinterd/packaging/splinterd.toml.example | 64 - splinterd/packaging/systemd/splinterd | 15 - splinterd/packaging/systemd/splinterd.service | 28 - splinterd/packaging/ubuntu/postinst | 52 - .../splinterd-node-0-docker.toml | 41 - .../sample_configs/splinterd.toml.example | 52 - .../sample_configs/splinterd.toml.example2 | 54 - splinterd/sample_node_registries/nodes.yaml | 24 - splinterd/src/certs.rs | 150 - splinterd/src/config/builder.rs | 373 -- splinterd/src/config/command_line.rs | 222 -- splinterd/src/config/default.rs | 175 - splinterd/src/config/env.rs | 96 - splinterd/src/config/error.rs | 64 - splinterd/src/config/mod.rs | 864 ----- splinterd/src/config/partial.rs | 398 --- splinterd/src/config/toml.rs | 190 - splinterd/src/daemon.rs | 1061 ------ splinterd/src/main.rs | 652 ---- splinterd/src/registry_config.rs | 88 - splinterd/src/routes/mod.rs | 18 - splinterd/src/routes/status.rs | 56 - {canopy/saplingjs/src => src}/index.spec.ts | 0 {canopy/saplingjs/src => src}/index.ts | 0 {canopy/saplingjs/src => src}/submitter.ts | 0 tests/Dockerfile | 21 - tests/test-splinter-cron.yaml | 33 - tests/test-splinter.yaml | 35 +- .../saplingjs/tsconfig.json => tsconfig.json | 0 599 files changed, 18 insertions(+), 84326 deletions(-) rename canopy/saplingjs/.eslintrc => .eslintrc (100%) rename canopy/app/.prettierrc => .prettierrc (100%) delete mode 100644 Cargo.toml rename canopy/saplingjs/Dockerfile => Dockerfile (100%) delete mode 100644 README.md delete mode 100644 RELEASE_NOTES.md delete mode 100644 assets/diagram-splinter-circuits+3companies.svg delete mode 100644 assets/diagram-splinter-smartcontractdeployment.svg delete mode 100644 assets/diagram-splinter-twopartycircuit.svg delete mode 100755 bin/run_lint_rust delete mode 100644 canopy/app/.eslintignore delete mode 100644 canopy/app/.eslintrc delete mode 100644 canopy/app/.lintstagedrc delete mode 100644 canopy/app/Dockerfile delete mode 100644 canopy/app/README.md delete mode 100644 canopy/app/package.json delete mode 100644 canopy/app/public/index.html delete mode 100644 canopy/app/public/manifest.json delete mode 100644 canopy/app/public/robots.txt delete mode 100644 canopy/app/saplings/configSaplings delete mode 100644 canopy/app/saplings/loginRegisterSapling.js delete mode 100644 canopy/app/saplings/profile.js delete mode 100644 canopy/app/saplings/userSaplings delete mode 100644 canopy/app/saplings/vanilla.js delete mode 100644 canopy/app/src/App.js delete mode 100644 canopy/app/src/App.scss delete mode 100644 canopy/app/src/App.test.js delete mode 100644 canopy/app/src/images/default.svg delete mode 100644 canopy/app/src/index.css delete mode 100644 canopy/app/src/index.js delete mode 100644 canopy/canopyjs/.babelrc delete mode 100644 canopy/canopyjs/.eslintignore delete mode 100644 canopy/canopyjs/.eslintrc delete mode 100644 canopy/canopyjs/.prettierrc delete mode 100644 canopy/canopyjs/README.md delete mode 100644 canopy/canopyjs/package.json delete mode 100644 canopy/canopyjs/rollup.config.js delete mode 100644 canopy/canopyjs/src/CanopyContext.js delete mode 100644 canopy/canopyjs/src/components/index.js delete mode 100644 canopy/canopyjs/src/components/navigation/NavItem.js delete mode 100644 canopy/canopyjs/src/components/navigation/SideNav.js delete mode 100644 canopy/canopyjs/src/components/navigation/SideNav.scss delete mode 100644 canopy/canopyjs/src/components/progress/Progress.js delete mode 100644 canopy/canopyjs/src/components/progress/Progress.scss delete mode 100644 canopy/canopyjs/src/components/tabBox/TabBox.js delete mode 100644 canopy/canopyjs/src/components/tabBox/TabBox.scss delete mode 100644 canopy/canopyjs/src/index.js delete mode 100644 canopy/canopyjs/src/loadSaplings.js delete mode 100644 canopy/canopyjs/src/promiseLoader.js delete mode 100644 canopy/canopyjs/src/request.js delete mode 100644 canopy/canopyjs/src/styleLoader.js delete mode 100644 canopy/canopyjs/src/styles/colors.scss delete mode 100644 canopy/canopyjs/src/styles/components.scss delete mode 100644 canopy/canopyjs/src/styles/core.scss delete mode 100644 canopy/canopyjs/src/styles/layout.scss delete mode 100644 canopy/canopyjs/src/styles/mixins.scss delete mode 100644 canopy/canopyjs/src/styles/navigation.scss delete mode 100644 canopy/canopyjs/src/themes/default/colors.scss delete mode 100644 canopy/canopyjs/src/themes/default/index.js delete mode 100644 canopy/canopyjs/src/themes/default/index.scss delete mode 100644 canopy/canopyjs/src/themes/default/sizes.scss delete mode 100644 canopy/canopyjs/src/themes/default/timings.scss delete mode 100644 canopy/canopyjs/src/themes/default/typography.scss delete mode 100644 canopy/canopyjs/src/themes/default/variables.scss delete mode 100644 canopy/saplingjs/.prettierrc delete mode 100644 canopy/saplings/notifier/.keep delete mode 100755 ci/publish-docker delete mode 100644 ci/publish-splinter-crates delete mode 100644 ci/splinter-dev delete mode 100644 cli/Cargo.toml delete mode 100644 cli/Dockerfile-installed-bionic delete mode 100644 cli/packaging/ubuntu/postinst delete mode 100644 cli/src/action/admin.rs delete mode 100644 cli/src/action/certs.rs delete mode 100644 cli/src/action/circuit/api.rs delete mode 100644 cli/src/action/circuit/builder.rs delete mode 100644 cli/src/action/circuit/defaults.rs delete mode 100644 cli/src/action/circuit/mod.rs delete mode 100644 cli/src/action/circuit/payload.rs delete mode 100644 cli/src/action/database.rs delete mode 100644 cli/src/action/health.rs delete mode 100644 cli/src/action/keygen.rs delete mode 100644 cli/src/action/mod.rs delete mode 100644 cli/src/action/node.rs delete mode 100644 cli/src/error.rs delete mode 100644 cli/src/main.rs delete mode 100644 cli/src/store/default_value/error.rs delete mode 100644 cli/src/store/default_value/mod.rs delete mode 100644 cli/src/store/default_value/yaml_store.rs delete mode 100644 cli/src/store/mod.rs delete mode 100644 cli/src/store/node/error.rs delete mode 100644 cli/src/store/node/mod.rs delete mode 100644 cli/src/store/node/yaml_store.rs delete mode 100644 client/Cargo.toml delete mode 100644 client/src/error.rs delete mode 100644 client/src/lib.rs delete mode 100644 client/src/splinter_client.rs delete mode 100644 docker-compose-installed.yaml delete mode 100644 docker-compose.yaml delete mode 100644 docker/compose/copy-debs.yaml delete mode 100644 docker/kubernetes/README.md delete mode 100644 docker/kubernetes/arcade.yaml delete mode 100644 docker/kubernetes/create-gameroom-keys.yaml delete mode 100644 docker/kubernetes/images/acme-1-launch.png delete mode 100644 docker/kubernetes/images/acme-2-register.png delete mode 100644 docker/kubernetes/images/acme-3-loggedin.png delete mode 100644 docker/kubernetes/images/acme-4-newgameroom.png delete mode 100644 docker/kubernetes/images/acme-5-invitationsent.png delete mode 100644 docker/kubernetes/images/acme-6-invitationlist.png delete mode 100644 docker/kubernetes/images/acme-7-creategame.png delete mode 100644 docker/kubernetes/images/acme-8-joingame.png delete mode 100644 docker/kubernetes/images/acme-9-takespace.png delete mode 100644 docker/kubernetes/images/bubba-1-launch.png delete mode 100644 docker/kubernetes/images/bubba-2-register.png delete mode 100644 docker/kubernetes/images/bubba-3-loggedin.png delete mode 100644 docker/kubernetes/images/bubba-4-invitationnotification.png delete mode 100644 docker/kubernetes/images/bubba-5-invitation.png delete mode 100644 docker/kubernetes/images/bubba-6-gameroom.png delete mode 100644 docker/kubernetes/images/bubba-7-joingame.png delete mode 100644 docker/kubernetes/images/bubba-8-takespace.png delete mode 100644 docker/kubernetes/key-registry.yaml delete mode 100644 docker/kubernetes/node-registry.yaml delete mode 100644 docker/lint delete mode 100644 docker/lint-client delete mode 100644 examples/gameroom/.dockerignore delete mode 100644 examples/gameroom/README.md delete mode 100644 examples/gameroom/cli/Cargo.toml delete mode 100644 examples/gameroom/cli/src/action/database.rs delete mode 100644 examples/gameroom/cli/src/action/mod.rs delete mode 100644 examples/gameroom/cli/src/error.rs delete mode 100644 examples/gameroom/cli/src/main.rs delete mode 100644 examples/gameroom/daemon/Cargo.toml delete mode 100644 examples/gameroom/daemon/Dockerfile-installed-bionic delete mode 100644 examples/gameroom/daemon/openapi.yml delete mode 100644 examples/gameroom/daemon/packaging/systemd/gameroomd delete mode 100644 examples/gameroom/daemon/packaging/systemd/gameroomd.service delete mode 100644 examples/gameroom/daemon/packaging/ubuntu/postinst delete mode 100644 examples/gameroom/daemon/src/application_metadata/error.rs delete mode 100644 examples/gameroom/daemon/src/application_metadata/mod.rs delete mode 100644 examples/gameroom/daemon/src/authorization_handler/error.rs delete mode 100644 examples/gameroom/daemon/src/authorization_handler/mod.rs delete mode 100644 examples/gameroom/daemon/src/authorization_handler/sabre.rs delete mode 100644 examples/gameroom/daemon/src/authorization_handler/state_delta.rs delete mode 100644 examples/gameroom/daemon/src/config.rs delete mode 100644 examples/gameroom/daemon/src/error.rs delete mode 100644 examples/gameroom/daemon/src/main.rs delete mode 100644 examples/gameroom/daemon/src/rest_api/error.rs delete mode 100644 examples/gameroom/daemon/src/rest_api/mod.rs delete mode 100644 examples/gameroom/daemon/src/rest_api/routes/authenticate.rs delete mode 100644 examples/gameroom/daemon/src/rest_api/routes/gameroom.rs delete mode 100644 examples/gameroom/daemon/src/rest_api/routes/gameroom_websocket.rs delete mode 100644 examples/gameroom/daemon/src/rest_api/routes/key.rs delete mode 100644 examples/gameroom/daemon/src/rest_api/routes/mod.rs delete mode 100644 examples/gameroom/daemon/src/rest_api/routes/node.rs delete mode 100644 examples/gameroom/daemon/src/rest_api/routes/notification.rs delete mode 100644 examples/gameroom/daemon/src/rest_api/routes/proposal.rs delete mode 100644 examples/gameroom/daemon/src/rest_api/routes/submit.rs delete mode 100644 examples/gameroom/daemon/src/rest_api/routes/xo_games.rs delete mode 100644 examples/gameroom/database/Cargo.toml delete mode 100644 examples/gameroom/database/Dockerfile-installed delete mode 100644 examples/gameroom/database/migrations/00000000000000_diesel_initial_setup/down.sql delete mode 100644 examples/gameroom/database/migrations/00000000000000_diesel_initial_setup/up.sql delete mode 100644 examples/gameroom/database/migrations/2020-01-15-180145_gameroom_last_event/down.sql delete mode 100644 examples/gameroom/database/migrations/2020-01-15-180145_gameroom_last_event/up.sql delete mode 100644 examples/gameroom/database/src/error.rs delete mode 100644 examples/gameroom/database/src/helpers/gameroom.rs delete mode 100644 examples/gameroom/database/src/helpers/gameroom_user.rs delete mode 100644 examples/gameroom/database/src/helpers/mod.rs delete mode 100644 examples/gameroom/database/src/helpers/notification.rs delete mode 100644 examples/gameroom/database/src/helpers/xo_games.rs delete mode 100644 examples/gameroom/database/src/lib.rs delete mode 100644 examples/gameroom/database/src/models.rs delete mode 100644 examples/gameroom/database/src/schema.rs delete mode 100644 examples/gameroom/database/tables/gameroom_tables.sql delete mode 100755 examples/gameroom/docker-compose-dockerhub.yaml delete mode 100755 examples/gameroom/docker-compose.yaml delete mode 100644 examples/gameroom/gameroom-app/.browserslistrc delete mode 100644 examples/gameroom/gameroom-app/.gitignore delete mode 100644 examples/gameroom/gameroom-app/Dockerfile-installed delete mode 100644 examples/gameroom/gameroom-app/README.md delete mode 100644 examples/gameroom/gameroom-app/babel.config.js delete mode 100644 examples/gameroom/gameroom-app/package.json delete mode 100644 examples/gameroom/gameroom-app/postcss.config.js delete mode 100644 examples/gameroom/gameroom-app/public/img/logo-acme.png delete mode 100644 examples/gameroom/gameroom-app/public/img/logo-bubba.png delete mode 100644 examples/gameroom/gameroom-app/public/img/logo-generic.png delete mode 100644 examples/gameroom/gameroom-app/public/index.html delete mode 100644 examples/gameroom/gameroom-app/sabre_proto/sabre_payload.proto delete mode 100644 examples/gameroom/gameroom-app/sawtooth-sdk.d.ts delete mode 100755 examples/gameroom/gameroom-app/scripts/compile_protobuf.js delete mode 100644 examples/gameroom/gameroom-app/src/App.vue delete mode 100644 examples/gameroom/gameroom-app/src/assets/acme/logo_wide.png delete mode 100644 examples/gameroom/gameroom-app/src/assets/acme/xo/omark.svg delete mode 100644 examples/gameroom/gameroom-app/src/assets/acme/xo/xmark.svg delete mode 100644 examples/gameroom/gameroom-app/src/assets/bubba/logo_wide.png delete mode 100644 examples/gameroom/gameroom-app/src/assets/bubba/xo/omark.svg delete mode 100644 examples/gameroom/gameroom-app/src/assets/bubba/xo/xmark.svg delete mode 100644 examples/gameroom/gameroom-app/src/assets/generic/logo_wide.png delete mode 100644 examples/gameroom/gameroom-app/src/assets/generic/xo/omark.svg delete mode 100644 examples/gameroom/gameroom-app/src/assets/generic/xo/xmark.svg delete mode 100644 examples/gameroom/gameroom-app/src/class-component-hooks.ts delete mode 100644 examples/gameroom/gameroom-app/src/components/AppNavbar.vue delete mode 100644 examples/gameroom/gameroom-app/src/components/Dropdown.vue delete mode 100644 examples/gameroom/gameroom-app/src/components/DropdownNotification.vue delete mode 100644 examples/gameroom/gameroom-app/src/components/GameCard.vue delete mode 100644 examples/gameroom/gameroom-app/src/components/GameInfoPanel.vue delete mode 100644 examples/gameroom/gameroom-app/src/components/InvitationCard.vue delete mode 100644 examples/gameroom/gameroom-app/src/components/Loading.vue delete mode 100644 examples/gameroom/gameroom-app/src/components/Modal.vue delete mode 100644 examples/gameroom/gameroom-app/src/components/TabButton.vue delete mode 100644 examples/gameroom/gameroom-app/src/components/Tabs.vue delete mode 100644 examples/gameroom/gameroom-app/src/components/Toast.vue delete mode 100644 examples/gameroom/gameroom-app/src/components/sidebar/GameroomSidebar.vue delete mode 100644 examples/gameroom/gameroom-app/src/components/sidebar/SidebarSection.vue delete mode 100644 examples/gameroom/gameroom-app/src/components/xo/XOBoard.vue delete mode 100644 examples/gameroom/gameroom-app/src/components/xo/XOCell.vue delete mode 100644 examples/gameroom/gameroom-app/src/main.ts delete mode 100644 examples/gameroom/gameroom-app/src/protobuf/index.ts delete mode 100644 examples/gameroom/gameroom-app/src/router.ts delete mode 100644 examples/gameroom/gameroom-app/src/scss/components/_app-navbar.scss delete mode 100644 examples/gameroom/gameroom-app/src/scss/components/_dashboard.scss delete mode 100644 examples/gameroom/gameroom-app/src/scss/components/_dropdown-notification.scss delete mode 100644 examples/gameroom/gameroom-app/src/scss/components/_dropdown.scss delete mode 100644 examples/gameroom/gameroom-app/src/scss/components/_game-card.scss delete mode 100644 examples/gameroom/gameroom-app/src/scss/components/_game-info-panel.scss delete mode 100644 examples/gameroom/gameroom-app/src/scss/components/_gameroom-details.scss delete mode 100644 examples/gameroom/gameroom-app/src/scss/components/_invitation-card.scss delete mode 100644 examples/gameroom/gameroom-app/src/scss/components/_loading.scss delete mode 100644 examples/gameroom/gameroom-app/src/scss/components/_modal.scss delete mode 100644 examples/gameroom/gameroom-app/src/scss/components/_toast.scss delete mode 100644 examples/gameroom/gameroom-app/src/scss/components/sidebar/_sidebar-container.scss delete mode 100644 examples/gameroom/gameroom-app/src/scss/components/sidebar/_sidebar-section.scss delete mode 100644 examples/gameroom/gameroom-app/src/scss/components/xo/_xo-board.scss delete mode 100644 examples/gameroom/gameroom-app/src/scss/components/xo/_xo-cell.scss delete mode 100644 examples/gameroom/gameroom-app/src/scss/main.scss delete mode 100644 examples/gameroom/gameroom-app/src/scss/modules/_colors.scss delete mode 100644 examples/gameroom/gameroom-app/src/scss/modules/_mixins.scss delete mode 100644 examples/gameroom/gameroom-app/src/scss/modules/_typography.scss delete mode 100644 examples/gameroom/gameroom-app/src/scss/modules/themes/acme/variables.scss delete mode 100644 examples/gameroom/gameroom-app/src/scss/modules/themes/bubba/variables.scss delete mode 100644 examples/gameroom/gameroom-app/src/scss/modules/themes/generic/variables.scss delete mode 100644 examples/gameroom/gameroom-app/src/scss/partials/_animations.scss delete mode 100644 examples/gameroom/gameroom-app/src/scss/partials/_base.scss delete mode 100644 examples/gameroom/gameroom-app/src/scss/partials/_buttons.scss delete mode 100644 examples/gameroom/gameroom-app/src/scss/partials/_forms.scss delete mode 100644 examples/gameroom/gameroom-app/src/scss/partials/_icons.scss delete mode 100644 examples/gameroom/gameroom-app/src/scss/partials/_links.scss delete mode 100644 examples/gameroom/gameroom-app/src/scss/vendor/_multiselect.scss delete mode 100644 examples/gameroom/gameroom-app/src/scss/vendor/_normalize.scss delete mode 100644 examples/gameroom/gameroom-app/src/shims-tsx.d.ts delete mode 100644 examples/gameroom/gameroom-app/src/shims-vue.d.ts delete mode 100644 examples/gameroom/gameroom-app/src/store/api.ts delete mode 100644 examples/gameroom/gameroom-app/src/store/index.ts delete mode 100644 examples/gameroom/gameroom-app/src/store/models.ts delete mode 100644 examples/gameroom/gameroom-app/src/store/modules/gamerooms.ts delete mode 100644 examples/gameroom/gameroom-app/src/store/modules/games.ts delete mode 100644 examples/gameroom/gameroom-app/src/store/modules/nodes.ts delete mode 100644 examples/gameroom/gameroom-app/src/store/modules/notifications.ts delete mode 100644 examples/gameroom/gameroom-app/src/store/modules/pageLoading.ts delete mode 100644 examples/gameroom/gameroom-app/src/store/modules/proposals.ts delete mode 100644 examples/gameroom/gameroom-app/src/store/modules/selectedGameroom.ts delete mode 100644 examples/gameroom/gameroom-app/src/store/modules/user.ts delete mode 100644 examples/gameroom/gameroom-app/src/store/modules/votes.ts delete mode 100644 examples/gameroom/gameroom-app/src/utils/addressing.ts delete mode 100644 examples/gameroom/gameroom-app/src/utils/crypto.ts delete mode 100644 examples/gameroom/gameroom-app/src/utils/transactions.ts delete mode 100644 examples/gameroom/gameroom-app/src/utils/xo-games.ts delete mode 100644 examples/gameroom/gameroom-app/src/views/Dashboard.vue delete mode 100644 examples/gameroom/gameroom-app/src/views/DashboardHome.vue delete mode 100644 examples/gameroom/gameroom-app/src/views/GameDetail.vue delete mode 100644 examples/gameroom/gameroom-app/src/views/GameroomDetail.vue delete mode 100644 examples/gameroom/gameroom-app/src/views/Home.vue delete mode 100644 examples/gameroom/gameroom-app/src/views/Invitations.vue delete mode 100644 examples/gameroom/gameroom-app/src/views/Login.vue delete mode 100644 examples/gameroom/gameroom-app/src/views/NotFound.vue delete mode 100644 examples/gameroom/gameroom-app/src/views/Register.vue delete mode 100644 examples/gameroom/gameroom-app/tsconfig.json delete mode 100644 examples/gameroom/gameroom-app/tslint.json delete mode 100644 examples/gameroom/gameroom-app/vue-clickaway.d.ts delete mode 100644 examples/gameroom/gameroom-app/vue-native-websocket.d.ts delete mode 100644 examples/gameroom/gameroom-app/vue.config.js delete mode 100644 examples/gameroom/gameroom-app/whitelabel.config.js delete mode 100644 examples/gameroom/key_registry/key_registry_spec.yaml delete mode 100644 examples/gameroom/node_registry/nodes.yaml delete mode 100644 examples/gameroom/splinterd-config/splinterd-node-acme.toml delete mode 100644 examples/gameroom/splinterd-config/splinterd-node-bubba.toml delete mode 100644 examples/gameroom/tests/.gitignore delete mode 100644 examples/gameroom/tests/Dockerfile delete mode 100755 examples/gameroom/tests/bin/run_tests delete mode 100644 examples/gameroom/tests/cypress/Dockerfile delete mode 100644 examples/gameroom/tests/cypress/cypress.json delete mode 100644 examples/gameroom/tests/cypress/docker-compose.yaml delete mode 100644 examples/gameroom/tests/cypress/fixtures/credentials.json delete mode 100644 examples/gameroom/tests/cypress/fixtures/views.json delete mode 100644 examples/gameroom/tests/cypress/integration/index.spec.js delete mode 100644 examples/gameroom/tests/cypress/integration/login.spec.js delete mode 100644 examples/gameroom/tests/cypress/integration/register.spec.js delete mode 100644 examples/gameroom/tests/cypress/package.json delete mode 100755 examples/gameroom/tests/cypress/scripts/clear_db.sh delete mode 100644 examples/gameroom/tests/cypress/support/commands.js delete mode 100644 examples/gameroom/tests/cypress/support/index.d.ts delete mode 100644 examples/gameroom/tests/cypress/support/index.js delete mode 100644 examples/gameroom/tests/docker-compose.yaml delete mode 100644 examples/gameroom/tests/sample_node_registry.yaml delete mode 100644 examples/gameroom/tests/splinterd-node-0-docker.toml delete mode 100644 examples/private_counter/README.md delete mode 100644 examples/private_counter/cli/Cargo.toml delete mode 100644 examples/private_counter/cli/Dockerfile-installed-bionic delete mode 100644 examples/private_counter/cli/src/actions.rs delete mode 100644 examples/private_counter/cli/src/error.rs delete mode 100644 examples/private_counter/cli/src/main.rs delete mode 100644 examples/private_counter/demo_state/circuits.yaml delete mode 100644 examples/private_counter/docker-compose.yaml delete mode 100644 examples/private_counter/node_registry/nodes.yaml delete mode 100644 examples/private_counter/protos/private_counter.proto delete mode 100644 examples/private_counter/service/Cargo.toml delete mode 100644 examples/private_counter/service/Dockerfile-installed-bionic delete mode 100644 examples/private_counter/service/build.rs delete mode 100644 examples/private_counter/service/src/consensus.rs delete mode 100644 examples/private_counter/service/src/error.rs delete mode 100644 examples/private_counter/service/src/main.rs delete mode 100644 examples/private_counter/service/src/protos/mod.rs delete mode 100644 examples/private_xo/Cargo.toml delete mode 100644 examples/private_xo/Dockerfile-installed-bionic delete mode 100644 examples/private_xo/README.md delete mode 100644 examples/private_xo/build.rs delete mode 100644 examples/private_xo/demo_state/circuits.yaml delete mode 100644 examples/private_xo/docker-compose.yaml delete mode 100644 examples/private_xo/node_registry/nodes.yaml delete mode 100644 examples/private_xo/protos/private_xo.proto delete mode 100644 examples/private_xo/src/error.rs delete mode 100644 examples/private_xo/src/main.rs delete mode 100644 examples/private_xo/src/protos/mod.rs delete mode 100644 examples/private_xo/src/routes/batches.rs delete mode 100644 examples/private_xo/src/routes/error.rs delete mode 100644 examples/private_xo/src/routes/mod.rs delete mode 100644 examples/private_xo/src/routes/state.rs delete mode 100644 examples/private_xo/src/service/consensus.rs delete mode 100644 examples/private_xo/src/service/error.rs delete mode 100644 examples/private_xo/src/service/mod.rs delete mode 100644 examples/private_xo/src/transaction/mod.rs rename canopy/saplingjs/jest.config.js => jest.config.js (100%) delete mode 100644 libsplinter/Cargo.toml delete mode 100644 libsplinter/build.rs delete mode 100644 libsplinter/examples/mesh-echo-peer.rs delete mode 100644 libsplinter/protos/admin.proto delete mode 100644 libsplinter/protos/authorization.proto delete mode 100644 libsplinter/protos/circuit.proto delete mode 100644 libsplinter/protos/consensus.proto delete mode 100644 libsplinter/protos/network.proto delete mode 100644 libsplinter/protos/scabbard.proto delete mode 100644 libsplinter/protos/two_phase.proto delete mode 100644 libsplinter/sample_files/circuits.yaml.example delete mode 100644 libsplinter/src/admin/error.rs delete mode 100644 libsplinter/src/admin/messages.rs delete mode 100644 libsplinter/src/admin/mod.rs delete mode 100644 libsplinter/src/admin/rest_api/actix/circuits.rs delete mode 100644 libsplinter/src/admin/rest_api/actix/circuits_circuit_id.rs delete mode 100644 libsplinter/src/admin/rest_api/actix/mod.rs delete mode 100644 libsplinter/src/admin/rest_api/actix/proposals_read.rs delete mode 100644 libsplinter/src/admin/rest_api/actix/proposals_read_circuit_id.rs delete mode 100644 libsplinter/src/admin/rest_api/actix/submit.rs delete mode 100644 libsplinter/src/admin/rest_api/actix/ws_register_type.rs delete mode 100644 libsplinter/src/admin/rest_api/error.rs delete mode 100644 libsplinter/src/admin/rest_api/mod.rs delete mode 100644 libsplinter/src/admin/rest_api/resources/circuits.rs delete mode 100644 libsplinter/src/admin/rest_api/resources/circuits_circuit_id.rs delete mode 100644 libsplinter/src/admin/rest_api/resources/mod.rs delete mode 100644 libsplinter/src/admin/rest_api/resources/proposals_read.rs delete mode 100644 libsplinter/src/admin/service/consensus.rs delete mode 100644 libsplinter/src/admin/service/error.rs delete mode 100644 libsplinter/src/admin/service/mailbox.rs delete mode 100644 libsplinter/src/admin/service/messages/builders.rs delete mode 100644 libsplinter/src/admin/service/messages/mod.rs delete mode 100644 libsplinter/src/admin/service/mod.rs delete mode 100644 libsplinter/src/admin/service/open_proposals.rs delete mode 100644 libsplinter/src/admin/service/shared.rs delete mode 100644 libsplinter/src/biome/credentials/mod.rs delete mode 100644 libsplinter/src/biome/credentials/rest_resources.rs delete mode 100644 libsplinter/src/biome/credentials/store/diesel/mod.rs delete mode 100644 libsplinter/src/biome/credentials/store/diesel/models.rs delete mode 100644 libsplinter/src/biome/credentials/store/diesel/operations/add_credentials.rs delete mode 100644 libsplinter/src/biome/credentials/store/diesel/operations/fetch_credential_by_id.rs delete mode 100644 libsplinter/src/biome/credentials/store/diesel/operations/fetch_credential_by_username.rs delete mode 100644 libsplinter/src/biome/credentials/store/diesel/operations/fetch_username.rs delete mode 100644 libsplinter/src/biome/credentials/store/diesel/operations/get_usernames.rs delete mode 100644 libsplinter/src/biome/credentials/store/diesel/operations/mod.rs delete mode 100644 libsplinter/src/biome/credentials/store/diesel/operations/remove_credentials.rs delete mode 100644 libsplinter/src/biome/credentials/store/diesel/operations/update_credentials.rs delete mode 100644 libsplinter/src/biome/credentials/store/diesel/postgres/migrations/2019-11-13-214153_create_credentials/down.sql delete mode 100644 libsplinter/src/biome/credentials/store/diesel/postgres/migrations/2019-11-13-214153_create_credentials/up.sql delete mode 100644 libsplinter/src/biome/credentials/store/diesel/postgres/mod.rs delete mode 100644 libsplinter/src/biome/credentials/store/diesel/schema.rs delete mode 100644 libsplinter/src/biome/credentials/store/error.rs delete mode 100644 libsplinter/src/biome/credentials/store/mod.rs delete mode 100644 libsplinter/src/biome/key_management/database/mod.rs delete mode 100644 libsplinter/src/biome/key_management/database/postgres/helpers/keys.rs delete mode 100644 libsplinter/src/biome/key_management/database/postgres/helpers/mod.rs delete mode 100644 libsplinter/src/biome/key_management/database/postgres/migrations/2019-12-12-200956_create-keys/down.sql delete mode 100644 libsplinter/src/biome/key_management/database/postgres/migrations/2019-12-12-200956_create-keys/up.sql delete mode 100644 libsplinter/src/biome/key_management/database/postgres/migrations/2020-01-10-204453_add_foreign_key_constraint/down.sql delete mode 100644 libsplinter/src/biome/key_management/database/postgres/migrations/2020-01-10-204453_add_foreign_key_constraint/up.sql delete mode 100644 libsplinter/src/biome/key_management/database/postgres/mod.rs delete mode 100644 libsplinter/src/biome/key_management/database/postgres/models.rs delete mode 100644 libsplinter/src/biome/key_management/database/postgres/schema.rs delete mode 100644 libsplinter/src/biome/key_management/mod.rs delete mode 100644 libsplinter/src/biome/key_management/rest_resources.rs delete mode 100644 libsplinter/src/biome/key_management/store/error.rs delete mode 100644 libsplinter/src/biome/key_management/store/mod.rs delete mode 100644 libsplinter/src/biome/key_management/store/postgres/mod.rs delete mode 100644 libsplinter/src/biome/mod.rs delete mode 100644 libsplinter/src/biome/notifications/database/migrations/2019-11-11-231339_create_notifications/down.sql delete mode 100644 libsplinter/src/biome/notifications/database/migrations/2019-11-11-231339_create_notifications/up.sql delete mode 100644 libsplinter/src/biome/notifications/database/mod.rs delete mode 100644 libsplinter/src/biome/notifications/database/models.rs delete mode 100644 libsplinter/src/biome/notifications/database/schema.rs delete mode 100644 libsplinter/src/biome/notifications/mod.rs delete mode 100644 libsplinter/src/biome/rest_api/config.rs delete mode 100644 libsplinter/src/biome/rest_api/error.rs delete mode 100644 libsplinter/src/biome/rest_api/mod.rs delete mode 100644 libsplinter/src/biome/secrets/auto_secret_manager.rs delete mode 100644 libsplinter/src/biome/secrets/error.rs delete mode 100644 libsplinter/src/biome/secrets/mod.rs delete mode 100644 libsplinter/src/biome/sessions/claims.rs delete mode 100644 libsplinter/src/biome/sessions/error.rs delete mode 100644 libsplinter/src/biome/sessions/mod.rs delete mode 100644 libsplinter/src/biome/sessions/token_issuer.rs delete mode 100644 libsplinter/src/biome/user/mod.rs delete mode 100644 libsplinter/src/biome/user/store/diesel/mod.rs delete mode 100644 libsplinter/src/biome/user/store/diesel/models.rs delete mode 100644 libsplinter/src/biome/user/store/diesel/operations/add_user.rs delete mode 100644 libsplinter/src/biome/user/store/diesel/operations/delete_user.rs delete mode 100644 libsplinter/src/biome/user/store/diesel/operations/fetch_user.rs delete mode 100644 libsplinter/src/biome/user/store/diesel/operations/list_users.rs delete mode 100755 libsplinter/src/biome/user/store/diesel/operations/mod.rs delete mode 100644 libsplinter/src/biome/user/store/diesel/operations/update_user.rs delete mode 100644 libsplinter/src/biome/user/store/diesel/postgres/migrations/2019-11-13-213120_create_users/down.sql delete mode 100644 libsplinter/src/biome/user/store/diesel/postgres/migrations/2019-11-13-213120_create_users/up.sql delete mode 100644 libsplinter/src/biome/user/store/diesel/postgres/mod.rs delete mode 100644 libsplinter/src/biome/user/store/diesel/schema.rs delete mode 100644 libsplinter/src/biome/user/store/error.rs delete mode 100644 libsplinter/src/biome/user/store/mod.rs delete mode 100644 libsplinter/src/channel/crossbeam.rs delete mode 100644 libsplinter/src/channel/error.rs delete mode 100644 libsplinter/src/channel/mock.rs delete mode 100644 libsplinter/src/channel/mod.rs delete mode 100644 libsplinter/src/channel/mpsc.rs delete mode 100644 libsplinter/src/circuit/directory.rs delete mode 100644 libsplinter/src/circuit/handlers/admin_message.rs delete mode 100644 libsplinter/src/circuit/handlers/circuit_error.rs delete mode 100644 libsplinter/src/circuit/handlers/circuit_message.rs delete mode 100644 libsplinter/src/circuit/handlers/direct_message.rs delete mode 100644 libsplinter/src/circuit/handlers/mod.rs delete mode 100644 libsplinter/src/circuit/handlers/service_handlers.rs delete mode 100644 libsplinter/src/circuit/mod.rs delete mode 100644 libsplinter/src/circuit/service.rs delete mode 100644 libsplinter/src/circuit/store.rs delete mode 100644 libsplinter/src/collections/mod.rs delete mode 100644 libsplinter/src/consensus/error.rs delete mode 100644 libsplinter/src/consensus/mod.rs delete mode 100644 libsplinter/src/consensus/two_phase/mod.rs delete mode 100644 libsplinter/src/consensus/two_phase/timing.rs delete mode 100644 libsplinter/src/database/error.rs delete mode 100644 libsplinter/src/database/migrations/00000000000000_diesel_initial_setup/down.sql delete mode 100644 libsplinter/src/database/migrations/00000000000000_diesel_initial_setup/up.sql delete mode 100644 libsplinter/src/database/mod.rs delete mode 100644 libsplinter/src/events/error.rs delete mode 100644 libsplinter/src/events/mod.rs delete mode 100644 libsplinter/src/events/reactor.rs delete mode 100644 libsplinter/src/events/ws.rs delete mode 100644 libsplinter/src/hex.rs delete mode 100644 libsplinter/src/keys/error.rs delete mode 100644 libsplinter/src/keys/insecure.rs delete mode 100644 libsplinter/src/keys/mod.rs delete mode 100644 libsplinter/src/keys/rest_api.rs delete mode 100644 libsplinter/src/keys/storage.rs delete mode 100644 libsplinter/src/lib.rs delete mode 100644 libsplinter/src/matrix.rs delete mode 100644 libsplinter/src/mesh/control.rs delete mode 100644 libsplinter/src/mesh/incoming.rs delete mode 100644 libsplinter/src/mesh/matrix.rs delete mode 100644 libsplinter/src/mesh/mod.rs delete mode 100644 libsplinter/src/mesh/outgoing.rs delete mode 100644 libsplinter/src/mesh/pool.rs delete mode 100644 libsplinter/src/mesh/reactor.rs delete mode 100644 libsplinter/src/network/auth/handlers.rs delete mode 100644 libsplinter/src/network/auth/mod.rs delete mode 100644 libsplinter/src/network/connection_manager/error.rs delete mode 100644 libsplinter/src/network/connection_manager/messages.rs delete mode 100644 libsplinter/src/network/connection_manager/mod.rs delete mode 100644 libsplinter/src/network/connection_manager/pacemaker.rs delete mode 100644 libsplinter/src/network/dispatch.rs delete mode 100644 libsplinter/src/network/dispatch_proto.rs delete mode 100644 libsplinter/src/network/handlers.rs delete mode 100644 libsplinter/src/network/mod.rs delete mode 100644 libsplinter/src/network/peer.rs delete mode 100644 libsplinter/src/network/reply.rs delete mode 100644 libsplinter/src/network/sender.rs delete mode 100644 libsplinter/src/node_registry/error.rs delete mode 100644 libsplinter/src/node_registry/mod.rs delete mode 100644 libsplinter/src/node_registry/noop.rs delete mode 100644 libsplinter/src/node_registry/rest_api.rs delete mode 100644 libsplinter/src/node_registry/unified.rs delete mode 100644 libsplinter/src/node_registry/yaml/error.rs delete mode 100644 libsplinter/src/node_registry/yaml/mod.rs delete mode 100644 libsplinter/src/orchestrator/error.rs delete mode 100644 libsplinter/src/orchestrator/mod.rs delete mode 100644 libsplinter/src/orchestrator/rest_api.rs delete mode 100644 libsplinter/src/protocol/mod.rs delete mode 100644 libsplinter/src/protos/mod.rs delete mode 100644 libsplinter/src/rest_api/errors.rs delete mode 100644 libsplinter/src/rest_api/events.rs delete mode 100644 libsplinter/src/rest_api/mod.rs delete mode 100644 libsplinter/src/rest_api/paging.rs delete mode 100644 libsplinter/src/rest_api/response_models.rs delete mode 100644 libsplinter/src/service/error.rs delete mode 100644 libsplinter/src/service/factory.rs delete mode 100644 libsplinter/src/service/mod.rs delete mode 100644 libsplinter/src/service/processor.rs delete mode 100644 libsplinter/src/service/registry.rs delete mode 100644 libsplinter/src/service/rest_api.rs delete mode 100644 libsplinter/src/service/scabbard/client/error.rs delete mode 100644 libsplinter/src/service/scabbard/client/mod.rs delete mode 100644 libsplinter/src/service/scabbard/client/scar.rs delete mode 100644 libsplinter/src/service/scabbard/client/submit.rs delete mode 100644 libsplinter/src/service/scabbard/consensus.rs delete mode 100644 libsplinter/src/service/scabbard/error.rs delete mode 100644 libsplinter/src/service/scabbard/factory.rs delete mode 100644 libsplinter/src/service/scabbard/mod.rs delete mode 100644 libsplinter/src/service/scabbard/rest_api.rs delete mode 100644 libsplinter/src/service/scabbard/shared.rs delete mode 100644 libsplinter/src/service/scabbard/state.rs delete mode 100644 libsplinter/src/service/sender.rs delete mode 100644 libsplinter/src/signing/error.rs delete mode 100644 libsplinter/src/signing/hash.rs delete mode 100644 libsplinter/src/signing/mod.rs delete mode 100644 libsplinter/src/signing/sawtooth.rs delete mode 100644 libsplinter/src/signing/ursa.rs delete mode 100644 libsplinter/src/storage/memory.rs delete mode 100644 libsplinter/src/storage/mod.rs delete mode 100644 libsplinter/src/storage/sets/mem.rs delete mode 100644 libsplinter/src/storage/sets/mod.rs delete mode 100644 libsplinter/src/storage/yaml.rs delete mode 100644 libsplinter/src/transport/inproc.rs delete mode 100644 libsplinter/src/transport/mod.rs delete mode 100644 libsplinter/src/transport/multi.rs delete mode 100644 libsplinter/src/transport/raw.rs delete mode 100644 libsplinter/src/transport/rw.rs delete mode 100644 libsplinter/src/transport/tls.rs delete mode 100644 libsplinter/src/transport/zmq.rs rename canopy/saplingjs/package.json => package.json (100%) delete mode 100644 services/health/Cargo.toml delete mode 100644 services/health/src/lib.rs delete mode 100644 services/scabbard/Cargo.toml delete mode 100644 services/scabbard/Dockerfile-installed-bionic delete mode 100644 services/scabbard/packaging/ubuntu/postinst delete mode 100644 services/scabbard/src/cli/error.rs delete mode 100644 services/scabbard/src/cli/key.rs delete mode 100644 services/scabbard/src/cli/main.rs delete mode 100644 services/scabbard/src/cli/transaction.rs delete mode 100644 services/scabbard/src/lib.rs delete mode 100644 splinterd/Cargo.toml delete mode 100644 splinterd/Dockerfile-installed-bionic delete mode 100644 splinterd/api/openapi.dockerfile delete mode 100644 splinterd/api/static/openapi.yml delete mode 100644 splinterd/packaging/nodes.yaml.example delete mode 100644 splinterd/packaging/splinterd.toml.example delete mode 100644 splinterd/packaging/systemd/splinterd delete mode 100644 splinterd/packaging/systemd/splinterd.service delete mode 100644 splinterd/packaging/ubuntu/postinst delete mode 100644 splinterd/sample_configs/splinterd-node-0-docker.toml delete mode 100644 splinterd/sample_configs/splinterd.toml.example delete mode 100644 splinterd/sample_configs/splinterd.toml.example2 delete mode 100644 splinterd/sample_node_registries/nodes.yaml delete mode 100644 splinterd/src/certs.rs delete mode 100644 splinterd/src/config/builder.rs delete mode 100644 splinterd/src/config/command_line.rs delete mode 100644 splinterd/src/config/default.rs delete mode 100644 splinterd/src/config/env.rs delete mode 100644 splinterd/src/config/error.rs delete mode 100644 splinterd/src/config/mod.rs delete mode 100644 splinterd/src/config/partial.rs delete mode 100644 splinterd/src/config/toml.rs delete mode 100644 splinterd/src/daemon.rs delete mode 100644 splinterd/src/main.rs delete mode 100644 splinterd/src/registry_config.rs delete mode 100644 splinterd/src/routes/mod.rs delete mode 100644 splinterd/src/routes/status.rs rename {canopy/saplingjs/src => src}/index.spec.ts (100%) rename {canopy/saplingjs/src => src}/index.ts (100%) rename {canopy/saplingjs/src => src}/submitter.ts (100%) delete mode 100644 tests/Dockerfile delete mode 100644 tests/test-splinter-cron.yaml rename canopy/saplingjs/tsconfig.json => tsconfig.json (100%) diff --git a/.dockerignore b/.dockerignore index a5c04328c3..ebabbd521e 100644 --- a/.dockerignore +++ b/.dockerignore @@ -12,48 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -/libsplinter/target -/libsplinter/Cargo.lock - -/splinterd/target -/splinterd/Cargo.lock - -/client/target -/client/Cargo.lock - -/cli/target -/cli/Cargo.lock - -/examples/private_xo/target -/examples/private_xo/Cargo.lock - -/examples/private_counter/service/target -/examples/private_counter/service/Cargo.lock - -/examples/private_counter/cli/target -/examples/private_counter/cli/Cargo.lock - -/examples/private_xo/target -/examples/private_xo/Cargo.lock - -/examples/gameroom/database/target -/examples/gameroom/database/Cargo.lock - -/examples/gameroom/daemon/target -/examples/gameroom/daemon/Cargo.lock - -/examples/gameroom/gameroom-app/node_modules -/examples/gameroom/gameroom-app/dist -/examples/gameroom/gameroom-app/package-lock.json - -# Canopy **/node_modules **/.pnp **/.pnp.js **/yarn.lock -/canopy/**/coverage -/canopy/**/build -/canopy**/dist - -/target -/Cargo.lock +**/coverage +**/build +**/dist diff --git a/canopy/saplingjs/.eslintrc b/.eslintrc similarity index 100% rename from canopy/saplingjs/.eslintrc rename to .eslintrc diff --git a/.gitignore b/.gitignore index e9cd50249d..3857fe88b0 100644 --- a/.gitignore +++ b/.gitignore @@ -12,47 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -/libsplinter/target -/libsplinter/Cargo.lock - -/splinterd/target -/splinterd/Cargo.lock - -/messaging/src/protos -/messaging/target -/messaging/Cargo.lock - -/client/target -/client/Cargo.lock - -/cli/target -/cli/Cargo.lock - -/examples/private_xo/target -/examples/private_xo/Cargo.lock -/examples/private_xo/demo_state/keys.yaml -/examples/private_xo/demo_state/circuit_proposals.yaml - -/examples/private_counter/service/target -/examples/private_counter/service/Cargo.lock -/examples/private_counter/demo_state/keys.yaml -/examples/private_counter/demo_state/circuit_proposals.yaml - -/examples/gameroom/database/target -/examples/gameroom/database/Cargo.lock - -/examples/gameroom/daemon/target -/examples/gameroom/daemon/Cargo.lock - -/examples/gameroom/gameroom-app/src/compiled_protos.json - -/tests/Cargo.lock -/tests/target - -/target -/Cargo.lock - -## Canopy # deps **/node_modules **/.pnp @@ -60,23 +19,23 @@ **/yarn.lock #testing -/canopy/**/coverage +**/coverage # production -/canopy/**/build -/canopy**/dist -/canopy**/lib +**/build +**/dist +**/lib # misc .DS_Store -/canopy/**/.env.local -/canopy/**/.env.development.local -/canopy/**/.env.test.local -/canopy/**/.env.production.local - -/canopy/**/npm-debug.log* -/canopy/**/yarn-debug.log* -/canopy/**/yarn-error.log* +**/.env.local +**/.env.development.local +**/.env.test.local +**/.env.production.local + +**/npm-debug.log* +**/yarn-debug.log* +**/yarn-error.log* # editor **/.vscode diff --git a/canopy/app/.prettierrc b/.prettierrc similarity index 100% rename from canopy/app/.prettierrc rename to .prettierrc diff --git a/.travis.yml b/.travis.yml index ab0ee3c745..7ef9483a1f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,6 @@ services: env: global: - ISOLATION_ID=$TRAVIS_BUILD_ID - - NAMESPACE="splintercommunity/" - VERSION=AUTO_STRICT before_install: @@ -33,60 +32,7 @@ addons: jobs: include: - - stage: Lint Gameroom Client + - stage: Lint/Unit Test script: - - docker-compose -f docker/compose/run-lint.yaml up --abort-on-container-exit lint-gameroom-client - - - stage: Run Lint/Clippy on Splinter - script: - - docker-compose -f docker/compose/run-lint.yaml up --abort-on-container-exit lint-splinter - - stage: Run Lint/Clippy on Splinter - script: - - docker-compose -f docker/compose/run-lint.yaml up --abort-on-container-exit clippy-splinter - - - stage: Lint/Unit Test Canopy - script: - - docker-compose -f tests/test-splinter.yaml up --abort-on-container-exit unit-test-canopy-app - - docker-compose -f docker/compose/run-lint.yaml up --abort-on-container-exit lint-canopy-app - docker-compose -f tests/test-splinter.yaml up --abort-on-container-exit unit-test-saplingjs - docker-compose -f docker/compose/run-lint.yaml up --abort-on-container-exit lint-saplingjs - - - stage: Run Splinter/Gameroom Unit Tests - before_script: - - set -e - script: - - docker-compose -f tests/test-splinter.yaml up --abort-on-container-exit unit-test-splinter - - stage: Run Splinter/Gameroom Unit Tests - before_script: - - set -e - script: - - docker-compose -f examples/gameroom/tests/docker-compose.yaml up --abort-on-container-exit - - stage: Run Splinter/Gameroom Unit Tests - before_script: - - set -e - script: - - docker-compose -f examples/gameroom/tests/cypress/docker-compose.yaml up --abort-on-container-exit - - - stage: Cron only - if: type = cron - script: docker-compose -f tests/test-splinter-cron.yaml up --abort-on-container-exit unit-test-splinter - - - stage: Publish docker images - language: generic - before_deploy: - - docker login -u splintercommunity -p $DOCKER_TOKEN - deploy: - - provider: script - script: bash ci/publish-docker master - on: - branch: master - - provider: script - script: bash ci/publish-docker experimental - on: - branch: master - condition: $TRAVIS_EVENT_TYPE == cron - - provider: script - script: bash ci/publish-docker - on: - tags: true - all_branches: true diff --git a/Cargo.toml b/Cargo.toml deleted file mode 100644 index 69219a9b25..0000000000 --- a/Cargo.toml +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2018-2020 Cargill Incorporated -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -[workspace] - -members = [ - "cli", - "client", - "libsplinter", - "splinterd", - "examples/private_counter/cli", - "examples/private_counter/service", - "examples/private_xo", - "examples/gameroom/cli", - "examples/gameroom/database", - "examples/gameroom/daemon", - "services/health", - "services/scabbard", -] diff --git a/canopy/saplingjs/Dockerfile b/Dockerfile similarity index 100% rename from canopy/saplingjs/Dockerfile rename to Dockerfile diff --git a/README.md b/README.md deleted file mode 100644 index 146a57601a..0000000000 --- a/README.md +++ /dev/null @@ -1,130 +0,0 @@ -# Splinter - -Splinter is a privacy-focused platform for distributed applications that provides -a blockchain-inspired networking environment for communication and transactions -between organizations. Splinter lets you combine blockchain-related technologies --- such as smart contracts and consensus engines -- to build a wide variety -of architectural patterns. - - ⊹ [Features](#features-and-concepts) ⊹ [Building Splinter](#building-splinter) ⊹ [Demos](#demos) ⊹ [License](#license) ⊹ - -## Features and Concepts - -Splinter allows the same network to do two-party private communication, -multi-party private communication, and network-wide multi-party shared state, -all managed with consensus. A Splinter network enables multi-party or two-party -private conversations between nodes using circuits and services. - - - A _**node**_ is the foundational runtime that allows an organization to - participate in the network. - - - A _**circuit**_ is a virtual network within the broader Splinter network that - safely and securely enforces privacy scope boundaries. - - - A _**service**_ is an endpoint within a circuit that sends and receives - private messages. - -A Splinter application provides a set of distributed services that can -communicate with each other across a Splinter circuit. - -![Splinter private circuits with shared state](assets/diagram-splinter-circuits+3companies.svg) - -**Splinter is designed for privacy** - -The key concepts of Splinter are fundamentally anchored to privacy. - - - _**Circuits**_ define scope and visibility domains. - - _**Shared state**_, a database updated by smart contracts, is visible only - to the services within a circuit. - -**Splinter is distributed and flexible** - -Splinter works across a network - - - _**State agreement**_ is achieved via the Merkle-radix tree in - [Hyperledger Transact](https://github.com/hyperledger/transact/), - allowing multiple services to prove they have the same data down to the - last bit, cryptographically. - - _**Consensus**_ is provided for creating real distributed applications. - Splinter currently includes **two-phase commit** for 2- or 3-party - conversations. - - _**Connections**_ are dynamically constructed between nodes as circuits are - created. - - -![Splinter smart contract deployment at runtime](assets/diagram-splinter-smartcontractdeployment.svg) - -**Splinter is agile with smart contracts** - - - Smart contracts _**capture business logic**_ for processing transactions. - - _**Runtime deployment**_ of smart contracts means no need to upgrade the - Splinter software stack to add business logic. - - _**Sandboxed WebAssembly smart contracts**_ keep the network safe and - ensure determinism. - - _**Scabbard**_, an out-of-the-box Splinter service that runs - [Sawtooth Sabre](https://github.com/hyperledger/sawtooth-sabre) - smart contracts across nodes, coordinated with consensus. - -**Splinter is designed for applications** - - - _**State delta export**_ allows an application to materialize the - Merkle-radix tree database to another database such as PostgreSQL. - Applications can read from the materialized database (just like any other - web application). - - _**Admin services**_ provide applications with a REST API to dynamically - create new circuits, based on business need. - - _**Authorization**_ for circuit management can be delegated to application - code and defined by business policies. - -![Two-party Splinter circuit](assets/diagram-splinter-twopartycircuit.svg) - -## Building Splinter - -To build Splinter, run `cargo build` from the root directory. This command -builds all of the Splinter components, including `libsplinter` (the main -library), `splinterd` (the splinter daemon), the CLI, the client, and all -examples in the `examples` directory. - -To build individual components, run `cargo build` in the component directories. -For example, to build only the Private XO demo, navigate to -`examples/private_xo`, then run `cargo build`. - -To build Splinter using Docker, run -`docker-compose -f docker-compose-installed.yaml build` from the root -directory. This command builds Docker images for all of the Splinter -components, including `libsplinter` (the main library), `splinterd` -(the splinter daemon), the CLI, the client, and all examples in the `examples` -directory. - -To build individual components using Docker, run -`docker-compose -f docker-compose-installed.yaml build ` -from the root directory. For example, to build only the Private XO demo, -run `docker-compose -f docker-compose-installed.yaml build private_xo`. - -To use Docker to build Splinter with experimental features enabled, set an -enviroment variable in your shell before running the build commands. For -example: `export 'CARGO_ARGS=-- --features experimental'`. To go back to -building with default features, unset the evironment variable: -`unset CARGO_ARGS` - -## Demos - -Splinter includes several example applications that you can run as demos. The -README in each directory explains how to run the demo. - -- [Private Counter](examples/private_counter/): Three services communicate over - a circuit to increment a shared counter. - -- [Private XO](examples/private_xo/): Two services talk over a circuit to play - a private game of tic tac toe (XO). - -- [Gameroom](examples/gameroom/): Web application that allows you to set up a - dynamic multi-party circuit (called a "gameroom") and play tic tac toe (XO). - -## License - -Splinter software is licensed under the [Apache License Version 2.0](LICENSE) software license. - -## Code of Conduct - -Splinter operates under the [Cargill Code of Conduct](https://github.com/Cargill/code-of-conduct/blob/master/code-of-conduct.md). \ No newline at end of file diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md deleted file mode 100644 index 15a99f138e..0000000000 --- a/RELEASE_NOTES.md +++ /dev/null @@ -1,679 +0,0 @@ -# Release Notes - -## Changes in Splinter 0.3.11 - -### Highlights: -* Splinter supports dynamic multi-party circuit creation in scenarios where the -peers are not connected when the circuit proposal is submitted. -* A new scabbard CLI provides experimental subcommands to submit batches of -transactions to a scabbard service. -* New experimental endpoints have been added to get state from a scabbard -service. -* Information on how to run the Gameroom demo using Kubernetes is available in -[docker/kubernetes/README.md](https://github.com/Cargill/splinter/blob/master/docker/kubernetes/README.md). - - -### libsplinter: -- Enable more than two-party circuit connection. The admin service now waits -for all nodes in the circuit proposal to be peered before handling a consensus -proposal. -- Add Biome (user management) routes for fetching, listing and deleting users -and updating credentials. -- Establish connection to peers when handling votes. If the connection between -nodes is dropped after a proposal is submitted, a node will try to re-establish -the connection before submitting the vote. -- Add support to configure the timeout value for two-phase commit. -- Set the default timeout for admin and scabbard services to 30 seconds. -- Add experimental endpoints (behind the "scabbard-get-state" feature) for -fetching and listing entries in scabbard state. - -### splinterd: -- Replace the current Config object with a PartialConfig and a -PartialConfigBuilder. This is the first part of significantly refactoring how -the Splinter daemon is configured. -- Fix the panic caused by unwrapping a bad protobuf message - -### Gameroom: -- Add example files and instructions (in docker/kubernetes) on how to run the -Gameroom demo using Kubernetes. - -### scabbard CLI: -- Add the scabbard CLI with experimental subcommands that closely resemble -those of the sabre CLI in Sawtooth Sabre. - -### splinter CLI: -- Add a keygen subcommand to generate a user's public/private key pair. This -subcommand uses the "keygen" experimental feature. - -### Packaging: -- Update the libsplinter Cargo.toml file to include only experimental and -stable in the list of features in package.metadata.docs.rs. -- Add the Gameroom CLI to the splinter-dev docker image. -- Publish Docker images built with experimental features during nightly cron -builds. - -## Changes in Splinter 0.3.10 - -### libsplinter: -- Fix the wait for batch status in the ScabbardClient by adding the base URL if - one is not provided. -- Add comments to ScabbardClient tests. - -### splinterd: -- Add the CLI flag --enable-biome to the splinterd CLI. The addition of this - flag relaxes the requirement that the database-url option must be set. - Currently, the database-url option is only required for the Biome subsystem. - -### Gameroom: -- Add migrations for the Gameroom database to support upgrading an existing - gameroom daemon. - -### Gameroom CLI: -- Add gameroom CLI, which will initially be used to migrate the gameroom - database. - -## Changes in Splinter 0.3.9 - -### Highlights: -* A Splinter crate is now available at https://crates.io/crates/splinter. -* The "splinter" CLI has new experimental subcommands: - - splinter circuit create (create a circuit) - - splinter circuit vote (vote on a circuit) - - splinter circuit list (display a list of circuits) - - splinter circuit proposals (display a list of circuit proposals) - - splinter circuit show (display circuit and proposal details) - -### Deprecations and Breaking Changes: -* The new node registry format is enforced as of release 0.3.8. Each entry in - the node registry must specify a node ID, a display name, and an endpoint. - -### libsplinter: -* Add experimental list and fetch routes for circuit proposals to the admin - service REST API. -* Add key management routes to the Biome REST API, including POST, GET and - PATCH to /biome/users/{user_id}/keys. -* Fix Scabbard initial events by rejecting an empty last_seen_event query - parameter and properly handling empty transaction receipt stores. -* Add a newline to key files generated by the splinter CLI. -* Start initial implementation of ScabbardClient, which provides a convenient - way to submit batches to a scabbard instance. - -### splinterd -* Add experimental Biome users API routes to splinterd. -* Add experimental list and fetch routes for circuit proposals to the admin - service REST API. -* Log a debug message instead of a warning when the splinterd config file is - not found. -* Remove panics that can be caused by a user from Splinter daemon startup. -* Fix typos and standardize capitalization in splinterd help and error messages. - -### splinter CLI -* Implement experimental "circuit create" subcommand. -* Implement experimental "circuit vote" subcommand. -* Add experimental "circuit list" and "circuit show" subcommands. -* Add "splinter circuit proposals" subcommand to list proposals. -* Add support for showing proposal details to "circuit list" subcommand. -* Change verbose and quiet flags to be global. - -### Gameroom -* Add a docker-compose file that uses published images. This compose file can be - used along with the repository in situations where building from scratch is - not feasible. -* Update the Gameroom README with CARGO_ARGS instructions for running with - experimental features. - -### Packaging -* Update splinterd packaging for the current node registry format. -* Log current git HEAD commit hash during docker image builds. -* Add a description to the Cargo.toml files. - -## Changes in Splinter 0.3.8 - -### Highlights: - -* A new "experimental" feature set. Features marked as experimental are - available for use, but are subject to change. -* The “splinter-cli” command has been renamed to “splinter”. - -### Deprecations and Breaking Changes: - -* The Splinter CLI name has changed from “splinter-cli” to “splinter”. - “splinter-cli” remains as an alias for “splinter”, but should be considered - deprecated as of this release. -* The node registry trait was extensively updated to support iteration, - implementation-agnostic filtering, and simplified modifications. - -### Libsplinter: - -* The protobuf files are now under the libsplinter subdirectory. This enables - publishing the "splinter" library crate. -* NodeRegistry::list_nodes now returns an iterator. -* NodeRegistry::update_node and add_node have been merged to - NodeRegistry::insert. -* The REST API implementations for circuits, node registry, and key registry - have moved from splinterd to libsplinter. -* A new "rest-api" stable feature includes the library functions mentioned - above. -* New Biome features for user-related functionality such as credentials and key - management. (Biome is the libsplinter module that supports user management.) - - "biome" - - "biome-credentials" - - "biome-key-management" - - "biome-notifications" -* A new "experimental" feature set that includes all experimental features. - -## Changes in Splinter 0.3.7 - -### Highlights: -* The admin service and the scabbard service can now send catch-up events to - bring new subscribers up to date - -### Deprecations and Breaking Changes: -* The splinterd --generate-certs flag, which was deprecated in 0.3.6, is still - available by default. In 0.3.8, the flag will not be available by default. - Instead, you must use the Rust compile-time feature “generate-certs” to - explicitly enable the deprecated --generate-certs flag. For more information, - see the 0.3.6 release notes. -* In the next release, the splinter CLI name will change from “splinter-cli” to - “splinter”. “splinter-cli” will exist as an alias for “splinter”, but should - be considered deprecated as of release 0.3.8. - -### libsplinter: -* Refactor the admin service and scabbard service to separate the REST API code -* Change admin service events to include a timestamp of when the event occurred -* Update the admin service to send all historical events that have occurred - since a given timestamp when an app auth handler subscribes -* Update the scabbard event format to correlate directly with a transaction - receipt -* Remove EventHistory from the REST API because it is no longer used -* Remove EventDealer from the REST API and replace it with the EventSender -* Update the event sender to send catch-up events as an asynchronous stream -* Add state-delta catch-up to the scabbard service, sending all events that - occurred since a given event ID when a subscription request is received -* Update Network to properly clean up connections on disconnection - -### splinterd: -* Fix the splinterd --heartbeat argument to properly accept a value - -### Gameroom example: -* Update the gameroomd app auth handler to track the timestamp of the last-seen - admin event -* Add the timestamp for the last-seen admin event to the app auth handler’s - subscription request for getting any catch-up events -* Update the gameroom state-delta subscriber to track the ID of the last-seen - scabbard event -* Add the ID of the last-seen scabbard event when subscribing to scabbard on - restart, which lets the gameroom daemon receive catch-up events - -### Private XO example: -* Replace the transact git repo dependency with a crates.io dependency - -## Changes in Splinter 0.3.6 - -### Highlights: -* Peers can now successfully reconnect after restarting -* Faster build times: - * Added a Dockerfile for splinter-dev docker image - * Based the installed images on the splinter-dev image - * Updated the compose files to build the installed docker images - * Added parallelization to Travis CI builds -* Initial database structure for Biome, the libsplinter module that supports - user management -* New Gameroom Technical Walkthrough document that explains the Splinter - functionality that powers the Gameroom application; see - examples/gameroom/README.md for a link to the PDF - -### Deprecated Features: -* The --generate-certs flag for splinterd is now deprecated. Instead, please - generate development certificates and keys using the new command "splinter-cli - cert generate". This command will generate the certificates and keys in - /etc/splinter/certs/ (by default) or in the specified directory. - Note: --generate-certs is still available by default in 0.3.6. It will be - turned off in 0.3.7, but will still be available with a Rust compile-time - feature flag. If using generated certificates, run splinterd with the - --insecure flag. - -### libsplinter: -* Improve logging: - * Log when a peer is removed - * Log an event Reactor background thread error on startup - * Log REST API background thread startup errors immediately, rather than on - shutdown - * Log a WebSocket shutdown - * Log a peer connection initiation - * Log the configuration used to start splinterd - * Add timestamp and thread name to log messages -* Return an error when a peer is disconnected -* Allow consensus threads to log error and exit, rather than panic -* Enforce that member, endpoint, and service IDs are unique to a circuit -* Update the example TOML configuration file -* Verify a CircuitManagementPayload message's payload field, header field, and - payload signature -* Update example circuit files to use correct enum types -* Fix a typo in DurabilityType enum -* Stop the admin service once a shutdown signal is received -* Fix a locking bug that prevented admin service from properly shutting down -* Stop running services upon admin service shutdown -* Include the service definition in service shutdown error -* Update format lint for Rust 1.39 -* Add a Splinter PostgreSQL database to be used by Splinter modules -* Decouple EventDealer and EventHistory to allow the storage of events to be - managed separately from event history -* Change the log levels of received messages and pings/pongs -* Update EventDealers to return error from EventDealer.add_sender method and - handle errors from EventDealer.dispatch method -* Store AuthServiceEvents in a Mailbox, replacing LocalEventHistory -* Start reorganizing the admin service module -* Store pending changes as transaction receipts in scabbard -* Add a "state_" prefix to variables that refer to the scabbard LMDB backend - database, which helps distinguish this database from other databases that - scabbard may maintain -* Run tests behind the "experimental" feature -* Move the zmq-transport feature, which loads the ZMQ dependency, to experimental -* Rename the node registry method create_node add_node, which more accurately - reflects its functionality -* Update the struct used to build REST API resources to represent multiple - method and handler pairs for a given resource -* Fix the node registry implementation’s file editing to completely overwrite - the YAML node registry file rather than append changes -* Add a disconnect listener to Network; this listener is used to close the - connection when a peer is disconnected from the network -* Register the AuthorizationManager to listen for peer disconnections to clean - up old state about the disconnected peer - -### splinterd: -* Add endpoints for local registry, including: - * POST /nodes - * DELETE /nodes/{identity} - * PATCH /nodes/{identity} -* Move the node registry implementation from splinterd to libsplinter -* Update the struct used to build REST API resources to represent multiple - method and handler pairs for a given resource -* Run tests behind the experimental feature -* Add /circuits route, available with circuit-read experimental feature, -* Update splinterd to look for certificates and keys in /etc/splinter/certs (by - default) or the location specified by "--cert-dir" or the environment variable - SPLINTER_CERT_DIR -* Deprecate the generate-cert flag (will be removed in a future release) now - that "splinter-cli cert generate" is available - -### splinter-cli: -* Add subcommand "cert generate" to generate certificates and keys that can be - used to run splinterd for development. - -### Canopy: -* Add CSS styles for responsive side navigation bar -* Add default color styles to be used in design app -* Add default typography styles and initial typography documentation -* Add CSS class defaults and themes for navigation -* Add structure and initial introduction page for the documentation app -* Add configuration to build theme CSS bundles -* Add the initial structure for a sapling example (an application to extend - Canopy) -* Implement register and initialize functions for saplings in CanopyJS -* Add lint and unit tests to Travis CI -* Refactor CanopyJS to improve clarity and extensibility -* Implement CanopyJS user - -### Gameroom example: -* Add a generic-themed Gameroom app to installed docker-compose file -* Add functions to check for active gamerooms and resubscribe on startup -* Add volumes for /var/lib/splinter to the docker-compose file -* Add timestamp and thread name to log messages -* Remove the hardcoded protocol for octet-stream submission; instead, use a - relative URL handled by the proxy -* Attempt to reconnect WebSocket clients if a "close" message is received -* Time out WebSocket client connections and attempt to reconnect -* Convert signature hex string to bytes for signing payloads -* Base the test docker image on the splinter-dev docker image -* Fix a bug with cell selection - -### Packaging: -* Remove known errors during a .deb package install - -## Changes in Splinter 0.3.5 - -### Highlights: -* Add network-level heartbeats to improve peer connectivity -* Update Gameroom UI to use the WebSocket Secure protocol (wss) when the - application protocol is HTTPS -* Improve libsplinter tests -* Add code of conduct to README -* Add the command-line option --common-name to splinterd - -### Canopy: -* Add initial directory structure for the Canopy project, a web application - that hosts pluggable applications and tools built on Splinter - -### Gameroom example: -* Remove unnecessary logo files -* Update UI to use wss when the application protocol is HTTPS. This fixes an - issue where the application could not communicate via WebSockets if the - application was communicating over HTTPS -* Check for batch status after batch is submitted, then wait for batch to be - committed or invalidated in gameroomd -* Remove member node’s metadata from gameroom propose request payload -* Fetch member node information from splinterd when gameroomd receives a - gameroom propose request - -### libsplinter: -* Add dockerfile for libsplinter crate generation -* Document the limitations for two-phase commit -* Add network-level heartbeats. The network now creates a thread that will send - a one-way heartbeat to each connected peer every 30 seconds by default. -* Rename libsplinter crate to splinter -* Store the current state root hash for scabbard's shared transaction state in - order to support restarts -* Simplify where services can be connected. This ensures that a service is - connected to the first allowed node and that allowed nodes can only have one - service. -* Remove peers when a node is disconnected - - -### libsplinter Testing: -* Update key_not_registered test to use a valid circuit -* Rename error_msg to msg in AdminDirectMessage tests -* Correctly set message type to CircuitMessageType::CIRCUIT_DIRECT_MESSAGE in - AdminDirectMessage tests -* Fix typos in doc comments - -## Changes in Splinter 0.3.4 - -### Highlights -* Implement a batch status endpoint for scabbard -* Set up the Cypress integration test framework for the Gameroom UI - -### Gameroom example -* Copy Splinter .proto files into installed client builds -* Redirect the user to a “Not Found” page if the page does not exist -* Set up integration tests using Cypress -* Add XO smart contract to installed gameroomd builds - -### libsplinter -* Reduce latency of events by replacing run_interval in EventDealerWebSocket - with streams - -### scabbard -* Change the scabbard database name to be the sha256 hash of - service_id::circuit_id to ensure that it will be a valid file name -* Add signature and structure verification to the scabbard service when it - receives batches submitted via the REST API -* Add /batch_statuses endpoint to scabbard and update /batches endpoint to - return a /batch_statuses link for the submitted batch IDs - -### splinterd -* Add config builder with toml loading (experimental feature) - -### Packaging -* Add Dockerfile to package gameroom UI -* Update packaging for gameroomd and splinterd so modified systemd files are - not overwritten -* Modify gameroomd and splinterd postinst scripts to add data directories -* Add plumbing to properly version deb packages - -## Changes in Splinter 0.3.3 - -### Highlights -* Add functionality to create and play XO games - -### libsplinter -* Add EventHistory trait to EventDealer to allow for new event subscribers to catch - up on previous events. This trait describes how events are stored. -* Add LocalEventHistory, a basic implementation of EventHistory that stores events - locally in a queue. -* Add MessageWrapper to be consumed by EventDealerWebsockets, to allow for - shutdown messages to be sent by the EventDealer -* Enforce that a Splinter service may only be added to Splinter state if the - connecting node is in its list of allowed nodes -* Add Context object for WebSocket callbacks to assist in restarting WebSocket - connections -* Add specified supported service types to the service orchestrator to determine - which service types are locally supported versus externally supported -* Only allow initialization of the orchestrator’s supported service -* On restart, reuse the services of circuits which are stored locally -* Add circuit ID when creating a service factory, in case it is needed by the - service -* Replace UUID with service_id::circuit_id, which is guaranteed to be unique on - a Splinter node, to name the Scabbard database -* Fix clippy error in events reactor -* Fix tests to match updated cargo args format -* Change certain circuit fields from strings to enums -* Remove Splinter client from CLI to decrease build time - -### Gameroom Example -* Add ability in the UI to fetch and list XO games -* Correct arguments used to fetch the members of an existing gameroom, allowing - the members to be included in the /gamerooms endpoint response -* Add GET /keys/{public_key} endpoint to gameroomd, to fetch key information - associated with a public key -* Add UI functionality to create a new XO game: -* Add ability to calculate addresses -* Add methods to build and sign XO transactions and batches -* Add methods to submit XO transactions and batches -* Add form for user to create new game -* Add new game notification to UI and gameroomd -* Add player information displayed for a game in UI -* Implement XO game board in UI -* Implement XO take functionality and state styling in UI -* Add component to show game information in the Gameroom details page in the UI -* Use md5 hash of game name when creating a game, rather than URL-encoded name - that handles special characters -* Add player information when updating an XO game from exported data (from state - delta export) -* Add auto-generated protos for the UI -* Remove the explicit caching in the Gameroom Detail view in the UI, because Vue - does this automatically -* Make various UI styling fixes -* Remove unused imports to avoid cargo compilation warnings - -## Changes in Splinter 0.3.2 - -### Highlights -* Completed the code to propose, accept, and create a gameroom in the Gameroom - example application - -### libsplinter -* Persist AdminService state that includes the pending circuits -* Replace the WebSocketClient with a new events module, which improves - multi-threaded capabilities of the clients (libsplinter::events; requires the - use of "events" feature flag) -* Improve log messages by logging the length of the bytes instead of the bytes - themselves -* Fix issue with sending and receiving large messages (greater than 64k) -* Fix issues with threads exiting without reporting the error -* Removed inaccurate warn log message that said signature verification was not - turned off - -### splinterd -* Add Key Registry REST API resources -* Increase message queue sizes for the admin service's ServiceProcessor. - -### splinter-cli -* Remove outdated CLI commands - -### Gameroom Example -* Add XoStateDeltaProcessor to Gameroom application authorization handler -* Add route to gameroom REST API to submit batches to scabbard service -* Set six-second timeout for toast notifications in the UI -* Add notification in the UI for newly active gamerooms -* Enhance invitation UI and add tabs for viewing sent, received, or all - invitations -* Fix bug that caused read notifications to not appear as read in the UI -* Fix bug where the Gameroom WebSocket was sending notifications to the UI - every 3 seconds instead of when a new notification was added - -## Changes in Splinter 0.3.1 - -### Highlights - -* Completion of circuit proposal validation, voting, and dynamic circuit creation -* Addition of key generation and management, as well as role-based permissions -* Continued progress towards proposing, accepting, and creating a gameroom in the - Gameroom example application - -### libsplinter - -* Add AdminService, with support for: - * Accepting and verifying votes on circuit proposals - * Committing approved circuit proposals to SplinterState -* Add notification to be sent to application authorization handlers when a - circuit is ready -* Update scabbard to properly set up Sabre state by adding admin keys -* Add support for exposing service endpoints using the orchestrator and service - factories -* Add WebSocketClient for consuming Splinter service events -* Add KeyRegistry trait for managing key information with a StorageKeyRegistry - implementation, backed by the storage module -* Add KeyPermissionsManager trait for accessing simple, role-based permissions - using public keys and an insecure AllowAllKeyPermissionManager implementation -* Add SHA512 hash implementation of signing traits, for test cases -* Add Sawtooth-compatible signing trait implementations behind the - "sawtooth-signing-compat" feature flag. - -### splinterd - -* Add package metadata and license field to Cargo.toml file -* Add example configuration files, systemd files, and postinst script to Debian - package -* Reorder internal service startup to ensure that the admin service and - orchestrator can appropriately connect and start up -* Use SawtoothSecp256k1SignatureVerifier for admin service - -### splinter-cli - -* Add "splinter-cli admin keygen" command to generate secp256k1 public/private - key pairs -* Add "splinter-cli admin keyregistry" command to generate a key registry and - key pairs based on a YAML specification - -### Private XO and Private Counter Examples -* Add license field to all Cargo.toml files -* Rename private-xo package to private-xo-service-.deb -* Rename private-counter packages to private-counter-cli-.deb and - private-counter-service-.deb - -### Gameroom Example -* Add package metadata and license field to gameroomd Cargo.toml file -* Add example configs, systemd files, and postinst script to gameroomd Debian - package; rename package to gameroom-.deb -* Implement notification retrieval using WebSocket subscription and - notifications endpoints -* Show pending and accepted gamerooms in the Gameroom UI -* Add full support for signing CircuitManagementPayloads with the user's - private key and submitting it to splinterd -* Update gameroomd to specify itself as the scabbard admin and submit the XO - smart contract when the circuit is ready -* Make various UI enhancements - -## Changes in Splinter 0.3.0 - -### Highlights - -* Completion of the two-phase-commit consensus algorithm with deterministic - coordination -* Continued progress towards dynamically generating circuits, including - dynamic peering and circuit proposal validation -* Continued progress on the Gameroom example, including UI updates and - automatic reconnection - -### libsplinter - -* Add a service orchestration implementation -* Add Scabbard service factory -* Implement a deterministic two-phase-commit coordinator -* Reorder the commit/reject process for the two-phase-commit coordinator. The - coordinator now tells proposal manager to commit/reject before broadcasting - the corresponding message to other verifiers. -* Refactor two-phase-commit complete_coordination. Move the process of - finishing the coordination of a proposal in two-phase commit to a single - function to reduce duplication. -* Implement a two-phase-commit timeout for consensus proposals -* Update the two-phase-commit algorithm to ignore duplicate proposals -* Allow dynamic verifiers for a single instance of two-phase-commit consensus -* Add an Authorization Inquisitor trait for inspecting peer authorization state -* Add the ability to queue messages from unauthorized peers and unpeered nodes - to the admin service -* Fix an issue that caused the admin service to deadlock when handling proposals -* Add Event Dealers for services to construct websocket endpoints -* Add a subscribe endpoint to Scabbard -* Validate circuit proposals against existing Splinter state -* Update create-circuit notification messages to include durability field - -### splinterd - -* Log only warning-level messages from Tokio and Hyper -* Improve Splinter component build times -* Add a NoOp registry to handle when a node registry backend is not specified - -### Private XO and Private Counter Examples - -* Use service IDs as peer node IDs, in order to make them compatible with - two-phase consensus - -### Gameroom Example - -* Add server-side WebSocket notifications to the UI -* Add borders to the Acme UI -* Improve error handling and add reconnects to the Application Authorization - Handler -* Add a circuit ID and hash to GET /proposals endpoint -* Standardize buttons and forms in the UI -* Improve error formatting in the UI by adding toasts and progress bar spinners -* Change the Gameroom REST API to retrieve node data automatically on startup -* Split the circuit_proposals table into gameroom and gameroom_proposals tables -* Use the [Material elevation strategy](https://material.io/design/color/dark-theme.html) - for coloring the UI -* Decrease the font size -* Change the UI to redirect users who are not logged in to login page -* Add a dashboard view -* Add an invitation cards view -* Add a button for creating a new gameroom to the UI - -## Changes in Splinter 0.2.0 - -### libsplinter - -* Add new consensus API (libsplinter::consensus) -* Add new consensus implementation for N-party, two-phase commit - (libsplinter::consensus::two_phase) -* Add new service SDK with in-process service implementations - (libsplinter::service) -* Add initial implementation for Scabbard, a Splinter service for running Sabre - transactions with two-phase commit between services -(libsplinter::service::scabbard) -* Add REST API SDK (consider this experimental, as the backing implementation - may change) -* Add new node registry REST API endpoint for providing information about all - possible nodes in the network, with initial YAML-file backed implementation. -* Add new signing API for verifying and signing messages, with optional - Ursa-backed implementation (libsplinter::signing, requires the use of -"ursa-compat" feature flag) -* Add MultiTransport for managing multiple transport types and selecting - connections based on a URI (libsplinter::transport::multi) -* Add ZMQ transport implementation (libsplinter::transport::zmq, requires the - use of the "zmq-transport" feature flag) -* Add peer authorization callbacks, in order to notify other system entities - that a peer is fully ready to receive messages - - -### splinterd - -* Add REST API instance to provide node registry API endpoints -* Add CLI parameter --bind for the REST API port -* Add CLI parameters for configuring node registryy; the default registry type - is "FILE" - -### Gameroom Example - -* Add gameroom example infrastructure, such as the gameroomd binary, docker - images, and compose files -* Add Login and Register UI -* Add New Gameroom UI -* Add UI themes for both parties in demo -* Initialize Gameroom database -* Add circuit proposals table -* Initialize Gameroom REST API -* Implement Gameroom REST API authentication routes -* Implement Gameroom REST API create gameroom endpoint -* Implement Gameroom REST API proposals route -* Implement /nodes endpoint in gameroomd diff --git a/assets/diagram-splinter-circuits+3companies.svg b/assets/diagram-splinter-circuits+3companies.svg deleted file mode 100644 index 859403eabc..0000000000 --- a/assets/diagram-splinter-circuits+3companies.svg +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - - - - - - - - - - Produced by OmniGraffle 7.11.3 - 2019-10-02 18:56:27 +0000 - - - Canvas 1 - - Layer 1 - - - - Company B - - - - - - Company C - - - - - - Company A - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Circuit - - - - - - - Shared State - - - - - - - Service - - - - - - - Node - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/diagram-splinter-smartcontractdeployment.svg b/assets/diagram-splinter-smartcontractdeployment.svg deleted file mode 100644 index f2a398923d..0000000000 --- a/assets/diagram-splinter-smartcontractdeployment.svg +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - Produced by OmniGraffle 7.11.3 - 2019-10-02 15:57:16 +0000 - - - Canvas 2 - - Layer 1 - - - - - Splinter daemon - (company A) - - - - - - - Application - - - - - - - Scabbard - - - - - - - Smart - Contracts - - - - - - - - - - Admin service - - - - - - - Splinter daemon - (company B) - - - - - - - Scabbard - - - - - - - Smart - Contracts - - - - - - - - - - Admin service - - - - - - - Runtime - Smart Contract Deployment - - - - - - - - - - - - - Synchronization - - - - - diff --git a/assets/diagram-splinter-twopartycircuit.svg b/assets/diagram-splinter-twopartycircuit.svg deleted file mode 100644 index af14eb29e7..0000000000 --- a/assets/diagram-splinter-twopartycircuit.svg +++ /dev/null @@ -1,241 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Produced by OmniGraffle 7.11.3 - 2019-10-01 23:12:27 +0000 - - - Canvas 3 - - Layer 1 - - - - - Splinter daemon - (company A) - - - - - - - Application - - - - - - - Scabbard - - - - - - - Admin service - - - - - - - Splinter daemon - (company B) - - - - - - - - - - Database - - - - - - - - - - - - - State - - - - - - - State Delta Export - - - - - - - Shared State - - - - - - - Dynamic Circuit Creation - - - - - - - Consensus - Coordination - - - - - - - Authorization Delegation - - - - - - - Scabbard - - - - - - - Admin service - - - - - - - Consensus - - - - - - - REST - API - - - - - - - REST - API - - - - - - - Consensus - - - - - - - - - - Application - - - - - - - - - - - - - State - - - - - - - - - - - - - - - - - - - - - - Application - - - - - - - Database - - - - - - - - - - - - - - diff --git a/bin/run_lint_rust b/bin/run_lint_rust deleted file mode 100755 index 32309bfbe8..0000000000 --- a/bin/run_lint_rust +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash -# -# Copyright 2018 Intel Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ------------------------------------------------------------------------------ - -top_dir=$(cd $(dirname $(dirname $0)) && pwd) - -dirs=" - $top_dir -" - -exitcode=0 - -rustfmt --version - -for dir in $dirs; do - cd $dir - echo "$dir" - - echo "-- rustfmt" - - diff=$(cargo fmt -- --check) - rustfmt_exit=$? - - # rustfmt --check returns the following exit codes: - # - # 0 = No errors - # 1 = Formatted code differs from existing code (check only) - - if [[ $rustfmt_exit != 0 ]]; then - exitcode=1 - if [[ $rustfmt_exit == 1 ]]; then - echo "Incorrect formatting: $dir (error code: $rustfmt_exit)" - echo "$diff" - else - echo "rustfmt encountered an operational error" - fi - fi - -done - -exit $exitcode diff --git a/canopy/app/.eslintignore b/canopy/app/.eslintignore deleted file mode 100644 index bf6b87e7aa..0000000000 --- a/canopy/app/.eslintignore +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright 2018-2020 Cargill Incorporated -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -saplings/* -build/* diff --git a/canopy/app/.eslintrc b/canopy/app/.eslintrc deleted file mode 100644 index 361bdf0167..0000000000 --- a/canopy/app/.eslintrc +++ /dev/null @@ -1,23 +0,0 @@ -{ - "env": { - "es6": true, - "jest": true, - "browser": true - }, - "parserOptions": { - "ecmaVersion": 2020 - }, - "extends": ["airbnb", "plugin:prettier/recommended"], - "rules": { - "react/jsx-filename-extension": 0, - "react/prefer-stateless-function": 0, - "import/prefer-default-export": 0 - }, - "settings": { - "import/resolver": { - "node": { - "paths": ["src"] - } - } - } -} diff --git a/canopy/app/.lintstagedrc b/canopy/app/.lintstagedrc deleted file mode 100644 index dbb2cf1a81..0000000000 --- a/canopy/app/.lintstagedrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "*.+(js|jsx|json|css|scss|md)": ["prettier --write"], - "*.+(js|jsx)": ["eslint"] -} diff --git a/canopy/app/Dockerfile b/canopy/app/Dockerfile deleted file mode 100644 index 88845bd88a..0000000000 --- a/canopy/app/Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright 2018-2020 Cargill Incorporated -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FROM node:lts-alpine - -WORKDIR /project/app - -COPY app/package*.json /project/app - -COPY canopyjs /project/canopyjs - -RUN cd ../canopyjs && yarn install && yarn build && rm -rf node_modules/ && cd ../app - -RUN yarn install - -COPY app /project/app diff --git a/canopy/app/README.md b/canopy/app/README.md deleted file mode 100644 index e8596b957d..0000000000 --- a/canopy/app/README.md +++ /dev/null @@ -1,47 +0,0 @@ - - -# Canopy - -Canopy is a web application that hosts pluggable applications and tools built -on Splinter. - -## Available Scripts - -In the `splinter/canopy/app` directory, you can run: - -### `yarn install` - -Installs dependencies for the Canopy application. - -### `yarn start` - -Runs the app in the development mode.
-Open [http://localhost:3000](http://localhost:3000) to view it in the browser. - -The page will reload if you make edits.
-You will also see any lint errors in the console. - -### `yarn test` - -Launches the test runner in the interactive watch mode.
- -### `yarn build` - -Builds the app for production to the `build` folder.
-It correctly bundles React in production mode and optimizes the build for the -best performance. - -The build is minified and the filenames include the hashes.
-Your app is ready to be deployed! diff --git a/canopy/app/package.json b/canopy/app/package.json deleted file mode 100644 index 99d7ef04c8..0000000000 --- a/canopy/app/package.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "name": "app", - "license": "Apache-2.0", - "author": "Cargill Incorporated", - "proxy": "http://0.0.0.0:8080", - "scripts": { - "start:saplings": "http-server ./saplings -p 8675 --cors", - "start:react": "REACT_APP_SAPLING_URL=http://0.0.0.0:8675 REACT_APP_SPLINTER_URL=http://localhost:3000 react-scripts start", - "start": "run-p start:saplings start:react", - "build": "react-scripts build", - "test": "react-scripts test", - "eject": "react-scripts eject", - "format": "prettier --write \"**/*.+(js|jsx|json|css|scss|md)\"", - "lint": "eslint ." - }, - "husky": { - "hooks": { - "pre-commit": "lint-staged" - } - }, - "browserslist": { - "production": [ - ">0.2%", - "not dead", - "not op_mini all" - ], - "development": [ - "last 1 chrome version", - "last 1 firefox version", - "last 1 safari version" - ] - }, - "dependencies": { - "@babel/parser": "^7.7.2", - "@fortawesome/fontawesome-svg-core": "^1.2.25", - "@fortawesome/free-solid-svg-icons": "^5.11.2", - "@fortawesome/react-fontawesome": "^0.1.7", - "babel-plugin-macros": "^2.6.1", - "canopyjs": "file:../canopyjs", - "classnames": "^2.2.6", - "es6-promisify": "^6.0.2", - "http-proxy-cli": "^2.1.0", - "js-yaml": "^3.13.1", - "node-sass": "^4.12.0", - "prop-types": "^15.7.2", - "react": "^16.10.2", - "react-dom": "^16.10.2", - "react-scripts": "3.2.0" - }, - "devDependencies": { - "eslint": "^6.6.0", - "eslint-config-airbnb": "18.0.1", - "eslint-config-prettier": "^6.4.0", - "eslint-plugin-import": "^2.18.2", - "eslint-plugin-jsx-a11y": "^6.2.3", - "eslint-plugin-prettier": "^3.1.1", - "eslint-plugin-react": "^7.14.3", - "eslint-plugin-react-hooks": "^1.7.0", - "http-server": "^0.11.1", - "husky": "^3.0.9", - "lint-staged": "^9.4.2", - "npm-run-all": "^4.1.5", - "prettier": "^1.18.2" - } -} diff --git a/canopy/app/public/index.html b/canopy/app/public/index.html deleted file mode 100644 index 7532f78c16..0000000000 --- a/canopy/app/public/index.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - React App - - - -
-
-
-
- - - - diff --git a/canopy/app/public/manifest.json b/canopy/app/public/manifest.json deleted file mode 100644 index 2e2569307b..0000000000 --- a/canopy/app/public/manifest.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "short_name": "Canopy", - "name": "Canopy", - "icons": [], - "start_url": ".", - "display": "standalone", - "theme_color": "#000000", - "background_color": "#ffffff" -} diff --git a/canopy/app/public/robots.txt b/canopy/app/public/robots.txt deleted file mode 100644 index 01b0f9a107..0000000000 --- a/canopy/app/public/robots.txt +++ /dev/null @@ -1,2 +0,0 @@ -# https://www.robotstxt.org/robotstxt.html -User-agent: * diff --git a/canopy/app/saplings/configSaplings b/canopy/app/saplings/configSaplings deleted file mode 100644 index 419f1954fb..0000000000 --- a/canopy/app/saplings/configSaplings +++ /dev/null @@ -1,18 +0,0 @@ -[ - { - "namespace": "login", - "runtimeFiles": [ - "0.0.0.0:8675/loginRegisterSapling.js" - ], - "styleFiles": [], - "workerFiles": [] - }, - { - "namespace": "profile", - "runtimeFiles": [ - "0.0.0.0:8675/profile.js" - ], - "styleFiles": [], - "workerFiles": [] - } -] diff --git a/canopy/app/saplings/loginRegisterSapling.js b/canopy/app/saplings/loginRegisterSapling.js deleted file mode 100644 index 0540aca7f6..0000000000 --- a/canopy/app/saplings/loginRegisterSapling.js +++ /dev/null @@ -1,3 +0,0 @@ -window.$CANOPY.registerConfigSapling('login', () => { - console.log('Registering Login Sapling'); -}); diff --git a/canopy/app/saplings/profile.js b/canopy/app/saplings/profile.js deleted file mode 100644 index f8b6892fc4..0000000000 --- a/canopy/app/saplings/profile.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright 2018-2020 Cargill Incorporated - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -window.$CANOPY.registerConfigSapling('profile', () => { - console.log('Registering Profile Sapling'); - - if (window.location.pathname === '/profile') { - window.$CANOPY.registerApp(function(domNode) { - console.log('Rendering Profile JS App'); - domNode.innerHTML = `

Profile

`; - }); - } -}); diff --git a/canopy/app/saplings/userSaplings b/canopy/app/saplings/userSaplings deleted file mode 100644 index 005c4a4bff..0000000000 --- a/canopy/app/saplings/userSaplings +++ /dev/null @@ -1,12 +0,0 @@ -[ - { - "displayName": "Vanilla", - "namespace": "vanilla", - "runtimeFiles": [ - "0.0.0.0:8675/vanilla.js" - ], - "styleFiles": [], - "workerFiles": [], - "icon": "https://via.placeholder.com/48" - } -] diff --git a/canopy/app/saplings/vanilla.js b/canopy/app/saplings/vanilla.js deleted file mode 100644 index 196e05b283..0000000000 --- a/canopy/app/saplings/vanilla.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright 2018-2020 Cargill Incorporated - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -window.$CANOPY.registerApp(function(domNode) { - console.log('Rendering Vanilla JS App'); - domNode.innerHTML = `

Hello World from a vanilla JS Canopy App

`; -}); diff --git a/canopy/app/src/App.js b/canopy/app/src/App.js deleted file mode 100644 index 06129ea207..0000000000 --- a/canopy/app/src/App.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Copyright 2018-2020 Cargill Incorporated - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import React from 'react'; -import { library } from '@fortawesome/fontawesome-svg-core'; -import { faLeaf, faUserCircle } from '@fortawesome/free-solid-svg-icons'; -import { CanopyProvider, SideNav } from 'canopyjs'; - -import './App.scss'; - -window.$CANOPY = {}; - -library.add(faLeaf); -library.add(faUserCircle); - -function AppWithProvider() { - return ( - - - - ); -} -export default AppWithProvider; diff --git a/canopy/app/src/App.scss b/canopy/app/src/App.scss deleted file mode 100644 index 7bd8af3ee5..0000000000 --- a/canopy/app/src/App.scss +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright 2018-2020 Cargill Incorporated - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -@import '~canopyjs/build/themes/default/index.css'; - -.app { - height: 100vh; - display: flex; - align-items: center; - color: var(--text-primary); - - .view { - flex: 0 1 100%; - height: 100vh; - overflow-y: scroll; - overflow-x: none; - } -} diff --git a/canopy/app/src/App.test.js b/canopy/app/src/App.test.js deleted file mode 100644 index b5b318a834..0000000000 --- a/canopy/app/src/App.test.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright 2018-2020 Cargill Incorporated - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import React from 'react'; -import ReactDOM from 'react-dom'; -import App from './App'; - -it('renders without crashing', () => { - const div = document.createElement('div'); - ReactDOM.render(, div); - ReactDOM.unmountComponentAtNode(div); -}); diff --git a/canopy/app/src/images/default.svg b/canopy/app/src/images/default.svg deleted file mode 100644 index 605257279e..0000000000 --- a/canopy/app/src/images/default.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - \ No newline at end of file diff --git a/canopy/app/src/index.css b/canopy/app/src/index.css deleted file mode 100644 index 68761699b3..0000000000 --- a/canopy/app/src/index.css +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Copyright 2018-2020 Cargill Incorporated - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -:root { - --brand-img-url: url('./images/default.svg'); -} - -html { - box-sizing: border-box; -} - -*, -*:before, -*:after { - box-sizing: inherit; -} - -body { - margin: 0; - font-family: var(--fontFamily-primary); - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -code { - font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', - monospace; -} diff --git a/canopy/app/src/index.js b/canopy/app/src/index.js deleted file mode 100644 index aaf5f59eba..0000000000 --- a/canopy/app/src/index.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright 2018-2020 Cargill Incorporated - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import React from 'react'; -import ReactDOM from 'react-dom'; -import './index.css'; -import App from './App'; - -ReactDOM.render(, document.getElementById('root')); diff --git a/canopy/canopyjs/.babelrc b/canopy/canopyjs/.babelrc deleted file mode 100644 index 67d7adc2ae..0000000000 --- a/canopy/canopyjs/.babelrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "presets": ["@babel/preset-react", "@babel/preset-env"], - "plugins": [ - ["@babel/transform-runtime"] - ] -} diff --git a/canopy/canopyjs/.eslintignore b/canopy/canopyjs/.eslintignore deleted file mode 100644 index bf6b87e7aa..0000000000 --- a/canopy/canopyjs/.eslintignore +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright 2018-2020 Cargill Incorporated -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -saplings/* -build/* diff --git a/canopy/canopyjs/.eslintrc b/canopy/canopyjs/.eslintrc deleted file mode 100644 index 361bdf0167..0000000000 --- a/canopy/canopyjs/.eslintrc +++ /dev/null @@ -1,23 +0,0 @@ -{ - "env": { - "es6": true, - "jest": true, - "browser": true - }, - "parserOptions": { - "ecmaVersion": 2020 - }, - "extends": ["airbnb", "plugin:prettier/recommended"], - "rules": { - "react/jsx-filename-extension": 0, - "react/prefer-stateless-function": 0, - "import/prefer-default-export": 0 - }, - "settings": { - "import/resolver": { - "node": { - "paths": ["src"] - } - } - } -} diff --git a/canopy/canopyjs/.prettierrc b/canopy/canopyjs/.prettierrc deleted file mode 100644 index 57a1013229..0000000000 --- a/canopy/canopyjs/.prettierrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "printWidth": 80, - "tabWidth": 2, - "singleQuote": true -} diff --git a/canopy/canopyjs/README.md b/canopy/canopyjs/README.md deleted file mode 100644 index 425fb344eb..0000000000 --- a/canopy/canopyjs/README.md +++ /dev/null @@ -1,125 +0,0 @@ - - -# CanopyJS - -CanopyJS is a library for building Canopy applications. A Canopy application is -a React app that is capable of dynamically loading in saplings, which are UI -components designed to work with Splinter. - -The central component provided by CanopyJS is a React context provider called -`CanopyProvider`. This context provider should wrap the top level component of -a Canopy application. - -## Features - -- Provides functionality for loading saplings into the Canopy application -- Implements some of the functions that are defined in SaplingJS -- Exposes shared configuration to saplings and Canopy application components - -## Configuration - -CanopyJS makes use of two endpoints, `splinterURL` and `saplingURL`. - -### splinterURL - -`splinterURL` is the URL where the Splinter daemon is running. This URL will be -used by Canopy and saplings to interact with Splinter via the Splinter daemon's -REST API. Examples of these interactions would include: -- Submitting transactions to a Scabbard service -- Managing users using the Biome module of Splinter - -### saplingURL - -`saplingURL` is the URL where saplings are being served from. On startup, -canopyJS will attempt to fetch sapling configuration from the following -endpoints: - -- `${saplingURL}/configSaplings`: Config saplings -- `${saplingURL}/userSaplings`: User saplings - -See the example in `splinter/canopy/app/saplings` for an example of these -configuration responses. - -## Example - -### App.js - -```javascript -import React from 'react'; -import { CanopyProvider } from 'canopyjs'; - -import SideNav from './components/SideNav'; - -function CanopyApp() { - return ( - - - - ); -} -export default CanopyApp; -``` - -In this example, `saplingURL` and `splinterURL` are set as React app environment -variables prior to starting up the application. The `SideNav` component gets -wrapped by the `CanopyProvider`, which gives it access to the React context -provided by CanopyJS. - -### SideNav.js - -```javascript -import React from 'react'; -import { useUserSaplings } from 'canopyjs'; - -import NavItem from './NavItem'; - -function SideNav() { - const userSaplings = useUserSaplings(); - const userSaplingRoutes = userSaplings.map( - ({ displayName, namespace, icon }) => { - return { - path: `/${namespace}`, - displayName, - logo: icon - }; - } - ); - const userSaplingTabs = userSaplingRoutes.map( - ({ path, displayName, logo }) => { - return ; - } - ); - - return ( - <> - -

Canopy

-
-
{userSaplingTabs}
- - ); -} - -export default SideNav; -``` - -The `SideNav` component imports `useUserSaplings` from CanopyJS. The -`useUserSaplings` function exposes the part of the Canopy context that contains -user sapling configuration. This allows the `SideNav` component to render -`NavItems` for each of the user saplings. CanopyJS handles mounting the styles -and DOM elements for the currently active sapling. diff --git a/canopy/canopyjs/package.json b/canopy/canopyjs/package.json deleted file mode 100644 index ee6837e35c..0000000000 --- a/canopy/canopyjs/package.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "name": "canopyjs", - "version": "0.0.0-alpha", - "description": "React context provider for building Canopy applications.", - "main": "./build/index.js", - "author": "Cargill Incorporated", - "license": "Apache-2.0", - "private": false, - "repository": { - "type": "git", - "url": "https://github.com/Cargill/splinter", - "directory": "canopy/canopyjs" - }, - "components": "build/index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", - "build": "yarn rollup:build", - "rollup:build": "NODE_ENV=production rollup -c && yarn rollup:clean", - "rollup:clean": "cd build/themes; each '*/index.js' -- rm index.js" - }, - "peerDependencies": { - "@fortawesome/fontawesome-svg-core": "^1.2.25", - "@fortawesome/free-regular-svg-icons": "^5.11.2", - "@fortawesome/free-solid-svg-icons": "^5.12.0", - "@fortawesome/react-fontawesome": "^0.1.8", - "classnames": "^2.2.6", - "react": "^16.10.2", - "react-dom": "^16.10.2" - }, - "dependencies": { - "@babel/runtime": "^7.8.4", - "@fortawesome/fontawesome-svg-core": "^1.2.25", - "@fortawesome/free-regular-svg-icons": "^5.11.2", - "@fortawesome/free-solid-svg-icons": "^5.12.0", - "@fortawesome/react-fontawesome": "^0.1.8", - "classnames": "^2.2.6", - "webpack": "^4.41.5" - }, - "devDependencies": { - "@babel/cli": "^7.8.4", - "@babel/core": "^7.8.4", - "@babel/plugin-transform-runtime": "^7.8.3", - "@babel/preset-env": "^7.8.4", - "@babel/preset-react": "^7.8.3", - "@rollup/plugin-commonjs": "^11.0.2", - "@rollup/plugin-node-resolve": "^7.1.1", - "autoprefixer": "^9.7.0", - "babel-loader": "^8.0.6", - "cli-foreachfile": "^1.0.5", - "eslint": "^6.6.0", - "eslint-config-airbnb": "18.0.1", - "eslint-config-prettier": "^6.4.0", - "eslint-plugin-import": "^2.18.2", - "eslint-plugin-jsx-a11y": "^6.2.3", - "eslint-plugin-prettier": "^3.1.1", - "eslint-plugin-react": "^7.14.3", - "eslint-plugin-react-hooks": "^1.7.0", - "postcss": "^7.0.21", - "postcss-base64": "^0.7.1", - "postcss-clean": "^1.1.0", - "prettier": "^1.18.2", - "react": "^16.10.2", - "react-dom": "^16.10.2", - "rollup": "^1.26.0", - "rollup-plugin-analyzer": "^3.2.2", - "rollup-plugin-babel": "^4.3.3", - "rollup-plugin-peer-deps-external": "^2.2.0", - "rollup-plugin-sass": "^1.2.2", - "rollup-plugin-terser": "^5.1.3", - "rollup-plugin-uglify": "^6.0.4", - "webpack-cli": "^3.3.10" - } -} diff --git a/canopy/canopyjs/rollup.config.js b/canopy/canopyjs/rollup.config.js deleted file mode 100644 index 9e792278c0..0000000000 --- a/canopy/canopyjs/rollup.config.js +++ /dev/null @@ -1,107 +0,0 @@ -/** - * Copyright 2018-2020 Cargill Incorporated - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import sass from 'rollup-plugin-sass'; -import babel from 'rollup-plugin-babel'; -import commonjs from '@rollup/plugin-commonjs'; -import resolve from '@rollup/plugin-node-resolve'; -import external from 'rollup-plugin-peer-deps-external'; -import analyzer from 'rollup-plugin-analyzer'; -import { terser } from 'rollup-plugin-terser'; -import { uglify } from 'rollup-plugin-uglify'; -import autoprefixer from 'autoprefixer'; -import postcss from 'postcss'; -import base64 from 'postcss-base64'; -import clean from 'postcss-clean'; -import fs from 'fs'; -import packageJSON from './package.json'; - -const themes = fs.readdirSync('./src/themes'); -const components = './src/index.js'; -const minifyExtension = pathToFile => pathToFile.replace(/\.js$/, '.min.js'); - -const opts = { - extensions: ['.png', '.svg'] -}; - -const themeBundles = themes.map(theme => { - return { - input: `./src/themes/${theme}/index.js`, - output: { - file: `build/themes/${theme}/index.js`, - format: 'esm' - }, - plugins: [ - sass({ - output: true, - processor: css => - postcss([autoprefixer, base64(opts), clean()]) - .process(css) - .then(result => result.css) - }) - ] - }; -}); - -export default [ - // style themes - ...themeBundles, - // commonjs - { - input: components, - output: { - file: packageJSON.components, - format: 'cjs', - sourcemap: true - }, - plugins: [ - babel({ - exclude: '/node_modules/**', - runtimeHelpers: true - }), - external(), - resolve(), - commonjs({ - namedExports: { - 'react-is': ['isValidElementType'] - } - }), - analyzer() - ] - }, - { - input: components, - output: { - file: minifyExtension(packageJSON.components), - format: 'cjs', - sourcemap: true - }, - plugins: [ - babel({ - exclude: 'node_modules/**', - runtimeHelpers: true - }), - external(), - resolve(), - commonjs({ - namedExports: { - 'react-is': ['isValidElementType'] - } - }), - uglify(), - analyzer() - ] - } -]; diff --git a/canopy/canopyjs/src/CanopyContext.js b/canopy/canopyjs/src/CanopyContext.js deleted file mode 100644 index 626b869aed..0000000000 --- a/canopy/canopyjs/src/CanopyContext.js +++ /dev/null @@ -1,113 +0,0 @@ -/** - * Copyright 2018-2020 Cargill Incorporated - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import React, { useState, createContext, useContext, useEffect } from 'react'; -import { get } from './request'; - -import { - mountCurrentSapling, - mountSaplingStyles, - mountConfigSaplings -} from './loadSaplings'; - -export const CanopyContext = createContext({}); - -const fetchUserSaplings = async saplingURL => { - const response = await get(`${saplingURL}/userSaplings`); - const userSaplingsResponse = response.json; - return userSaplingsResponse; -}; - -const fetchConfigSaplings = async saplingURL => { - const response = await get(`${saplingURL}/configSaplings`); - const configSaplingsResponse = response.json; - return configSaplingsResponse; -}; - -export function CanopyProvider({ saplingURL, splinterURL, children }) { - const [userSaplings, setUserSaplings] = useState([]); - const [configSaplings, setConfigSaplings] = useState({}); - - const sessionUser = window.sessionStorage.getItem('CANOPY_USER'); - const [user, setUser] = useState( - sessionUser ? JSON.parse(sessionUser) : null - ); - - window.$CANOPY.getSharedConfig = () => { - return { - canopyConfig: { - splinterURL, - saplingURL - } - }; - }; - window.$CANOPY.setUser = canopyUser => { - window.sessionStorage.setItem('CANOPY_USER', JSON.stringify(canopyUser)); - setUser(canopyUser); - }; - - window.$CANOPY.getUser = () => user; - - useEffect(() => { - window.$CANOPY = window.$CANOPY || {}; - window.$CANOPY.registerApp = bootStrapFunction => { - bootStrapFunction(document.querySelector('#sapling-container')); - }; - - fetchConfigSaplings(saplingURL).then(saplings => { - mountConfigSaplings(saplings); - mountSaplingStyles(saplings); - }); - }, [saplingURL]); - - useEffect(() => { - window.$CANOPY.registerConfigSapling = (namespace, bootStrapFunction) => { - bootStrapFunction(); - return setConfigSaplings(currentConfigSaplings => { - return { ...currentConfigSaplings, [namespace]: bootStrapFunction }; - }); - }; - }, []); - - useEffect(() => { - fetchUserSaplings(saplingURL).then(saplings => { - mountSaplingStyles(saplings); - mountCurrentSapling(saplings); - setUserSaplings(saplings); - }); - }, [saplingURL]); - - return ( - - {children} - - ); -} - -export function useUserSaplings() { - const context = useContext(CanopyContext); - return context.userSaplings; -} - -export function useConfigSaplings() { - const context = useContext(CanopyContext); - return context.userSaplings; -} - -export function useUser() { - const context = React.useContext(CanopyContext); - return context.user; -} diff --git a/canopy/canopyjs/src/components/index.js b/canopy/canopyjs/src/components/index.js deleted file mode 100644 index fd0ed57e82..0000000000 --- a/canopy/canopyjs/src/components/index.js +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Copyright 2018-2020 Cargill Incorporated - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export { NavItem } from './navigation/NavItem'; -export { SideNav } from './navigation/SideNav'; -export { Progress } from './progress/Progress'; -export { TabBox } from './tabBox/TabBox'; diff --git a/canopy/canopyjs/src/components/navigation/NavItem.js b/canopy/canopyjs/src/components/navigation/NavItem.js deleted file mode 100644 index 5616bb227a..0000000000 --- a/canopy/canopyjs/src/components/navigation/NavItem.js +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Copyright 2018-2020 Cargill Incorporated - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import React from 'react'; -import PropTypes from 'prop-types'; -import classnames from 'classnames'; - -export const NavItem = (props) => { - const { path, logo, label } = props; - - const classes = classnames('nav-tab', { - 'page-active': path === `/${window.location.pathname.split('/')[1]}` - }); - - return ( - - logo -
{label}
-
- ); -} - -NavItem.propTypes = { - label: PropTypes.string.isRequired, - logo: PropTypes.string.isRequired, - path: PropTypes.string.isRequired -}; diff --git a/canopy/canopyjs/src/components/navigation/SideNav.js b/canopy/canopyjs/src/components/navigation/SideNav.js deleted file mode 100644 index bd2a31de00..0000000000 --- a/canopy/canopyjs/src/components/navigation/SideNav.js +++ /dev/null @@ -1,69 +0,0 @@ -/** - * Copyright 2018-2020 Cargill Incorporated - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import React from 'react'; -import classnames from 'classnames'; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { useUserSaplings } from '../../CanopyContext'; - -import { NavItem } from './NavItem'; - -export const SideNav = () => { - const makeUserSaplingTabs = ( userSaplings ) => userSaplings.map( - ({ displayName, namespace, icon }) => { - return { - path: `/${namespace}`, - displayName, - logo: icon - }; - }) - .map( - ({ path, displayName, logo }) => { - return ; - } - ); - - return ( - <> - -
- -
- {makeUserSaplingTabs(useUserSaplings())} -
-
- -
Saplings
-
-
-
- -
- - ); -} - -function ProfileTab() { - const profileClasses = classnames('profile-tab', 'tab', { - 'page-active': `${window.location.pathname.split('/')[1]}` === 'profile' - }); - - return ( - - - - ); -} diff --git a/canopy/canopyjs/src/components/navigation/SideNav.scss b/canopy/canopyjs/src/components/navigation/SideNav.scss deleted file mode 100644 index 8a33fad40b..0000000000 --- a/canopy/canopyjs/src/components/navigation/SideNav.scss +++ /dev/null @@ -1,115 +0,0 @@ -/** - * Copyright 2018-2020 Cargill Incorporated - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - .side-nav { - display: flex; - flex-direction: column; - position: relative; - top: 0; - left: 0; - width: 100px; - height: 100vh; - background: #e5e5e5; - - hr { - margin: 0; - border: 0; - width: 100%; - height: 1px; - - &.bottom { - margin-top: auto; - } - } -} - -.brand { - display: flex; - flex-direction: column; - align-items: center; - text-decoration: none; - width: 100px; - height: 100px; - background-image: var(--brand-img-url); - background-size: 80px 80px; - background-position: center; - background-repeat: no-repeat; -} - -.nav-items { - margin-top: 3rem; - display: flex; - flex-direction: column; - - .nav-tab { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - width: 100px; - height: 100px; - text-decoration: none; - color: #555555; - transition: $transitionDuration-s; - - .icon { - width: 40px; - height: 40px; - } - - .label { - margin-top: 12px; - } - - &:hover { - color: rgba($color: #ffffff, $alpha: 0.9); - background: #333333; - cursor: pointer; - } - } - - hr { - background-color: #c4c4c4; - height: 2px; - width: 60%; - margin: 24px 0; - align-self: center; - } -} - -.canopy-items { - display: flex; - justify-self: flex-end; - flex-direction: column; - justify-content: center; - margin-top: auto; - - .tab { - .icon { - width: 40px; - height: 40px; - margin: 30px; - color: #555555; - transition: $transitionDuration-s; - } - - &:hover { - .icon { - color: #333333; - } - } - } -} diff --git a/canopy/canopyjs/src/components/progress/Progress.js b/canopy/canopyjs/src/components/progress/Progress.js deleted file mode 100644 index 0a5cf62d66..0000000000 --- a/canopy/canopyjs/src/components/progress/Progress.js +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Copyright 2018-2020 Cargill Incorporated - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import React from 'react'; -import PropTypes from 'prop-types'; - -export function Progress({ max, value }) { - return ; -} - -Progress.propTypes = { - max: PropTypes.number.isRequired, - value: PropTypes.number.isRequired -}; diff --git a/canopy/canopyjs/src/components/progress/Progress.scss b/canopy/canopyjs/src/components/progress/Progress.scss deleted file mode 100644 index 7102fff1bd..0000000000 --- a/canopy/canopyjs/src/components/progress/Progress.scss +++ /dev/null @@ -1,79 +0,0 @@ -/** - * Copyright 2018-2020 Cargill Incorporated - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -$progress-size: 6rem; - -$progress-colors: ( - 'background': $color-primary, - 'gutter': $background-light, - 'leaf': $color-primary-light -); - -@function asRGBString($color) { - @return 'rgb(' + red($color) + ',' + green($color) + ',' + blue($color) + ')'; -} - -@function makeLoadingSvg($colorKey) { - $svg-ns: 'xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"'; - $svgMime: 'data:image/svg+xml;utf8,'; - $svgDimensions: 'height="100" width="100" viewBox="-10 -10 120 120"'; - $svgOpen: ''; - $svgClose: ''; - $d: 'M 85,8 C 18,20 -6,29 20,73 L 10,88 L 15,93 L 30,78 C 93,98 98,62, 85,8 z M 70,30 C 56,38 43,47 40,60 L 35,55 C 44,41 56,34 70,30 z'; - $path: ''; - @return url($svgMime+$svgOpen+$path+$svgClose); -} - -@mixin progressGutter { - border-radius: 50%; - background-color: map-get($progress-colors, 'background'); - background-size: cover; - background-image: makeLoadingSvg('gutter'); -} - -@mixin progressLeaf { - background-color: transparent; - background-size: cover; - background-image: makeLoadingSvg('leaf'); -} - -progress.progress { - appearance: none; - border: none; - width: $progress-size; - height: $progress-size; - @include progressGutter; - - &[value] { - border-radius: 50%; - color: map-get($progress-colors, 'leaf'); - background-color: map-get($progress-colors, 'background'); - } - - &[value]::-webkit-progress-bar { - @include progressGutter; - } - - &[value]::-webkit-progress-value { - @include progressLeaf; - } - - &[value]::-moz-progress-bar { - @include progressLeaf; - } -} diff --git a/canopy/canopyjs/src/components/tabBox/TabBox.js b/canopy/canopyjs/src/components/tabBox/TabBox.js deleted file mode 100644 index 5ad1d63777..0000000000 --- a/canopy/canopyjs/src/components/tabBox/TabBox.js +++ /dev/null @@ -1,73 +0,0 @@ -/** - * Copyright 2018-2020 Cargill Incorporated - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import React, { useState } from 'react'; -import classnames from 'classnames'; -import PropTypes from 'prop-types'; - -export function TabBox({ contents, keyExtractor }) { - const titles = contents.map(({ title }) => title); - const contentElements = contents.map(({ content }) => content); - const keys = contents.map(keyExtractor); - - const [selectedTab, setSelectedTab] = useState(0); - const Content = - contentElements[selectedTab] && - typeof contentElements[selectedTab] === 'string' - ? () => <>{contentElements[selectedTab]} - : contentElements[selectedTab]; - - return ( -
-
- {titles.map((title, index) => { - const Title = title; - const selected = index === selectedTab; - return ( - + ); +}; diff --git a/src/components/navigation/SideNav.js b/src/components/navigation/SideNav.js index 5e19504d46..f683c268c7 100644 --- a/src/components/navigation/SideNav.js +++ b/src/components/navigation/SideNav.js @@ -17,6 +17,7 @@ import React from 'react'; import classnames from 'classnames'; import Icon from '@material-ui/core/Icon'; +import { Logout } from './Logout'; import { useUserSaplings } from '../../CanopyContext'; import { NavItem } from './NavItem'; @@ -73,6 +74,7 @@ function ProfileTab() {
Profile
+ ); } diff --git a/src/components/navigation/SideNav.scss b/src/components/navigation/SideNav.scss index d97a3e84cc..64e4a0d8c1 100644 --- a/src/components/navigation/SideNav.scss +++ b/src/components/navigation/SideNav.scss @@ -166,6 +166,19 @@ } } + .Logout { + width: 0; + height: 0; + background: none; + overflow: hidden; + position: absolute; + border: unset; + display: flex; + align-items: center; + flex-direction: column; + text-decoration: none; + } + .label { margin-top: 5px; font-size: 11px; @@ -181,6 +194,31 @@ color: var(--color-primary-light); } } + .Logout { + width: 75px; + height: 75px; + margin-bottom: 144px; + outline: none; + + .border { + border: none; + } + + .icon { + color: var(--color-primary); + } + + &:hover { + .border { + border: 3px solid #999999; + + .icon { + color: var(--color-primary-light); + cursor: pointer; + } + } + } + } } } From efd9333b9a0f72dbf61dc18ee2651c955e743baf Mon Sep 17 00:00:00 2001 From: Davey Newhall Date: Thu, 8 Apr 2021 15:20:43 -0500 Subject: [PATCH 54/69] Update babel preset-env version This updates the minimum patch version for the @babel/preset-env package. The previous version was causing compilation issues. Signed-off-by: Davey Newhall --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 86b34a856a..08d028383f 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "@babel/cli": "^7.8.4", "@babel/core": "^7.8.4", "@babel/plugin-transform-runtime": "^7.8.3", - "@babel/preset-env": "^7.8.4", + "@babel/preset-env": "^7.8.7", "@babel/preset-react": "^7.8.3", "@rollup/plugin-commonjs": "^11.0.2", "@rollup/plugin-node-resolve": "^7.1.1", From 2d972b30b56589ecd34b6686d234af3d5d15f260 Mon Sep 17 00:00:00 2001 From: Davey Newhall Date: Thu, 8 Apr 2021 15:24:42 -0500 Subject: [PATCH 55/69] Add custom icon support to sidebar This adds support for custom icons for a sapling in the sidebar. These custom icons are specified by setting the image field in a sapling's entry in the sapling manifest with a URL to the image. The custom image takes precedence over an icon set with the icon field but at least one of these fields is required. Signed-off-by: Davey Newhall --- src/components/navigation/NavItem.js | 35 +++++++++++++++++++++++--- src/components/navigation/SideNav.js | 17 +++++++++---- src/components/navigation/SideNav.scss | 9 +++++++ 3 files changed, 53 insertions(+), 8 deletions(-) diff --git a/src/components/navigation/NavItem.js b/src/components/navigation/NavItem.js index e75d8c60c1..9521e251ba 100644 --- a/src/components/navigation/NavItem.js +++ b/src/components/navigation/NavItem.js @@ -20,7 +20,7 @@ import classnames from 'classnames'; import Icon from '@material-ui/core/Icon'; export const NavItem = props => { - const { path, logo, label } = props; + const { path, icon, label, logo } = props; const classes = classnames('nav-tab', { 'page-active': path === `/${window.location.pathname.split('/')[1]}` @@ -30,7 +30,11 @@ export const NavItem = props => {
- {logo} + {logo ? ( + {label} + ) : ( + {icon} + )}
{label}
@@ -38,8 +42,33 @@ export const NavItem = props => { ); }; +const iconImagePropsCheck = (props, propName, componentName) => { + if (!props.icon && !props.logo) { + return new Error( + `One of 'logo' or 'icon' is required by '${componentName}' component` + ); + } + + if ( + typeof props[propName] !== 'string' && + typeof props[propName] !== 'undefined' + ) { + return new Error( + `Invalid prop '${propName}' passed to '${componentName}': must be a string` + ); + } + + return true; +}; + NavItem.propTypes = { + icon: iconImagePropsCheck, label: PropTypes.string.isRequired, - logo: PropTypes.string.isRequired, + logo: iconImagePropsCheck, path: PropTypes.string.isRequired }; + +NavItem.defaultProps = { + icon: undefined, + logo: undefined +}; diff --git a/src/components/navigation/SideNav.js b/src/components/navigation/SideNav.js index f683c268c7..722c7884c4 100644 --- a/src/components/navigation/SideNav.js +++ b/src/components/navigation/SideNav.js @@ -25,16 +25,23 @@ import { NavItem } from './NavItem'; export const SideNav = () => { const makeUserSaplingTabs = userSaplings => userSaplings - .map(({ displayName, namespace, icon }) => { + .map(({ displayName, namespace, icon, logo }) => { return { path: `/${namespace}`, displayName, - logo: icon + icon, + logo }; }) - .map(({ path, displayName, logo }) => { + .map(({ path, displayName, icon, logo }) => { return ( - + ); }); @@ -48,7 +55,7 @@ export const SideNav = () => {
- eco_icon + eco_icon
Saplings
diff --git a/src/components/navigation/SideNav.scss b/src/components/navigation/SideNav.scss index 64e4a0d8c1..bdc92e0dbf 100644 --- a/src/components/navigation/SideNav.scss +++ b/src/components/navigation/SideNav.scss @@ -87,6 +87,15 @@ border-radius: 10px; outline: none; transition: $transitionDuration-s; + + .brand-logo { + width: 1em; + height: 1em; + overflow: hidden; + font-size: 1.5rem; + flex-shrink: 0; + user-select: none; + } } } From 6420fb3cde3bb2ab3d969a9765b3e8ad0e0cc5e4 Mon Sep 17 00:00:00 2001 From: Ryan Beck-Buysse Date: Fri, 7 May 2021 13:31:32 -0500 Subject: [PATCH 56/69] Disable Travis CI builds GitHub actions will be used going forward instead of Travis. Signed-off-by: Ryan Beck-Buysse --- .travis.yml | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5528fa1a82..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright 2018-2020 Cargill Incorporated -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -services: - - docker - -env: - global: - - ISOLATION_ID=$TRAVIS_BUILD_ID - - VERSION=AUTO_STRICT - -before_install: - - sudo rm /usr/local/bin/docker-compose - - curl -L https://github.com/docker/compose/releases/download/1.23.2/docker-compose-`uname -s`-`uname -m` > docker-compose - - chmod +x docker-compose - - sudo mv docker-compose /usr/local/bin -addons: - apt: - packages: - - docker-ce - -jobs: - include: - - stage: Lint/Unit Test - script: - - docker-compose -f docker/compose/run-lint.yaml up --abort-on-container-exit lint-canopyjs From 168b2615988c8ecd7bd6945119ce9a061d59bf12 Mon Sep 17 00:00:00 2001 From: Ryan Beck-Buysse Date: Fri, 7 May 2021 13:33:15 -0500 Subject: [PATCH 57/69] Add GitHub Actions workflow files The Splinter project is working to transition from Travis CI to GitHub Actions. Signed-off-by: Ryan Beck-Buysse --- .github/workflows/ci.yaml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000000..41c1a75ee9 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,39 @@ +# Copyright 2021 Cargill Incorporated +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: CI + +on: [push, pull_request] + +env: + CARGO_TERM_COLOR: always + ISOLATION_ID: latest + +jobs: + + run_lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Lint SaplingJS + run: docker-compose -f docker/compose/run-lint.yaml up --abort-on-container-exit lint-saplingjs + + unit_test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Test SaplingJS + run: docker-compose -f tests/test-splinter.yaml up --abort-on-container-exit unit-test-saplingjs From d3fdb89d94e2be5c2e21428772c26590333cb0da Mon Sep 17 00:00:00 2001 From: Ryan Beck-Buysse Date: Fri, 7 May 2021 13:37:58 -0500 Subject: [PATCH 58/69] Disable Travis CI builds GitHub actions will be used going forward instead of Travis. Signed-off-by: Ryan Beck-Buysse --- .travis.yml | 38 -------------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7ef9483a1f..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright 2018-2020 Cargill Incorporated -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -services: - - docker - -env: - global: - - ISOLATION_ID=$TRAVIS_BUILD_ID - - VERSION=AUTO_STRICT - -before_install: - - sudo rm /usr/local/bin/docker-compose - - curl -L https://github.com/docker/compose/releases/download/1.23.2/docker-compose-`uname -s`-`uname -m` > docker-compose - - chmod +x docker-compose - - sudo mv docker-compose /usr/local/bin -addons: - apt: - packages: - - docker-ce - -jobs: - include: - - stage: Lint/Unit Test - script: - - docker-compose -f tests/test-splinter.yaml up --abort-on-container-exit unit-test-saplingjs - - docker-compose -f docker/compose/run-lint.yaml up --abort-on-container-exit lint-saplingjs From 0baa141ee1883e4634ce2d7e8076abed01e20c4c Mon Sep 17 00:00:00 2001 From: Ryan Beck-Buysse Date: Fri, 7 May 2021 10:29:31 -0500 Subject: [PATCH 59/69] Add GitHub Actions workflow files The Splinter project is working to transition from Travis CI to GitHub Actions. Signed-off-by: Ryan Beck-Buysse --- .github/workflows/ci.yaml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000000..4a6d9d9b2c --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,34 @@ +# Copyright 2021 Cargill Incorporated +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: CI + +on: [push, pull_request] + +env: + CARGO_TERM_COLOR: always + ISOLATION_ID: latest + +jobs: + + run_lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Display envvars + run: env + + - name: Lint CanopyJS + run: docker-compose -f docker/compose/run-lint.yaml up --abort-on-container-exit lint-canopyjs From cc6f76554d658d29dda615541677f9a5f1fdf93d Mon Sep 17 00:00:00 2001 From: Ryan Beck-Buysse Date: Wed, 12 May 2021 08:04:13 -0500 Subject: [PATCH 60/69] Add additional .env file As of version 1.28.0, Docker Compose expects .env files to reside in the same directory as the compose files or to have their path specicified with an additional argument to the compose command. Duplicating the .env files whereever they're needed was deemed to be the least disruptive solution. Signed-off-by: Ryan Beck-Buysse --- docker/compose/.env | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 docker/compose/.env diff --git a/docker/compose/.env b/docker/compose/.env new file mode 100644 index 0000000000..cbe9914025 --- /dev/null +++ b/docker/compose/.env @@ -0,0 +1,17 @@ +# Copyright 2018-2020 Cargill Incorporated +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +ISOLATION_ID=latest +DISTRO=bionic +REPO_VERSION=0.3.12-dev From 72e0e8692b24ae0a9730d5a1e3e317f44877334c Mon Sep 17 00:00:00 2001 From: Ryan Beck-Buysse Date: Wed, 12 May 2021 08:05:05 -0500 Subject: [PATCH 61/69] Add additional .env file As of version 1.28.0, Docker Compose expects .env files to reside in the same directory as the compose files or to have their path specicified with an additional argument to the compose command. Duplicating the .env files whereever they're needed was deemed to be the least disruptive solution. Signed-off-by: Ryan Beck-Buysse --- docker/compose/.env | 17 +++++++++++++++++ tests/.env | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 docker/compose/.env create mode 100644 tests/.env diff --git a/docker/compose/.env b/docker/compose/.env new file mode 100644 index 0000000000..cbe9914025 --- /dev/null +++ b/docker/compose/.env @@ -0,0 +1,17 @@ +# Copyright 2018-2020 Cargill Incorporated +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +ISOLATION_ID=latest +DISTRO=bionic +REPO_VERSION=0.3.12-dev diff --git a/tests/.env b/tests/.env new file mode 100644 index 0000000000..cbe9914025 --- /dev/null +++ b/tests/.env @@ -0,0 +1,17 @@ +# Copyright 2018-2020 Cargill Incorporated +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +ISOLATION_ID=latest +DISTRO=bionic +REPO_VERSION=0.3.12-dev From 2df20e6ba53a01575e299324aa03ce9370f47c14 Mon Sep 17 00:00:00 2001 From: Darian Plumb Date: Wed, 30 Jun 2021 11:27:32 -0500 Subject: [PATCH 62/69] Remove Sapling nav tab Currently this button doesn't do anything. It should be removed until there is some Sapling selector functionality that would use it. Signed-off-by: Darian Plumb --- src/components/navigation/SideNav.js | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/components/navigation/SideNav.js b/src/components/navigation/SideNav.js index 722c7884c4..d77bbc1d14 100644 --- a/src/components/navigation/SideNav.js +++ b/src/components/navigation/SideNav.js @@ -50,17 +50,7 @@ export const SideNav = () => {
-
- {makeUserSaplingTabs(useUserSaplings())} -
-
-
- eco_icon -
-
-
Saplings
-
-
+
{makeUserSaplingTabs(useUserSaplings())}
From ee2eef6aabea795661b4530631798fb65ea19582 Mon Sep 17 00:00:00 2001 From: Ryan Beck-Buysse Date: Mon, 16 Aug 2021 12:50:36 -0500 Subject: [PATCH 63/69] Trigger builds at 10am UTC Signed-off-by: Ryan Beck-Buysse --- .github/workflows/ci.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4a6d9d9b2c..d59f2e6094 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -14,7 +14,11 @@ name: CI -on: [push, pull_request] +on: + push: + pull_request: + schedule: + - cron: "0 10 * * *" env: CARGO_TERM_COLOR: always From ac8a382e285e14f585705bbebddea0471531a011 Mon Sep 17 00:00:00 2001 From: Ryan Beck-Buysse Date: Mon, 16 Aug 2021 14:05:09 -0500 Subject: [PATCH 64/69] Trigger builds at 10am UTC Signed-off-by: Ryan Beck-Buysse --- .github/workflows/ci.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 41c1a75ee9..c8c306e339 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -14,7 +14,11 @@ name: CI -on: [push, pull_request] +on: + push: + pull_request: + schedule: + - cron: "0 10 * * *" env: CARGO_TERM_COLOR: always From 66dc31dda06f565f171c7bf4748177b8a7dd449b Mon Sep 17 00:00:00 2001 From: Amelia Bradley Date: Fri, 29 Jul 2022 17:20:55 -0500 Subject: [PATCH 65/69] Move contents to saplingjs folder Signed-off-by: Amelia Bradley --- .dockerignore => ui/saplingjs/.dockerignore | 0 .env => ui/saplingjs/.env | 0 .eslintrc => ui/saplingjs/.eslintrc | 0 {.github => ui/saplingjs/.github}/workflows/ci.yaml | 0 .gitignore => ui/saplingjs/.gitignore | 0 .prettierrc => ui/saplingjs/.prettierrc | 0 CODEOWNERS => ui/saplingjs/CODEOWNERS | 0 Dockerfile => ui/saplingjs/Dockerfile | 0 LICENSE => ui/saplingjs/LICENSE | 0 MAINTAINERS.md => ui/saplingjs/MAINTAINERS.md | 0 README.md => ui/saplingjs/README.md | 0 VERSION => ui/saplingjs/VERSION | 0 {bin => ui/saplingjs/bin}/get_version | 0 {docker => ui/saplingjs/docker}/compose/.env | 0 {docker => ui/saplingjs/docker}/compose/run-lint.yaml | 0 jest.config.js => ui/saplingjs/jest.config.js | 0 package.json => ui/saplingjs/package.json | 0 {src => ui/saplingjs/src}/crypto.ts | 0 {src => ui/saplingjs/src}/index.spec.ts | 0 {src => ui/saplingjs/src}/index.ts | 0 {src => ui/saplingjs/src}/submitter.ts | 0 {tests => ui/saplingjs/tests}/.env | 0 {tests => ui/saplingjs/tests}/test-splinter.yaml | 0 tsconfig.json => ui/saplingjs/tsconfig.json | 0 24 files changed, 0 insertions(+), 0 deletions(-) rename .dockerignore => ui/saplingjs/.dockerignore (100%) rename .env => ui/saplingjs/.env (100%) rename .eslintrc => ui/saplingjs/.eslintrc (100%) rename {.github => ui/saplingjs/.github}/workflows/ci.yaml (100%) rename .gitignore => ui/saplingjs/.gitignore (100%) rename .prettierrc => ui/saplingjs/.prettierrc (100%) rename CODEOWNERS => ui/saplingjs/CODEOWNERS (100%) rename Dockerfile => ui/saplingjs/Dockerfile (100%) rename LICENSE => ui/saplingjs/LICENSE (100%) rename MAINTAINERS.md => ui/saplingjs/MAINTAINERS.md (100%) rename README.md => ui/saplingjs/README.md (100%) rename VERSION => ui/saplingjs/VERSION (100%) rename {bin => ui/saplingjs/bin}/get_version (100%) rename {docker => ui/saplingjs/docker}/compose/.env (100%) rename {docker => ui/saplingjs/docker}/compose/run-lint.yaml (100%) rename jest.config.js => ui/saplingjs/jest.config.js (100%) rename package.json => ui/saplingjs/package.json (100%) rename {src => ui/saplingjs/src}/crypto.ts (100%) rename {src => ui/saplingjs/src}/index.spec.ts (100%) rename {src => ui/saplingjs/src}/index.ts (100%) rename {src => ui/saplingjs/src}/submitter.ts (100%) rename {tests => ui/saplingjs/tests}/.env (100%) rename {tests => ui/saplingjs/tests}/test-splinter.yaml (100%) rename tsconfig.json => ui/saplingjs/tsconfig.json (100%) diff --git a/.dockerignore b/ui/saplingjs/.dockerignore similarity index 100% rename from .dockerignore rename to ui/saplingjs/.dockerignore diff --git a/.env b/ui/saplingjs/.env similarity index 100% rename from .env rename to ui/saplingjs/.env diff --git a/.eslintrc b/ui/saplingjs/.eslintrc similarity index 100% rename from .eslintrc rename to ui/saplingjs/.eslintrc diff --git a/.github/workflows/ci.yaml b/ui/saplingjs/.github/workflows/ci.yaml similarity index 100% rename from .github/workflows/ci.yaml rename to ui/saplingjs/.github/workflows/ci.yaml diff --git a/.gitignore b/ui/saplingjs/.gitignore similarity index 100% rename from .gitignore rename to ui/saplingjs/.gitignore diff --git a/.prettierrc b/ui/saplingjs/.prettierrc similarity index 100% rename from .prettierrc rename to ui/saplingjs/.prettierrc diff --git a/CODEOWNERS b/ui/saplingjs/CODEOWNERS similarity index 100% rename from CODEOWNERS rename to ui/saplingjs/CODEOWNERS diff --git a/Dockerfile b/ui/saplingjs/Dockerfile similarity index 100% rename from Dockerfile rename to ui/saplingjs/Dockerfile diff --git a/LICENSE b/ui/saplingjs/LICENSE similarity index 100% rename from LICENSE rename to ui/saplingjs/LICENSE diff --git a/MAINTAINERS.md b/ui/saplingjs/MAINTAINERS.md similarity index 100% rename from MAINTAINERS.md rename to ui/saplingjs/MAINTAINERS.md diff --git a/README.md b/ui/saplingjs/README.md similarity index 100% rename from README.md rename to ui/saplingjs/README.md diff --git a/VERSION b/ui/saplingjs/VERSION similarity index 100% rename from VERSION rename to ui/saplingjs/VERSION diff --git a/bin/get_version b/ui/saplingjs/bin/get_version similarity index 100% rename from bin/get_version rename to ui/saplingjs/bin/get_version diff --git a/docker/compose/.env b/ui/saplingjs/docker/compose/.env similarity index 100% rename from docker/compose/.env rename to ui/saplingjs/docker/compose/.env diff --git a/docker/compose/run-lint.yaml b/ui/saplingjs/docker/compose/run-lint.yaml similarity index 100% rename from docker/compose/run-lint.yaml rename to ui/saplingjs/docker/compose/run-lint.yaml diff --git a/jest.config.js b/ui/saplingjs/jest.config.js similarity index 100% rename from jest.config.js rename to ui/saplingjs/jest.config.js diff --git a/package.json b/ui/saplingjs/package.json similarity index 100% rename from package.json rename to ui/saplingjs/package.json diff --git a/src/crypto.ts b/ui/saplingjs/src/crypto.ts similarity index 100% rename from src/crypto.ts rename to ui/saplingjs/src/crypto.ts diff --git a/src/index.spec.ts b/ui/saplingjs/src/index.spec.ts similarity index 100% rename from src/index.spec.ts rename to ui/saplingjs/src/index.spec.ts diff --git a/src/index.ts b/ui/saplingjs/src/index.ts similarity index 100% rename from src/index.ts rename to ui/saplingjs/src/index.ts diff --git a/src/submitter.ts b/ui/saplingjs/src/submitter.ts similarity index 100% rename from src/submitter.ts rename to ui/saplingjs/src/submitter.ts diff --git a/tests/.env b/ui/saplingjs/tests/.env similarity index 100% rename from tests/.env rename to ui/saplingjs/tests/.env diff --git a/tests/test-splinter.yaml b/ui/saplingjs/tests/test-splinter.yaml similarity index 100% rename from tests/test-splinter.yaml rename to ui/saplingjs/tests/test-splinter.yaml diff --git a/tsconfig.json b/ui/saplingjs/tsconfig.json similarity index 100% rename from tsconfig.json rename to ui/saplingjs/tsconfig.json From 8ce738e072cb27ce475f3b393f911094ca083e08 Mon Sep 17 00:00:00 2001 From: Amelia Bradley Date: Fri, 29 Jul 2022 17:20:55 -0500 Subject: [PATCH 66/69] Move contents to canopyjs folder Signed-off-by: Amelia Bradley --- .babelrc => ui/canopyjs/.babelrc | 0 .dockerignore => ui/canopyjs/.dockerignore | 0 .env => ui/canopyjs/.env | 0 .eslintignore => ui/canopyjs/.eslintignore | 0 .eslintrc => ui/canopyjs/.eslintrc | 0 {.github => ui/canopyjs/.github}/workflows/ci.yaml | 0 .gitignore => ui/canopyjs/.gitignore | 0 .prettierrc => ui/canopyjs/.prettierrc | 0 CODEOWNERS => ui/canopyjs/CODEOWNERS | 0 Dockerfile => ui/canopyjs/Dockerfile | 0 LICENSE => ui/canopyjs/LICENSE | 0 MAINTAINERS.md => ui/canopyjs/MAINTAINERS.md | 0 README.md => ui/canopyjs/README.md | 0 {bin => ui/canopyjs/bin}/get_version | 0 {docker => ui/canopyjs/docker}/compose/.env | 0 {docker => ui/canopyjs/docker}/compose/run-lint.yaml | 0 package.json => ui/canopyjs/package.json | 0 rollup.config.js => ui/canopyjs/rollup.config.js | 0 {src => ui/canopyjs/src}/CanopyContext.js | 0 {src => ui/canopyjs/src}/components/button/Button.scss | 0 {src => ui/canopyjs/src}/components/forms/AuthForm.scss | 0 {src => ui/canopyjs/src}/components/index.js | 0 {src => ui/canopyjs/src}/components/input/Input.js | 0 {src => ui/canopyjs/src}/components/input/Input.scss | 0 {src => ui/canopyjs/src}/components/navigation/Logout.js | 0 {src => ui/canopyjs/src}/components/navigation/NavItem.js | 0 {src => ui/canopyjs/src}/components/navigation/SideNav.js | 0 {src => ui/canopyjs/src}/components/navigation/SideNav.scss | 0 {src => ui/canopyjs/src}/components/progress/Progress.js | 0 {src => ui/canopyjs/src}/components/progress/Progress.scss | 0 {src => ui/canopyjs/src}/components/tabBox/TabBox.js | 0 {src => ui/canopyjs/src}/components/tabBox/TabBox.scss | 0 {src => ui/canopyjs/src}/index.js | 0 {src => ui/canopyjs/src}/loadSaplings.js | 0 {src => ui/canopyjs/src}/promiseLoader.js | 0 {src => ui/canopyjs/src}/request.js | 0 {src => ui/canopyjs/src}/styleLoader.js | 0 {src => ui/canopyjs/src}/styles/colors.scss | 0 {src => ui/canopyjs/src}/styles/components.scss | 0 {src => ui/canopyjs/src}/styles/core.scss | 0 {src => ui/canopyjs/src}/styles/layout.scss | 0 {src => ui/canopyjs/src}/styles/mixins.scss | 0 {src => ui/canopyjs/src}/styles/navigation.scss | 0 {src => ui/canopyjs/src}/themes/default/colors.scss | 0 {src => ui/canopyjs/src}/themes/default/index.js | 0 {src => ui/canopyjs/src}/themes/default/index.scss | 0 {src => ui/canopyjs/src}/themes/default/sizes.scss | 0 {src => ui/canopyjs/src}/themes/default/timings.scss | 0 {src => ui/canopyjs/src}/themes/default/typography.scss | 0 {src => ui/canopyjs/src}/themes/default/variables.scss | 0 50 files changed, 0 insertions(+), 0 deletions(-) rename .babelrc => ui/canopyjs/.babelrc (100%) rename .dockerignore => ui/canopyjs/.dockerignore (100%) rename .env => ui/canopyjs/.env (100%) rename .eslintignore => ui/canopyjs/.eslintignore (100%) rename .eslintrc => ui/canopyjs/.eslintrc (100%) rename {.github => ui/canopyjs/.github}/workflows/ci.yaml (100%) rename .gitignore => ui/canopyjs/.gitignore (100%) rename .prettierrc => ui/canopyjs/.prettierrc (100%) rename CODEOWNERS => ui/canopyjs/CODEOWNERS (100%) rename Dockerfile => ui/canopyjs/Dockerfile (100%) rename LICENSE => ui/canopyjs/LICENSE (100%) rename MAINTAINERS.md => ui/canopyjs/MAINTAINERS.md (100%) rename README.md => ui/canopyjs/README.md (100%) rename {bin => ui/canopyjs/bin}/get_version (100%) rename {docker => ui/canopyjs/docker}/compose/.env (100%) rename {docker => ui/canopyjs/docker}/compose/run-lint.yaml (100%) rename package.json => ui/canopyjs/package.json (100%) rename rollup.config.js => ui/canopyjs/rollup.config.js (100%) rename {src => ui/canopyjs/src}/CanopyContext.js (100%) rename {src => ui/canopyjs/src}/components/button/Button.scss (100%) rename {src => ui/canopyjs/src}/components/forms/AuthForm.scss (100%) rename {src => ui/canopyjs/src}/components/index.js (100%) rename {src => ui/canopyjs/src}/components/input/Input.js (100%) rename {src => ui/canopyjs/src}/components/input/Input.scss (100%) rename {src => ui/canopyjs/src}/components/navigation/Logout.js (100%) rename {src => ui/canopyjs/src}/components/navigation/NavItem.js (100%) rename {src => ui/canopyjs/src}/components/navigation/SideNav.js (100%) rename {src => ui/canopyjs/src}/components/navigation/SideNav.scss (100%) rename {src => ui/canopyjs/src}/components/progress/Progress.js (100%) rename {src => ui/canopyjs/src}/components/progress/Progress.scss (100%) rename {src => ui/canopyjs/src}/components/tabBox/TabBox.js (100%) rename {src => ui/canopyjs/src}/components/tabBox/TabBox.scss (100%) rename {src => ui/canopyjs/src}/index.js (100%) rename {src => ui/canopyjs/src}/loadSaplings.js (100%) rename {src => ui/canopyjs/src}/promiseLoader.js (100%) rename {src => ui/canopyjs/src}/request.js (100%) rename {src => ui/canopyjs/src}/styleLoader.js (100%) rename {src => ui/canopyjs/src}/styles/colors.scss (100%) rename {src => ui/canopyjs/src}/styles/components.scss (100%) rename {src => ui/canopyjs/src}/styles/core.scss (100%) rename {src => ui/canopyjs/src}/styles/layout.scss (100%) rename {src => ui/canopyjs/src}/styles/mixins.scss (100%) rename {src => ui/canopyjs/src}/styles/navigation.scss (100%) rename {src => ui/canopyjs/src}/themes/default/colors.scss (100%) rename {src => ui/canopyjs/src}/themes/default/index.js (100%) rename {src => ui/canopyjs/src}/themes/default/index.scss (100%) rename {src => ui/canopyjs/src}/themes/default/sizes.scss (100%) rename {src => ui/canopyjs/src}/themes/default/timings.scss (100%) rename {src => ui/canopyjs/src}/themes/default/typography.scss (100%) rename {src => ui/canopyjs/src}/themes/default/variables.scss (100%) diff --git a/.babelrc b/ui/canopyjs/.babelrc similarity index 100% rename from .babelrc rename to ui/canopyjs/.babelrc diff --git a/.dockerignore b/ui/canopyjs/.dockerignore similarity index 100% rename from .dockerignore rename to ui/canopyjs/.dockerignore diff --git a/.env b/ui/canopyjs/.env similarity index 100% rename from .env rename to ui/canopyjs/.env diff --git a/.eslintignore b/ui/canopyjs/.eslintignore similarity index 100% rename from .eslintignore rename to ui/canopyjs/.eslintignore diff --git a/.eslintrc b/ui/canopyjs/.eslintrc similarity index 100% rename from .eslintrc rename to ui/canopyjs/.eslintrc diff --git a/.github/workflows/ci.yaml b/ui/canopyjs/.github/workflows/ci.yaml similarity index 100% rename from .github/workflows/ci.yaml rename to ui/canopyjs/.github/workflows/ci.yaml diff --git a/.gitignore b/ui/canopyjs/.gitignore similarity index 100% rename from .gitignore rename to ui/canopyjs/.gitignore diff --git a/.prettierrc b/ui/canopyjs/.prettierrc similarity index 100% rename from .prettierrc rename to ui/canopyjs/.prettierrc diff --git a/CODEOWNERS b/ui/canopyjs/CODEOWNERS similarity index 100% rename from CODEOWNERS rename to ui/canopyjs/CODEOWNERS diff --git a/Dockerfile b/ui/canopyjs/Dockerfile similarity index 100% rename from Dockerfile rename to ui/canopyjs/Dockerfile diff --git a/LICENSE b/ui/canopyjs/LICENSE similarity index 100% rename from LICENSE rename to ui/canopyjs/LICENSE diff --git a/MAINTAINERS.md b/ui/canopyjs/MAINTAINERS.md similarity index 100% rename from MAINTAINERS.md rename to ui/canopyjs/MAINTAINERS.md diff --git a/README.md b/ui/canopyjs/README.md similarity index 100% rename from README.md rename to ui/canopyjs/README.md diff --git a/bin/get_version b/ui/canopyjs/bin/get_version similarity index 100% rename from bin/get_version rename to ui/canopyjs/bin/get_version diff --git a/docker/compose/.env b/ui/canopyjs/docker/compose/.env similarity index 100% rename from docker/compose/.env rename to ui/canopyjs/docker/compose/.env diff --git a/docker/compose/run-lint.yaml b/ui/canopyjs/docker/compose/run-lint.yaml similarity index 100% rename from docker/compose/run-lint.yaml rename to ui/canopyjs/docker/compose/run-lint.yaml diff --git a/package.json b/ui/canopyjs/package.json similarity index 100% rename from package.json rename to ui/canopyjs/package.json diff --git a/rollup.config.js b/ui/canopyjs/rollup.config.js similarity index 100% rename from rollup.config.js rename to ui/canopyjs/rollup.config.js diff --git a/src/CanopyContext.js b/ui/canopyjs/src/CanopyContext.js similarity index 100% rename from src/CanopyContext.js rename to ui/canopyjs/src/CanopyContext.js diff --git a/src/components/button/Button.scss b/ui/canopyjs/src/components/button/Button.scss similarity index 100% rename from src/components/button/Button.scss rename to ui/canopyjs/src/components/button/Button.scss diff --git a/src/components/forms/AuthForm.scss b/ui/canopyjs/src/components/forms/AuthForm.scss similarity index 100% rename from src/components/forms/AuthForm.scss rename to ui/canopyjs/src/components/forms/AuthForm.scss diff --git a/src/components/index.js b/ui/canopyjs/src/components/index.js similarity index 100% rename from src/components/index.js rename to ui/canopyjs/src/components/index.js diff --git a/src/components/input/Input.js b/ui/canopyjs/src/components/input/Input.js similarity index 100% rename from src/components/input/Input.js rename to ui/canopyjs/src/components/input/Input.js diff --git a/src/components/input/Input.scss b/ui/canopyjs/src/components/input/Input.scss similarity index 100% rename from src/components/input/Input.scss rename to ui/canopyjs/src/components/input/Input.scss diff --git a/src/components/navigation/Logout.js b/ui/canopyjs/src/components/navigation/Logout.js similarity index 100% rename from src/components/navigation/Logout.js rename to ui/canopyjs/src/components/navigation/Logout.js diff --git a/src/components/navigation/NavItem.js b/ui/canopyjs/src/components/navigation/NavItem.js similarity index 100% rename from src/components/navigation/NavItem.js rename to ui/canopyjs/src/components/navigation/NavItem.js diff --git a/src/components/navigation/SideNav.js b/ui/canopyjs/src/components/navigation/SideNav.js similarity index 100% rename from src/components/navigation/SideNav.js rename to ui/canopyjs/src/components/navigation/SideNav.js diff --git a/src/components/navigation/SideNav.scss b/ui/canopyjs/src/components/navigation/SideNav.scss similarity index 100% rename from src/components/navigation/SideNav.scss rename to ui/canopyjs/src/components/navigation/SideNav.scss diff --git a/src/components/progress/Progress.js b/ui/canopyjs/src/components/progress/Progress.js similarity index 100% rename from src/components/progress/Progress.js rename to ui/canopyjs/src/components/progress/Progress.js diff --git a/src/components/progress/Progress.scss b/ui/canopyjs/src/components/progress/Progress.scss similarity index 100% rename from src/components/progress/Progress.scss rename to ui/canopyjs/src/components/progress/Progress.scss diff --git a/src/components/tabBox/TabBox.js b/ui/canopyjs/src/components/tabBox/TabBox.js similarity index 100% rename from src/components/tabBox/TabBox.js rename to ui/canopyjs/src/components/tabBox/TabBox.js diff --git a/src/components/tabBox/TabBox.scss b/ui/canopyjs/src/components/tabBox/TabBox.scss similarity index 100% rename from src/components/tabBox/TabBox.scss rename to ui/canopyjs/src/components/tabBox/TabBox.scss diff --git a/src/index.js b/ui/canopyjs/src/index.js similarity index 100% rename from src/index.js rename to ui/canopyjs/src/index.js diff --git a/src/loadSaplings.js b/ui/canopyjs/src/loadSaplings.js similarity index 100% rename from src/loadSaplings.js rename to ui/canopyjs/src/loadSaplings.js diff --git a/src/promiseLoader.js b/ui/canopyjs/src/promiseLoader.js similarity index 100% rename from src/promiseLoader.js rename to ui/canopyjs/src/promiseLoader.js diff --git a/src/request.js b/ui/canopyjs/src/request.js similarity index 100% rename from src/request.js rename to ui/canopyjs/src/request.js diff --git a/src/styleLoader.js b/ui/canopyjs/src/styleLoader.js similarity index 100% rename from src/styleLoader.js rename to ui/canopyjs/src/styleLoader.js diff --git a/src/styles/colors.scss b/ui/canopyjs/src/styles/colors.scss similarity index 100% rename from src/styles/colors.scss rename to ui/canopyjs/src/styles/colors.scss diff --git a/src/styles/components.scss b/ui/canopyjs/src/styles/components.scss similarity index 100% rename from src/styles/components.scss rename to ui/canopyjs/src/styles/components.scss diff --git a/src/styles/core.scss b/ui/canopyjs/src/styles/core.scss similarity index 100% rename from src/styles/core.scss rename to ui/canopyjs/src/styles/core.scss diff --git a/src/styles/layout.scss b/ui/canopyjs/src/styles/layout.scss similarity index 100% rename from src/styles/layout.scss rename to ui/canopyjs/src/styles/layout.scss diff --git a/src/styles/mixins.scss b/ui/canopyjs/src/styles/mixins.scss similarity index 100% rename from src/styles/mixins.scss rename to ui/canopyjs/src/styles/mixins.scss diff --git a/src/styles/navigation.scss b/ui/canopyjs/src/styles/navigation.scss similarity index 100% rename from src/styles/navigation.scss rename to ui/canopyjs/src/styles/navigation.scss diff --git a/src/themes/default/colors.scss b/ui/canopyjs/src/themes/default/colors.scss similarity index 100% rename from src/themes/default/colors.scss rename to ui/canopyjs/src/themes/default/colors.scss diff --git a/src/themes/default/index.js b/ui/canopyjs/src/themes/default/index.js similarity index 100% rename from src/themes/default/index.js rename to ui/canopyjs/src/themes/default/index.js diff --git a/src/themes/default/index.scss b/ui/canopyjs/src/themes/default/index.scss similarity index 100% rename from src/themes/default/index.scss rename to ui/canopyjs/src/themes/default/index.scss diff --git a/src/themes/default/sizes.scss b/ui/canopyjs/src/themes/default/sizes.scss similarity index 100% rename from src/themes/default/sizes.scss rename to ui/canopyjs/src/themes/default/sizes.scss diff --git a/src/themes/default/timings.scss b/ui/canopyjs/src/themes/default/timings.scss similarity index 100% rename from src/themes/default/timings.scss rename to ui/canopyjs/src/themes/default/timings.scss diff --git a/src/themes/default/typography.scss b/ui/canopyjs/src/themes/default/typography.scss similarity index 100% rename from src/themes/default/typography.scss rename to ui/canopyjs/src/themes/default/typography.scss diff --git a/src/themes/default/variables.scss b/ui/canopyjs/src/themes/default/variables.scss similarity index 100% rename from src/themes/default/variables.scss rename to ui/canopyjs/src/themes/default/variables.scss From eaf52ca8407aa1c5914956fe7ea4e45e5766f4b5 Mon Sep 17 00:00:00 2001 From: Amelia Bradley Date: Fri, 29 Jul 2022 17:21:00 -0500 Subject: [PATCH 67/69] Update grid-ui to use local canopyjs Signed-off-by: Amelia Bradley --- ui/Dockerfile | 12 ++- ui/grid-ui/package.json | 2 +- ui/saplingjs/.env | 17 ++++ ui/saplingjs/.eslintrc | 39 ++++++++ ui/saplingjs/.prettierrc | 5 + ui/saplingjs/Dockerfile | 25 +++++ ui/saplingjs/README.md | 21 +++++ ui/saplingjs/docker/compose/run-lint.yaml | 29 ++++++ ui/saplingjs/jest.config.js | 20 ++++ ui/saplingjs/package.json | 39 ++++++++ ui/saplingjs/src/crypto.ts | 37 ++++++++ ui/saplingjs/src/index.spec.ts | 108 ++++++++++++++++++++++ ui/saplingjs/src/index.ts | 107 +++++++++++++++++++++ ui/saplingjs/src/submitter.ts | 101 ++++++++++++++++++++ ui/saplingjs/tests/test-splinter.yaml | 25 +++++ ui/saplingjs/tsconfig.json | 9 ++ 16 files changed, 592 insertions(+), 4 deletions(-) create mode 100644 ui/saplingjs/.env create mode 100644 ui/saplingjs/.eslintrc create mode 100644 ui/saplingjs/.prettierrc create mode 100644 ui/saplingjs/Dockerfile create mode 100644 ui/saplingjs/README.md create mode 100644 ui/saplingjs/docker/compose/run-lint.yaml create mode 100644 ui/saplingjs/jest.config.js create mode 100644 ui/saplingjs/package.json create mode 100644 ui/saplingjs/src/crypto.ts create mode 100644 ui/saplingjs/src/index.spec.ts create mode 100644 ui/saplingjs/src/index.ts create mode 100644 ui/saplingjs/src/submitter.ts create mode 100644 ui/saplingjs/tests/test-splinter.yaml create mode 100644 ui/saplingjs/tsconfig.json diff --git a/ui/Dockerfile b/ui/Dockerfile index 2d917caa1f..4d3571f336 100644 --- a/ui/Dockerfile +++ b/ui/Dockerfile @@ -16,13 +16,19 @@ FROM node:14.18.1-alpine3.11 as canopy-app-build-stage RUN apk add --no-cache python g++ git make +COPY ui/canopyjs /canopyjs +ENV REACT_APP_SPLINTER_URL "/splinterd" +ENV REACT_APP_SAPLING_URL "/sapling-dev-server" +ENV REACT_APP_GRID_URL "/gridd" +WORKDIR /canopyjs +RUN npm config set unsafe-perm true \ + && npm install \ + && npm run build WORKDIR /ui COPY ui/grid-ui/package*.json ./ RUN npm config set unsafe-perm true && npm install COPY ui/grid-ui . -ENV REACT_APP_SPLINTER_URL "/splinterd" -ENV REACT_APP_SAPLING_URL "/sapling-dev-server" -ENV REACT_APP_GRID_URL "/gridd" + RUN npm run build WORKDIR /ui/build ARG REPO_VERSION diff --git a/ui/grid-ui/package.json b/ui/grid-ui/package.json index 8b3cbdff88..edc0ebc2bb 100644 --- a/ui/grid-ui/package.json +++ b/ui/grid-ui/package.json @@ -12,7 +12,7 @@ "react": "^16.12.0", "react-dom": "^16.12.0", "react-scripts": "^3.4.0", - "splinter-canopyjs": "github:Cargill/splinter-canopyjs#main" + "splinter-canopyjs": "file:../canopyjs" }, "scripts": { "start:saplings": "http-server .. -p 3030 --cors", diff --git a/ui/saplingjs/.env b/ui/saplingjs/.env new file mode 100644 index 0000000000..cbe9914025 --- /dev/null +++ b/ui/saplingjs/.env @@ -0,0 +1,17 @@ +# Copyright 2018-2020 Cargill Incorporated +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +ISOLATION_ID=latest +DISTRO=bionic +REPO_VERSION=0.3.12-dev diff --git a/ui/saplingjs/.eslintrc b/ui/saplingjs/.eslintrc new file mode 100644 index 0000000000..44ac895377 --- /dev/null +++ b/ui/saplingjs/.eslintrc @@ -0,0 +1,39 @@ +{ + "parser": "@typescript-eslint/parser", + "plugins": ["@typescript-eslint"], + "settings": { + "import/resolver": { + "node": { + "extensions": [".js", ".ts"] + } + } + }, + "env": { + "es6": true, + "jest": true, + "browser": true + }, + "parserOptions": { + "ecmaVersion": 2020 + }, + "rules": { + "import/no-default-export": 2, + "import/prefer-default-export": 0, + "import/no-var-requires": 0, + "import/extensions": [ + "error", + "ignorePackages", + { + "js": "never", + "jsx": "never", + "ts": "never", + "tsx": "never" + } + ] + }, + "extends": [ + "plugin:@typescript-eslint/recommended", + "airbnb", + "plugin:prettier/recommended" + ] +} diff --git a/ui/saplingjs/.prettierrc b/ui/saplingjs/.prettierrc new file mode 100644 index 0000000000..57a1013229 --- /dev/null +++ b/ui/saplingjs/.prettierrc @@ -0,0 +1,5 @@ +{ + "printWidth": 80, + "tabWidth": 2, + "singleQuote": true +} diff --git a/ui/saplingjs/Dockerfile b/ui/saplingjs/Dockerfile new file mode 100644 index 0000000000..a9a99f9b86 --- /dev/null +++ b/ui/saplingjs/Dockerfile @@ -0,0 +1,25 @@ +# Copyright 2018-2020 Cargill Incorporated +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM node:lts-alpine + +<<<<<<< HEAD:ui/saplingjs/Dockerfile +WORKDIR /saplingjs +======= +WORKDIR /splinter-canopyjs +>>>>>>> canopyjs-main:ui/canopyjs/Dockerfile + +COPY . . + +RUN npm install diff --git a/ui/saplingjs/README.md b/ui/saplingjs/README.md new file mode 100644 index 0000000000..bd76e96b65 --- /dev/null +++ b/ui/saplingjs/README.md @@ -0,0 +1,21 @@ + + +# SaplingJS + +SaplingJS is a library for building saplings, which are UI plugins for Canopy +applications. Saplings are designed to work with Splinter. + +See [splinter.dev](https://www.splinter.dev/) for Splinter documentation, +release notes, and community information. diff --git a/ui/saplingjs/docker/compose/run-lint.yaml b/ui/saplingjs/docker/compose/run-lint.yaml new file mode 100644 index 0000000000..ebad2eb637 --- /dev/null +++ b/ui/saplingjs/docker/compose/run-lint.yaml @@ -0,0 +1,29 @@ +# Copyright 2018-2020 Cargill Incorporated +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +version: "3.7" + +services: +<<<<<<< HEAD:ui/saplingjs/docker/compose/run-lint.yaml + lint-saplingjs: + build: + context: ../.. + image: saplingjs:${ISOLATION_ID} +======= + lint-canopyjs: + build: + context: ../.. + image: canopyjs:${ISOLATION_ID} +>>>>>>> canopyjs-main:ui/canopyjs/docker/compose/run-lint.yaml + command: yarn lint diff --git a/ui/saplingjs/jest.config.js b/ui/saplingjs/jest.config.js new file mode 100644 index 0000000000..edfb2c94d7 --- /dev/null +++ b/ui/saplingjs/jest.config.js @@ -0,0 +1,20 @@ +/** + * Copyright 2018-2020 Cargill Incorporated + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +module.exports = { + preset: 'ts-jest', + testEnvironment: 'jsdom' +}; diff --git a/ui/saplingjs/package.json b/ui/saplingjs/package.json new file mode 100644 index 0000000000..7899dfba82 --- /dev/null +++ b/ui/saplingjs/package.json @@ -0,0 +1,39 @@ +{ + "name": "splinter-saplingjs", + "private": false, + "version": "0.0.1", + "author": "Cargill Incorporated", + "license": "Apache-2.0", + "main": "dist/index.js", + "dependencies": { + "@babel/parser": "^7.8.3", + "@types/sjcl": "^1.0.29", + "babel-plugin-macros": "^2.8.0", + "js-yaml": "^3.13.1", + "sjcl": "^1.0.8" + }, + "scripts": { + "test": "jest", + "build": "tsc -p ./tsconfig.json --strict --outDir dist", + "prepare": "npm run build", + "format": "prettier --write \"**/*.+(ts|*rc|json|js)\"", + "lint": "eslint src/*" + }, + "devDependencies": { + "@types/jest": "^24.0.19", + "@types/uuid": "^3.4.5", + "@typescript-eslint/eslint-plugin": "^2.5.0", + "@typescript-eslint/parser": "^2.5.0", + "eslint": "^6.6.0", + "eslint-config-airbnb": "^18.0.1", + "eslint-config-prettier": "^6.4.0", + "eslint-plugin-import": "^2.18.2", + "eslint-plugin-jsx-a11y": "^6.2.3", + "eslint-plugin-prettier": "^3.1.1", + "eslint-plugin-react": "^7.16.0", + "jest": "^24.9.0", + "prettier": "^1.18.2", + "ts-jest": "^24.1.0", + "typescript": "^3.6.4" + } +} diff --git a/ui/saplingjs/src/crypto.ts b/ui/saplingjs/src/crypto.ts new file mode 100644 index 0000000000..3990866937 --- /dev/null +++ b/ui/saplingjs/src/crypto.ts @@ -0,0 +1,37 @@ +/** + * Copyright 2018-2020 Cargill Incorporated + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import sjcl from 'sjcl'; + +/** + * Encrypts a private key. + * @param password - Encryption key. + * @param privateKey - Unencrypted private key. + */ +export function encryptKey(privateKey: string, password: string): string { + return JSON.stringify(sjcl.encrypt(password, privateKey)); +} + +/** + * Decrypts a private key. + * @param password - Encryption key. + * @param encryptedPrivateKey - Encrypted private key. + */ +export function decryptKey( + encryptedPrivateKey: string, + password: string +): string { + return sjcl.decrypt(password, encryptedPrivateKey); +} diff --git a/ui/saplingjs/src/index.spec.ts b/ui/saplingjs/src/index.spec.ts new file mode 100644 index 0000000000..10a3c7200b --- /dev/null +++ b/ui/saplingjs/src/index.spec.ts @@ -0,0 +1,108 @@ +/** + * Copyright 2018-2020 Cargill Incorporated + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +const bootstrap = (): void => { + /* no op */ +}; +const completeUser = { + userId: 'COMPLETE', + displayName: 'canopy', + token: 'canopy.token' +}; +const minimalUser = { userId: 'MINIMAL' }; + +// In order to prevent the need to overwrite the window interface, +// a intentional `any` is cast here. +// eslint-disable-next-line @typescript-eslint/no-explicit-any +(window as any).$CANOPY = { + registerConfigSapling: jest.fn(), + registerApp: jest.fn(), + getUser: jest.fn(() => completeUser), + setUser: jest.fn(), + getSharedConfig: jest.fn(() => ({ + mock: true + })) +}; + +interface MockCanopy { + registerConfigSapling: jest.Mock; + registerApp: jest.Mock; + getUser: jest.Mock; + setUser: jest.Mock; + getSharedConfig: jest.Mock; +} + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +const $CANOPY = (window as any).$CANOPY as MockCanopy; + +describe('CanopyJS', () => { + afterEach(() => { + jest.clearAllMocks(); + }); + describe('registerApp(bootstrapFn)', () => { + it('should call the window.$CANOPY.registerApp function with the same signature as the register function', async () => { + expect.assertions(1); + // dynamic import is used here to ensure that the window.$CANOPY object has been set up + const { registerApp } = await import('./index'); + registerApp(bootstrap); + expect($CANOPY.registerApp.mock.calls[0][0]).toEqual(bootstrap); + }); + }); + + describe('registerConfigSapling(configNamespace, bootstrapFn)', () => { + it('should register to the window Canopy object', async () => { + expect.assertions(2); + // dynamic import is used here to ensure that the window.$CANOPY object has been set up + const { registerConfigSapling } = await import('./index'); + registerConfigSapling('login', bootstrap); + expect($CANOPY.registerConfigSapling.mock.calls[0][0]).toEqual('login'); + expect($CANOPY.registerConfigSapling.mock.calls[0][1]).toEqual(bootstrap); + }); + }); + + describe('getUser()', () => { + it('should call getUser from window object', async () => { + expect.assertions(1); + // dynamic import is used here to ensure that the window.$CANOPY object has been set up + const { getUser } = await import('./index'); + expect(getUser()).toEqual(completeUser); + }); + }); + + describe('setUser(user)', () => { + it('should call setUser from window object with a complete user object', async () => { + expect.assertions(1); + // dynamic import is used here to ensure that the window.$CANOPY object has been set up + const { setUser } = await import('./index'); + setUser(completeUser); + expect($CANOPY.setUser.mock.calls[0][0]).toEqual(completeUser); + }); + it('it should call setUser from window object with a minimal user object', async () => { + expect.assertions(1); + // dynamic import is used here to ensure that the window.$CANOPY object has been set up + const { setUser } = await import('./index'); + setUser(minimalUser); + expect($CANOPY.setUser.mock.calls[0][0]).toEqual(minimalUser); + }); + }); + + describe('getSharedConfig', () => { + it('should call getSharedConfig from window object', async () => { + const { getSharedConfig } = await import('./index'); + expect(getSharedConfig()).toEqual({ mock: true }); + }); + }); +}); diff --git a/ui/saplingjs/src/index.ts b/ui/saplingjs/src/index.ts new file mode 100644 index 0000000000..09012073b7 --- /dev/null +++ b/ui/saplingjs/src/index.ts @@ -0,0 +1,107 @@ +/** + * Copyright 2018-2020 Cargill Incorporated + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export { submitBatchList } from './submitter'; +export { decryptKey, encryptKey } from './crypto'; + +interface User { + userId: string; + displayName?: string; + token?: string; +} + +interface KeyPair { + publicKey: string; + privateKey: string; +} + +interface SetUser { + (user: User): void; +} + +interface SetKeys { + (keys: KeyPair): void; +} + +interface SharedConfig { + canopyConfig: { + splinterURL: string; + }; +} + +interface GetSharedConfig { + (): SharedConfig; +} + +interface GetUser { + (): User; +} + +interface GetKeys { + (): KeyPair; +} + +interface RegisterApp { + (bootstrapFunction: (domNode: Node) => void): void; +} + +interface RegisterConfigSapling { + ( + configNamespace: 'login' | 'notifications', + bootstrapFunction: () => void + ): void; +} + +interface HideCanopy { + (): void; +} + +interface Canopy { + registerApp: RegisterApp; + registerConfigSapling: RegisterConfigSapling; + getUser: GetUser; + setUser: SetUser; + setKeys: SetKeys; + getKeys: GetKeys; + getSharedConfig: GetSharedConfig; + hideCanopy: HideCanopy; +} + +function assertAndGetWindowCanopy(): Canopy { + // In order to prevent the need to overwrite the window interface, + // a intentional `any` is cast here. + // eslint-disable-next-line @typescript-eslint/no-explicit-any + if (!window || !(window as any).$CANOPY) { + throw new Error( + `Must be in a Canopy with 'window.$CANOPY' in scope to call this CanopyJS functions` + ); + } + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return (window as any).$CANOPY; +} + +const canopy = assertAndGetWindowCanopy(); + +export const { + registerApp, + registerConfigSapling, + getUser, + setUser, + setKeys, + getKeys, + getSharedConfig, + hideCanopy +}: Canopy = canopy; diff --git a/ui/saplingjs/src/submitter.ts b/ui/saplingjs/src/submitter.ts new file mode 100644 index 0000000000..5e83d51a68 --- /dev/null +++ b/ui/saplingjs/src/submitter.ts @@ -0,0 +1,101 @@ +/** + * Copyright 2018-2020 Cargill Incorporated + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +interface BatchStatus { + statusType: string; + message: BatchMessage[]; +} + +interface BatchMessage { + transactionId: string; + errorMessage: string; + errorData: number[]; +} + +interface BatchInfo { + id: string; + status: BatchStatus; +} + +const HTTPMethods = ['GET', 'POST', 'PUT', 'PATCH', 'DELETE']; + +/** + * Wrapper function to set up XHR. + * @param {string} method HTTP method for the request + * @param {string} url endpoint to make the request to + * @param {Uint8Array} data Byte array representation of the request body + * @param {function} headerFn Function to set the correct request headers + */ +async function http( + method: string, + url: string, + data: Uint8Array | null, + headerFn: (request: XMLHttpRequest) => void +): Promise { + return new Promise((resolve, reject) => { + if (!HTTPMethods.includes(method.toUpperCase())) { + reject(Error('Invalid HTTP Method')); + } + + const request = new XMLHttpRequest(); + request.open(method, url); + if (headerFn) { + headerFn(request); + } + request.onload = (): void => { + if (request.status >= 200 && request.status < 300) { + resolve(request.response); + } else if (request.status >= 400 && request.status < 500) { + reject( + Error('Failed to send request. Contact the administrator for help.') + ); + } else { + reject( + Error( + 'The server has encountered an error. Please contact the administrator.' + ) + ); + } + }; + request.onerror = (): void => { + reject( + Error( + 'The server has encountered an error. Please contact the administrator.' + ) + ); + }; + request.send(data); + }); +} + +/** + * Submits a batch list of transaction batches + * @param {string} url The endpoint to submit the batch list to + * @param {Uint8Array} batchList The serialized batch list + */ +export async function submitBatchList( + url: string, + batchList: Uint8Array +): Promise { + return http('POST', url, batchList, (request: XMLHttpRequest) => { + request.setRequestHeader('Content-Type', 'application/octet-stream'); + }) + .catch(err => { + throw new Error(err); + }) + .then(body => { + return JSON.parse(body).data as BatchInfo[]; + }); +} diff --git a/ui/saplingjs/tests/test-splinter.yaml b/ui/saplingjs/tests/test-splinter.yaml new file mode 100644 index 0000000000..9b23d9ddbb --- /dev/null +++ b/ui/saplingjs/tests/test-splinter.yaml @@ -0,0 +1,25 @@ +# Copyright 2018-2020 Cargill Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ------------------------------------------------------------------------------ + +version: "3.7" + +services: + unit-test-saplingjs: + build: + context: .. + environment: + - CI=true + image: saplingjs:${ISOLATION_ID} + command: yarn test diff --git a/ui/saplingjs/tsconfig.json b/ui/saplingjs/tsconfig.json new file mode 100644 index 0000000000..afe2494c0c --- /dev/null +++ b/ui/saplingjs/tsconfig.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "lib": ["es2015", "dom", "es2017"], + "esModuleInterop": true, + "declaration": true + }, + "exclude": ["node_modules", "**/*.spec.ts"], + "include": ["src/**/*"] +} From 7fd8efa52fdcf9e87d93535a3a6404d856da2375 Mon Sep 17 00:00:00 2001 From: Amelia Bradley Date: Fri, 29 Jul 2022 17:21:01 -0500 Subject: [PATCH 68/69] Update saplings to use local saplingjs Signed-off-by: Amelia Bradley --- ui/Dockerfile | 5 +++++ ui/saplings/circuits/package.json | 2 +- ui/saplings/product/package.json | 2 +- ui/saplings/profile/package.json | 2 +- ui/saplings/register-login/package.json | 2 +- 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ui/Dockerfile b/ui/Dockerfile index 4d3571f336..7a3b80042b 100644 --- a/ui/Dockerfile +++ b/ui/Dockerfile @@ -48,6 +48,11 @@ RUN apk add --no-cache python g++ git make \ COPY ui/saplings /saplings COPY ui/sapling-dev-server /sapling-dev-server COPY ui/protos /protos +COPY ui/saplingjs /saplingjs + +WORKDIR /saplingjs +RUN npm install \ + && npm run build ARG PUBLIC_URL_PARTIAL ENV PUBLIC_URL $PUBLIC_URL_PARTIAL diff --git a/ui/saplings/circuits/package.json b/ui/saplings/circuits/package.json index 87e1a8e183..d70f66c768 100644 --- a/ui/saplings/circuits/package.json +++ b/ui/saplings/circuits/package.json @@ -44,7 +44,7 @@ "react-dropdown": "^1.7.0", "react-router-dom": "^5.1.2", "react-toast-notifications": "^2.4.0", - "splinter-saplingjs": "github:cargill/splinter-saplingjs#main", + "splinter-saplingjs": "file:../../saplingjs", "transact-sdk": "^0.1.0" }, "devDependencies": { diff --git a/ui/saplings/product/package.json b/ui/saplings/product/package.json index 1571a3042f..e02fac8d13 100644 --- a/ui/saplings/product/package.json +++ b/ui/saplings/product/package.json @@ -57,7 +57,7 @@ "react-router-dom": "^5.1.2", "react-table": "^7.6.3", "react-toast-notifications": "^2.4.0", - "splinter-saplingjs": "github:cargill/splinter-saplingjs#main", + "splinter-saplingjs": "file:../../saplingjs", "transact-sdk": "^0.1.0" }, "devDependencies": { diff --git a/ui/saplings/profile/package.json b/ui/saplings/profile/package.json index e775d71017..52484b874b 100644 --- a/ui/saplings/profile/package.json +++ b/ui/saplings/profile/package.json @@ -20,7 +20,7 @@ "react": "^16.12.0", "react-dom": "^16.12.0", "sjcl": "^1.0.8", - "splinter-saplingjs": "github:cargill/splinter-saplingjs#main", + "splinter-saplingjs": "file:../../saplingjs", "transact-sdk": "^0.1.0" }, "scripts": { diff --git a/ui/saplings/register-login/package.json b/ui/saplings/register-login/package.json index 2fad35bdb3..60e13ac726 100644 --- a/ui/saplings/register-login/package.json +++ b/ui/saplings/register-login/package.json @@ -9,7 +9,7 @@ "axios": "^0.21.1", "history": "^4.10.1", "js-sha256": "^0.9.0", - "splinter-saplingjs": "github:cargill/splinter-saplingjs#main" + "splinter-saplingjs": "file:../../saplingjs" }, "scripts": { "test": "jest", From 0cbe0303b54e932077ee5a7cc1390f30469d669b Mon Sep 17 00:00:00 2001 From: Amelia Bradley Date: Fri, 29 Jul 2022 17:21:01 -0500 Subject: [PATCH 69/69] Combine Dockerfile RUN commands Signed-off-by: Amelia Bradley --- ui/saplings/circuits/test/Dockerfile | 7 +++---- ui/saplings/profile/test/Dockerfile | 7 +++---- ui/saplings/register-login/test/Dockerfile | 7 +++---- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/ui/saplings/circuits/test/Dockerfile b/ui/saplings/circuits/test/Dockerfile index b718ad4914..0a59f5d92b 100644 --- a/ui/saplings/circuits/test/Dockerfile +++ b/ui/saplings/circuits/test/Dockerfile @@ -19,10 +19,9 @@ WORKDIR /saplings/circuits COPY package*.json ./ -RUN apk add --no-cache git - -# Gives npm permission to run the prepare script in splinter-canopyjs as root -RUN npm config set unsafe-perm true && npm install +RUN apk add --no-cache git \ + # Gives npm permission to run the prepare script in splinter-canopyjs as root + && npm install COPY . . diff --git a/ui/saplings/profile/test/Dockerfile b/ui/saplings/profile/test/Dockerfile index 95cd88a7b7..0470123b58 100644 --- a/ui/saplings/profile/test/Dockerfile +++ b/ui/saplings/profile/test/Dockerfile @@ -19,9 +19,8 @@ WORKDIR /saplings/profile COPY package*.json ./ -RUN apk add --no-cache git - -# Gives npm permission to run the prepare script in splinter-canopyjs as root -RUN npm config set unsafe-perm true && npm install +RUN apk add --no-cache git \ + # Gives npm permission to run the prepare script in splinter-canopyjs as root + && npm install COPY . . diff --git a/ui/saplings/register-login/test/Dockerfile b/ui/saplings/register-login/test/Dockerfile index 6f471b2c20..f4e9c87662 100644 --- a/ui/saplings/register-login/test/Dockerfile +++ b/ui/saplings/register-login/test/Dockerfile @@ -19,9 +19,8 @@ WORKDIR /saplings/register-login COPY package*.json ./ -RUN apk add --no-cache git - -# Gives npm permission to run the prepare script in splinter-canopyjs as root -RUN npm config set unsafe-perm true && npm install +RUN apk add --no-cache git \ + # Gives npm permission to run the prepare script in splinter-canopyjs as root + && npm install COPY . .