Skip to main content

How to share data between two Debox nodes?

This guide presents how to share data between two Debox nodes, further demonstrating Debox's functionality and approach to sharing data between users.

Step 1: Install Debox

See Installation section.

Install Debox on each of the nodes that will be sharing or receiving data.

Adjust the Config file if testing multiple nodes on a single computer

If you are testing two or more Debox nodes on a single computer make sure to set different port numbers for each of the node configs.

For example:

Node 1's config would look like this:

{
"daemon": {
"port": 35351
},
"ipfs": {
"api_port": 5001,
"gateway_port": 8081,
"swarm_port": 4001
},
"protocol": {
"keeper_port": 32861
},
"webdav": {
"port": 49181
}
}

Node 2's config would look like this:

{
"daemon": {
"port": 35352
},
"ipfs": {
"api_port": 5002,
"gateway_port": 8082,
"swarm_port": 4002
},
"protocol": {
"keeper_port": 32862
},
"webdav": {
"port": 49182
}
}

Step 2: Launch Debox nodes

Launch Debox on each of the nodes that will be sharing or receiving data.

  1. Launch Debox daemon (accept the disclaimer when prompted)

    .\debox.exe

    Output:

    (truncated)
    Daemon | Debox v0.1.0
    Daemon | Listening on 127.0.0.1:35350
  2. Open up another terminal to execute the remaining commands

  3. Intialize IPFS to provision all necessary files for the IPFS daemon

    Run ipfs init only once after installation

    Running ipfs init command more than once will result in an error

    .\debox-cli.exe ipfs init

    Output:

    Success
  4. Start the IPFS daemon

    .\debox-cli.exe ipfs daemon start

    Output:

    Success
    Accept Windows security pop-up

    Click Allow for IPFS daemon to start

    Windows Security Pop-Up
  5. Start Debox Keeper

    .\debox-cli.exe keeper start

    Output:

    Success
    Accept Windows security pop-up

    Click Allow for Debox Keeper to start

    Windows Security Pop-Up

Step 3: Prepare Data for Sharing (Node 1)

  1. Create a directory in DeboxFS (using demo-test in this example)

    .\debox-cli.exe fs mkdir /demo-test

    Output:

    Success
  2. Create a test file or select any file that you would like to share (creating a test file for example)

    echo
  3. Add the file to your local DeboxFS

    .\debox-cli.exe fs add \path\to\debox.txt /demo-test/debox.txt

    Output:

    Success
  4. List files in DeboxFS to ensure that the file was added

    .\debox-cli.exe fs ls /demo-test

    Output:

    Name Size Date created Date modified
    debox.txt F 13 2024-02-19 16:48:19 2024-02-19 16:48:19
  5. Create a Debox Share for the /demo-test folder

    .\debox-cli.exe share create /demo-test

    Output:

    Share ID (SID) Path
    3diYHJwUzzj1BDnvyUen3aQi5nySvxXmi8KesBtkewBz /test
  6. List all Shares to see newly created Share (optional)

    ./debox-cli share ls

    Output:

    Share ID (SID) Path
    3diYHJwUzzj1BDnvyUen3aQi5nySvxXmi8KesBtkewBz /test
  7. Sync the newly created Share so that its contents can be shared

    .\debox-cli.exe share sync 3diYHJwUzzj1BDnvyUen3aQi5nySvxXmi8KesBtkewBz

    Output:

    Pull events:
    No data

    Push events:
    MODIFIED: 2024-02-19 16:48:19 debox.txt 13 ljMnEGmz Qme1oistKpzditFWdwUfvkrwHUVLdbf74uMrirtC7meCaV
  8. Create an Invite to your newly created Share using the Share ID. The created Invite will need to be sent via any secure channel to the party that you are intending to grant access to this newly created Share.

    .\debox-cli.exe invite create 3diYHJwUzzj1BDnvyUen3aQi5nySvxXmi8KesBtkewBz

    Output:

    New Invite:
    G5Sacrg7CiwV17ueL2e2P1krBJzw3CSzBg2JLAnmhxnTp7NLWorK9B4MS6a86Jh1RnYboBws7J9VxpCDpvQv4jCxUezG9aKin2BhVMA9WCLyouhFndMCd2yJkYy9icyYKLHZwD9kPcL8zAzyjAvMFv7Xcwo4PUNebdgcZDYyRWx9mE2awNhBwawcE8WR

Step 3: Requesting Access (Node 2)

  1. Use the received Invite to create a Pass to request access to Node 1's Share

    .\debox-cli.exe pass create G5Sacrg7CiwV17ueL2e2P1krBJzw3CSzBg2JLAnmhxnTp7NLWorK9B4MS6a86Jh1RnYboBws7J9VxpCDpvQv4jCxUezG9aKin2BhVMA9WCLyouhFndMCd2yJkYy9icyYKLHZwD9kPcL8zAzyjAvMFv7Xcwo4PUNebdgcZDYyRWx9mE2awNhBwawcE8WR

    Output:

    Pass ID (PID)
    MD5Ny74Qkskgeb3QZDmAmzbCTcNeaEi4cfL1wp9GkgJ
  2. List the newly created Pass (the pass will be pending until Node 1 accepts it to grant access to the Share) (optional)

    .\debox-cli.exe pass pending

    Output:

    Pass ID (PID)
    MD5Ny74Qkskgeb3QZDmAmzbCTcNeaEi4cfL1wp9GkgJ

Step 4: Granting Access (Node 1)

  1. List the pending Passes, requesting access to the earlier created Share. (There should be one from Node 2.)

    .\debox-cli.exe pass ls 3diYHJwUzzj1BDnvyUen3aQi5nySvxXmi8KesBtkewBz

    Output:

    Pass ID (PID) Name Message
    MD5Ny74Qkskgeb3QZDmAmzbCTcNeaEi4cfL1wp9GkgJ - -
  2. Accept the Pass to grant access to Node 2.

    .\debox-cli.exe pass accept 3diYHJwUzzj1BDnvyUen3aQi5nySvxXmi8KesBtkewBz MD5Ny74Qkskgeb3QZDmAmzbCTcNeaEi4cfL1wp9GkgJ

    Output:

    Success

Step 5: Retrieving Share Contents (Node 2)

  1. After Node 1 has accepted Node 2's requested Pass, Node 2 can join Node 1's Share using that Pass

    .\debox-cli.exe pass join MD5Ny74Qkskgeb3QZDmAmzbCTcNeaEi4cfL1wp9GkgJ

    Output:

    Share ID (SID) Path
    3diYHJwUzzj1BDnvyUen3aQi5nySvxXmi8KesBtkewBz /test
  2. Sync the Share contents for local access to the Share data

    .\debox-cli.exe share sync 3diYHJwUzzj1BDnvyUen3aQi5nySvxXmi8KesBtkewBz

    Output:

    Pull events:
    MODIFIED: 2024-02-19 16:48:19 debox.txt 13 ljMnEGmz Qme1oistKpzditFWdwUfvkrwHUVLdbf74uMrirtC7meCaV

    Push events:
    No data
  3. List the Share contents to view the received data

    .\debox-cli.exe fs ls /demo-test

    Output:

    Name Size Date created Date modified
    debox.txt F 13 2024-02-19 16:48:19 2024-02-19 16:48:19
    using webdav

    The contents of the share can be viewed via your file explorer (See WebDAV)

  4. Transfer the contents to your local filesystem

    .\debox-cli.exe fs get /demo-test/debox.txt /local/path/to/debox.txt

    Output:

    Success
  5. View the contents of the retrieved file

    cat \local\path\to\debox.txt

    Output:

    Hello, Debox!