forked from o1-labs/docs2
-
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
Showing
17 changed files
with
743 additions
and
112 deletions.
There are no files selected for viewing
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,82 @@ | ||
--- | ||
title: Appendix | ||
sidebar_label: Appendix | ||
hide_title: true | ||
description: Berkeley Upgrade Appendix | ||
keywords: | ||
- Berkeley | ||
- upgrade | ||
- appendix | ||
--- | ||
|
||
# Appendix | ||
|
||
## Migration from o1labs/client-sdk to mina-signer | ||
|
||
The signing library o1labs/client-sdk was deprecated some time ago and will stop working after the upgrade. All users should upgrade with the library mina-signer https://www.npmjs.com/package/mina-signer. | ||
|
||
Below you will find an example of how to use the mina-signer library. Please keep in mind the following: | ||
|
||
1. Make sure to adjust the nonce to the correct nonce on the account you want to use | ||
2. Use fee 1 MINA to get the TX submitted quickly | ||
3. Update the “url” variable with an existing Mina Node GraphQL | ||
|
||
```javascript | ||
import { Client } from 'mina-signer'; | ||
|
||
// create testnet client and define hard-coded keypair | ||
|
||
const client = new Client({ network: 'testnet' }); | ||
|
||
let privateKey = Your private key; | ||
let publicKey = the public key - perhaps derived from the private key using -> client.derivePublicKey(privateKey); | ||
|
||
// define and sign payment | ||
|
||
let payment = { | ||
from: publicKey, | ||
to: 'to public key', | ||
amount: 100, | ||
nonce: 1, | ||
fee: 1000000, | ||
}; | ||
|
||
const signedPayment = client.signPayment(payment, privateKey); | ||
|
||
// send payment to graphql endpoint | ||
|
||
let url = 'https://qanet.minaprotocol.network/graphql'; | ||
|
||
let query = `mutation { | ||
sendPayment( | ||
input: ${objectToGraphqlQuery(signedPayment.data)}, | ||
signature: ${objectToGraphqlQuery(signedPayment.signature)} | ||
) { | ||
payment { id } | ||
} | ||
}`; | ||
|
||
console.log('======================='); | ||
console.log(query); | ||
console.log('======================='); | ||
|
||
let response = await fetch(url, { | ||
method: 'POST', | ||
headers: { 'Content-Type': 'application/json' }, | ||
body: JSON.stringify({ operationName: null, query, variables: {} }), | ||
}); | ||
if (response.status == 200) { | ||
let json = await response.json(); | ||
console.dir(json, { depth: null }); | ||
} else { | ||
let text = await response.text(); | ||
console.log('Error:\n', text); | ||
} | ||
|
||
function objectToGraphqlQuery(obj: any) { | ||
let json = JSON.stringify(obj, null, 2); | ||
// removes the quotes on JSON keys | ||
return json.replace(/\"(\S+)\"\s*:/gm, '$1:'); | ||
} | ||
|
||
``` |
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,137 @@ | ||
--- | ||
title: Appendix | ||
sidebar_label: Appendix | ||
hide_title: true | ||
description: archive node schema changes between Mainnet and Berkeley | ||
keywords: | ||
- Berkeley | ||
- upgrade | ||
- archive migration | ||
- appendix | ||
- mina archive node | ||
- archive node | ||
--- | ||
|
||
# Appendix | ||
|
||
## Archive node schema changes | ||
|
||
If you are using the Archive Node database directly for your system integrations, then you should understand all the changes that might impact your applications. The most important change is that the `balances` table in the Devnet schema will no longer exist. In the new schema, it is replaced with the table `accounts_accessed` - from an application semantics point of view, the data in `accounts_accessed` is still the same. | ||
|
||
In the Berkeley protocol, accounts can now have the same public key but a different token_id. This means accounts are identified by both their public key and token_id, not just the public key. Consequently, the foreign key for the account in all tables is account_identifier_id instead of public_key_id. | ||
|
||
### Schema differences | ||
- **Removed Types** | ||
- The options `create_token`, `create_account`, and `mint_tokens` have been removed from the user_command_type enumeration. | ||
- Indexes Dropped | ||
- We've removed several indexes from tables, this may affect how you search and organize data: | ||
- `idx_public_keys_id` | ||
- `idx_public_keys_value` | ||
- `idx_snarked_ledger_hashes_value` | ||
- `idx_blocks_id` | ||
- `idx_blocks_state_hash` | ||
- **Table Removed** | ||
- The `balances` table is no longer available. | ||
- **New Tables Added** | ||
- We've introduced the following new tables: | ||
- `tokens` | ||
- `token_symbols` | ||
- `account_identifiers` | ||
- `voting_for` | ||
- `protocol_versions` | ||
- `accounts_accessed` | ||
- `accounts_created` | ||
- `zkapp_commands` | ||
- `blocks_zkapp_commands` | ||
- `zkapp_field` | ||
- `zkapp_field_array` | ||
- `zkapp_states_nullable` | ||
- `zkapp_states` | ||
- `zkapp_action_states` | ||
- `zkapp_events` | ||
- `zkapp_verification_key_hashes` | ||
- `zkapp_verification_keys` | ||
- `zkapp_permissions` | ||
- `zkapp_timing_info` | ||
- `zkapp_uris` | ||
- `zkapp_updates` | ||
- `zkapp_balance_bounds` | ||
- `zkapp_nonce_bounds` | ||
- `zkapp_account_precondition` | ||
- `zkapp_accounts` | ||
- `zkapp_token_id_bounds` | ||
- `zkapp_length_bounds` | ||
- `zkapp_amount_bounds` | ||
- `zkapp_global_slot_bounds` | ||
- `zkapp_epoch_ledger` | ||
- `zkapp_epoch_data` | ||
- `zkapp_network_precondition` | ||
- `zkapp_fee_payer_body` | ||
- `zkapp_account_update_body` | ||
- `zkapp_account_update` | ||
- `zkapp_account_update_failures` | ||
- **Updated Tables** | ||
- The following tables have been updated | ||
- `timing_info` | ||
- `user_commands` | ||
- `internal_commands` | ||
- `epoch_data` | ||
- `blocks` | ||
- `blocks_user_commands` | ||
- `blocks_internal_commands` | ||
|
||
### Differences per table | ||
- **`timing_info`** | ||
- Removed columns: | ||
- `token` | ||
- `initial_balance` | ||
- **`user_commands`** | ||
- Removed columns: | ||
- `fee_token` | ||
- `token` | ||
- **`internal_commands`** | ||
- Removed columns: | ||
- `token` | ||
- Renamed column | ||
- `command_type` to `type` | ||
- **`epoch_data`** | ||
- Added columns: | ||
- `total_currency` | ||
- `start_checkpoint` | ||
- `lock_checkpoint` | ||
- `epoch_length` | ||
- **`blocks`** | ||
- Added columns: | ||
- `last_vrf_output` | ||
- `min_window_density` | ||
- `sub_window_densities` | ||
- `total_currency` | ||
- `global_slot_since_hard_fork` | ||
- `global_slot_since_genesis` | ||
- `protocol_version_id` | ||
- `proposed_protocol_version_id` | ||
- Removed column: | ||
- `global_slot` | ||
- **`blocks_user_commands`** | ||
- Removed columns: | ||
- `fee_payer_account_creation_fee_paid` | ||
- `receiver_account_creation_fee_paid` | ||
- `created_token` | ||
- `fee_payer_balance` | ||
- `source_balance` | ||
- `receiver_balance` | ||
- Added index: | ||
- `idx_blocks_user_commands_sequence_no` | ||
- **`blocks_internal_commands`** | ||
- Removed columns: | ||
- `receiver_account_creation_fee_paid` | ||
- `receiver_balance` | ||
- Added indexes: | ||
- `idx_blocks_internal_commands_sequence_no` | ||
- `idx_blocks_internal_commands_secondary_sequence_no` | ||
|
||
### Rosetta API new operations | ||
|
||
The Berkeley upgrade introduces two new operation types: | ||
- `zkapp_fee_payer_dec` | ||
- `zkapp_balance_change` |
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
File renamed without changes.
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
Oops, something went wrong.