Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .docker/subzero-dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Note: We don't use Alpine and its packaged Rust/Cargo
# because they're too often out of date,
# preventing them from being used to build subzero/Polkadot.

FROM phusion/baseimage:focal-1.2.0 as baseimage
ENV DEBIAN_FRONTEND=noninteractive


RUN apt-get update && \
apt-get dist-upgrade -y -o Dpkg::Options::="--force-confold" && \
apt-get install -y cmake pkg-config libssl-dev git clang

WORKDIR /subzero
COPY . /subzero

RUN curl https://sh.rustup.rs -sSf | sh -s -- -y && \
export PATH="$PATH:$HOME/.cargo/bin" && \
rustup toolchain install nightly-2022-06-24 && \
rustup target add wasm32-unknown-unknown --toolchain nightly-2022-06-24 && \
rustup default nightly-2022-06-24 &&\
rustup show

# ===== STAGE 2 ======

FROM baseimage as builder
ARG PROFILE=release

RUN export PATH="$PATH:$HOME/.cargo/bin" && \
cargo build "--$PROFILE"

# ===== STAGE 3 ======

FROM phusion/baseimage:focal-1.2.0
LABEL maintainer="devops@zero.io"
LABEL description="This is the 2nd stage: a very small image where we copy the subzero binary."
ARG PROFILE=release

