description: Tutorial on setting up swarm node.

Setting up Swarm

To run swarm you first need to install geth and bzzd which is the swarm daemon.

  1. go install github.com/ethereum/go-ethereum/cmd/geth
  2. go install github.com/ethersphere/swarm/cmd/swarm

Now we’ll generate a new geth account.

  1. $ geth account new
  2. Your new account is locked with a password. Please give a password. Do not forget this password.
  3. Passphrase:
  4. Repeat passphrase:
  5. Address: {970ef9790b54425bea2c02e25cab01e48cf92573}

Export the environment variable BZZKEY mapping to the geth account address we just generated.

  1. export BZZKEY=970ef9790b54425bea2c02e25cab01e48cf92573

And now run swarm with the specified account to be our swarm account. Swarm by default will run on port 8500.

  1. $ swarm --bzzaccount $BZZKEY
  2. Unlocking swarm account 0x970EF9790B54425BEA2C02e25cAb01E48CF92573 [1/3]
  3. Passphrase:
  4. WARN [06-12|13:11:41] Starting Swarm service

Now that we have the swarm daemon set up and running, let’s learn how to upload files to swarm in the next section.

Full code

Commands

  1. go install github.com/ethereum/go-ethereum/cmd/geth
  2. go install github.com/ethersphere/swarm/cmd/swarm
  3. geth account new
  4. export BZZKEY=970ef9790b54425bea2c02e25cab01e48cf92573
  5. swarm --bzzaccount $BZZKEY