ixofoundation / ixo-cellnode

Elysian release of the Cell Node for decentralised processing and storage of project data.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

IXO CellNode

Documentation

PostgresExpress.jsNodeJSTypeScriptPrismaDockerGraphQL

Twitter Follow Medium

Instructions to set up the current v2 release of IXO CellNode.
This runs a Node.js app using Express 4 in a dockerized container.


Run this on Akash!

Akash


Running Cellnode

Run

From Source

Requirements

git clone https://github.com/ixofoundation/ixo-cellnode.git
cd ixo-cellnode/

Copy .env.example to .env and configure. If this step is skipped, ixo-cellnode will use .env.example as the configuration by default.

  • Create a database called Cellnode
npm install
npx prisma migrate reset
npx prisma generate
npm run build
npm start

Using Docker (with Compose)

Requirements

git clone https://github.com/ixofoundation/ixo-cellnode.git
cd ixo-cellnode/

Copy .env.example to .env and configure. If this step is skipped, ixo-cellnode will use .env.example as the configuration by default. Don't use quotations when assigning env vars for docker. Delete the seed folder in src/seed/* if you do not plan to import data from json. Create a role(e.g. app_user) in the DB for postgress to work.

docker build -t ixofoundation/ixo-cellnode:latest .
docker compose up -d

###Akash Akash


Seeding the Database with Previous MongoDB Data

  • Export all collections as JSON from the Cellnode MongoDB database
  • Place the resulting JSON files within the src/seed/json_exports directory
  • Configure DATABASE_URL in .env with the correct username, password and host

Local PostgreSQL

  • Create a database called Cellnode
npx prisma migrate reset
npx prisma generate
npx ts-node src/seed/seed.ts

Docker PostgreSQL

docker build .
npx prisma generate
npx ts-node src/seed/seed.ts

Configuration

Handlers are registered according to the capability loaded from the configuration file. Template defines where the schema template directory can be found and the allow determines who has access to specified capability.

{
	"configuration": [
		{
			"capability": "CreateProject",
			"template": "projects",
			"allow": [
				"did:sov:*",
				"did:ixo:*"
			],
		},
		{
			"capability": "CreateAgent",
			"template": "agents"
		},
		{
			"capability": "UpdateAgentStatus",
			"template": "agents"
		},
		{
			"capability": "SubmitClaim",
			"template": "claims"
		},
		{
			"capability": "EvaluateClaim",
			"template": "evaluations"
		},
		{
			"capability": "ListClaims",
			"template": "claims"
		},
		{
			"capability": "ListAgents",
			"template": "agents"
		}
	]
}

Develop notes:

Memcached

You need memcached in order to riun the server, please install it on local machine for development. Mac users can install it through brew:

brew install memcached

brew services start memcached
brew services restart memcached
brew services stop memcached

About

Elysian release of the Cell Node for decentralised processing and storage of project data.

License:Apache License 2.0


Languages

Language:TypeScript 96.7%Language:Dockerfile 3.3%