Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nouns amigos game2 d #1

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# encuesta

# NounsAmigosGame2D Proyecto =HomieLand= (encuesta example)
Proyecto realizado para la certificaci[on de ICP.
Durante este periodo de aprendizaje me di a la tarea de aprender los fundamentos y aplicaciones de Internet Computer. Desarrollé un proyecto titulado HomieLand el cual tiene como objetivo, crear una plataforma dedicada a Gaming web3 enfocandome principalmente en el host de videojuegos con implementaci[on de blockchain, as[i como una plataforma social de gamers con algunas implementaciones que pueden hacer más llevadero el conocimiento y onbording de gamers hacia este tipo de tecnologia como stream, un mercado de activos digitales conectados a cada videojuego o como tal una plataforma que registre logros, airdrops o informaci[on basica de cualquier proyecto de gaming.
Para esta etapa inicial, subi un juego en el que estoy trabajando titulado "NounsAmigosGame2D"un juego plataformero con los assets de NounsAmigos, este proyecto puden probarlo dentro de la carpeta titulada icp-project.


Welcome to your new encuesta project and to the internet computer development community. By default, creating a new project adds this README and some template files to your project directory. You can edit these template files to customize your project and to include your own code to speed up the development cycle.

Expand Down
15 changes: 15 additions & 0 deletions ic-project/dfx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"canisters": {
"nouns_a_game": {
"frontend": {
"entrypoint": "src/nouns_a_game/src/index.html"
},
"source": [
"src/nouns_a_game/assets",
"src/nouns_a_game/src"
],
"type": "assets"
}
},
"version": 1
}
8 changes: 8 additions & 0 deletions ic-project/local/canister_ids.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"__Candid_UI": {
"local": "ajuq4-ruaaa-aaaaa-qaaga-cai"
},
"nouns_a_game": {
"local": "a4tbr-q4aaa-aaaaa-qaafq-cai"
}
}
244 changes: 244 additions & 0 deletions ic-project/local/canisters/nouns_a_game/assetstorage.did
Original file line number Diff line number Diff line change
@@ -0,0 +1,244 @@
type BatchId = nat;
type ChunkId = nat;
type Key = text;
type Time = int;

type CreateAssetArguments = record {
key: Key;
content_type: text;
max_age: opt nat64;
headers: opt vec HeaderField;
enable_aliasing: opt bool;
allow_raw_access: opt bool;
};

// Add or change content for an asset, by content encoding
type SetAssetContentArguments = record {
key: Key;
content_encoding: text;
chunk_ids: vec ChunkId;
sha256: opt blob;
};

// Remove content for an asset, by content encoding
type UnsetAssetContentArguments = record {
key: Key;
content_encoding: text;
};

// Delete an asset
type DeleteAssetArguments = record {
key: Key;
};

// Reset everything
type ClearArguments = record {};

type BatchOperationKind = variant {
CreateAsset: CreateAssetArguments;
SetAssetContent: SetAssetContentArguments;

SetAssetProperties: SetAssetPropertiesArguments;

UnsetAssetContent: UnsetAssetContentArguments;
DeleteAsset: DeleteAssetArguments;

Clear: ClearArguments;
};

type CommitBatchArguments = record {
batch_id: BatchId;
operations: vec BatchOperationKind
};

type CommitProposedBatchArguments = record {
batch_id: BatchId;
evidence: blob;
};

type ComputeEvidenceArguments = record {
batch_id: BatchId;
max_iterations: opt nat16
};

type DeleteBatchArguments = record {
batch_id: BatchId;
};

type HeaderField = record { text; text; };

type HttpRequest = record {
method: text;
url: text;
headers: vec HeaderField;
body: blob;
certificate_version: opt nat16;
};

type HttpResponse = record {
status_code: nat16;
headers: vec HeaderField;
body: blob;
streaming_strategy: opt StreamingStrategy;
};

type StreamingCallbackHttpResponse = record {
body: blob;
token: opt StreamingCallbackToken;
};

type StreamingCallbackToken = record {
key: Key;
content_encoding: text;
index: nat;
sha256: opt blob;
};

type StreamingStrategy = variant {
Callback: record {
callback: func (StreamingCallbackToken) -> (opt StreamingCallbackHttpResponse) query;
token: StreamingCallbackToken;
};
};

type SetAssetPropertiesArguments = record {
key: Key;
max_age: opt opt nat64;
headers: opt opt vec HeaderField;
allow_raw_access: opt opt bool;
is_aliased: opt opt bool;
};

type ConfigurationResponse = record {
max_batches: opt nat64;
max_chunks: opt nat64;
max_bytes: opt nat64;
};

type ConfigureArguments = record {
max_batches: opt opt nat64;
max_chunks: opt opt nat64;
max_bytes: opt opt nat64;
};

type Permission = variant {
Commit;
ManagePermissions;
Prepare;
};

type GrantPermission = record {
to_principal: principal;
permission: Permission;
};
type RevokePermission = record {
of_principal: principal;
permission: Permission;
};
type ListPermitted = record { permission: Permission };

type ValidationResult = variant { Ok : text; Err : text };

service: {
api_version: () -> (nat16) query;

get: (record {
key: Key;
accept_encodings: vec text;
}) -> (record {
content: blob; // may be the entirety of the content, or just chunk index 0
content_type: text;
content_encoding: text;
sha256: opt blob; // sha256 of entire asset encoding, calculated by dfx and passed in SetAssetContentArguments
total_length: nat; // all chunks except last have size == content.size()
}) query;

// if get() returned chunks > 1, call this to retrieve them.
// chunks may or may not be split up at the same boundaries as presented to create_chunk().
get_chunk: (record {
key: Key;
content_encoding: text;
index: nat;
sha256: opt blob; // sha256 of entire asset encoding, calculated by dfx and passed in SetAssetContentArguments
}) -> (record { content: blob }) query;

list : (record {}) -> (vec record {
key: Key;
content_type: text;
encodings: vec record {
content_encoding: text;
sha256: opt blob; // sha256 of entire asset encoding, calculated by dfx and passed in SetAssetContentArguments
length: nat; // Size of this encoding's blob. Calculated when uploading assets.
modified: Time;
};
}) query;

certified_tree : (record {}) -> (record {
certificate: blob;
tree: blob;
}) query;

create_batch : (record {}) -> (record { batch_id: BatchId });

create_chunk: (record { batch_id: BatchId; content: blob }) -> (record { chunk_id: ChunkId });

// Perform all operations successfully, or reject
commit_batch: (CommitBatchArguments) -> ();

// Save the batch operations for later commit
propose_commit_batch: (CommitBatchArguments) -> ();

// Given a batch already proposed, perform all operations successfully, or reject
commit_proposed_batch: (CommitProposedBatchArguments) -> ();

// Compute a hash over the CommitBatchArguments. Call until it returns Some(evidence).
compute_evidence: (ComputeEvidenceArguments) -> (opt blob);

// Delete a batch that has been created, or proposed for commit, but not yet committed
delete_batch: (DeleteBatchArguments) -> ();

create_asset: (CreateAssetArguments) -> ();
set_asset_content: (SetAssetContentArguments) -> ();
unset_asset_content: (UnsetAssetContentArguments) -> ();

delete_asset: (DeleteAssetArguments) -> ();

clear: (ClearArguments) -> ();

// Single call to create an asset with content for a single content encoding that
// fits within the message ingress limit.
store: (record {
key: Key;
content_type: text;
content_encoding: text;
content: blob;
sha256: opt blob
}) -> ();

http_request: (request: HttpRequest) -> (HttpResponse) query;
http_request_streaming_callback: (token: StreamingCallbackToken) -> (opt StreamingCallbackHttpResponse) query;

authorize: (principal) -> ();
deauthorize: (principal) -> ();
list_authorized: () -> (vec principal) query;
grant_permission: (GrantPermission) -> ();
revoke_permission: (RevokePermission) -> ();
list_permitted: (ListPermitted) -> (vec principal) query;
take_ownership: () -> ();

get_asset_properties : (key: Key) -> (record {
max_age: opt nat64;
headers: opt vec HeaderField;
allow_raw_access: opt bool;
is_aliased: opt bool; } ) query;
set_asset_properties: (SetAssetPropertiesArguments) -> ();

get_configuration: () -> (ConfigurationResponse);
configure: (ConfigureArguments) -> ();

validate_grant_permission: (GrantPermission) -> (ValidationResult);
validate_revoke_permission: (RevokePermission) -> (ValidationResult);
validate_take_ownership: () -> (ValidationResult);
validate_commit_proposed_batch: (CommitProposedBatchArguments) -> (ValidationResult);
validate_configure: (ConfigureArguments) -> (ValidationResult);
}
Binary file not shown.
Loading