verida / network-data-api Goto Github PK
View Code? Open in Web Editor NEWAn API that returns public data from the Verida network
An API that returns public data from the Verida network
Currently deploying this app from MacOS doen't work, because we get this when deployed:
"/var/task/node_modules/leveldown/build/Release/leveldown.node: invalid ELF header",
This is because leveldown
is build on Mac but deployed on Linux.
Adding this to serverless.xml
should work but has stopped for some reason:
webpack:
includeModules: true
packagerOptions:
scripts:
- npm_config_platform=linux npm_config_arch=x64 yarn add leveldown
Currently I'm deploy via a docker build. This was non-trivial, but a few notes:
On the Mac, rm -rf node_modules
to make sure we get rid of Mac versions
# run docker mapping the path things are checkout out at to a `/working` directory inside docker
docker run -v ~/dev/verida/network-data-api:/working -it --rm ubuntu
# Now we are in docker (Ubuntu)
apt update
apt install unzip nodejs npm curl
cd /root
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip" # NOTE the ARM version is needed!
unzip awscliv2.zip
./aws/install
cd /working
nvm install # install and use the correct node version
nvm use
/usr/local/bin/aws configure # add the AWS deployment keys
npm install --global yarn
yarn # do the build
yarn deploy-prod # deploy!
@nick-verida Can you please make this work as a lambda and deploy to to https://data.verida.network
There is no need for this to be a testnet only deployment as the network name is in the DID and I've written it to use whatever network the DID specified.
We are getting
{"message":"Error: Failed to get number of active DIDs","status":"fail"}
I added some logging and see the following when running locally:
Error: Failed to get number of active DIDs
at /Users/nlothian/dev/verida/network-data-api/node_modules/@verida/vda-did-resolver/dist/activeDIDCount.js:74:27
at step (/Users/nlothian/dev/verida/network-data-api/node_modules/@verida/vda-did-resolver/dist/activeDIDCount.js:33:23)
at Object.throw (/Users/nlothian/dev/verida/network-data-api/node_modules/@verida/vda-did-resolver/dist/activeDIDCount.js:14:53)
at rejected (/Users/nlothian/dev/verida/network-data-api/node_modules/@verida/vda-did-resolver/dist/activeDIDCount.js:6:65)
Add support for a redis cache (if specified in environment config)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.