Skip to content

Commit

Permalink
[chore] fastnft -> sui everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
sblackshear committed Mar 8, 2022
1 parent ad4f4d9 commit 1f89431
Show file tree
Hide file tree
Showing 20 changed files with 49 additions and 49 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ TODO: Define basic system requirements for a reliable environment: recommended O

To contribute, ensure you have the latest version of the codebase. To clone the repository, run the following:
```bash
git clone https://github.com/mystenlabs/fastnft.git
git clone https://github.com/mystenlabs/sui.git
cd sui
cargo build --all --all-targets
cargo test
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@

Welcome to Sui, a next generation smart contract platform with high throughput, low latency, and an asset-oriented programming model powered by the [Move](https://github.com/MystenLabs/awesome-move) programming language! Here are some suggested starting points:

* To jump right into building smart contract applications on top of Sui, go to [Move Quick Start](https://github.com/MystenLabs/fastnft/tree/main/doc/src/move.md).
* To experiment with a sample Sui wallet, check out [Wallet Quick Start](https://github.com/MystenLabs/fastnft/tree/main/doc/src/wallet.md).
* To go deep on how Sui works, read the Sui [white paper](https://github.com/MystenLabs/fastnft/tree/main/doc/paper/sui.pdf) and check out [Key Concepts](https://github.com/MystenLabs/fastnft/tree/main/doc/src/key-concepts.md).
* To jump right into building smart contract applications on top of Sui, go to [Move Quick Start](https://github.com/MystenLabs/sui/tree/main/doc/src/move.md).
* To experiment with a sample Sui wallet, check out [Wallet Quick Start](https://github.com/MystenLabs/sui/tree/main/doc/src/wallet.md).
* To go deep on how Sui works, read the Sui [white paper](https://github.com/MystenLabs/sui/tree/main/doc/paper/sui.pdf) and check out [Key Concepts](https://github.com/MystenLabs/sui/tree/main/doc/src/key-concepts.md).
<!---* To understand what's possible by browsing examples of full-fledged applications and games built on top of Sui, review the [Demos](TODO).--->
* To understand what's possible by browsing Move code built on top of Sui, review the [examples](https://github.com/MystenLabs/fastnft/tree/main/sui_programmability/examples/sources)
* To understand what's possible by browsing Move code built on top of Sui, review the [examples](https://github.com/MystenLabs/sui/tree/main/sui_programmability/examples/sources)
* To start coding against Sui's REST API's, start [here](https://app.swaggerhub.com/apis/MystenLabs/sui-api/0.1)
* To learn what distinguishes Sui from other blockchain systems, see [What Makes Sui Different?](https://github.com/MystenLabs/fastnft/tree/main/doc/src/what-makes-sui-different.md).
* To learn what distinguishes Sui from other blockchain systems, see [What Makes Sui Different?](https://github.com/MystenLabs/sui/tree/main/doc/src/what-makes-sui-different.md).
<!---* To experience Sui's speed and scalability for yourself, try [Benchmarking](TODO).--->
<!---* To see the current status of the Sui software/network and preview what's coming next, read through our [Roadmap](TODO).--->

<!---TODO: Populate and link to the missing pages above or strike the links and references.--->

## Architecture

Sui is a distributed ledger that stores a collection of programmable *[objects](https://github.com/MystenLabs/fastnft/tree/main/doc/src/objects.md)*, each with a globally unique ID. Every object is owned by a single *address*, and each address can own an arbitrary number of objects.
Sui is a distributed ledger that stores a collection of programmable *[objects](https://github.com/MystenLabs/sui/tree/main/doc/src/objects.md)*, each with a globally unique ID. Every object is owned by a single *address*, and each address can own an arbitrary number of objects.

The ledger is updated via a *[transaction](https://github.com/MystenLabs/fastnft/tree/main/doc/src/transactions.md)* sent by a particular address. A transaction can create, destroy, and write objects, as well as transfer them to other addresses.
The ledger is updated via a *[transaction](https://github.com/MystenLabs/sui/tree/main/doc/src/transactions.md)* sent by a particular address. A transaction can create, destroy, and write objects, as well as transfer them to other addresses.

Structurally, a transaction contains a set of input object references and a pointer to a Move code object that already exists in the ledger. Executing a transaction produces updates to the input objects and (if applicable) a set of freshly created objects along with their owners. A transaction whose sender is address *A* can accept objects owned by *A*, shared objects, and objects owned by other objects in the first two groups as input.

Expand All @@ -42,9 +42,9 @@ flowchart LR
Sui authorities agree on and execute transactions in parallel with high throughput using [Byzantine Consistent Broadcast](https://en.wikipedia.org/wiki/Byzantine_fault).

## Move quick start
See the [Move Quick Start](https://github.com/MystenLabs/fastnft/tree/main/doc/src/move.md) for installation, defining custom objects, object operations (create/destroy/update/transfer/freeze), publishing, and invoking your published code.
See the [Move Quick Start](https://github.com/MystenLabs/sui/tree/main/doc/src/move.md) for installation, defining custom objects, object operations (create/destroy/update/transfer/freeze), publishing, and invoking your published code.
<!--- Then deeper: Sui standard library, design patterns, examples. --->

## Wallet quick start
See the [Wallet Quick Start](https://github.com/MystenLabs/fastnft/tree/main/doc/src/wallet.md) for installation, querying the chain, client setup, sending transfer transactions, and viewing the effects.
See the [Wallet Quick Start](https://github.com/MystenLabs/sui/tree/main/doc/src/wallet.md) for installation, querying the chain, client setup, sending transfer transactions, and viewing the effects.
<!--- Then deeper: wallet CLI vs client service vs forwarder architecture, how to integrate your code (wallet, indexer, ...) with the client service or forwarder components. --->
4 changes: 2 additions & 2 deletions doc/src/learn/how-sui-works.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
title: How Sui Works
---

Sui is a distributed ledger that stores a collection of programmable *[objects](https://github.com/MystenLabs/fastnft/tree/main/doc/src/objects.md)*, each with a globally unique ID. Every object is owned by a single *address*, and each address can own an arbitrary number of objects.
Sui is a distributed ledger that stores a collection of programmable *[objects](https://github.com/MystenLabs/sui/tree/main/doc/src/objects.md)*, each with a globally unique ID. Every object is owned by a single *address*, and each address can own an arbitrary number of objects.

The ledger is updated via a *[transaction](https://github.com/MystenLabs/fastnft/tree/main/doc/src/transactions.md)* sent by a particular address. A transaction can create, destroy, and write objects, as well as transfer them to other addresses.
The ledger is updated via a *[transaction](https://github.com/MystenLabs/sui/tree/main/doc/src/transactions.md)* sent by a particular address. A transaction can create, destroy, and write objects, as well as transfer them to other addresses.

Structurally, a transaction contains a set of input object references and a pointer to a Move code object that already exists in the ledger. Executing a transaction produces updates to the input objects and (if applicable) a set of freshly created objects along with their owners. A transaction whose sender is address *A* can accept objects owned by *A*, shared objects, and objects owned by other objects in the first two groups as input.

Expand Down
4 changes: 2 additions & 2 deletions doc/src/move.md
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ name = "MyMovePackage"
version = "0.0.1"
[dependencies]
Sui = { local = "../fastnft/sui_programmability/framework/" }
Sui = { local = "../sui/sui_programmability/framework/" }
[addresses]
MyMovePackage = "0x0"
Expand Down Expand Up @@ -554,7 +554,7 @@ little to do with Sui beyond using some Sui packages, such as
already very useful for developers writing Move code for Sui, they may
also want to test additional Sui-specific features. In particular, a
Move call in Sui is encapsulated in a Sui
[transaction](https://github.com/MystenLabs/fastnft/blob/main/doc/transactions.md),
[transaction](https://github.com/MystenLabs/sui/blob/main/doc/transactions.md),
and a developer may wish to test interactions between different
transactions within a single test (e.g. one transaction creating an
object and the other one transferring it).
Expand Down
2 changes: 1 addition & 1 deletion doc/src/objects.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Transactions (and thus, certificates) take objects as input, read/write/mutate t
To construct this graph, we add a node for each committed transaction and draw a directed edge labeled with object reference `O` from transaction `A` to transaction `B` if `A` produced object `O` (i.e., created or mutated `O`) and transaction `B` takes object `O` as an input.

EDITORIAL NOTE: A diagram would be useful here. Can we use Mermaid as now seen in the [Summary](SUMMARY.md) thanks to Evan? Tracked in:
https://github.com/MystenLabs/fastnft/issues/564
https://github.com/MystenLabs/sui/issues/564

The root of this DAG is a *genesis* transaction that takes no inputs and produces the objects that exist in the initial state of the system. The DAG can be extended by identifying mutable transaction outputs that have not yet been consumed by any committed transaction and sending a new transaction that takes these outputs (and optionally, immutable transaction outputs) as inputs.

Expand Down
2 changes: 1 addition & 1 deletion sui_core/src/authority_aggregator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,7 @@ where

// For now assume all authorities. Assume they're all honest
// This assumption is woeful, and should be fixed
// TODO: https://github.com/MystenLabs/fastnft/issues/320
// TODO: https://github.com/MystenLabs/sui/issues/320
let results = future::join_all(authority_clients.iter().map(|(_, ac)| {
tokio::time::timeout(timeout, ac.handle_object_info_request(request.clone()))
}))
Expand Down
18 changes: 9 additions & 9 deletions sui_core/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ impl ClientState {
/// It is recommended that one call sync and download_owned_objects
/// right after constructor to fetch missing info form authorities
/// TODO: client should manage multiple addresses instead of each addr having DBs
/// https://github.com/MystenLabs/fastnft/issues/332
/// https://github.com/MystenLabs/sui/issues/332
#[cfg(test)]
pub fn new(path: PathBuf, address: SuiAddress) -> Self {
ClientState {
Expand Down Expand Up @@ -413,7 +413,7 @@ impl ClientState {
/// We use this to ensure that a transaction can indeed unlock or lock certain objects in the transaction
/// This means either exactly all the objects are owned by this transaction, or by no transaction
/// The caller has to explicitly find which objects are locked
/// TODO: always return true for immutable objects https://github.com/MystenLabs/fastnft/issues/305
/// TODO: always return true for immutable objects https://github.com/MystenLabs/sui/issues/305
fn can_lock_or_unlock(&self, transaction: &Transaction) -> Result<bool, SuiError> {
let iter_matches = self.store.pending_transactions.multi_get(
&transaction
Expand All @@ -438,7 +438,7 @@ impl ClientState {
/// One should call can_lock_or_unlock before locking as this overwites the previous lock
/// If the object is already locked, ensure it is unlocked by calling unlock_pending_transaction_objects
/// Client runs sequentially right now so access to this is safe
/// Double-locking can cause equivocation. TODO: https://github.com/MystenLabs/fastnft/issues/335
/// Double-locking can cause equivocation. TODO: https://github.com/MystenLabs/sui/issues/335
pub fn lock_pending_transaction_objects(
&self,
transaction: &Transaction,
Expand Down Expand Up @@ -506,7 +506,7 @@ where
/// Update local object states using newly created certificate and ObjectInfoResponse from the Confirmation step.
/// This functions locks all the input objects if possible, and unlocks at the end of confirmation or if an error occurs
/// TODO: define other situations where we can unlock objects after authority error
/// https://github.com/MystenLabs/fastnft/issues/346
/// https://github.com/MystenLabs/sui/issues/346
async fn execute_transaction(
&mut self,
transaction: Transaction,
Expand Down Expand Up @@ -534,9 +534,9 @@ where

// How do we handle errors on authority which lock objects?
// Currently VM crash can keep objects locked, but we would like to avoid this.
// TODO: https://github.com/MystenLabs/fastnft/issues/349
// https://github.com/MystenLabs/fastnft/issues/211
// https://github.com/MystenLabs/fastnft/issues/346
// TODO: https://github.com/MystenLabs/sui/issues/349
// https://github.com/MystenLabs/sui/issues/211
// https://github.com/MystenLabs/sui/issues/346

let account = self.get_or_create_account(transaction.sender_address())?;
account.unlock_pending_transaction_objects(&transaction)?;
Expand Down Expand Up @@ -586,7 +586,7 @@ where
}

// TODO: decide what to do with failed object downloads
// https://github.com/MystenLabs/fastnft/issues/331
// https://github.com/MystenLabs/sui/issues/331
let _failed = self
.download_objects_not_in_db(address, objs_to_download)
.await?;
Expand Down Expand Up @@ -638,7 +638,7 @@ where
let unique_pending_transactions = account.get_unique_pending_transactions();
// Transactions are idempotent so no need to prevent multiple executions
// Need some kind of timeout or max_trials here?
// TODO: https://github.com/MystenLabs/fastnft/issues/330
// TODO: https://github.com/MystenLabs/sui/issues/330
for transaction in unique_pending_transactions {
self.execute_transaction(transaction.clone())
.await
Expand Down
16 changes: 8 additions & 8 deletions sui_core/tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ https://github.com/novifinancial/serde-reflection
In this example, we will update one of our core types (SuiError), and then update the manifest:

```
[email protected]➜~/tmp/fastnft(main)» git checkout main [7:40:40]
[email protected]➜~/tmp/sui(main)» git checkout main [7:40:40]
Already on 'main'
Your branch is up to date with 'origin/main'.
[email protected]➜~/tmp/fastnft(main)» ruplacer --subvert 'CertificateAuthorityReuse' 'CertificateAuthorityDuplicate' --go [8:42:33]
[email protected]➜~/tmp/sui(main)» ruplacer --subvert 'CertificateAuthorityReuse' 'CertificateAuthorityDuplicate' --go [8:42:33]
./sui_types/src/error.rs:103 - CertificateAuthorityReuse,
./sui_types/src/error.rs:103 + CertificateAuthorityDuplicate,
Expand All @@ -36,30 +36,30 @@ Performed 4 replacements on 196 matching files
Now our code is modified in a way that will make the format test fail: let's update the manifest.

