-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
latentvector
committed
Dec 20, 2024
1 parent
1d71013
commit 92c8fa8
Showing
9 changed files
with
49 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,25 @@ | ||
# THE GENERAL CONTAINER FOR CONNECTING ALL THE ENVIRONMENTS 😈 | ||
FROM ubuntu:22.04 | ||
|
||
#SYSTEM | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
RUN usermod -s /bin/bash root | ||
RUN apt-get update | ||
|
||
#RUST | ||
RUN apt-get install curl nano build-essential cargo libstd-rust-dev -y | ||
#NPM/JS | ||
|
||
#JS | ||
RUN apt-get install -y nodejs npm | ||
RUN npm install -g pm2 | ||
|
||
#PYTHON | ||
RUN apt-get install python3 python3-pip python3-venv -y | ||
COPY . /commune | ||
RUN pip install -e /commune | ||
# RUN git clone -b main https://github.com/commune-ai/commune.git /commune | ||
WORKDIR /app | ||
|
||
# make /commune equal to the current directory | ||
COPY . /commune | ||
RUN pip install -e /commune | ||
|
||
# TODO DOCKERIZE THE ENTRYPOINT | ||
# ENTRYPOINT | ||
ENTRYPOINT [ "tail", "-f", "/dev/null"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,22 @@ | ||
|
||
import json | ||
|
||
|
||
class Memory: | ||
def __init__(self): | ||
self.memory = {} | ||
def __init__(self, max_bytes_size = 100000): | ||
self.memory = [] | ||
self.max_bytes_size = max_bytes_size | ||
|
||
|
||
def current_size(self): | ||
return sum([len(x) for x in self.memory]) | ||
|
||
def check_storage(self, value:str): | ||
return len(self.memory) + len(value) <= self.max_bytes | ||
|
||
def store(self, address, value): | ||
self.memory[address] = value | ||
def store(self, value): | ||
value = json.dumps(value) | ||
self.memory += [value_hash] | ||
|
||
def load(self, address): | ||
return self.memory.get(address, 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters