Skip to content

Commit

Permalink
Prepare v0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Caspar Oostendorp committed Feb 22, 2024
1 parent a3cb008 commit f24d170
Show file tree
Hide file tree
Showing 12 changed files with 87 additions and 85 deletions.
25 changes: 19 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18-bookworm-slim as web_node_deps
FROM node:20-bookworm-slim as web_node_deps

WORKDIR /app
COPY /web/patches ./patches
Expand All @@ -8,7 +8,7 @@ COPY --link /web/yarn.lock ./yarn.lock
# Install dependencies
RUN yarn install --frozen-lockfile

FROM node:18-bookworm-slim as bots_node_deps
FROM node:20-bookworm-slim as bots_node_deps
WORKDIR /app
COPY --link /bots/package.json ./package.json
COPY --link /bots/yarn.lock ./yarn.lock
Expand All @@ -17,7 +17,7 @@ COPY --link /bots/yarn.lock ./yarn.lock
RUN yarn install --frozen-lockfile

# Now copy all the sources so we can compile
FROM node:18-bookworm-slim AS web_node_builder
FROM node:20-bookworm-slim AS web_node_builder
WORKDIR /app
COPY /web .
COPY --from=web_node_deps /app/node_modules ./node_modules
Expand All @@ -27,7 +27,7 @@ RUN yarn build --mode production



FROM ghcr.io/oostvoort/keiko:0.0.21 AS runtime
FROM ghcr.io/pixelaw/keiko:0.1.5 AS runtime

ENV PUBLIC_TORII=http://localhost:8080
ENV PUBLIC_NODE_URL=http://localhost:5050
Expand All @@ -36,6 +36,19 @@ ENV CORE_VERSION=VERSION

