Giter Site home page Giter Site logo

aljosa / paima-engine Goto Github PK

View Code? Open in Web Editor NEW

This project forked from paimastudios/paima-engine

0.0 0.0 0.0 6.55 MB

Novel trustless web3/blockchain gaming engine.

License: Other

Shell 1.70% JavaScript 4.19% TypeScript 76.45% CSS 1.80% HTML 2.55% Dockerfile 0.04% Solidity 13.27%

paima-engine's Introduction

Paima Engine

Paima is a Web3 Engine optimized for games, gamification and autonomous worlds that allows building web3 applications in just days.

Documentation

Get started

  1. Download the Paima Engine binary from the release page
  2. Follow the guide at https://docs.paimastudios.com/

Background

Paima is a framework for creating app-specific layer 2s (L2s) as sovereign rollups. That is to say: apps publish transactions to a blockchain for ordering and data availability, but uses its own code to determine the correct app state.

Of note, Paima Engine Core refers to all of the following modules:

  • Paima Storage Contract (The smart contract for storing game inputs)
  • Paima Funnel (The library which enables reading from Paima Contract)
  • Paima SM (The framework which enables building the game logic state machine)
  • Paima Engine Runtime (Runtime which connects all the other portions of the engine together)

While Paima Engine SDK refers to these modules:

  • Paima Executors (The library which enables building RoundExecutors and MatchExecutors)
  • Paima Middleware Core (The library which aids connecting frontends to Paima logic)
  • Paima Utils (The Library which holds auxillary functions between the other modules)
  • Paima Utils Backend (Utils which are purely for backend (and may not work in a browser environment))
  • Paima Build Utils (Helps build the Paima components used user projects - not included as part of the @paima/sdk package)
  • Paima Prando (Custom fork of a deterministic pseudo-RNG generator library)
  • Paima Concise (The library which enables building and parsing concise encoding)
  • Paima Crypto (Has utility functions for all cryptography and blockchains Paima supports)
  • Paima Providers (Handles connection to wallet standards for all blockchains Paima supports)
  • Paima DB (Handles utility functions to handling the Paima database)

Then we also have a Paima Engine Standalone which is a module that utilizes Paima Engine Core to provide easy to use and secure way of creating new games by the public. This is achieved by creating an executable with the bundled core that has two main responsibilities:

  • generate new game template - prepare needed files and empty functions to implement custom game logic with minimal effort
  • run paima engine - start up the whole backend with no setup needed utilizing user's config and executing user's code added into the generated templates

How It Works

The Paima Contract is deployed on-chain which allows users to submit game input via transactions. Game input is a properly encoded piece of data which is then read and funneled by Paima Funnel to the game's state machine (implemented via Paima SM). When consumed by the game's state transition function, if the game input is valid then it is used to transition the global game state from state A to state B.

To install Paima SDK for games, run the following command

npm install @paima/sdk

How to Build

Paima Engine is a TypeScript monorepo implemented with npm (not Yarn nor Lerna) workspaces. The package.json file at the root indicates all the common dependencies (mostly devDependencies like TypeScript, ESLint etc.), and the root tsconfig.json indicates the common TypeScript configuration. Every package has also its own package.json and tsconfig.json files indicating their particular configuration.

  1. Setup an ssh agent so you don't have to enter your Git ssh key every time (eval "$(ssh-agent -s)" followed by ssh-add ~/.ssh/your_github_key)
  2. npm install (generate the common node_modules folder with all the combined dependencies of all packages)
  3. npm run build (to see if the build succeeds)
  4. (executable) npm run release:bin (for production builds. see bin folder for build result)
  5. (libraries) npm run release:lib

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.