2021-07-22 11:37:52 +00:00
|
|
|
/*
|
2023-01-11 07:50:07 +00:00
|
|
|
Netmap contract is a contract deployed in FrostFS sidechain.
|
2021-07-22 11:37:52 +00:00
|
|
|
|
2023-01-11 07:50:07 +00:00
|
|
|
Netmap contract stores and manages FrostFS network map, Storage node candidates
|
2023-03-07 08:21:11 +00:00
|
|
|
and epoch number counter.
|
2021-07-22 11:37:52 +00:00
|
|
|
|
2022-12-12 19:59:13 +00:00
|
|
|
# Contract notifications
|
2021-07-22 11:37:52 +00:00
|
|
|
|
2022-04-14 11:56:51 +00:00
|
|
|
AddPeer notification. This notification is produced when a Storage node sends
|
|
|
|
a bootstrap request by invoking AddPeer method.
|
2021-07-22 11:37:52 +00:00
|
|
|
|
2022-12-12 19:59:13 +00:00
|
|
|
AddPeer
|
|
|
|
- name: nodeInfo
|
|
|
|
type: ByteArray
|
2021-07-22 11:37:52 +00:00
|
|
|
|
2022-04-14 11:56:51 +00:00
|
|
|
UpdateState notification. This notification is produced when a Storage node wants
|
|
|
|
to change its state (go offline) by invoking UpdateState method. Supported
|
2021-07-22 11:37:52 +00:00
|
|
|
states: (2) -- offline.
|
|
|
|
|
2022-12-12 19:59:13 +00:00
|
|
|
UpdateState
|
|
|
|
- name: state
|
|
|
|
type: Integer
|
|
|
|
- name: publicKey
|
|
|
|
type: PublicKey
|
2021-07-22 11:37:52 +00:00
|
|
|
|
2022-04-14 11:56:51 +00:00
|
|
|
NewEpoch notification. This notification is produced when a new epoch is applied
|
2021-07-22 11:37:52 +00:00
|
|
|
in the network by invoking NewEpoch method.
|
|
|
|
|
2022-12-12 19:59:13 +00:00
|
|
|
NewEpoch
|
|
|
|
- name: epoch
|
|
|
|
type: Integer
|
2023-05-10 08:19:19 +00:00
|
|
|
|
|
|
|
# Contract storage scheme
|
|
|
|
|
|
|
|
| Key | Value | Description |
|
|
|
|
|-----------------------------|------------|-----------------------------------|
|
|
|
|
| `snapshotCount` | int | snapshot count |
|
|
|
|
| `snapshotEpoch` | int | snapshot epoch |
|
|
|
|
| `snapshotBlock` | int | snapshot block |
|
|
|
|
| `snapshot_` + snapshotNum | ByteArray | serialized '[]Node' array |
|
|
|
|
| `snapshotCurrent` | int | current snapshot |
|
|
|
|
| `balanceScriptHash` | Hash160 | balance contract hash |
|
|
|
|
| `containerScriptHash` | Hash160 | container contract hash |
|
|
|
|
|
2021-07-22 11:37:52 +00:00
|
|
|
*/
|
2021-07-04 11:08:37 +00:00
|
|
|
package netmap
|