Skip to content

Change ChainDescriptions into blobs #3787

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CLI.md
Original file line number Diff line number Diff line change
Expand Up @@ -717,12 +717,12 @@ Create an unassigned key pair

Link an owner with a key pair in the wallet to a chain that was created for that owner

**Usage:** `linera assign --owner <OWNER> --message-id <MESSAGE_ID>`
**Usage:** `linera assign --owner <OWNER> --chain-id <CHAIN_ID>`

###### **Options:**

* `--owner <OWNER>` — The owner to assign
* `--message-id <MESSAGE_ID>` — The ID of the message that created the chain. (This uniquely describes the chain and where it was created.)
* `--chain-id <CHAIN_ID>` — The ID of the chain



Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ linera wallet init --faucet $FAUCET_URL
INFO1=($(linera wallet request-chain --faucet $FAUCET_URL))
INFO2=($(linera wallet request-chain --faucet $FAUCET_URL))
CHAIN1="${INFO1[0]}"
ACCOUNT1="${INFO1[3]}"
ACCOUNT1="${INFO1[2]}"
CHAIN2="${INFO2[0]}"
ACCOUNT2="${INFO2[3]}"
ACCOUNT2="${INFO2[2]}"

# Show the different chains tracked by the wallet.
linera wallet show
Expand Down
4 changes: 2 additions & 2 deletions examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
resolver = "2"
members = [
"amm",
"counter",
"call-evm-counter",
"counter",
"counter-no-graphql",
"crowd-funding",
"ethereum-tracker",
"fungible",
"gen-nft",
"how-to/perform-http-requests",
"hex-game",
"how-to/perform-http-requests",
"llm",
"matching-engine",
"meta-counter",
Expand Down
6 changes: 3 additions & 3 deletions examples/amm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ INFO_2=($(linera wallet request-chain --faucet $FAUCET_URL))
CHAIN_AMM="${INFO_AMM[0]}"
CHAIN_1="${INFO_1[0]}"
CHAIN_2="${INFO_2[0]}"
OWNER_AMM="${INFO_AMM[3]}"
OWNER_1="${INFO_1[3]}"
OWNER_2="${INFO_2[3]}"
OWNER_AMM="${INFO_AMM[2]}"
OWNER_1="${INFO_1[2]}"
OWNER_2="${INFO_2[2]}"
```

Now we have to publish and create the fungible applications. The flag `--wait-for-outgoing-messages` waits until a quorum of validators has confirmed that all sent cross-chain messages have been delivered.
Expand Down
2 changes: 1 addition & 1 deletion examples/counter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ linera wallet init --faucet $FAUCET_URL

INFO_1=($(linera wallet request-chain --faucet $FAUCET_URL))
CHAIN_1="${INFO_1[0]}"
OWNER_1="${INFO_1[3]}"
OWNER_1="${INFO_1[2]}"
```

Now, compile the `counter` application WebAssembly binaries, publish and create an application instance.
Expand Down
4 changes: 2 additions & 2 deletions examples/crowd-funding/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ INFO_1=($(linera --with-wallet 1 wallet request-chain --faucet $FAUCET_URL))
INFO_2=($(linera --with-wallet 2 wallet request-chain --faucet $FAUCET_URL))
CHAIN_1="${INFO_1[0]}"
CHAIN_2="${INFO_2[0]}"
OWNER_1="${INFO_1[3]}"
OWNER_2="${INFO_2[3]}"
OWNER_1="${INFO_1[2]}"
OWNER_2="${INFO_2[2]}"
```

Note that `linera --with-wallet 1` is equivalent to `linera --wallet "$LINERA_WALLET_1"
Expand Down
4 changes: 2 additions & 2 deletions examples/fungible/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ linera wallet init --faucet $FAUCET_URL

INFO_1=($(linera wallet request-chain --faucet $FAUCET_URL))
CHAIN_1="${INFO_1[0]}"
OWNER_1="${INFO_1[3]}"
OWNER_1="${INFO_1[2]}"
INFO_2=($(linera wallet request-chain --faucet $FAUCET_URL))
CHAIN_2="${INFO_2[0]}"
OWNER_2="${INFO_2[3]}"
OWNER_2="${INFO_2[2]}"
```

Now, compile the `fungible` application WebAssembly binaries, and publish them as an application
Expand Down
4 changes: 2 additions & 2 deletions examples/gen-nft/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ INFO_1=($(linera wallet request-chain --faucet $FAUCET_URL))
INFO_2=($(linera wallet request-chain --faucet $FAUCET_URL))
CHAIN_1="${INFO_1[0]}"
CHAIN_2="${INFO_2[0]}"
OWNER_1="${INFO_1[3]}"
OWNER_2="${INFO_2[3]}"
OWNER_1="${INFO_1[2]}"
OWNER_2="${INFO_2[2]}"
```

Next, compile the `non-fungible` application WebAssembly binaries, and publish them as an application module:
Expand Down
17 changes: 8 additions & 9 deletions examples/hex-game/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ INFO_1=($(linera --with-wallet 1 wallet request-chain --faucet $FAUCET_URL))
INFO_2=($(linera --with-wallet 2 wallet request-chain --faucet $FAUCET_URL))
CHAIN_1="${INFO_1[0]}"
CHAIN_2="${INFO_2[0]}"
OWNER_1="${INFO_1[3]}"
OWNER_2="${INFO_2[3]}"
OWNER_1="${INFO_1[2]}"
OWNER_2="${INFO_2[2]}"
```

Note that `linera --with-wallet 1` or `linera -w1` is equivalent to `linera --wallet
Expand Down Expand Up @@ -123,25 +123,24 @@ query {
gameChains {
entry(key: "$OWNER_1") {
value {
messageId chainId
chainId
}
}
}
}
```

Set the `QUERY_RESULT` variable to have the result returned by the previous query, and `HEX_CHAIN` and `MESSAGE_ID` will be properly set for you.
Alternatively you can set the variables to the `chainId` and `messageId` values, respectively, returned by the previous query yourself.
Using the message ID, we can assign the new chain to the key in each wallet:
Set the `QUERY_RESULT` variable to have the result returned by the previous query, and `HEX_CHAIN` will be properly set for you.
Alternatively you can set the variable to the `chainId`, returned by the previous query yourself.
Using the chain ID, we can assign the new chain to the key in each wallet:

```bash
kill %% && sleep 1 # Kill the service so we can use CLI commands for wallet 0.

HEX_CHAIN=$(echo "$QUERY_RESULT" | jq -r '.gameChains.entry.value[0].chainId')
MESSAGE_ID=$(echo "$QUERY_RESULT" | jq -r '.gameChains.entry.value[0].messageId')

linera -w1 assign --owner $OWNER_1 --message-id $MESSAGE_ID
linera -w2 assign --owner $OWNER_2 --message-id $MESSAGE_ID
linera -w1 assign --owner $OWNER_1 --message-id $HEX_CHAIN
linera -w2 assign --owner $OWNER_2 --message-id $HEX_CHAIN

linera -w1 service --port 8080 &
linera -w2 service --port 8081 &
Expand Down
7 changes: 2 additions & 5 deletions examples/hex-game/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,17 +155,14 @@ impl HexContract {
);
let app_id = self.runtime.application_id();
let permissions = ApplicationPermissions::new_single(app_id.forget_abi());
let (message_id, chain_id) = self.runtime.open_chain(ownership, permissions, fee_budget);
let chain_id = self.runtime.open_chain(ownership, permissions, fee_budget);
for owner in &players {
self.state
.game_chains
.get_mut_or_default(owner)
.await
.unwrap()
.insert(GameChain {
message_id,
chain_id,
});
.insert(GameChain { chain_id });
}
self.runtime.send_message(
chain_id,
Expand Down
2 changes: 0 additions & 2 deletions examples/hex-game/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ use serde::{Deserialize, Serialize};
/// The IDs of a temporary chain for a single game of Hex.
#[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Serialize, Deserialize, SimpleObject)]
pub struct GameChain {
/// The ID of the `OpenChain` message that created the chain.
pub message_id: MessageId,
/// The ID of the temporary game chain itself.
pub chain_id: ChainId,
}
Expand Down
6 changes: 3 additions & 3 deletions examples/matching-engine/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ INFO_3=($(linera wallet request-chain --faucet $FAUCET_URL))
CHAIN_1="${INFO_1[0]}"
CHAIN_2="${INFO_2[0]}"
CHAIN_3="${INFO_3[0]}"
OWNER_1="${INFO_1[3]}"
OWNER_2="${INFO_2[3]}"
OWNER_3="${INFO_3[3]}"
OWNER_1="${INFO_1[2]}"
OWNER_2="${INFO_2[2]}"
OWNER_3="${INFO_3[2]}"
```

Publish and create two `fungible` applications whose IDs will be used as a
Expand Down
4 changes: 2 additions & 2 deletions examples/native-fungible/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ INFO_1=($(linera wallet request-chain --faucet $FAUCET_URL))
INFO_2=($(linera wallet request-chain --faucet $FAUCET_URL))
CHAIN_1="${INFO_1[0]}"
CHAIN_2="${INFO_2[0]}"
OWNER_1="${INFO_1[3]}"
OWNER_2="${INFO_2[3]}"
OWNER_1="${INFO_1[2]}"
OWNER_2="${INFO_2[2]}"
```

Compile the `native-fungible` application WebAssembly binaries, and publish them as an application
Expand Down
4 changes: 2 additions & 2 deletions examples/non-fungible/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ INFO_1=($(linera wallet request-chain --faucet $FAUCET_URL))
INFO_2=($(linera wallet request-chain --faucet $FAUCET_URL))
CHAIN_1="${INFO_1[0]}"
CHAIN_2="${INFO_2[0]}"
OWNER_1="${INFO_1[3]}"
OWNER_2="${INFO_2[3]}"
OWNER_1="${INFO_1[2]}"
OWNER_2="${INFO_2[2]}"
```

```bash
Expand Down
4 changes: 2 additions & 2 deletions examples/rfq/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ INFO_1=($(linera --with-wallet 1 wallet request-chain --faucet $FAUCET_URL))
INFO_2=($(linera --with-wallet 2 wallet request-chain --faucet $FAUCET_URL))
CHAIN_1="${INFO_1[0]}"
CHAIN_2="${INFO_2[0]}"
OWNER_1="${INFO_1[3]}"
OWNER_2="${INFO_2[3]}"
OWNER_1="${INFO_1[2]}"
OWNER_2="${INFO_2[2]}"
```

Note that `linera --with-wallet 1` is equivalent to `linera --wallet "$LINERA_WALLET_1"
Expand Down
2 changes: 1 addition & 1 deletion examples/rfq/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ impl RfqContract {
);
let app_id = self.runtime.application_id();
let permissions = ApplicationPermissions::new_single(app_id.forget_abi());
let (_, temp_chain_id) = self.runtime.open_chain(ownership, permissions, fee_budget);
let temp_chain_id = self.runtime.open_chain(ownership, permissions, fee_budget);

// transfer tokens to the new chain
let transfer = fungible::Operation::Transfer {
Expand Down
Loading
Loading