npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@counterfactual/playground

v0.1.5

Published

This is an environment to run dApps (state channel-based decentralized applications) using [CF.js](../cf.js). It allows to showcase different demo apps, presenting a variety of use cases where state channels are applicable.

Downloads

21

Readme

Playground Demo

This is an environment to run dApps (state channel-based decentralized applications) using CF.js. It allows to showcase different demo apps, presenting a variety of use cases where state channels are applicable.

You can see the app online at https://playground.counterfactual.com.

How do I run the Playground?

Requirements 📋️

Make sure your dependency tree and package builds is up-to-date. Run the following command at the monorepo's root directory:

yarn && yarn build

In order for the Playground to run at your workstation, you'll need:

  • A PostgreSQL database (>= 10.x)
  • A BIP39 mnemonic for the Server's funds account

Check on the Simple Hub Server requirements before running the Playground.

Running the Playground 🎪

You can use the following command at the monorepo's root to run the following Playground components:

yarn run:playground

This command will run:

Playing with bots 🤖

In order to play either High Roller or Tic-Tac-Toe locally, you'll need to run a bot package. You can run a bot package by running its own yarn start command on its directory. Refer either to the High Roller or Tic-Tac-Toe's README files for any specific setup required by the bot.

Once you have a bot up and running, you'll need to setup the Playground to force-matchmake with the bot's account. Since matchmaking works by choosing random users, it might not select the bot user when you click "Play" on the dApp.

In order to force-matchmake, the Playground listens to a flag that can be set via Local Storage, called playground:matchmakeWith.

Open the Playground's local URL, http://localhost:3334 and on your devtools's console, run the following command:

// Use "HighRollerBot" or "TicTacToeBot" as value
window.localStorage.setItem("playground:matchmakeWith", "<BotName>");

Refresh the page and you should see a ⚠️ Using dev flags message in the header. If you click it, it'll bring up a modal. It should reflect the value you set with the command mentioned above.

Now you're ready to play with a bot! 🤖

If you want to stop force-matchmaking, simply delete the flag by clicking the "Unset" action on the "Using dev flags" modal or by entering this command at your browser's console:

window.localStorage.removeItem("playground:matchmakeWith");

Be sure to refresh the page to apply the changes.

Playing with a specific user 👪️

You can use the same procedure described before to matchmake with a particular player. In order to do so, instead of using HighRollerBot or TicTacToe as the value of the flag, set it to the player's username.

Known issues

  • When using Firefox or any browsers without full support to Custom Elements, you can run the project with ES5 transpiling enabled (it'll slow down the live rebuilding a bit but it'll work). To do so, modify the start NPM script and add the --es5 flag at the end of the command.