Skip to content

Commit

Permalink
Merge pull request #228 from desci-labs/develop
Browse files Browse the repository at this point in the history
promote main
  • Loading branch information
hubsmoke authored Feb 26, 2024
2 parents e7e74b4 + 7cc914a commit 7d21252
Show file tree
Hide file tree
Showing 177 changed files with 26,802 additions and 1,636 deletions.
8 changes: 6 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PORT=5420
IPFS_NODE_URL=http://host.docker.internal:5001
PUBLIC_IPFS_RESOLVER=https://ipfs.io

# IPFS_RESOLVER_OVERRIDE=http://host.docker.internal:8089/ipfs
IPFS_RESOLVER_OVERRIDE=http://host.docker.internal:8089/ipfs

### Database - Postgres
PG_HOST=db_boilerplate
Expand Down Expand Up @@ -90,9 +90,13 @@ ORCID_API_DOMAIN=https://api.sandbox.orcid.org
ORCID_CLIENT_ID=
ORCID_CLIENT_SECRET=

REPO_SERVER_URL=http://host.docker.internal:5445
REPO_SERVER_URL=http://host.docker.internal:5484
REPO_SERVICE_SECRET_KEY=secretrepo

# Ceramic publish feature toggle, set to 1 for active
TOGGLE_CERAMIC=
# If above is set, clone `@desci-labs/desci-codex` and put the path to it here
CODEX_REPO_PATH=

