Code Monkey home page Code Monkey logo

eden's Introduction

Eden

Eden Community Web App

Running Eden Community Web App locally

yarn
yarn dev --stream
open http://localhost:3000

For more details, refer to the Web App README.

Eden Contracts

Contracts can be built manually (see below) but the latest contracts are also available from our Github CI/CD in this repo. For contract deployment/update instructions and considerations, see the Contracts README.

Build

Set the WASI_SDK_PREFIX environment variable before building (see architecture-specific instructions below). Alternatively, use cmake's -DWASI_SDK_PREFIX=.... option. Also make sure nodejs 14, npm 6.14, and yarn 1.22 are in your path.

git submodule update --init --recursive
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j
ctest -j

To speed up builds, use -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache

Ubuntu 20.04

sudo apt-get update
sudo apt-get install -yq    \
    binaryen                \
    build-essential         \
    cmake                   \
    git                     \
    libboost-all-dev        \
    libcurl4-openssl-dev    \
    libgbm-dev              \
    libgmp-dev              \
    libnss3-dev             \
    libssl-dev              \
    libusb-1.0-0-dev        \
    pkg-config              \
    wget

export WASI_SDK_PREFIX=~/work/wasi-sdk-12.0
export PATH=~/work/node-v14.16.0-linux-x64/bin:$PATH

cd ~/work
wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-12/wasi-sdk-12.0-linux.tar.gz
tar xf wasi-sdk-12.0-linux.tar.gz

wget https://nodejs.org/dist/v14.16.0/node-v14.16.0-linux-x64.tar.xz
tar xf node-v14.16.0-linux-x64.tar.xz
npm i -g yarn

Helper Scripts

Don't see the scripts directory. These scripts fell behind. Only use the build method described here.

Don't rely on the docker files in this repo, except for use within GH workflows. Instead, manually follow the instructions here inside a persistent interactive docker container.

Running Eden with Ephemeral Chains Locally

Ephemeral chains are instances of the EOS blockchain spawned by nodeos locally, with manipulated data from our chain runners, eg: Basic Genesis Runner, Elections Runner (which finishes with an open, running election), and Completed Elections Runner. By running a ephemeral chain you are in full control of the blockchain, giving you more flexibility to test the Eden contracts.

Get the executables

You will need to build the repo locally by following the below build steps. If you don't have a proper C++ environment setup you can download it from our current main branch artifacts.

If you built locally, you can skip these steps.

Downloading the executables

  • Open our main branch builds.
  • Click in the most recent successful one
  • Scroll down to the artifacts section
  • Download the following files:
    • Eden Microchain
    • Ephemeral Eden Chains Runners
    • clsdk
  • From the root of this repo, run the following commands:
mkdir build
# unzip all of the above artifact files in this build folder
cd build
tar -xvf clsdk-ubuntu-20-04.tar.gz clsdk/bin
cp ../scripts/eden_chain_runner.sh ./

Now you have all the files needed for running the ephemeral chain inside the build folder.

If you are on a Linux machine compatible with Ubuntu arch you can spin it up by just running: ./eden_chain_runner.sh run-genesis.wasm 1

Otherwise you can spin it up with the following docker command:

docker run --name eden-genesis \
  -v "$(pwd)":/app \
  -w /app \
  -p 8080:8080 -p 8888:8888 \
  -d -it ghcr.io/eoscommunity/eden-builder:sub-chain \
  bash ./eden_chain_runner.sh run-genesis.wasm 1

To see if the chain is running successfully you can execute cleos get info or watch the nodeos logs: tail -fn +1 eden-runner.log

With the ephemeral chain running you can just spin up our local environment with:

yarn
NODE_ENV=test yarn build --stream
NODE_ENV=test yarn start --stream
open http://localhost:3000

Re-running ephemeral chains

Running the above commands again will just setup a brand new chain! Just watch out to kill nodeos and unlock your keos wallet if built locally or remove your docker container. Also don't forget to restart the yarn environment because the blocks state needs to be refreshed.