HEALTHCHECK CMD (curl --fail http://localhost:3000 && curl --fail http://localhost:5050) || exit 1

WORKDIR /tmp/contracts
COPY ./contracts /tmp/contracts
RUN sozo build --manifest-path Scarb.toml && \
bash scripts/create_genesis.sh

RUN mkdir /keiko/config && mkdir /keiko/storage && mkdir /keiko/log && \
mv genesis.json /keiko/config/genesis.json && \
mv target/dev/manifest.json /keiko/config/manifest.json && \
mv torii.sqlite /keiko/storage/torii.sqlite && \
touch /keiko/log/katana.log.json && touch /keiko/log/torii.log

RUN rm -rf /tmp/contracts

WORKDIR /keiko

COPY --link ./startup.sh ./startup.sh
Expand All @@ -47,10 +60,10 @@ COPY ./bots ./bots
COPY --link ./bots/.env.production ./bots/.env
COPY --from=bots_node_deps /app/node_modules ./bots/node_modules

COPY ./contracts ./contracts



LABEL org.opencontainers.image.description = "PixeLAW core container"

RUN sozo build --manifest-path ./contracts/Scarb.toml

CMD ["bash", "./startup.sh"]
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
REPO = pixelaw/core
CORE_VERSION = 0.0.66
KEIKO_VERSION = v0.0.16
CORE_VERSION = 0.1.1
KEIKO_VERSION = v0.1.5


docker_build:
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.66
0.1.1
9 changes: 5 additions & 4 deletions contracts/Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
cairo-version = "2.4.0"
name = "pixelaw"
version = "0.0.66"
version = "0.1.1"
homepage = "https://github.com/pixelaw/core"

[cairo]
Expand Down Expand Up @@ -43,9 +43,10 @@ update_scarb = "bash ./scripts/update_scarb.sh"
#rpc_url = "https://api.cartridge.gg/x/pxlw-demo/katana"
#world_address = "0x34f94959ab0187227dd2d39e99b0650380e048e307392850e5c7aadb5e8de9f"

# Default account for katana with seed = 0
account_address = "0x6618f45aa1fe17d32ccd6217ad5d6a1fb6f25d7252dbf7e4423149af32c8ccd"
private_key = "0x313ae921cf6557b23a493d6b9ffa4be3ae93813bb59f8fa0effeb7be94b73f3"
# World Owner account
account_address = "0xb3ff441a68610b30fd5e2abbf3a1548eb6ba6f3559f2862bf2dc757e5828ca"
account_pubkey = "0x640466ebd2ce505209d3e5c4494b4276ed8f1cde764d757eb48831961f7cdea"
private_key = "0x2bbf4f9fd0bbb2e60b0316c1fe0b76cf7a4d0198bd493ced9b8df2a3a24d68a"

#keystore_password = "password"
#keystore_path = "../keystore.json"
65 changes: 34 additions & 31 deletions contracts/genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,17 @@
}
},
"accounts": {
"0x6618f45aa1fe17d32ccd6217ad5d6a1fb6f25d7252dbf7e4423149af32c8ccd": {
"publicKey": "0x1",
"0xb3ff441a68610b30fd5e2abbf3a1548eb6ba6f3559f2862bf2dc757e5828ca": {
"publicKey": "0x640466ebd2ce505209d3e5c4494b4276ed8f1cde764d757eb48831961f7cdea",
"balance": "0xD3C21BCECCEDA1000000",
"nonce": "0x1",
"storage": {
"0x1": "0x1",
"0x2": "0x2"
}
"storage": {}
},
"0xe29882a1fcba1e7e10cad46212257fea5c752a4f9b1b1ec683c503a2cf5c8a": {
"publicKey": "0x16e375df37a7653038bd9eccd767e780c2c4d4c66b4c85f455236a3fd75673a",
"balance": "0xD3C21BCECCEDA1000000",
"nonce": "0x1",
"storage": {}
}
},
"contracts": {
Expand All @@ -43,31 +46,31 @@
"class": "0x5ac623f0c96059936bd2d0904bdd31799e430fe08a0caff7a5f497260b16497",
"storage": {
"0x36d13f3f96a254c70c8330b71d2bd1ddec5e51f41977e0a2581409a42320efc": "0x6c458453d35753703ad25632deec20a29faf8531942ec109e6eb0650316a2bc",
"0x2df32d2c3738133c5521beef25940680c0449fb911eb65b5d86789728b0f657": "0x1",
"0x1e1a4f440a09e62552e8b84a50e697fb4320c97ca40a405efbfac1d14b300c2": "0x30d87b1462e33becf675f22517d2ff6d6b3b00ace2217a629a7eab770e467bc",
"0x485a841f2483848eac1f88b7d5a45b884dcf2c43b4e3c38412d906f479575e4": "0x1",
"0x158adc9c63a85ca0a8c64ef93f6d20fc1413b1eebf466cd3ba8be575c3f063e": "0x60863ea4ac938e2df9e6708ffed07fe349c7b73bc48f917753b516f3deb907d",
"0x2ce176e50297d4541c3b6203add03ca423c3c5e51acf6312107ddeb52826081": "0x708e05bf6d9dbf22b803a19456f9cefad46efae177f673044e0cacb826b3ff7",
"0x8c3e74337d26246eacdecd8e1cf6924ea447d730bcce9274ba324921cfbc88": "0x10072d7dc8685368983e2f453d267c0fc69ccbfcf0b9476b1776b6635a2b026",
"0x2c9402952f021499f9029cffb3eda6c20f13f9f732aa7bd1c4c38148d42d1a5": "0x1",
"0xda633847bd72b1b55f1420583782a12909cf095b8b7d43d5951e986c5a488f": "0x1",
"0x2fb934c9dc4f6097b4c6139e547fc46991c347ed8ccb8ba0ed666b460bc0c48": "0x1",
"0xbbbeab40b983304169afd9554624f1b6fc36cbbf2a44db533707f553676cc6": "0x5886d4be89cfed7d2e7207f05e844cc02291a4c5cefed3d78958194fb581ba5",
"0x92a38c5d069edaf176fc06c7f686932fb0ab25ff422755071e0696a420fb3e": "0x582f4025e4e013b12375cadaef31b4f68e7197e8bd951222ba182b2b6b702c6",
"0x74a3d9ec0eeafb61304f50a3efcc88580740745700f67ee27712cfd7f12d867": "0x9d54b9f3937222037f2c8e06d3daff945bcaf548f5069e421c2f6d27a2d3f",
"0x1acc3e6bd6dbb1f1ae7b13724744109c68251928f524d38be8eee7ca8b2632": "0x1",
"0x8c3e74337d26246eacdecd8e1cf6924ea447d730bcce9274ba324921cfbc88": "0x10072d7dc8685368983e2f453d267c0fc69ccbfcf0b9476b1776b6635a2b026",
"0x412d6240a20192df5da1136e7887de9d5d69c616fb83e46dac8228409910292": "0x303e1f153ea797a8fcd0554508e9f632e40c14d5ef36e01f801ec1322c159d4",
"0x6fd7bbc78dada217d8b2925162d696bbe02cc77da18dd535c7ec449313879c9": "0x1",
"0x92a38c5d069edaf176fc06c7f686932fb0ab25ff422755071e0696a420fb3e": "0x582f4025e4e013b12375cadaef31b4f68e7197e8bd951222ba182b2b6b702c6",
"0x1ba5716f3942eab1a545d32231b87046f72c0fc44f36e742070516240323cfb": "0x1",
"0x20623a7012604309947644101dcddbabb8deedfca644039e4f607d3591f5c07": "0x1",
"0x2698ea56b2005ec787d7fcb1bd073cd8c3f36c95fb6dfea395d6aeb9ae1c6ca": "0x1",
"0x5dae06452f557e1c40f7ad280422366d8e9e0d1deaad7e99fbfa5347d23b351": "0x1",
"0xbbbeab40b983304169afd9554624f1b6fc36cbbf2a44db533707f553676cc6": "0x5886d4be89cfed7d2e7207f05e844cc02291a4c5cefed3d78958194fb581ba5",
"0x575edf3c61d91a8e6b5d8faf732b1dfec6c8698b0a7af663519399b2f209bc7": "0x1",
"0x2910aa687e695a747b480bf4cb7ffcc17f8992570fa8cae34b8f92cc142afc2": "0x1d9b47c4273700072422dc4b8d651fbf2acd5007b962367cf462d9a94c7a950",
"0x3b7d0e229b3d3f9a7d474614af17d4b6022be0ee0c6eb925b03718df51de11c": "0x58c3b3d1bcb660d87aca81b732170c01fc20a5ecaf5f243030ccdb5473bd25f",
"0x73bdb1c676ba8341ff08550ec9f7c6889787694867717cbde3593a4a6cfae88": "0x1",
"0x7583fae5cd02c018e4969c3aa01d3193d9dde2937331494035a05761cf57125": "0x1",
"0x668b96e7798fc29a7e9feebfb0666f24f9952c68717fd51fa69b545fe8abe0d": "0x1",
"0x19ef53bbb8584634952d067cc57de5a84b32fd27aa34fe29f92bb2e5d16b98f": "0x1",
"0x6960f43f75d54729fd4aa0eda1d366a630d606644c873504ec505ff2a380347": "0x1",
"0x9fbe7db16ac7dd6f428c726999dd8ad21ca8d10f3d1e0bff6feba4a1be72eb": "0x1",
"0x2ce176e50297d4541c3b6203add03ca423c3c5e51acf6312107ddeb52826081": "0x708e05bf6d9dbf22b803a19456f9cefad46efae177f673044e0cacb826b3ff7",
"0x158adc9c63a85ca0a8c64ef93f6d20fc1413b1eebf466cd3ba8be575c3f063e": "0x60863ea4ac938e2df9e6708ffed07fe349c7b73bc48f917753b516f3deb907d",
"0x44e4a403dd32cc5fb03644b4492e2956813677d35ca0c014a7cce8d90c50c3f": "0x3a4c809a96cfaceca6754acf1f2b74efcdd28ba28cf0daecd8f3b2ee4ec7ef5",
"0x63fb6a0ae85fc7f9f8544016af7208ea2d47b9048ec2cde09317f8e09ec0ea9": "0x1",
"0x11e3fa52d905af29091d4d8142cce46c9892fafbb00f0eb986194183d878030": "0x1",
"0x58f0f26a414e91b4fc6839c1416ff8c649c7086885dcab52ed50dc3ee27458a": "0x1",
"0x4e5fd7f83688dfbac6ba3f3a57f6b175034a1d14627d3c02e2070b04fd0655": "0x1",
"0x3b7d0e229b3d3f9a7d474614af17d4b6022be0ee0c6eb925b03718df51de11c": "0x58c3b3d1bcb660d87aca81b732170c01fc20a5ecaf5f243030ccdb5473bd25f",
"0x43368a74d457911067e301b4b088892979dfbdeac9ad0dcdb01e134bdb14564": "0x1",
"0x4051be1539f896d6d550f48054f8ee51eb99d9ed98ed150c3ba77912d464eb2": "0x1",
"0x2910aa687e695a747b480bf4cb7ffcc17f8992570fa8cae34b8f92cc142afc2": "0x1d9b47c4273700072422dc4b8d651fbf2acd5007b962367cf462d9a94c7a950",
"0x60445d8ee009eedb2890b54645177c68c511aed3791dfc5877963551034036e": "0x1",
"0x4c2a9bd4c52845beb02f46be78aa22510f670801942c9300610780c51346a00": "0x1",
"0x576765861f0fdbef63caf78dcfb0add8c0efce1ae8a49bb82be776677ad679c": "0x1",
"0x13c8ef346a0c20efdc65e33153eb62edaf662eb162cd197bdd2f4cd626647f6": "0x1",
"0xd37f2ff98f2f86aac9c617cba79b5aef656c5ccdefbbb094332cf32fd4625a": "0x1",
"0x532e890069ee72c81b163f29d9151814401b53244c3a9a3c9220df7a955b473": "0x1",
"0x7da59c2b293df209ec3468120ffa72be33813ebb90bfada1013b449d46a07f7": "0x1",
Expand All @@ -78,15 +81,15 @@
"0x10d393c0f1195add769dd27aa65dcb8572c2120c9c9f2f7a3ea7b5c4dd72239": "0x1",
"0x1e8d257588aad9431a5c116e924d3144a60c76bcb04b8ca018663ff03872fc": "0x7a43b95fea20aff37d9d8ee7eb8ee07f2ff1f349c6ed5e24af5bd4808b4179e",
"0x373fecf4967fe6dc1a2d1ebc5dea841cc9031115882792291c1afa2bd87c564": "0x736e616b65",
"0x373fecf4967fe6dc1a2d1ebc5dea841cc9031115882792291c1afa2bd87c566": "0x552b3146343044",
"0x2f94b03ad682dbd36a69c3c3f60f3689e8a6fb6cf2ada271b5cca416923dab0": "0x73656c65637420646972656374696f6e20666f7220736e616b65",
"0x373fecf4967fe6dc1a2d1ebc5dea841cc9031115882792291c1afa2bd87c565": "0x424153452f6d616e6966657374732f736e616b65",
"0x2f94b03ad682dbd36a69c3c3f60f3689e8a6fb6cf2ada271b5cca416923dab0": "0x73656c65637420646972656374696f6e20666f7220736e616b65",
"0x11aa83fb9a3f9801b54f4ccc6b9a38169bca8f0791dc82bc302903d6f4fcdcf": "0x2bb5f29705bd1de1948f86e6f186b14da7f9134d980ff07a24d781eceee11ee",
"0x373fecf4967fe6dc1a2d1ebc5dea841cc9031115882792291c1afa2bd87c566": "0x552b3146343044",
"0x42565222488c41b2552159baa11343d9f169c1e7f875b4b77ff9d380761d272": "0x7061696e74",
"0x42565222488c41b2552159baa11343d9f169c1e7f875b4b77ff9d380761d274": "0x552b3146353843",
"0x118c44f251ac6e91e8a220283f86f0d8d3631da3149031a6f3c694b2b9a8c81": "0xff59cc477c124d615fd52cbea3d13bee2805d4454161be740fde62cd6f72af",
"0x42565222488c41b2552159baa11343d9f169c1e7f875b4b77ff9d380761d273": "0x424153452f6d616e6966657374732f7061696e74",
"0x1918b831d582e9e29410e2067e1246e9d25c27c15b25790e341848b4f464dc6": "0xa",
"0x42565222488c41b2552159baa11343d9f169c1e7f875b4b77ff9d380761d273": "0x424153452f6d616e6966657374732f7061696e74"
"0x118c44f251ac6e91e8a220283f86f0d8d3631da3149031a6f3c694b2b9a8c81": "0xff59cc477c124d615fd52cbea3d13bee2805d4454161be740fde62cd6f72af"
}
},
"0xff59cc477c124d615fd52cbea3d13bee2805d4454161be740fde62cd6f72af": {
Expand Down
15 changes: 9 additions & 6 deletions contracts/genesis_template.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,17 @@
}
},
"accounts": {
"0x6618f45aa1fe17d32ccd6217ad5d6a1fb6f25d7252dbf7e4423149af32c8ccd": {
"publicKey": "0x1",
"0xb3ff441a68610b30fd5e2abbf3a1548eb6ba6f3559f2862bf2dc757e5828ca": {
"publicKey": "0x640466ebd2ce505209d3e5c4494b4276ed8f1cde764d757eb48831961f7cdea",
"balance": "0xD3C21BCECCEDA1000000",
"nonce": "0x1",
"storage": {
"0x1": "0x1",
"0x2": "0x2"
}
"storage": {}
},
"0xe29882a1fcba1e7e10cad46212257fea5c752a4f9b1b1ec683c503a2cf5c8a": {
"publicKey": "0x16e375df37a7653038bd9eccd767e780c2c4d4c66b4c85f455236a3fd75673a",
"balance": "0xD3C21BCECCEDA1000000",
"nonce": "0x1",
"storage": {}
}
},
"contracts": {
Expand Down
2 changes: 1 addition & 1 deletion contracts/scripts/create_genesis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ GENESIS_TEMPLATE=genesis_template.json
GENESIS_OUT=genesis.json
KATANA_LOG=katana.log
MANIFEST=$TARGET/manifest.json
TORII_DB=torii_db.sqlite
TORII_DB=torii.sqlite
TORII_LOG=torii.log


Expand Down
2 changes: 1 addition & 1 deletion deployment/demo/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ version: "0.0.45"
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.0.66"
appVersion: "0.1.1"
34 changes: 11 additions & 23 deletions deployment/demo/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,30 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Values.projectName }}-{{ .Values.nameSpace }}-{{ .Values.appType.frontend }}
name: {{ .Values.projectName }}-{{ .Values.nameSpace }}
namespace: {{ .Values.projectName }}-{{ .Values.nameSpace }}
labels:
app: {{ .Values.projectName }}-{{ .Values.nameSpace }}-{{ .Values.appType.frontend }}
app: {{ .Values.projectName }}-{{ .Values.nameSpace }}
spec:
replicas: {{ .Values.replicaSet }}
selector:
matchLabels:
app: {{ .Values.projectName }}-{{ .Values.nameSpace }}-{{ .Values.appType.frontend }}
app: {{ .Values.projectName }}-{{ .Values.nameSpace }}
template:
metadata:
labels:
app: {{ .Values.projectName }}-{{ .Values.nameSpace }}-{{ .Values.appType.frontend }}
app: {{ .Values.projectName }}-{{ .Values.nameSpace }}
spec:
containers:
- name: {{ .Values.projectName }}-{{ .Values.nameSpace }}-{{ .Values.appType.frontend }}
- name: {{ .Values.projectName }}-{{ .Values.nameSpace }}
image: {{ .Values.dockerImage }}
imagePullPolicy: Always
ports:
- containerPort: {{ .Values.webappContainerService.port }}
env:
- name: CORE_VERSION
value: "{{ .Chart.AppVersion }}"
- name: PUBLIC_NODE_URL
value: "{{ .Values.webapp.katanaUrl }}"
- name: PUBLIC_TORII
value: "{{ .Values.webapp.toriiUrl }}"
- name: SLOT_KATANA
value: "{{ .Values.webapp.katanaSlotUrl }}"
- name: SLOT_TORII
value: "{{ .Values.webapp.toriiSlotUrl }}"
- name: SEED
value: "{{ .Values.webapp.seed }}"
- name: TOTAL_ACCOUNTS
value: "{{ .Values.webapp.totalAccounts }}"
- name: WORLD_ADDRESS
value: "{{ .Values.worldAddress }}"


