Skip to content

Commit

Permalink
Merge branch 'main' into clio
Browse files Browse the repository at this point in the history
  • Loading branch information
tbfleming committed Jun 26, 2021
2 parents 33bb5a8 + f7debfd commit da287ee
Show file tree
Hide file tree
Showing 358 changed files with 30,926 additions and 3,470 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/box.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: box

on:
push:
branches:
- main
- "test/*"
pull_request:
types: [assigned, opened, synchronize, reopened, labeled]
paths:
- "docker/eden-box.Dockerfile"
- ".eslintignore"
- ".eslintrc.js"
- ".prettierrc.json"
- "lerna.json"
- "packages/box"
- "package.json"
- "tsconfig.build.json"
- "tsconfig.json"
- "yarn.lock"

jobs:
box-e2e:
name: Eden Box E2E Tests
runs-on: ubuntu-latest

steps:
- name: ✅ Checkout code
uses: actions/checkout@v2

- name: 🛠 Build and Start Box
run: |
yarn
cd packages/box
yarn build
yarn start &
- name: 🧪 Run E2E
# TODO: add real E2E tests... for now it's just a shameless curl ping
run: |
curl localhost:3032
box-build:
needs: box-e2e
name: Build Eden Box
runs-on: ubuntu-latest

steps:
- name: ✅ Checkout code
uses: actions/checkout@v2

- name: Image Preparation
id: prep
run: |
REGISTRY="ghcr.io"
IMAGE="${REGISTRY}/${{ github.repository_owner }}/eden-box"
TAGS="${IMAGE}:${{ github.sha }}"
if [[ $GITHUB_REF == ref/head/master ]]; then
TAGS="${TAGS},${IMAGE}:latest"
fi
echo ::set-output name=tags::${TAGS,,}
- name: Showtag
id: showtag
run: echo ${{ steps.prep.outputs.tags }}

- name: Docker Buildx setup
uses: docker/setup-buildx-action@v1

- name: Login in to registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: 🛠 Build & Publish Image
uses: docker/build-push-action@v2
with:
# push: true # TODO: follow up on this... https://github.community/t/403-error-on-container-registry-push-from-github-action/173071/5
file: docker/eden-box.Dockerfile
tags: ${{ steps.prep.outputs.tags }}
21 changes: 10 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,24 +57,24 @@ jobs:
git submodule update --init --recursive
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DSKIP_TS=Yes -DEDEN_ATOMIC_ASSETS_ACCOUNT=atomicassets -DEDEN_ATOMIC_MARKET_ACCOUNT=atomicmarket -DEDEN_COLLECTION_NAME=edenmembers1 -DEDEN_SCHEMA_NAME=edenmembers1 ..
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DSKIP_TS=Yes -DEDEN_ATOMIC_ASSETS_ACCOUNT=atomicassets -DEDEN_ATOMIC_MARKET_ACCOUNT=atomicmarket -DEDEN_SCHEMA_NAME=members ..
make -j$(nproc)
echo =====
ccache -s
echo =====
cp eden.wasm eden-wax.wasm
cmake -DEDEN_ATOMIC_ASSETS_ACCOUNT=atomicassets -DEDEN_ATOMIC_MARKET_ACCOUNT=atomicmarket -DEDEN_COLLECTION_NAME=edenmembers1 -DEDEN_SCHEMA_NAME=edenmembers1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DSKIP_TS=Yes ..
touch ../contracts/eden/include/constants.hpp
make -j$(nproc) wasm
tar czf clsdk-ubuntu-20-04.tar.gz clsdk
echo =====
ccache -s
echo =====
- name: 🧪 Run tests with CTest
run: cd build && ctest -j$(nproc)
run: cd build && ctest -j$(nproc) -V