In the above instructions we ran a simple genesis case with 3 inducted members, but you can also try run-complete-elections.wasm to see a community with more than 100 members with chief delegates already elected.

eden's People

Contributors

brandonfancher avatar cool-ant avatar greenbusdriver avatar james-mart avatar norsegaud avatar shakhruz avatar sparkplug0025 avatar swatanabe avatar tbfleming avatar velua avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eden's Issues

๐Ÿ“œ Add member's full name to the members table

We'd like to display a member's full name in more places throughout the UI. And in some places, full names for not just the member, but also endorsers on invitations. Calling AA's APIs to do this is heavy and doesn't make much sense.

Once a member is completely inducted, let's add their new name to the members table.

Note: We should only do this after they make their donation...not earlier when they fill out their profile. Because profiles belong to invitations, and a user could have multiple open invitations/profiles until they're inducted.

eden: figure out IPFS pinning solution

We're issuing NFTs. They'll have associated assets. We also have induction videos. While we may (as part of v0) handle much of this manually and host the IPFS assets ourselves, we should work to identify a better solution to the IPFS pinning problem.

This is about identifying and documenting the solution. We will implement it later.

๐Ÿš Identify Domain & Hosting

We need to identify and settle on the domain and hosting. Some options mentioned thus far:

  • Vercel is a frontrunner and offers best-in-class NextJS hosting.
  • Netlify is another option that our team has some experience with, however we need to figure out whether it handles NextJS/SSR (I don't see why it wouldn't).

๐ŸŽจ Update induction process form screens to more closely match XD wireframes

Similar to:

Except:

  • Use your judgment...these are just wireframes; they don't have to be exact.
  • Don't worry about modals/overlays. I'd just keep it on the page right now, but inside a Card component.

๐ŸŽจ Display induction status to pending member

When a user is signed in and have donated their 10 EOS, show them that they have a pending membership, its status, and its expiration.

There are several status (and this list may not be exhaustive):

  • Awaiting Invite (no action required by the pending member)
  • Invited and pending action by the invitee to set up their profile
  • Awaiting Induction Ceremony (waiting for hash of video recording to be added)
  • Awaiting endorsements (x/3)
  • Expired
  • Canceled (only inviter can cancel) The pending induction will simply (for now) if canceled by inviter.
  • Complete & NFTs issued! The pending invite is totally gone at this point, so they just see the membership dashboard.

Backport of eosio-tester to 2.0.x

This is to support unit and integration testing for the Eden contract, and as a potential tool for testing other projects.

eosio-tester Overview

