Skip to content

Fluent-Finance/cognition

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

80 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”Ž πŸ“Š Cognition

Baked by Bun Powered By Sveltekit Language: TypeScript Tailwindcss Jest Prettier Postcss SCSS Eslint ECMAScript: 2019 License: Apache-2.0 fleek

A charted data dashboard to track metrics across the fluent network.

πŸ“Ž Pre Reqs

# install native bun
curl -fsSL https://bun.sh/install | bash

# install via homebrew
brew tap oven-sh/bun && brew install bun

πŸš€ Bootstrap

git clone github:Fluent-Finance/cognition.git
cd cognition

πŸ“‘ Install Pkgs

bun install

✨ Shell Env

# source .env.bootstrap
. ./bootstrap.env 

πŸ”¨ Build

bun do

🚦 Run

bun go

🏁 Preview (production)

bun done

πŸ“ Testing (Integration & Unit)

cognition_run_tests

# Deps -- need to run only once
bunx playwright install

# will run both sets of tests
# and watch for file changes
bun run test

# test specific suite 
bun run test:unit
bun run test:integration

Docker Build

docker buildx build -f Dockerfile \
  --ssh default \
  --platform linux/arm64 \
  --build-arg APP_ENV=$APP_ENV \
  --build-arg APP_PORT=$PORT \
  --build-arg APP_HOST=$APP_ENV \
  --build-arg SERVICE_NAME=$SERVICE_NAME \
  --build-arg APP_LOG_LEVEL=$LOG_LEVEL \
  --tag "cognition:latest" \
  .

Docker Run

docker run -it \
  --label cognition \
  --name cognition \
  --env-file build.env \
  -p 0.0.0.0:3333:3333/tcp \
  --rm \
  -t cognition:latest \

πŸ” Secure Shell / Runtime

# want to stay secure even in the shell
# you can extract env values from password manager
# if using 1Password or Bitwarden, e.g. uses 1Password
export OP_CONNECT_HOST=https://vault.fluent.finance
export OP_CONNECT_TOKEN="$(cat < $HOME/.config/op/op_fluent_token)"

# only run command if using 1password local vault 
op inject -i bootstrap.env > .env.bootstrap

# Not using a pw manager ?
# you will need to update the env vars 
# with your data after copy 
cp bootstrap.env .env.bootstrap

# Ultra Secure Method (1password)
# op run --env-file=bootstrap.env -- bun fun

# uses secure vault and 1password cli
# to read in environment variables into runtime
# secrets are not exposed even in the shell 
#
# bun run --bun dev --port $PORT --host $HOST

♻️ Decentralized Deploys

πŸ“ Data SOURCES

Off Chain

On Chain

πŸ’ Powered By NextGen Technology