- name: 📃 Upload clsdk
uses: actions/upload-artifact@v2
with:
name: clsdk
path: |
build/clsdk-ubuntu-20-04.tar.gz
- name: 📃 Upload Eden Smart Contract
uses: actions/upload-artifact@v2
Expand All @@ -83,4 +83,3 @@ jobs:
path: |
build/eden.abi
build/eden.wasm
build/eden-wax.wasm
27 changes: 27 additions & 0 deletions .github/workflows/job-dev-gc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: job-dev-gc
on:
schedule:
- cron: "0 0,6,12,18 * * *"
workflow_dispatch:
inputs:
reason:
description: "What is the reason for triggering it manually?"
required: true
limit:
description: "Limit Records to Collect"
required: false
default: 250

jobs:
cron:
runs-on: ubuntu-latest
container: curlimages/curl:latest

steps:
- name: GC Job
run: |
curl -i --fail-with-body --request POST \
--url 'https://eden-dev.vercel.app/api/jobs/gc' \
--header 'Content-Type: application/json' \
--header 'x-job-key: ${{ secrets.DEV_JOBS_AUTH_GC }}' \
-d '{"limit": ${{ github.event.inputs.limit || 250 }}}'
20 changes: 20 additions & 0 deletions .github/workflows/job-dev-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: job-dev-test
on:
schedule:
- cron: "0 * * * *" # every hour
workflow_dispatch:
inputs:
reason:
description: "What is the reason for triggering it manually?"
required: true
jobs:
cron:
runs-on: ubuntu-latest
container: curlimages/curl:latest

steps:
- name: Test Job
run: |
curl -i --fail-with-body --request POST \
--url 'https://eden-dev.vercel.app/api/jobs/test' \
--header 'x-job-key: ${{ secrets.DEV_JOBS_AUTH_GC }}'
27 changes: 27 additions & 0 deletions .github/workflows/job-prd-gc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: job-prd-gc
on:
schedule:
- cron: "0 0,6,12,18 * * *"
workflow_dispatch:
inputs:
reason:
description: "What is the reason for triggering it manually?"
required: true
limit:
description: "Limit Records to Collect"
required: false
default: 250

jobs:
cron:
runs-on: ubuntu-latest
container: curlimages/curl:latest

steps:
- name: GC Job
run: |
curl -i --fail-with-body --request POST \
--url 'https://eden-prod.vercel.app/api/jobs/gc' \
--header 'Content-Type: application/json' \
--header 'x-job-key: ${{ secrets.PRD_JOBS_AUTH_GC }}' \
-d '{"limit": ${{ github.event.inputs.limit || 250 }}}'
30 changes: 29 additions & 1 deletion .github/workflows/webapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,42 @@ on:
- ".eslintrc.js"
- ".prettierrc.json"
- "lerna.json"
- "packages/**"
- "packages/webapp"
- "package.json"
- "tsconfig.build.json"
- "tsconfig.json"
- "yarn.lock"

jobs:
webapp-e2e:
name: WebApp E2E Tests
runs-on: ubuntu-latest

steps:
- name: ✅ Checkout code
uses: actions/checkout@v2

- name: 🛠 Build and Start WebApp
run: |
yarn
yarn build --stream
yarn start --stream &
- name: 🧪 Run E2E
run: |
yarn test --stream
- name: 🎥 Upload Cypress Results
uses: actions/upload-artifact@v2
if: always()
with:
name: Cypress E2E Videos and Screenshots
path: |
packages/webapp/cypress/screenshots
packages/webapp/cypress/videos
webapp-build:
needs: webapp-e2e
name: Build Eden Community WebApp
runs-on: ubuntu-latest

Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
[submodule "external/Catch2"]
path = external/Catch2
url = https://github.com/catchorg/Catch2.git
[submodule "external/rocksdb"]
path = external/rocksdb
url = https://github.com/facebook/rocksdb.git
[submodule "external/atomicassets-contract"]
path = external/atomicassets-contract
url = https://github.com/pinknetworkx/atomicassets-contract.git
9 changes: 5 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,23 @@ endif()
if(DEFINED WASI_SDK_PREFIX)
set(EDEN_ATOMIC_ASSETS_ACCOUNT atomicassets CACHE STRING "The account holding the atomicassets contract")
set(EDEN_ATOMIC_MARKET_ACCOUNT atomicmarket CACHE STRING "The account holding the atomicmarket contract")
set(EDEN_COLLECTION_NAME eden CACHE STRING "The atomicassets collection to use for NTFS")
set(EDEN_SCHEMA_NAME eden CACHE STRING "The atomicassets schema to use for NFTS")
set(EDEN_SCHEMA_NAME members CACHE STRING "The atomicassets schema to use for NFTS")