# resources:
# requests:
Expand All @@ -47,12 +34,13 @@ spec:
# limits:
# memory: "1Gi"
# cpu: "1000m"

volumeMounts:
- name: keiko-manifests
mountPath: /keiko/manifests
- name: keiko-storage
mountPath: /keiko/storage

volumes:

- name: keiko-manifests
- name: keiko-storage
persistentVolumeClaim:
claimName: pixelaw-core-{{ .Values.nameSpace }}-pvc
claimName: {{ .Values.projectName }}-{{ .Values.nameSpace }}-pvc
10 changes: 2 additions & 8 deletions deployment/demo/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,7 @@ subDomainName:

dockerImage: ghcr.io/pixelaw/core:latest

worldAddress: "0x1a07a98f25210c7906fc09c44879e09b20b922ba4bf5e8ea5ae48db96f7f4bd"

webapp:
katanaUrl: "https://api.cartridge.gg/x/pxlw-demo-01/katana"
toriiUrl: "https://api.cartridge.gg/x/pxlw-demo-01/torii"
katanaSlotUrl: "https://api.cartridge.gg/x/pxlw-demo-01/katana"
toriiSlotUrl: "https://api.cartridge.gg/x/pxlw-demo-01/torii"
seed: "8657283857928754357"
totalAccounts: "4"
genesis: ""
torii-db: ""

2 changes: 1 addition & 1 deletion deployment/test/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ version: "0.0.45"
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.0.66"
appVersion: "0.1.1"
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
keiko:
image: ghcr.io/oostvoort/keiko:0.0.21
image: ghcr.io/pixelaw/keiko:0.1.3
container_name: keiko
ports:
- "5050:5050"
Expand Down

0 comments on commit f24d170

Please sign in to comment.