```
[email protected]➜~/tmp/fastnft(main✗)» cd sui_core [8:43:38]
[email protected]➜tmp/fastnft/sui_core(main✗)» cargo -q run --example generate-format -- print > tests/staged/sui.yaml
[email protected]➜~/tmp/sui(main✗)» cd sui_core [8:43:38]
[email protected]➜tmp/sui/sui_core(main✗)» cargo -q run --example generate-format -- print > tests/staged/sui.yaml
```


Let's check that we pass the test again:
```
[email protected]➜tmp/fastnft/sui_core(main✗)» cargo test format 2>&1 |tail -n 40 [8:47:22]
[email protected]➜tmp/sui/sui_core(main✗)» cargo test format 2>&1 |tail -n 40 [8:47:22]
Finished test [unoptimized + debuginfo] target(s) in 0.35s
Running unittests (/Users/huitseeker/tmp/fastnft/target/debug/deps/sui_core-5796871991341984)
Running unittests (/Users/huitseeker/tmp/sui/target/debug/deps/sui_core-5796871991341984)
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 52 filtered out; finished in 0.00s
Running tests/format.rs (/Users/huitseeker/tmp/fastnft/target/debug/deps/format-ecdfa91a67810be3)
Running tests/format.rs (/Users/huitseeker/tmp/sui/target/debug/deps/format-ecdfa91a67810be3)
running 1 test
Finished dev [unoptimized + debuginfo] target(s) in 0.20s
Running `target/debug/examples/generate-format test`
test test_format ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.48s
[email protected]➜tmp/fastnft/sui_core(main✗)» git status -s [8:47:38]
[email protected]➜tmp/sui/sui_core(main✗)» git status -s [8:47:38]
M tests/staged/sui.yaml
M ../sui_types/src/error.rs
M ../sui_types/src/messages.rs
Expand Down
Loading

0 comments on commit 1f89431

Please sign in to comment.