# Offline publisher for the Go4pp App Store The Shop prepares two unsigned operations. Use the standalone `rla-publish.mjs` with Node.js 22 or later and a dedicated Ed25519 publisher wallet. Keep only a small budget for publication fees. An existing protected wallet requires its own supported export procedure. This signer accepts an unencrypted local PKCS#8 private key in PEM or DER format. To generate a separate key in a private local directory with OpenSSL, use: ```sh umask 077 openssl genpkey -algorithm Ed25519 -out publisher-private.pem node rla-publish.mjs address --key publisher-private.pem ``` Keep the PKCS#8 file and backup on your device. The site needs only the public wallet address and the signed envelopes. The script needs no internet access, writes each envelope to a new file, and leaves existing outputs untouched. Only the command output containing the public address and the generated transaction files are intended for sharing. The title, description, public URLs and all manifest fields inside a successful transaction become public on the ledger. ## Set nonce and expiration Use the public HTTPS gateway to read the account and current ledger. Check that the ledger reports `rla-mainnet-1`, protocol `8` and genesis SHA-256 `6a69642757db6edae15a00647ee9416fe4ae812542439ba227c57bdb1a5c863d`. Read the account using the address returned by the signer. ```sh BASE=https://go4pp.com/rede/api/cadeia ADDR=$(node rla-publish.mjs address --key publisher-private.pem) curl --fail --show-error "$BASE/estado" curl --fail --show-error "$BASE/conta/$ADDR" curl --fail --show-error "$BASE/parametros" ``` Choose the next nonce above the confirmed account nonce. Choose an explicit Unix expiration a few minutes after both the observed block time and your device time. The signer accepts an expiration within one hour from the device time. Account reads and manually submitted transactions should use the same network. Re-read the account before every new operation when there may be another transaction in flight. ## Sign and submit step 1 Save the form output as `publicacao.json`. Use the selected nonce and expiry in `NONCE_1` and `ATE_1`. The signer also accepts a single unsigned operation object when a step number is omitted or matches the object's type. ```sh node rla-publish.mjs sign --payload publicacao.json --step 1 --key publisher-private.pem \ --nonce "$NONCE_1" --ate "$ATE_1" --out publication-step1.json curl --fail-with-body --show-error -H 'Content-Type: application/json' \ --data-binary @publication-step1.json "$BASE/tx" ``` The official gateway exposes this POST route with its relay enabled. Inspect the result for `codigo: 0` and a positive `altura`. HTTP 200 alone is insufficient for confirmation. If a response is lost, read the ledger before retrying so you can reconcile the original operation and nonce. Confirm that the authoritative ledger returns the same record key, publisher address and exact manifest `dados`. Save that GET response as `confirmed-record.json`. Replace `app.learn-rla` with the first operation's `chave`. ```sh curl --fail --show-error "$BASE/registro/$ADDR/app.learn-rla" -o confirmed-record.json curl --fail --show-error "$BASE/conta/$ADDR" ``` ## Sign and submit step 2 Use the new confirmed account nonce to choose `NONCE_2`, and choose a fresh expiry `ATE_2`. The offline signer checks the captured record's owner, key, contents and validity. The confirmation file must come from the inspected official HTTPS query. ```sh node rla-publish.mjs sign --payload publicacao.json --step 2 --confirmed-record confirmed-record.json \ --key publisher-private.pem --nonce "$NONCE_2" --ate "$ATE_2" --out publication-step2.json curl --fail-with-body --show-error -H 'Content-Type: application/json' \ --data-binary @publication-step2.json "$BASE/tx" ``` Confirm `codigo: 0`, positive `altura` and the assigned `recurso`. Query `/rede/api/cadeia/recurso/` and check that the resource is public, owned by the publisher and has the same record key in `descricao`. The Shop uses that owner and key to list the manifest. ## Publication cost At the observed production parameters, the network fee was 1,000 atomic units per transaction, with 1 RLA equal to 1,000,000 atomic units. The current record rent is 10 atomic units per UTF-8 byte per day. The resource rent is 10,000 atomic units per day when `aluguel_recurso_dia` is unset. Check the current ledger parameters and dynamic fee before signing. For a 400-byte record and resource both registered for 30 days, the two transaction fees plus rent total 0.422 RLA at those parameters. There is no per-use charge for an app catalog resource. Native validation can charge a fee for certain rejected operations after the envelope is accepted. A discarded or failed transaction should be reconciled against the account before you sign again. ## Local verification ```sh node --test rla-publish.test.mjs ``` The tests generate temporary Ed25519 keys. They check the native envelope signature and address, confirmation before step 2, exact nonce handling and output file safety. No tests contact the official relay.