ExternalProject_Add(wasm
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/wasm
DEPENDS cltester # for abi generation
BINARY_DIR wasm
INSTALL_COMMAND ""
BUILD_ALWAYS 1
TEST_EXCLUDE_FROM_MAIN 1
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_BUILD_TYPE=
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_CURRENT_SOURCE_DIR}/wasm/toolchain.cmake
-DWASI_SDK_PREFIX=${WASI_SDK_PREFIX}
-DWASM_CLANG_PREFIX=${WASM_CLANG_PREFIX}
-DWASM_CLANG_SUFFIX=${WASM_CLANG_SUFFIX}
-DEDEN_ATOMIC_ASSETS_ACCOUNT=${EDEN_ATOMIC_ASSETS_ACCOUNT}
-DEDEN_ATOMIC_MARKET_ACCOUNT=${EDEN_ATOMIC_MARKET_ACCOUNT}
-DEDEN_COLLECTION_NAME=${EDEN_COLLECTION_NAME}
-DEDEN_SCHEMA_NAME=${EDEN_SCHEMA_NAME}
-DCMAKE_SYSROOT=${WASI_SDK_PREFIX}/share/wasi-sysroot
-DFORCE_COLORED_OUTPUT=${FORCE_COLORED_OUTPUT}
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ MIT License

Copyright (c) 2021 humanity and its contributors. All rights reserved.

Copyright (c) 2017-2019 block.one and its contributors. All rights reserved.
Copyright (c) 2017-2021 block.one and its contributors. All rights reserved.

The MIT License

Expand Down
2 changes: 2 additions & 0 deletions contracts/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
add_subdirectory(eden)
add_subdirectory(token)
add_subdirectory(boot)
add_subdirectory(bios)
4 changes: 4 additions & 0 deletions contracts/bios/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
add_executable(bios src/bios.cpp)
target_include_directories(bios PUBLIC include)
target_link_libraries(bios eosio-contract-simple-malloc)
set_target_properties(bios PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${ROOT_BINARY_DIR})
32 changes: 32 additions & 0 deletions contracts/bios/include/bios/bios.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#pragma once

#include <eosio/contract.hpp>
#include <eosio/dispatcher.hpp>
#include <eosio/privileged.hpp>

namespace bios
{
class bios_contract : public eosio::contract
{
public:
using eosio::contract::contract;
void newaccount() {}
void updateauth() {}
void deleteauth() {}
void linkauth() {}
void setcode() {}
void setabi() {}
void canceldelay() {}
void setpriv(eosio::name account, bool is_priv) { eosio::set_privileged(account, is_priv); }
};
EOSIO_ACTIONS(bios_contract,
"eosio"_n,
newaccount,
updateauth,
deleteauth,
linkauth,
setcode,
setabi,
canceldelay,
setpriv)
} // namespace bios
3 changes: 3 additions & 0 deletions contracts/bios/src/bios.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include <bios/bios.hpp>

EOSIO_ACTION_DISPATCHER(bios::actions)
4 changes: 4 additions & 0 deletions contracts/boot/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
add_executable(boot src/boot.cpp)
target_include_directories(boot PUBLIC include)
target_link_libraries(boot eosio-contract-simple-malloc)
set_target_properties(boot PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${ROOT_BINARY_DIR})
17 changes: 17 additions & 0 deletions contracts/boot/include/boot/boot.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#pragma once

#include <eosio/contract.hpp>
#include <eosio/dispatcher.hpp>
#include <eosio/privileged.hpp>

namespace boot
{
class boot_contract : public eosio::contract
{
public:
using contract::contract;
void boot();
void setcode() {}
};
EOSIO_ACTIONS(boot_contract, "eosio"_n, boot, setcode)
} // namespace boot
Loading

0 comments on commit da287ee

Please sign in to comment.