PepecoinArcade
@ Create a new account

Shared Cores: running some chains, borrowing the rest

docs/shared-cores.md

Jump to: The rule · Setting it up · What sharing lets other arcades do · What a borrowing arcade checks · Every arcade's index, compared · A tenth to the arcade that shares · Mining test coins

An arcade does not have to run a Core node for every chain it offers. Any operator can share a Core that runs on their machine with every other arcade, and any arcade can borrow a chain from arcades that share it. Two arcades that each run two Cores can both offer every chain.

The rule

For example, one operator runs Pepecoin testnet, Pepecoin mainnet and Dogecoin, and shares the two mainnet Cores. Another runs Pepecoin testnet and Litecoin, and shares Litecoin. Both arcades then offer every chain.

Setting it up

Open Admin → Chains. Each chain has:

The same choices are kept in settings.json as core:<chain> (here, borrow or off) and share:<chain> (true or false; true when it is not set).

What sharing lets other arcades do

A shared Core answers a short list of requests and nothing else:

It never answers a wallet request. Sharing can never spend, sign or reveal your node's coins. Your Core works on at most two borrowed requests at a time, so your own pages never wait behind other arcades, and each borrowing arcade is limited in how fast it can ask.

A sharing arcade also sends each new mempool transaction, as it arrives, to the arcades borrowing that chain, so their wallets see incoming payments as quickly as yours does.

What a borrowing arcade checks

A borrowed chain's answers come from somebody else's node, so the borrowing arcade proves what it can from the bytes:

What cannot be proved from bytes is taken on the sharer's word: which block is at a given height, whether a coin is still unspent, and what the mempool holds. When two sharing arcades are linked, their chain tips are compared, and the admin panel says so if they disagree.

An answer that fails a check is refused. The sharer that sent it goes to the back of the line, and the next sharing arcade is asked instead.

A borrowed chain has no node wallet. Accounts work as usual, because people sign in their own browsers. What needs the node's own coins on that chain does not: the faucet, the node's own trading, and the node paying for inscriptions.

Every arcade's index, compared

Every arcade builds its index of tokens, inscriptions, names and trades from the chain alone, so honest arcades on the same rules hold the same index. Linked arcades check that they do:

This applies to borrowed chains too: an index built from a borrowed Core's blocks is compared with the indexes other arcades built from their own Cores.

A tenth to the arcade that shares

An arcade that borrows a chain pays the arcade whose Core it uses a tenth of what it earns on that chain:

Each sharing arcade names the address it is paid at for every chain it shares, and a borrowing arcade is paid its fees and mined coins in the same way. It's the operator account's own address on that chain when one is named, so the coins show up in that account's Wallet. Otherwise it's the Core wallet's address, or, on a chain with no Core wallet here (a borrowed one, or Litecoin), the arcade's own key's address there. Admin → The node's coins shows and spends those coins, signed by the arcade itself with its identity key. Nothing has to be imported into another wallet.

Mining test coins

Admin → Chains → Mine test coins mines blocks on a test-coin chain with this machine's CPU, using work from that chain's Core, whether it runs here or is borrowed. Chains of real coins and merge-mined chains are never mined this way. A testnet lets anyone mine its next block at the lowest difficulty once none has been found for a while. That is when a CPU wins a block.

A sharing arcade answers mining calls (getblocktemplate, submitblock) for test-coin chains only, and no more often than once every couple of seconds per borrower.

To mine on another machine, run the miner there against this arcade's /rpc/work/<chain>, with the arcade's RPC cookie (~/.dogecoinarcade/rpc.cookie):

`` python -m arcade.blockminer --url http://127.0.0.1:8420/rpc/work/ltctest \ --cookie ~/.dogecoinarcade/rpc.cookie --chain ltctest --address <yours> --workers 16 ``

The arcade listens on its own machine only, so reach it from another one through an SSH tunnel (ssh -L 8420:localhost:8420 <arcade machine>).

← all docs