Holochain experimental app to mimic reddit-place (pixel wars)
- Install the required tools
- Rust wasm target:
npm run install:rust
holochain
:cargo install holochain
(or use nix-shell)npm run install:hc
npm run install:zits
- Rust wasm target:
npm install
npm run install:submodules
npm run install:hash-zome
npm run devtest
npm run devtest:electron
- Build the chaperone specific happ:
npm run build:chaperone
- Launch the local holo-dev-server:
npm run self-hosted
- Launch the happ for chaperone:
npm run start:chaperone
- Build the chaperone specific happ:
npm run build:chaperone
- Launch the happ for holo main-net:
npm run start:holo-mainnet
After building the dna and chaperone app, the *.happ
and ui-chaperone.zip
files will be available in the /workdir
folder.
npm run build:webapp
the *.webhapp
file will be available in the /workdir
folder.
struct PlaceProperties {
pub start_time: u64, // Starting time of the Canvas for drawing, in seconds since UNIX_EPOCH
pub canvas_size: u16, // Canvas size, in pixels
pub bucket_size_sec: u32, // Size of a time bucket, in seconds
pub pixels_per_bucket: u16, // Number of pixels allowed per agent per time bucket
pub snapshot_interval_in_buckets: u16, // Time interval between frame snapshots, in number of time buckets
}
Agents creates "Placements" which is the attribution of an indexed color to a {x,y} pixel on the canvas. "Placements" are limited to 16 colors. The Canvas is square, with a side's length set by a DNA property.
Time is divided into buckets of size 'bucket_size_sec'. 'bucket_size_sec' is a DNA property which corresponds to the allowed minimum time interval between placements of pixel per agent. A "time_bucket_index" is the number of buckets since EPOCH.
DNA has a 'start_time' property which is the number of seconds since EPOCH. It represents the starting time of the 'place'. At every time bucket a snapshot is made by 'rendering nodes' or self. Nodes attempt to render the latest snapshot based on their ordering of pixel placement in that time bucket (i.e. the last agent to place a pixel is the first agent to try, the 2nd latest agent to place a pixel is the 2nd agent to try to render a snapshot, etc). After half of the next bucket's time is elapsed, any node can attempt to render a snapshot, if none exists. ex: The snapshot at bucket 42 is the result of all placements until bucket 41, included.
A snapshot stores the latest placements for each pixel at a given time bucket.
- UI: Typescript, Rollup, Lit, svelte-store, holochain-open-dev, pixijs
- Electron app: Typescript, electron-holochain, electron-builder
Directory | Description |
---|---|
/dna/ |
DNA source code |
/electron/ |
Electron app directory |
bin/ |
All the binaries we are dependent on and must ship with the app |
src/ |
The electron app source code |
web/ |
Final artifacts for the electron app (includes output from webapp ) |
/webapp/ |
The Place webapp source code |
webhapp.workdir/ |
webhapp work directory |
/webapp-chaperone/ |
The Place webapp source code for holo hosting |
/webcomponents/ |
The web components source code |
/we-applet/ |
The applet for We integration |
Copyright (C) 2021, Harris-Braun Enterprises, LLC
This program is free software: you can redistribute it and/or modify it under the terms of the license provided in the LICENSE file (CAL-1.0). This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.