Commit Graph

97 Commits

Author SHA1 Message Date
2f8a098580
Switch license to https://unlicense.org/ 2025-08-27 23:37:32 +03:00
4d0a219f07
change uuid to vm_id and app_id 2025-07-18 04:41:41 +03:00
dc8d33d487 Fixed vm port mapping 2025-07-16 17:55:19 +03:00
bc09a128af
enable multiple offers per VM node 2025-07-06 21:50:05 +03:00
9e3a39545d
fix tests for escrow 2025-07-06 00:58:57 +03:00
871e26edc2
fix app price calculation
fix overflow when calculating account escrow
calculates app price per minute based on resource usage
2025-07-01 19:21:26 +05:30
2fe8d38156
Merge branch 'app_payment' into credits_app 2025-07-01 12:23:05 +05:30
30eef43aa5
Merge branch 'credits-v2' into credits_app
fixed all mb gb issues on migration and test
2025-06-30 23:32:01 +05:30
ddba7a4f95
switch from LP to credits
As part of open sourcing the software product, we should consider that
loyalty points are not the best language. Switching to "credits" makes
sense from a lot of points of view.

At the same time, this change allows an achitectural change towards
slots. Slots allow daemon resources to get booked based on the HW ratio
configured in the daemon config.
2025-06-27 15:47:42 +03:00
2b6151d12f
Adds vcpus, memory_mib, and disk_mib fields to the AppNodeListResp 2025-06-26 18:28:40 +05:30
547246629b
cargo fmt 2025-06-25 18:57:01 +05:30
46ba0961bf
Refactor app engine resource units
updated app proto file to mib
fixed all tests and migrations
removed unused price calculation functions
modified mock data
2025-06-25 18:51:22 +05:30
1ca66f3bc3
switch from LP to credits
As part of open sourcing the software product, we should consider that
loyalty points are not the best language. Switching to "credits" makes
sense from a lot of points of view.

