Set up a node and wallet for mainnet
Mainnet is real value. Everything here assumes you have already done the local chain in run a local network and your first transfer, because the mechanics are identical and the consequences are not.
Two processes. A node that validates and relays the chain, and a wallet that holds keys and asks the node about the state of the world. You need a node. You do not need to mine.
1. Start the node
Mainnet is the default network, so there is no flag:
epic
The node writes epic-server.toml on first run and reads it from then on. Editing that file is the
normal way to change behaviour, because most settings exist only as config keys, not as command-line
flags. Every key needs a restart.
Confirm it is up. The owner surface is authenticated and the secret is created for you:
- Linux and macOS
- Windows
curl -s -u epic:$(cat ~/.epic/main/.api_secret) -H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","method":"get_status","params":[],"id":1}' \
http://127.0.0.1:3413/v2/owner
$secret = (Get-Content "$HOME\.epic\main\.api_secret" -First 1).Trim()
$body = '{"jsonrpc":"2.0","method":"get_status","params":[],"id":1}'
Invoke-RestMethod -Uri 'http://127.0.0.1:3413/v2/owner' -Method Post `
-ContentType 'application/json' -Body $body `
-Authentication Basic -Credential (
[PSCredential]::new('epic', (ConvertTo-SecureString $secret -AsPlainText -Force))
) -AllowUnencryptedAuthentication
The first sync downloads and validates the whole chain. Expect it to take a while and to use real disk.
Ports
| Port | Purpose | Default binding |
|---|---|---|
| 3413 | HTTP API | 127.0.0.1 |
| 3414 | P2P | All interfaces |
| 3416 | Stratum mining server | 127.0.0.1, off by default |
Only the P2P port needs to be reachable from outside. Leave the API on loopback and read authentication and TLS before changing that. Every port and network offset is in the CLI reference.
Sync validation settings
skip_pow_validation and disable_checkpoints both default to true. That is a sync speed
optimisation rather than a weakened default.
| Where the block sits | Validation performed |
|---|---|
| Inside a checkpointed range | Header hash compared against a hardcoded checkpoint. A mismatch aborts sync. Proof of work skipped |
| Past the checkpoints, more than 1,000 blocks behind the tip | Proof of work skipped |
| Within 1,000 blocks of the tip | Full proof of work, always, regardless of these settings |
There are 12 checkpoints compiled into the node, in
chain/src/types.rs:432. The code is
check_header_against_checkpoints(), the
skip decision is at servers/src/common/adapters.rs:728, and the floor
is POW_VERIFICATION_THRESHOLD.
Set both to false to verify all historical proof of work yourself. That costs a much longer initial
sync.
What the node stores
chain_data, the config file, log files and the API secret. chain_data is the large item and it is
disposable, so deleting it costs a resync and nothing else. A node holds no keys, so nothing in its data
directory needs backing up.
2. Create the wallet
epic-wallet init
You will be asked to set a password and shown a recovery phrase.
The phrase is the only thing that can reconstruct your funds. It is shown once here, and afterwards only
by epic-wallet recover, which needs the password.
| Command | Effect |
|---|---|
epic-wallet init | Create a wallet in the default location, ~/.epic/main |
epic-wallet init -w | Create it in the current directory. The flag takes no value |
epic-wallet init -r | Restore from an existing recovery phrase |
init -r refuses to run if a seed file already exists, so restoring into a directory that already holds
a wallet means moving that wallet aside first. See
back up and restore.
Turn off the Tor listener
The wallet defaults use_tor_listener to true and expects a Tor binary that the release archives do
not ship, so epic-wallet listen starts a background thread that fails. Two ways to switch it off, and
one of them is per command:
[tor]
use_tor_listener = false
epic-wallet listen -n
-n is declared on listen only (src/cmd/wallet_args.rs:123), so it
has to be repeated on every listen. The config key applies to every command in that wallet directory
and is the setting to prefer. Neither affects Tor use by the node.
What the wallet stores
Back up and restore lists every file in a wallet directory, what it holds, and whether it needs backing up. The recovery phrase reconstructs your funds but not your history. Transaction records, account labels and payment proof records live only in the database and nothing on the chain can rebuild them.
Ports the wallet opens
epic-wallet listen opens the Foreign API on 3415 and
epic-wallet owner_api opens the Owner API on 3420. The Foreign port is derived
from the network; the Owner port is 3420 on every network, so a second wallet on
the same machine collides there whatever chain it runs. Override owner_api_listen_port. Full list in
the CLI reference.
3. Point the wallet at the node
The wallet defaults to a node on loopback at port 3413, and in the default layout it resolves the node's API secret to the same file the node created. Nothing to configure.
Two things change that. If you moved either directory, set node_api_secret_path to
the credential the wallet presents to the node.
If you want a different node, set check_node_api_http_addr in epic-wallet.toml.
epic-wallet info
A balance of zero and no error means the wallet reached the node and the node answered. A 401 means the two disagree about the secret.
A wallet pointed at a public node works. That node sees which outputs the wallet asks about, and the wallet does not validate the chain state it is given.