GithubHelp home page GithubHelp logo

spellcaster-facets's Introduction

Issues Twitter


Logo

Treasure Spellcaster Facets

The source of truth for all facets related to the Spellcaster API suite of tools and game loops
Learn about Treasure »

Infrastructure · The Treasureverse · Request Feature

Table of Contents

About The Project

Logo

Simplifying blockchain interactions and allowing for seamless developer and user experiences is what makes Treasure magical. With this grimoire, harnesing the Spellcaster API to delight Treasure ecosystem players is as effortless as using a regular API.

By working on the secure, customizable, and user-centric blockchain features and bundling the blockchain interactions into a developer friendly API, Spellcaster frees up valuable developer time and resources to focus on making the best gaming experience for all Treasure players

Developer Resources

Initial installation

IMPORTANT: Use Node version 18.x

  1. Install NodeJS. You can also install/manage NodeJS via nvm, which helps with managing multiple repos with varying versions needed
  2. Install Yarn, the package manager that is used to build and cache dependencies as well as the solhint/spellcaster solhint plugin nested locally
  3. (Optional) Install act - Local GitHub Actions, a local GitHub Action runner, to ensure code stability before PRing. This will save from PRs that get flagged with errors. You will need to install Docker if you have not already

Install dependencies / initialize the repo

yarn init

To install Forge, go to https://book.getfoundry.sh/getting-started/installation

Linting

The following command gets ran via ci and will block code that doesn't conform.

yarn lint:check

Run the following command to try to automatically fix linting errors.

yarn lint:fix

Building

yarn build

Testing

yarn test

Commiting

When committing code, Husky will run 2 pre-commit hooks:

  1. commitlint - A conventional commit messaging enforcer. See https://www.conventionalcommits.org/en/v1.0.0/ for what conventional commits strive to achieve
  2. Lint / format fixing - Runs solhint + forge fmt to ensure code style formats are consistent across the repo. Will prevent commits if any errors are found

Running GitHub Actions

To run the lint-build-test GitHub Action job, execute the following script:

./run-gh-actions.sh -j lint-build-test 

This script will build and use the Dockerfile as the local runner with Node/Rust/Yarn preinstalled to bypass those slow steps. It will also reuse the previous run state (build/eslint state, etc) to only track changes between runs. It will always full copy the repo file state for anything not in the .gitignore file.

NOTE1: This requires docker and act to be installed and will prompt if they are missing.

NOTE2: If there are any weird issues, reset your act setup by deleting the container that starts with act-spellcaster-facets and optionally the $HOME/.cache/actcache directory (the local cache server location for the actions/cache package)

NOTE3: If you are running a Mac with an Apple Silicon CPU, some of the following settings should be considered for performance optimizations:

  • Currently there is a crippling performance bug on Docker Desktop's latest version. If the Virtual Machine Server service is at max CPU usage, revert to version 4.14.1 for now.
  • Enable VirtioFS for optimal volume file sharing (in Beta Features for verion 4.14.1 and General for latest versions)
  • Disable Open Docker Dashboard at startup
  • Do NOT use -b when running the run-gh-actions.sh script. Binding mounts for Mac Silicon is extremely slow.

Recommended Setup

For optimal intellisense and NatSpec completion, it is recommended to use the Nomic Foundation's Solidity extension, in addition to adding the following VSCode snippet (since there isn't any native event/struct completion snippets)

To add the snippet on Mac: Open Command Palette -> Type Snippet -> Press "Snippets: Configure User Snippets" -> find the 'Solidity' language -> Paste the following

{
	"natspec event": {
		"prefix": "\/\/ nat_event",
		"body": "\/**\r\n * @notice \r\n * @param \r\n *\/",
		"description": "natspec for events"
	},
	"natspec struct": {
		"prefix": "\/\/ nat_struct",
		"body": "\/**\r\n * @dev \r\n * @param \r\n *\/",
		"description": "natspec for structs"
	}
}

Now you can find these completions whenever typing '/'. For non-events/structs, use the default completion, as it will generate based on params and return variables

Contact

Treasure - @Treasure_DAO - [email protected]

Project Link: https://treasure.lol

spellcaster-facets's People

Contributors

treasure-t1dev avatar mouse-dev-1 avatar antlion12 avatar vinnytreasure avatar

Stargazers

GasWar avatar

Watchers

Alec Ananian avatar Yuri Visser avatar Francis John avatar Wyatt Mufson avatar  avatar  avatar

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.