Publishing¶
How publishing works¶
- The file is read in chunks. The SHA-256 digest, the digest of each chunk and the Merkle root are computed.
- Chunks are uploaded to the origin. An interrupted upload resumes with the missing chunks.
- The stored object is checked.
- An asset event and a new manifest are signed.
- Events are sent to the relays until
-ackof them accepted each event, with retries and backoff.
Before step 1, the current registry is read from the network. If it is newer than the state file, or exists without one, publishing stops.
The state file is written atomically before anything is sent. After an interruption, resume or the next command sends what is pending first.
Policy¶
| Flag | Values | Meaning |
|---|---|---|
-scope |
global, region, local |
Where the asset may be distributed. region needs -region |
-region |
repeatable | Regions |
-propagate |
Distribute proactively | |
-not-before, -expires |
Unix time | Validity of the distribution |
-priority |
0 to 6 | Distribution priority. If two assets have the same content, the lower number decides |
-on-delete |
purge, retain |
Remove distributed copies when the asset is withdrawn, or only stop distributing |
Intents¶
registryctl intent -registry demo/files -relay ... -ack 2 -name hello.txt -action hot
Use the registry name as -name to apply an intent to every asset without its own.
| Action | Meaning |
|---|---|
hot |
Distribute now |
cold |
Distribute only on request |
stop |
Do not distribute |
rewarm |
Remove copies and distribute again |
Withdrawing¶
| Command | Effect |
|---|---|
remove -name N |
Revokes the asset and publishes a manifest without it |
revoke -all |
Revokes every version published so far |
Keys and state¶
The author key is the registry's identity. Keep it offline when not in use and back it up. The state file can be rebuilt from the network with recover. Publish from one place at a time, because two manifests with the same version put the registry in conflict.
Choose -ack so that the required number of relays is independent. An event accepted by one relay can be lost with it.