RUN mv /usr/share/ca* /tmp && \
rm -rf /usr/share/* && \
mv /tmp/ca-certificates /usr/share/ && \
useradd -m -u 1000 -U -s /bin/sh -d /subzero subzero && \
mkdir -p /subzero/.local/share/subzero && \
chown -R subzero:subzero /subzero/.local && \
ln -s /subzero/.local/share/subzero /data

COPY --from=builder /subzero/target/$PROFILE/subzero-dev /usr/local/bin
COPY --from=builder /subzero/.docker/chainspec /chainspec

# checks
RUN ldd /usr/local/bin/subzero-dev && \
/usr/local/bin/subzero-dev --version

# Shrinking
# RUN rm -rf /usr/lib/python* && \
# rm -rf /usr/bin /usr/sbin /usr/share/man

USER subzero
EXPOSE 30333 9933 9944 9615
VOLUME ["/data"]

CMD ["/usr/local/bin/subzero-dev"]
3 changes: 3 additions & 0 deletions bin/alphaville/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ gamedao-flow = { path = "../../../modules/gamedao-protocol/flow", default-featur
gamedao-control = { path = "../../../modules/gamedao-protocol/control", default-features = false }
gamedao-signal = { path = "../../../modules/gamedao-protocol/signal", default-features = false }
gamedao-sense = { path = "../../../modules/gamedao-protocol/sense", default-features = false }
gamedao-battlepass = { path = "../../../modules/gamedao-protocol/battlepass", default-features = false }

[build-dependencies]
substrate-wasm-builder = { version = "5.0.0-dev", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.28" }
Expand Down Expand Up @@ -234,6 +235,7 @@ std = [
"gamedao-flow/std",
"gamedao-control/std",
"gamedao-signal/std",
"gamedao-battlepass/std",
]
runtime-benchmarks = [
"frame-benchmarking/runtime-benchmarks",
Expand Down Expand Up @@ -292,6 +294,7 @@ runtime-benchmarks = [
"gamedao-control/runtime-benchmarks",
"gamedao-flow/runtime-benchmarks",
"gamedao-signal/runtime-benchmarks",
"gamedao-battlepass/runtime-benchmarks",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are no benchmarks defined for this pallet.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not yet, will add benchmarks in separate PR.

]
try-runtime = [
"frame-executive/try-runtime",
Expand Down
24 changes: 21 additions & 3 deletions bin/alphaville/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1483,15 +1483,21 @@ impl pallet_gilt::Config for Runtime {
type WeightInfo = pallet_gilt::weights::SubstrateWeight<Runtime>;
}

parameter_types! {
pub const PartsLimit: u32 = 25;
pub const CollectionSymbolLimit: u32 = 100;
pub const MaxResourcesOnMint: u32 = 100;
}

impl pallet_rmrk_core::Config for Runtime {
type Event = Event;
type ProtocolOrigin = frame_system::EnsureRoot<AccountId>;
type MaxRecursions = ConstU32<10>;
type ResourceSymbolLimit = ConstU32<10>;
type PartsLimit = ConstU32<25>;
type PartsLimit = PartsLimit;
type MaxPriorities = ConstU32<25>;
type CollectionSymbolLimit = ConstU32<100>;
type MaxResourcesOnMint = ConstU32<100>;
type CollectionSymbolLimit = CollectionSymbolLimit;
type MaxResourcesOnMint = MaxResourcesOnMint;
}

parameter_types! {
Expand Down Expand Up @@ -1799,6 +1805,16 @@ impl gamedao_sense::Config for Runtime {
type StringLimit = StringLimit;
}

impl gamedao_battlepass::Config for Runtime {
type Event = Event;
type Control = Control;
type Rmrk = RmrkCore;
type StringLimit = StringLimit;
type SymbolLimit = CollectionSymbolLimit;
type PartsLimit = PartsLimit;
type MaxResourcesOnMint = MaxResourcesOnMint;
}

construct_runtime!(
pub enum Runtime where
Block = Block,
Expand Down Expand Up @@ -1877,6 +1893,7 @@ construct_runtime!(
Sense: gamedao_sense,
Control: gamedao_control,
Signal: gamedao_signal,
Battlepass: gamedao_battlepass,

// Zero pallets:
// Migration: module_migration,
Expand Down Expand Up @@ -1990,6 +2007,7 @@ mod benches {
[gamedao_control, Control]
[gamedao_flow, Flow]
[gamedao_signal, Signal]
// [gamedao_battlepass, Battlepass]
);
}

Expand Down
2 changes: 1 addition & 1 deletion bin/subzero-dev/node/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "subzero-dev-node"
version = "3.2.63"
version = "3.2.66"
authors = ["ZERO <play@zero.io>"]
description = "A substrate node for video games and beyond."
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
Expand Down
5 changes: 4 additions & 1 deletion bin/subzero-dev/runtime/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "subzero-dev-runtime"
version = "3.2.63"
version = "3.2.66"
authors = ["ZERO <play@zero.io>"]
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
homepage = "https://zero.io"
Expand Down Expand Up @@ -109,6 +109,7 @@ gamedao-flow = { path = "../../../modules/gamedao-protocol/flow", default-featur
gamedao-control = { path = "../../../modules/gamedao-protocol/control", default-features = false }
gamedao-signal = { path = "../../../modules/gamedao-protocol/signal", default-features = false }
gamedao-sense = { path = "../../../modules/gamedao-protocol/sense", default-features = false }
gamedao-battlepass = { path = "../../../modules/gamedao-protocol/battlepass", default-features = false }

[features]
default = [
Expand Down Expand Up @@ -197,6 +198,7 @@ std = [
"gamedao-flow/std",
"gamedao-control/std",
"gamedao-signal/std",
"gamedao-battlepass/std",
]

runtime-benchmarks = [
Expand All @@ -214,6 +216,7 @@ runtime-benchmarks = [
"pallet-identity/runtime-benchmarks",
"pallet-treasury/runtime-benchmarks",
"pallet-timestamp/runtime-benchmarks",
"pallet-uniques/runtime-benchmarks",
"pallet-xcm/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"xcm-builder/runtime-benchmarks",
Expand Down
13 changes: 12 additions & 1 deletion bin/subzero-dev/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("subzero"),
impl_name: create_runtime_str!("dev"),
authoring_version: 75,
spec_version: 63,
spec_version: 66,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down Expand Up @@ -1075,6 +1075,16 @@ impl gamedao_sense::Config for Runtime {
type StringLimit = StringLimit;
}

impl gamedao_battlepass::Config for Runtime {
type Event = Event;
type Control = Control;
type Rmrk = RmrkCore;
type StringLimit = StringLimit;
type SymbolLimit = ConstU32<100>;
type PartsLimit = ConstU32<25>;
type MaxResourcesOnMint = ConstU32<100>;
}

// Create the runtime by composing the FRAME pallets that were previously configured.
construct_runtime!(
pub enum Runtime where
Expand Down Expand Up @@ -1143,6 +1153,7 @@ construct_runtime!(
Sense: gamedao_sense = 71,
Control: gamedao_control = 72,
Signal: gamedao_signal = 73,
Battlepass: gamedao_battlepass = 74,
}
);

Expand Down
4 changes: 0 additions & 4 deletions bin/subzero/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1065,10 +1065,6 @@ mod benches {
[pallet_timestamp, Timestamp]
[pallet_collator_selection, CollatorSelection]
[cumulus_pallet_xcmp_queue, XcmpQueue]
[gamedao_flow, Flow]
[gamedao_sense, Sense]
[gamedao_control, Control]
[gamedao_signal, Signal]
);
}

Expand Down