# SET TO 1 to run communities seed script
RUN=1
3 changes: 1 addition & 2 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ jobs:
- name: Run tests
run: |
cd desci-server && export DOCKER_BUILDKIT=1 && yarn && yarn test
echo "exit code $?"
if [ $? -ne 0 ]; then
exit 1
fi
fi
50 changes: 50 additions & 0 deletions .github/workflows/nodes-lib-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
on:
push:
branches:
- develop
paths:
- nodes-lib/**
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

jobs:
generate:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2

- name: Configure GitHub Pages
uses: actions/configure-pages@v3

- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: npm
cache-dependency-path: nodes-lib/package-lock.json

- name: Generate docs
run: |
cd nodes-lib
npm ci
npx typedoc src/index.ts
- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v2
with:
path: nodes-lib/docs

deploy:
needs: generate
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.16.0
18.16.0
8 changes: 7 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,11 @@
"tw\\(.*?\\).*?`([^`]*)" // tw(Component)<xxx>`...`
],
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
"editor.formatOnSave": true,
"[prisma]": {
"editor.defaultFormatter": "Prisma.prisma"
},
"[sql]": {
"editor.defaultFormatter": "ms-mssql.mssql"
}
}
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ build: .env desci-contracts/.env
$(MAKE) -C desci-models build
$(MAKE) -C desci-contracts build
$(MAKE) -C desci-server install
$(MAKE) -C desci-repo install

.PHONY: sterile
sterile: clean-rec
Expand All @@ -23,20 +24,21 @@ clean-rec:
$(MAKE) -C desci-contracts clean
$(MAKE) -C desci-models clean
$(MAKE) -C desci-server clean
$(MAKE) -C desci-repo clean

.PHONY: .env
.env: nodes-media/.env desci-repo/.env
# Phony target, always runs but is idempotent
# Copies example env if not present, and fails until MNEMONIC is set
cp --no-clobber .env.example .env || true
if [ ! -f .env ]; then cp .env.example .env; fi
if ! grep -q MNEMONIC .env; then echo "ERROR: set MNEMONIC in .env"; exit 1; fi

desci-contracts/.env: .env
grep "MNEMONIC" .env > desci-contracts/.env

nodes-media/.env:
cp nodes-media/.env.example nodes-media/.env
if [ ! -f nodes-media/.env ]; then cp nodes-media/.env.example nodes-media/.env; fi

desci-repo/.env:
cp desci-repo/.env.example desci-repo/.env
if [ ! -f desci-repo/.env ]; then cp desci-repo/.env.example desci-repo/.env; fi

5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ This is a Typescript types library that describes a spec for Research Objects. I
This is a NodeJS backend that manages draft Nodes. It maintains a user auth, verifies wallet credentials, offers 2FA to users, and is the main system that orchestrates between microservices. It maintains version history for each update to Nodes. It interfaces with a Graph index to implement the [DPID](https://dpid.org) Resolution Scheme.
<br><br>

## **nodes-lib**

A library for programmatically interacting with Nodes, basically allowing automation of actions possible in the webapp. See separate documentation in the [README](./nodes-lib/README.md)
<br><br>

## **desci-art-viewer**

Nobody knows why this is still here, but it implements a React+Three.js 3d torus that plays [Conway's Game of Life](https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life) on the surface of the torus. We were totally inspired by [this gif on Wikipedia](https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life#/media/File:Trefoil_knot_conways_game_of_life.gif) and it only seems to work on Mac/Linux right now, YMMV.
Expand Down
9 changes: 8 additions & 1 deletion bootstrapCeramic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ CTX="[bootstrapCeramic.sh]"
set -euo pipefail
trap catch ERR
catch() {
echo "$CTX script failed"
echo "$CTX script failed (are CODEX_REPO_PATH and TOGGLE_CERAMIC set in .env?)"
exit 1
}

Expand Down Expand Up @@ -43,6 +43,13 @@ fi

# Setup desci-codex and deploy composites
pushd "$CODEX_REPO_PATH"

# Check that the node admin secret is set up, otherwise the model ID's wont be correct
if [ ! -f "packages/composedb/admin_seed.txt" ]; then
echo "$CTX Composites need to be deployed with the ceramic node admin seed for the local node, as the model IDs aren't deterministic otherwise"
exit 1
fi

if [[ ! -d "node_modules" ]]; then
echo "$CTX installing deps desci-codex..."
npm ci
Expand Down
2 changes: 1 addition & 1 deletion desci-contracts/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16.20.0-bookworm
FROM node:18.16.0-bookworm
WORKDIR /app

VOLUME /data
Expand Down
4 changes: 2 additions & 2 deletions desci-contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
"as-base64": "^0.2.0",
"chai": "^4.3.4",
"ethereum-waffle": "^3.4.0",
"ethers": "^5.4.4",
"ethers": "5.5.4",
"ganache": "^7.8.0",
"hardhat": "^2.19.2",
"hardhat": "2.19.3",
"hardhat-deploy": "^0.8.11",
"hardhat-deploy-ethers": "^0.3.0-beta.10",
"hardhat-gas-reporter": "^1.0.4",
Expand Down
34 changes: 17 additions & 17 deletions desci-contracts/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4914,22 +4914,7 @@ ethereumjs-wallet@0.6.5:
utf8 "^3.0.0"
uuid "^3.3.2"

ethers@^4.0.40:
version "4.0.49"
resolved "https://registry.yarnpkg.com/ethers/-/ethers-4.0.49.tgz#0eb0e9161a0c8b4761be547396bbe2fb121a8894"
integrity sha512-kPltTvWiyu+OktYy1IStSO16i2e7cS9D9OxZ81q2UUaiNPVrm/RTcbxamCXF9VUSKzJIdJV68EAIhTEVBalRWg==
dependencies:
aes-js "3.0.0"
bn.js "^4.11.9"
elliptic "6.5.4"
hash.js "1.1.3"
js-sha3 "0.5.7"
scrypt-js "2.0.4"
setimmediate "1.0.4"
uuid "2.0.1"
xmlhttprequest "1.8.0"

ethers@^5.0.1, ethers@^5.0.2, ethers@^5.4.4, ethers@^5.5.2:
ethers@5.5.4, ethers@^5.0.1, ethers@^5.0.2, ethers@^5.5.2:
version "5.5.4"
resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.5.4.tgz#e1155b73376a2f5da448e4a33351b57a885f4352"
integrity sha512-N9IAXsF8iKhgHIC6pquzRgPBJEzc9auw3JoRkaKe+y4Wl/LFBtDDunNe7YmdomontECAcC5APaAgWZBiu1kirw==
Expand Down Expand Up @@ -4965,6 +4950,21 @@ ethers@^5.0.1, ethers@^5.0.2, ethers@^5.4.4, ethers@^5.5.2:
"@ethersproject/web" "5.5.1"
"@ethersproject/wordlists" "5.5.0"

ethers@^4.0.40:
version "4.0.49"
resolved "https://registry.yarnpkg.com/ethers/-/ethers-4.0.49.tgz#0eb0e9161a0c8b4761be547396bbe2fb121a8894"
integrity sha512-kPltTvWiyu+OktYy1IStSO16i2e7cS9D9OxZ81q2UUaiNPVrm/RTcbxamCXF9VUSKzJIdJV68EAIhTEVBalRWg==
dependencies:
aes-js "3.0.0"
bn.js "^4.11.9"
elliptic "6.5.4"
hash.js "1.1.3"
js-sha3 "0.5.7"
scrypt-js "2.0.4"
setimmediate "1.0.4"
uuid "2.0.1"
xmlhttprequest "1.8.0"

ethers@^5.7.1:
version "5.7.2"
resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.7.2.tgz#3a7deeabbb8c030d4126b24f84e525466145872e"
Expand Down Expand Up @@ -5934,7 +5934,7 @@ hardhat-gas-reporter@^1.0.4:
eth-gas-reporter "^0.2.24"
sha1 "^1.1.1"

hardhat@^2.19.2:
hardhat@2.19.3:
version "2.19.3"
resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.19.3.tgz#fe3b28b889e34a074ea5b740c227e3c8d4ce56e8"
integrity sha512-zUvfILiu1O7W1a+t5E1nCJ6z1danRLNizQkSEQCCgDYcRx13AGXtH1MVZajKmdLmXIjKAPReTp/8JQQ4ZHaX3g==
Expand Down
4 changes: 2 additions & 2 deletions desci-models/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@desci-labs/desci-models",
"version": "0.2.1",
"version": "0.2.3-rc1",
"description": "Data models for DeSci Nodes",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -16,7 +16,7 @@
"test": "mocha -r ts-node/register --inspect tests/**/*.test.ts",
"coverage": "nyc -r lcov -e .ts -x \"*.test.ts\" npm run test",
"build": "tsc",
"publish": "npm publish --access public",
"doPublish": "npm publish --access public",
"generate": "ts-interface-builder src/ResearchObject.ts src/RoCrate.ts --ignore-generics"
},
"author": "",
Expand Down
Loading

0 comments on commit 7d21252

Please sign in to comment.