From 41bd28b352dd24a53fa6bacc4fcdb8ed52e07695 Mon Sep 17 00:00:00 2001 From: Alexey Proshutinskiy Date: Tue, 25 May 2021 13:01:21 +0300 Subject: [PATCH] add service id and name to generated .aqua --- aqua/aqua-dht.aqua | 76 +++++++++++++++++++++++----------------------- build.sh | 2 +- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/aqua/aqua-dht.aqua b/aqua/aqua-dht.aqua index 9ce4f11..ddc3be4 100644 --- a/aqua/aqua-dht.aqua +++ b/aqua/aqua-dht.aqua @@ -1,3 +1,8 @@ +data Key: + key: string + peer_id: string + timestamp_created: u64 + data Record: value: string peer_id: string @@ -5,39 +10,6 @@ data Record: service_id: []string timestamp_created: u64 -data GetValuesResult: - success: bool - error: string - result: []Record - -data PutValueResult: - success: bool - error: string - -data Key: - key: string - peer_id: string - timestamp_created: u64 - -data GetKeyMetadataResult: - success: bool - error: string - key: Key - -data RepublishKeyResult: - success: bool - error: string - -data RegisterKeyResult: - success: bool - error: string - -data ClearExpiredResult: - success: bool - error: string - count_keys: u64 - count_values: u64 - data EvictStaleItem: key: Key records: []Record @@ -47,17 +19,45 @@ data EvictStaleResult: error: string results: []EvictStaleItem +data GetValuesResult: + success: bool + error: string + result: []Record + +data GetKeyMetadataResult: + success: bool + error: string + key: Key + +data ClearExpiredResult: + success: bool + error: string + count_keys: u64 + count_values: u64 + +data RepublishKeyResult: + success: bool + error: string + +data PutValueResult: + success: bool + error: string + +data RegisterKeyResult: + success: bool + error: string + data RepublishValuesResult: success: bool error: string updated: u64 -service AquaDht: - get_values(key: string, current_timestamp: u64) -> GetValuesResult - put_value(key: string, value: string, current_timestamp: u64, relay_id: []string, service_id: []string) -> PutValueResult - republish_values(key: string, records: []Record, current_timestamp: u64) -> RepublishValuesResult - register_key(key: string, current_timestamp: u64) -> RegisterKeyResult +service AquaDHT("aqua-dht"): republish_key(key: Key, current_timestamp: u64) -> RepublishKeyResult clear_expired(current_timestamp: u64) -> ClearExpiredResult + put_value(key: string, value: string, current_timestamp: u64, relay_id: []string, service_id: []string) -> PutValueResult + register_key(key: string, current_timestamp: u64) -> RegisterKeyResult get_key_metadata(key: string, current_timestamp: u64) -> GetKeyMetadataResult + get_values(key: string, current_timestamp: u64) -> GetValuesResult + republish_values(key: string, records: []Record, current_timestamp: u64) -> RepublishValuesResult evict_stale(current_timestamp: u64) -> EvictStaleResult diff --git a/build.sh b/build.sh index 129b260..e877cde 100755 --- a/build.sh +++ b/build.sh @@ -9,4 +9,4 @@ rm -f artifacts/* mkdir -p artifacts cp target/wasm32-wasi/release/aqua-dht.wasm artifacts/ curl -L https://github.com/fluencelabs/sqlite/releases/download/v0.14.0_w/sqlite3.wasm -o artifacts/sqlite3.wasm -marine aqua artifacts/aqua-dht.wasm > aqua/aqua-dht.aqua +marine aqua artifacts/aqua-dht.wasm -s AquaDHT -i aqua-dht > aqua/aqua-dht.aqua