At the same time, this change allows an achitectural change towards
slots. Slots allow daemon resources to get booked based on the HW ratio
configured in the daemon config.
2025-06-25 03:51:02 +03:00
41b6b9b9d0
Minor fix on app node fields
Remove offline_minutes from AppNodeWithReports and update query condition for active app node filter
2025-06-23 15:46:49 +05:30
dcacd7b6b0
App contract payment
implement online/offline status updates
add timer to charge app contract
modified app_node in schema
2025-06-20 16:08:06 +05:30
ee1b12f85f
new staging server 2025-06-19 20:36:20 +03:00
d4e499126d
Fix new_app response error
fixed double deleting new_app_req from both daemon and cli side
enhanced new_app logging
2025-06-19 21:03:57 +05:30
8d1721ca11
Minor bug fixes
Updates ActiveApp with IP and fixes hratls_pubkey mapping
reduced rustls logging to debug
2025-06-17 15:23:56 +05:30
39ee3cd84b
Merge bug-fix: Fixes on app engine
fixed app node filter query
updated proto change mb to gb on app node resource
tests for get one node for app and vm
tests for node resource updates on vm and app
fix test for app node filtering implemented ip based node filtering
mocking random public ip for node
local brain binary for test without tls
refactor test grpc services to use grpc only stream
2025-06-16 18:39:07 +05:30
7b1bb98074
Update app proto
update storage unit to GB in AppNodeResources and related files
2025-06-16 17:46:29 +05:30
9bff01a440
add Apache-2.0 license 2025-06-14 03:40:13 +03:00
6bd30bf87c
implemented pubsub node redirect to app methods
fix app_node schema
improved query handling with bind on check pubsub node
test for app pubsub node
2025-06-13 20:12:21 +05:30
ff72ff6c1e
fixed pub_sub_node field error on re registration 2025-06-12 19:29:14 +05:30
9363750d5b
implemented redirect vm methods
Introduces new environment variable to set public endpoint of the brain
refactor redirect validation to db module
validating pubsub node on all vm
fixed some vm tests
2025-06-12 18:44:45 +05:30
5de6bd7cbf
WIP fixed redirect returning internal error
Refactors the `check_pubsub_node` function to return an `Option<Status>`
to indicate whether a redirect is needed.
2025-06-11 13:12:03 +05:30
786489fcbd
WIP on impl redirect use remote addr
using remote address on daemon registration as pubsub endpoint
validating pubsub node using client req remote address
remove fetching public ip
2025-06-10 21:02:54 +05:30
af7d4157ee
WIP on implementing redirect
implement public IP handling
Add pub_sub_node field to vm_node table in SQL schema
Refactor BRAIN_GRPC_ADDR to use LazyLock for dynamic IP assignment
Implement current_brain_endpoint function to retrieve public IP
2025-06-10 16:45:16 +05:30
d398198f63
fixes app node resource update
tests for node resource updates on vm and app
fix test for app node filtering implemented ip based node filtering
mocking random public ip for node
local brain binary for test without tls
refactor test grpc services to use grpc only stream
2025-06-09 18:29:00 +05:30
d1921eb838
fix get one app node
fixed app node filter query
updated proto change mb to gb on app node resource
tests for get one node for app and vm
2025-06-06 16:44:17 +05:30
eaed502805
Add GPLv2 license 2025-06-04 23:32:13 +03:00
479b9b6fa4 Implement refund on delete app and vm
fix authentication and refund on delete vm
refactor app daemon register to get delete app req
db function for delete app
sample environment variable
extensive tests for delete app and vm
refactor test utilities
2025-06-04 16:01:42 +00:00
e59a3c8fd8 Implement new app contract balance locking
minimum locking balance on deployment
locking balance on app deployment
refunding locked nano while error on daemon
returning appropreate error on app deployment
fixed some typos on logging
new timeout constants for daemon respose
minor change in schema and proto
extensive tests on app deployments
fixed some vm tests
2025-06-04 16:01:42 +00:00
c8363b5e07 fix new_vm error
reverted stream query
checking err on db before listening error stream
refactor app grpc code
2025-06-04 16:01:42 +00:00
965ac90319
adapt deploy script to the new brain infra 2025-06-01 03:16:55 +03:00
cd5c83d3c3
fix token calculation
all token inputs are in nano lp
fix MIN_ESCROW calculation
fixed all tests with TOKEN_DECIMAL multiplication
2025-05-29 20:34:23 +05:30
0367d70ef3
fix: refund on new_vm error
refund locked_nano on daemon returns error on new_vm
fix live select error on new_vm_req
refactor mock daemon for return error
extensive tests for new_vm
2025-05-29 17:37:53 +05:30
05759a5149
improve query handling in new_vm
enhanced transaction error handling
bind all string input into NewVmReq submission query
2025-05-28 17:17:26 +05:30
5ccd432566
feat extend vm locked amount
extensive test for extend_vm feature
error handling for db transaction limits
mock data for test extend_vm
todo marking for refund tmp_locked
2025-05-27 21:03:53 +05:30
0ec1b61d8b
Admin and opertor features (#3)
all admin features listing accounts and contracts with access controll and test
ban a user by operator
tests for all features
mock data for test

Reviewed-on: #3
Co-authored-by: Noor <noormohammedb@protonmail.com>
Co-committed-by: Noor <noormohammedb@protonmail.com>
Signed-off-by: Noor <noormohammedb@protonmail.com>
2025-05-26 03:17:27 +05:30
d1e85ec03e
Kick Contract (#2)
Production grade kick contract code for financial transaction tested for both vm and app
modified schema to include node in kick, default time for deleted_app and removed unwanted fields
app data migration for testing kick contract for active_app
fixed some tests
register operator

Reviewed-on: #2
Co-authored-by: Noor <noormohammedb@protonmail.com>
Co-committed-by: Noor <noormohammedb@protonmail.com>
Signed-off-by: Noor <noormohammedb@protonmail.com>
2025-05-26 03:17:00 +05:30
198f43f472
Fix: vm creating error
catching Insufficient fund error from transaction
returning approprate error variant
2025-05-20 20:20:02 +05:30
6a85acda9e
when node reconnects, send deleted VMs
previously, active VMs were sent
2025-05-20 01:45:31 +03:00
32b587c6c5
merged proto branch 2025-05-20 00:19:04 +03:00
0fc9b8003a
adding payments for VM contracts 2025-05-18 16:08:18 +03:00
5c74962ac6
Enhance contract inspect
Allow operators to access app and VM contracts to inspect
2025-05-14 20:58:19 +05:30
8caa55e325
App deployment
rename rpc method app deploy to new_app
improved is_banned_by_node checking app nodes also
moved common ErrorFromTable type to db module
2025-05-14 20:55:13 +05:30
92f4e15412
App contract delete 2025-05-14 13:31:12 +05:30
38a73fd003
App contract list
Implement retrieve app contracts by UUID, admin, and operator
2025-05-14 00:09:36 +05:30
1e8014a5d6
App node
get one app node
2025-05-13 16:07:57 +05:30
0ccaa4840c
App nodes list
modified AppNode filtering proto
improve logging in signature checking
2025-05-13 13:10:42 +05:30