diff --git a/.fluence/schemas/env.json b/.fluence/schemas/env.json index 9f27d846..15ba59de 100644 --- a/.fluence/schemas/env.json +++ b/.fluence/schemas/env.json @@ -24,5 +24,6 @@ }, "required": [ "version" - ] + ], + "additionalProperties": false } diff --git a/.fluence/schemas/fluence.json b/.fluence/schemas/fluence.json index 2a1f8e56..1d1afb23 100644 --- a/.fluence/schemas/fluence.json +++ b/.fluence/schemas/fluence.json @@ -88,7 +88,8 @@ } }, "required": [], - "nullable": true + "nullable": true, + "additionalProperties": false }, "properties": { "Module_name": { @@ -161,7 +162,8 @@ } }, "required": [], - "nullable": true + "nullable": true, + "additionalProperties": false } }, "nullable": true, @@ -170,7 +172,8 @@ }, "required": [ "get" - ] + ], + "additionalProperties": false }, "properties": { "Service_name": { @@ -256,7 +259,8 @@ } }, "required": [], - "nullable": true + "nullable": true, + "additionalProperties": false }, "properties": { "Module_name": { @@ -329,7 +333,8 @@ } }, "required": [], - "nullable": true + "nullable": true, + "additionalProperties": false } }, "nullable": true, @@ -338,7 +343,8 @@ }, "required": [ "get" - ] + ], + "additionalProperties": false } }, "required": [], @@ -387,7 +393,8 @@ } } }, - "required": [] + "required": [], + "additionalProperties": false }, "aquaInputPath": { "type": "string", @@ -437,7 +444,8 @@ "minItems": 1 } }, - "required": [] + "required": [], + "additionalProperties": false }, "properties": { "workerName": { @@ -469,7 +477,8 @@ "minItems": 1 } }, - "required": [] + "required": [], + "additionalProperties": false } }, "required": [] @@ -589,6 +598,7 @@ }, "clock": { "type": "object", + "additionalProperties": false, "nullable": true, "description": "Trigger the spell execution periodically. If you want to disable this property by overriding it in fluence.yaml - pass empty config for it like this: `clock: {}`", "properties": { @@ -629,7 +639,8 @@ }, "required": [ "get" - ] + ], + "additionalProperties": false }, "properties": { "Spell_name": { @@ -661,6 +672,7 @@ }, "clock": { "type": "object", + "additionalProperties": false, "nullable": true, "description": "Trigger the spell execution periodically. If you want to disable this property by overriding it in fluence.yaml - pass empty config for it like this: `clock: {}`", "properties": { @@ -701,7 +713,8 @@ }, "required": [ "get" - ] + ], + "additionalProperties": false } }, "required": [] @@ -757,7 +770,8 @@ "required": [ "contractsEnv", "relays" - ] + ], + "additionalProperties": false }, "defaultSecretKeyName": { "description": "Secret key with this name will be used by default by js-client inside CLI to run Aqua code", @@ -775,5 +789,6 @@ ], "$id": "https://fluence.dev/schemas/fluence.yaml", "title": "fluence.yaml", - "description": "Defines Fluence Project, most importantly - what exactly you want to deploy and how. You can use `fluence init` command to generate a template for new Fluence project" + "description": "Defines Fluence Project, most importantly - what exactly you want to deploy and how. You can use `fluence init` command to generate a template for new Fluence project", + "additionalProperties": false } diff --git a/.fluence/schemas/module.json b/.fluence/schemas/module.json index 3c23537a..18a045bb 100644 --- a/.fluence/schemas/module.json +++ b/.fluence/schemas/module.json @@ -86,6 +86,7 @@ "const": 0 } }, + "additionalProperties": false, "required": [ "version", "name" diff --git a/.fluence/schemas/service.json b/.fluence/schemas/service.json index be8f063d..5019ffb5 100644 --- a/.fluence/schemas/service.json +++ b/.fluence/schemas/service.json @@ -86,7 +86,8 @@ }, "required": [ "get" - ] + ], + "additionalProperties": false }, "properties": { "facade": { @@ -163,7 +164,8 @@ }, "required": [ "get" - ] + ], + "additionalProperties": false }, "Other_module_name": { "type": "object", @@ -239,7 +241,8 @@ }, "required": [ "get" - ] + ], + "additionalProperties": false } }, "required": [ @@ -255,5 +258,6 @@ "version", "name", "modules" - ] + ], + "additionalProperties": false } diff --git a/.fluence/schemas/spell.json b/.fluence/schemas/spell.json index 4c5a041d..10531fe8 100644 --- a/.fluence/schemas/spell.json +++ b/.fluence/schemas/spell.json @@ -23,6 +23,7 @@ }, "clock": { "type": "object", + "additionalProperties": false, "nullable": true, "description": "Trigger the spell execution periodically. If you want to disable this property by overriding it in fluence.yaml - pass empty config for it like this: `clock: {}`", "properties": { @@ -65,5 +66,6 @@ "version", "function", "aquaFilePath" - ] + ], + "additionalProperties": false } diff --git a/.fluence/schemas/workers.json b/.fluence/schemas/workers.json index 2b394551..cf08b55e 100644 --- a/.fluence/schemas/workers.json +++ b/.fluence/schemas/workers.json @@ -2,6 +2,7 @@ "$id": "https://fluence.dev/schemas/workers.yaml", "title": "workers.yaml", "type": "object", + "additionalProperties": false, "description": "A result of app deployment. This file is created automatically after successful deployment using `fluence workers deploy` command", "properties": { "version": { @@ -47,7 +48,8 @@ "dealIdOriginal", "chainNetwork", "chainNetworkId" - ] + ], + "additionalProperties": false }, "properties": { "Worker_deployed_using_deals": { @@ -86,7 +88,8 @@ "dealIdOriginal", "chainNetwork", "chainNetworkId" - ] + ], + "additionalProperties": false } }, "required": [], @@ -128,7 +131,8 @@ "host_id", "spell_id", "worker_id" - ] + ], + "additionalProperties": false } }, "relayId": { @@ -141,7 +145,8 @@ "installation_spells", "relayId", "dummyDealId" - ] + ], + "additionalProperties": false }, "properties": { "Worker_deployed_using_direct_hosting": { @@ -177,7 +182,8 @@ "host_id", "spell_id", "worker_id" - ] + ], + "additionalProperties": false } }, "relayId": { @@ -190,7 +196,8 @@ "installation_spells", "relayId", "dummyDealId" - ] + ], + "additionalProperties": false } }, "required": [], diff --git a/.gitignore b/.gitignore index f03529c7..ce3c47e3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,23 +1,12 @@ -/target - -# recommended by Fluence Labs: .idea .DS_Store +/.fluence/secrets +/.fluence/env.yaml +/.fluence/schemas +/.fluence/tmp **/node_modules **/target/ .repl_history -.vscode/settings.json -src/ts/src/aqua -src/js/src/aqua - -src/air -src/distro/decider-spell/ - -# builtin package artifacts -connector/ -connector.tar.gz -decider.json - -*.wasm - -**/target +/.vscode/settings.json +/src/ts/src/aqua +/src/js/src/aqua \ No newline at end of file diff --git a/fluence.yaml b/fluence.yaml index 1fc312f0..10f9b97c 100644 --- a/fluence.yaml +++ b/fluence.yaml @@ -1,9 +1,11 @@ # yaml-language-server: $schema=.fluence/schemas/fluence.json -# Defines Fluence Project, most importantly - what exactly you want to deploy and how. You can use `fluence init` command to generate a template for new Fluence project - -# Documentation: https://github.com/fluencelabs/fluence-cli/tree/main/docs/configs/fluence.md +# Documentation: https://github.com/fluencelabs/cli/tree/main/docs/configs/fluence.md +# Defines Fluence Project +# Most importantly - what exactly you want to deploy and how +# You can use `fluence init` command to generate a template for new Fluence project +# config version version: 5 # This is like the "main" Aqua file, but @@ -44,21 +46,3 @@ spells: decider: # path to directory containing 'spell.yaml' get: src/aqua - -# Here I define where to deploy workers. -hosts: - # this is the _worker_ name - decider: - peerIds: - # that's where to deploy it - - 12D3KooWJDiLFLmWstcFpAofWkYJzuvwuquNTQQkB9xzKjRyqqFJ - services: - - chain_connector - spells: - - decider - -relays: - - /ip4/127.0.0.1/tcp/9999/ws/p2p/12D3KooWJDiLFLmWstcFpAofWkYJzuvwuquNTQQkB9xzKjRyqqFJ - # - /dns4/stage.fluence.dev/tcp/19001/wss/p2p/12D3KooWHCJbJKGDfCgHSoCuK9q4STyRnVveqLoXAPBbXHTZx9Cv - -contractsEnv: testnet diff --git a/src/aqua/spell.yml b/src/aqua/spell.yml index e8e5dd85..7e59f65a 100644 --- a/src/aqua/spell.yml +++ b/src/aqua/spell.yml @@ -1,13 +1,17 @@ # yaml-language-server: $schema=../../.fluence/schemas/spell.json -yaml-language-server: $schema=../../../.fluence/schemas/spell.yaml.json +# # Defines a spell. You can use `fluence spell new` command to generate a template for new spell # Documentation: https://github.com/fluencelabs/fluence-cli/tree/main/docs/configs/spell.md version: 0 + aquaFilePath: ./decider/poll.aqua + function: main + clock: periodSec: 20 endDelaySec: 1800 + initArgs: chain: api_endpoint: http://127.0.0.1:8545