-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
1bbc147
commit 016a724
Showing
22 changed files
with
552 additions
and
217 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[package] | ||
name = "sonare-cli" | ||
description = "SONARE command-line interface" | ||
categories = ["cryptography", "science", "command-line-interface"] | ||
version.workspace = true | ||
authors.workspace = true | ||
repository.workspace = true | ||
homepage.workspace = true | ||
keywords.workspace = true | ||
readme.workspace = true | ||
license.workspace = true | ||
edition.workspace = true | ||
rust-version.workspace = true | ||
|
||
[dependencies] | ||
sonare = { version = "0.12.0-alpha.1", path = ".." } | ||
clap = { version = "4.5.21", features = ["derive", "env"] } |
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 |
---|---|---|
@@ -0,0 +1,78 @@ | ||
// SONARE: Runtime environment for formally-verifiable distributed software | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
// Designed in 2019-2024 by Dr Maxim Orlovsky <[email protected]> | ||
// Written in 2024-2025 by Dr Maxim Orlovsky <[email protected]> | ||
// | ||
// Copyright (C) 2019-2025 LNP/BP Standards Association, Switzerland. | ||
// Copyright (C) 2024-2025 Laboratories for Ubiquitous Deterministic Computing (UBIDECO), | ||
// Institute for Distributed and Cognitive Systems (InDCS), Switzerland. | ||
// Copyright (C) 2019-2025 Dr Maxim Orlovsky. | ||
// All rights under the above copyrights are reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except | ||
// in compliance with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software distributed under the License | ||
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express | ||
// or implied. See the License for the specific language governing permissions and limitations under | ||
// the License. | ||
|
||
use std::path::PathBuf; | ||
|
||
use sonare::util::ContractRef; | ||
|
||
pub enum Command { | ||
/// Import kit | ||
Import { | ||
path: PathBuf, | ||
}, | ||
|
||
/// List known objects | ||
List, | ||
|
||
/// Issue a new contract | ||
Issue { | ||
/// Contract information | ||
/// | ||
/// If not provided, read from the user input. | ||
path: Option<PathBuf>, | ||
}, | ||
|
||
/// Retrieve contract information | ||
Info { | ||
contract_id: ContractRef, | ||
}, | ||
|
||
/// Display contract state | ||
State { | ||
contract_id: ContractRef, | ||
}, | ||
|
||
/// Call contract read method | ||
Read { | ||
contract_id: ContractRef, | ||
}, | ||
|
||
/// Execute contract operation | ||
Exec { | ||
contract_id: ContractRef, | ||
}, | ||
|
||
/// Transfer contract state | ||
Transfer { | ||
contract_id: ContractRef, | ||
path: PathBuf, | ||
}, | ||
|
||
Validate { | ||
path: PathBuf, | ||
}, | ||
|
||
Accept { | ||
path: PathBuf, | ||
}, | ||
} |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// SONARE: Runtime environment for formally-verifiable distributed software | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
// Designed in 2019-2024 by Dr Maxim Orlovsky <[email protected]> | ||
// Written in 2024-2025 by Dr Maxim Orlovsky <[email protected]> | ||
// | ||
// Copyright (C) 2019-2025 LNP/BP Standards Association, Switzerland. | ||
// Copyright (C) 2024-2025 Laboratories for Ubiquitous Deterministic Computing (UBIDECO), | ||
// Institute for Distributed and Cognitive Systems (InDCS), Switzerland. | ||
// Copyright (C) 2019-2025 Dr Maxim Orlovsky. | ||
// All rights under the above copyrights are reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except | ||
// in compliance with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software distributed under the License | ||
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express | ||
// or implied. See the License for the specific language governing permissions and limitations under | ||
// the License. | ||
|
||
mod cmd; | ||
|
||
fn main() { todo!() } |
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,19 +1,6 @@ | ||
{-- | ||
A smart contract written for SONIC runtime environment | ||
SONIC stands for "State machine with ownership notation for indeterministic contracts" | ||
|
||
A contract calls are URIs and URLS, which may have multiple forms (depending on the backend). | ||
Here are the examples for the `castVote` call: | ||
- Using SONARE runtime: | ||
`contract:DAO.indsc.org/castVote?voting=id&with=(id,preimage)&next=(id,hash)&vote=pro` | ||
- Using a server providing SONIC API: | ||
`contract://any.sonicapi.node/DAO.indsc.org/castVote?voting=id&with=(id,preimage)&next=(id,hash)&vote=pro` | ||
- Using a server providing HTTP REST SONIC API: | ||
`https://[email protected]/DAO.indsc.org/castVote?voting=id&with=(id,preimage)&next=(id,hash)&vote=pro` | ||
- Using a websocket connection: | ||
`wws://[email protected]/DAO.indsc.org/castVote?voting=id&with=(id,preimage)&next=(id,hash)&vote=pro` | ||
- Using a Storm node server which contains SONARE runtime: | ||
`storm://any.storm.node/contract:DAO.indsc.org/castVote?voting=id&with=(id,preimage)&next=(id,hash)&vote=pro` | ||
--} | ||
|
||
data PartyId: U64 | ||
|
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 |
---|---|---|
|
@@ -30,6 +30,21 @@ | |
//! # URL Representation | ||
//! | ||
//! `contract:[//USER@NODE:PORT/]CONTRACT_ID[/API][/METHOD?ARGS]` | ||
//! | ||
//! A contract calls are URIs and URLS, which may have multiple forms (depending on the backend). | ||
//! Here are the examples for the `castVote` call for the DAO contract from the examples directory: | ||
//! - Using SONARE runtime: | ||
//! `contract:DAO.indsc.org/castVote?voting=id&with=(id,preimage)&next=(id,hash)&vote=pro` | ||
//! - Using a server providing SONIC API: | ||
//! `contract://any.sonicapi.node/DAO.indsc.org/castVote?voting=id&with=(id,preimage)&next=(id, | ||
//! hash)&vote=pro` | ||
//! - Using a server providing HTTP REST SONIC API: `https://[email protected]/DAO.indsc.org/castVote?voting=id&with=(id,preimage)&next=(id,hash)&vote=pro` | ||
//! - Using a websocket connection: | ||
//! `wws://[email protected]/DAO.indsc.org/castVote?voting=id&with=(id,preimage)& | ||
//! next=(id,hash)&vote=pro` | ||
//! - Using a Storm node server which contains SONARE runtime: | ||
//! `storm://any.storm.node/contract:DAO.indsc.org/castVote?voting=id&with=(id,preimage)&next=(id, | ||
//! hash)&vote=pro` | ||
mod data; | ||
|
||
|
Oops, something went wrong.