eosio-tester runs non-contract WASM files which drive testing. It gives those WASM files access to the local system, similar to what a scripting environment does, but also gives them the following abilities:

  • Create, stop, start, and clone chains, including running several at once, all running in a single fully-synchronous process. This does not interfere with any running nodeos instances. (striked-out features aren't currently present, but can be added)
  • Push transactions to these chains and get results back.
  • Full control over timing. If a test needs a set of transactions to be in a specific block and in a specific order, it can do it. If a test needs to jump to a specific block several years in the future, it can do it.
  • Include contract code directly in the test wasm. This simplifies pushing transactions, reading tables, and even calling individual functions from the contract's source without having to go through a transaction.

Where lives

There are 3 parts to this:

eden: internationalization (i18n)

We will have non-English-speaking Eden communities soon too. We need to ensure the application is properly internationalized for easy localization/translation.

๐ŸŽจ Add Auction and Sale badges in a member NFT card

If any of the minted assets of a member template is on sale or on auction, we should have a badge for that on top of the member card image.

  • The sale badge should have the sale price.
  • The auction badge should have the last/initial bid.

Current AtomicHub Assets and Market APIs implementation: https://github.com/eoscommunity/Eden/blob/becdaf8756ab91219f467c1ea31abec498fc7e2e/packages/webapp/src/nfts/api/nfts.ts
Market API docs: https://test.wax.api.atomicassets.io/atomicmarket/docs/swagger/

eden: create script to deploy the contract

The script should have two options by default:

  • deploy on wax-testnet
  • deploy on eos mainnet

And have some parameters to allow us to deploy in any other chain (local testnet, junglenet etc)

๐ŸŽจ Display status of pending invitation(s) to endorsers

When an inviter adds an Eden member as an endorser, they should be aware of that. When signed in, an Eden member should be able to see any pending invitations for which they have been selected as an endorser, along with the status of the invitation. If the invitation is pending the attachment of the induction ceremony video hash or is awaiting their endorsement, they should have an option inviting them to take action.

๐Ÿš Define a release pipeline

Right now our CI is building the webapp and the eden contract.

We need to set publish some build artifacts (contract wasm + abis + webapp dcker #5 ) and release it as latest (whenever we merge to master) and also have a way to tag versioned releases.

๐ŸŽจ Add the asset number badge in the Member Collection Tab

Look at the member profile page:

image

The collection tab shows what are the members card that the user collects. We should add a badge (aside from the on sale/auction #6) that shows which member card number the user collects.

More context:
Whenever we invite a new member to Eden we will issue 5-8 cards. Card 1 goes to the community auction, card 2 goes to the invited member, card 3 goes to the inviter, and the rest of them goes to the endorsers. We want to show which card number the current user collects.

๐ŸŽจ Add react icons for EOS and EosCommunity social handles

Right now we are using placeholders examples for the social handles in the profile page:

image

  • The 1st icon (bitcoin placeholder) links to EOS Mainnet Account (bloks.io), so the icon should be EOS Chestahedron
  • The 4th icon (airbnb placeholder) links to the EosCommunity.org profile page, so the icon could be the Discourse chat balloon with perhaps the chestahedron inside...

Wallet signin mechanism

A follow up for #13 -- after adding that provider, we can then create a login button on the top right corner of the screen. That way we can start the development of new members donation, induction process etc.

๐ŸŽจ Add pagination on the New Members section

Right now we have a draft of the New Members section on the Community Members page - http://localhost:3000/members
image

We can either:
a. show the newest X members and add a Show All button which will redirect to a page like /members/newest and add a pagination there.
b. keep the newest members panel on the members page with an infinite right arrow button... (kind of a "related products" widget)

Creates a Global Client Side Context in NextJs for UALProvider

Right now we have an example of UAL being used on client side for a specific single page: https://github.com/eoscommunity/Eden/blob/fd4144c23d653bf67504d33191dd5b1cecaa1731/packages/webapp/src/pages/nfts/creator.tsx

Instead, we should add the UALProvider in the whole app provider. In nextjs we usually do that in https://github.com/eoscommunity/Eden/blob/fd4144c23d653bf67504d33191dd5b1cecaa1731/packages/webapp/src/pages/_app.tsx

But for UALProvider we need to figure a way to only wrap it if it's in the client side. (I think NextJS repo, examples folder is the best resource, I've seen some client side providers being setup there like apollo-graphql...)

๐ŸŽจ Display status of pending invitation(s) to inviter

When an Eden member has invited another EOS user to the Eden community, the inviter should be able to see they have an open invitation (or invitations) along with its status, expiration, and whether any action is needed on their part for that status.

There are several status (and this list may not be exhaustive):

  • Invited and pending action by the invitee to set up their profile
  • Awaiting Induction Ceremony (waiting for hash of video recording to be added)
  • Awaiting endorsements (x/3)
  • Expired?

๐Ÿ“œ Contract: Limit Active Community Members to 10,000

See Eden Contract v0 Design > 10,000 Active Member Limit

Eden community membership should not exceed 10,000. UI should also reflect community size. (457 / 10,000 members).

This task is about implementing just enough of this feature that we avoid painting ourselves into a corner. As @sparkplug0025 suggested, let's:

create a table that controls the quantity of members - a stats table. Having the members counter will protect us from big design changes/data reload.

We'll follow up with more proper design and implementation in a future story.

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.