Skip to content

Commit

Permalink
V2.0.0 (#132)
Browse files Browse the repository at this point in the history
fix(db): fix critical DB nuke repeat loops due to container restarts
feat(db): add DB actions info, nuke, compact, repair-reserve, validate, validate-db to setup/config UI
feat(gui): add bee verbosity to config UI
docs(readme): improve instructions for development
chore(config): remove debug API
chore(config): reset BEE_API_ADDR to ":1633"
chore(config): remove BEE_DEBUG_API_ENABLE
chore(repo): update repository URL and new maintainer
chore(version): bump to major version 2.0.0
chore(version) update v2.0.0 IPFS hash
  • Loading branch information
rampall authored Oct 1, 2024
1 parent dcdc41f commit 6fedaed
Show file tree
Hide file tree
Showing 6 changed files with 182 additions and 23 deletions.
83 changes: 83 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,86 @@ Bee is a Swarm client implemented in Go. It’s the basic building block for the

You can get more information about the project on his official site https://www.ethswarm.org/

## Installing the package

### Connect
Connect to your Dappnode through Wireguard or OpenVPM

### Install package

#### Step 1. Visit the install link and wait for the package to load.
- http://my.dappnode/installer/dnp/swarm.public.dappnode.eth
#### Step 2: Fix the "Not Signed" red flag
To fix the "Not Signed" red flag ("Unsafe origin, not signed"), you will need to add w3rkspacelab's key `0xdAD64d07A318476dc48257a0bB53a8e9a26C6B33` to the "Release trusted keys" on dappnode.

- **Solution 1:** You may click "**ADVANCED OPTIONS**" on the Swarm package install page and enable "**Bypass only signed safe restriction**" one time to install or update the package. This is ideal for testing and development.
> ![image](https://github.com/user-attachments/assets/c118da50-6d39-4777-9cec-16fe717ed08f)
- **Solution 2:** For a more permanent solution, you can visit http://my.dappnode/system/advanced
- scroll down to the "**Release trusted keys**" section
- click "**Add new key**"
> ![image](https://github.com/user-attachments/assets/482b7c6b-7b50-4ef0-881b-a5e1c3d24c4c)
- Enter:
- **Key name:**
- `W3RKSPACE LABS`
- **Package name suffix:**
- `swarm.public.dappnode.eth`
- **Signature protocol:**
- `ECDSA_256`
- **Key:**
- `0xdAD64d07A318476dc48257a0bB53a8e9a26C6B33`
- Click "**Submit Key**"
> ![image](https://github.com/user-attachments/assets/86699463-caef-4e7b-873a-cb970e604de9)
#### Step 3: Install or Update your package
- - http://my.dappnode/installer/dnp/swarm.public.dappnode.eth

## Development & Testing

```
git clone https://github.com/w3rkspacelabs/dappnodepackage-swarm
cd dappnodepackage-swarm
```

### Building the package

**Note:** Make sure `docker` or Docker desktop is running.

```
npx dappnodesdk build --provider http://ipfs.dappnode:5001/
```

**Output:**
```
(node:88443) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
Validating files for swarm.public.dappnode.eth (version 2.0.0)
⠙ Validate files
✔ Validate files
✔ Validate files
✔ Verify connection
✔ Create release directories
✔ Copy files to release directory
✔ Build swarm.public.dappnode.eth (version 2.0.0) for arch linux/amd64
✔ Upload release for swarm.public.dappnode.eth to IPFS node
✔ Save upload results
Dappnode Package (swarm.public.dappnode.eth) built and uploaded
DNP name : swarm.public.dappnode.eth
Release hash : /ipfs/QmeRxj9QtPAspCccx9qLR7zJ5QjYgSKTWUVLnUadhsz1Qf
http://my.dappnode/installer/public/%2Fipfs%2FQmeRxj9QtPAspCccx9qLR7zJ5QjYgSKTWUVLnUadhsz1Qf
```

Open the IPFS url in the last line to install and test your package.

## Publishing your package

```
npx dappnodesdk publish --provider dappnode
```

## Troubleshooting common issues

### Issue: CliError: Invalid compose
**Solution:** Start Docker!
### Issue: Upload stuck during IPFS build
**Solution:** Clear IPFS cache!
35 changes: 31 additions & 4 deletions bee/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,35 @@ if ! test -f /home/bee/.bee/password; then
chown bee:bee /home/bee/.bee/password
fi

if [ "${BEE_NUKE_DB}" = "true" ]; then
exec bee db nuke --data-dir /home/bee/.bee
else
if [ "${BEE_DB_ACTION}" = "none" ]; then
exec bee start ${EXTRA_OPTS}
fi
else
if [ "${BEE_DB_ACTION}" = "nuke" ]; then
echo "Executing: bee db nuke"
bee db nuke --data-dir /home/bee/.bee
echo "Completed: bee db nuke"
elif [ "${BEE_DB_ACTION}" = "compact" ]; then
echo "Executing: bee db compact"
bee db compact --data-dir /home/bee/.bee
echo "Completed: bee db compact"
elif [ "${BEE_DB_ACTION}" = "repair-reserve" ]; then
echo "Executing: bee db repair-reserve"
bee db repair-reserve --data-dir /home/bee/.bee
echo "Completed: bee db repair-reserve"
elif [ "${BEE_DB_ACTION}" = "info" ]; then
echo "Executing: bee db info"
bee db info --data-dir /home/bee/.bee
echo "Completed: bee db info"
elif [ "${BEE_DB_ACTION}" = "validate" ]; then
echo "Executing: bee db validate"
bee db validate --data-dir /home/bee/.bee
echo "Completed: bee db validate"
elif [ "${BEE_DB_ACTION}" = "validate-pin" ]; then
echo "Executing: bee db validate-pin"
bee db validate-pin --data-dir /home/bee/.bee
echo "Completed: bee db validate-pin"
fi
echo 'Reset "Perform database action" to "none" in Swarm Package "Config" to start up your bee node.'
echo "- http://my.dappnode/packages/my/swarm.public.dappnode.eth/config"
sleep infinity # prevent restarts and repeated destructive db actions
fi
13 changes: 6 additions & 7 deletions dappnode_package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"name": "swarm.public.dappnode.eth",
"version": "1.0.24",
"upstreamVersion": "v2.1.0",
"version": "2.0.0",
"upstreamVersion": "v2.2.0",
"upstreamRepo": "ethersphere/bee",
"upstreamArg": "UPSTREAM_VERSION",
"description": "[Swarm](https://www.ethswarm.org/) is a decentralised data storage and distribution technology. Ready to power the next generation of censorship-resistant, unstoppable, serverless dapps.\n\n\nBy running a Swarm node on Dappnode, you help build a resilient, serverless web while **being rewarded with BZZ tokens** for your participation.\n\n\nLearn about all you can do today with Swarm in the [Swarm documentation](https://docs.ethswarm.org/).",
"shortDescription": "Get rewarded for supporting the Swarm network with your free storage and bandwidth.",
"type": "service",
"mainService": "bee",
"architectures": ["linux/amd64"],
"author": "rampall <[email protected]> (https://github.com/rampall)",
"author": "w3rkspace labs <[email protected]> (https://github.com/w3rkspacelabs)",
"contributors": [
"rampall <rameshpallikara@gmail.com> (https://github.com/rampall)",
"rampall <rampall@w3rkspacelabs.com> (https://github.com/rampall)",
"mfw78 <[email protected]> (https://github.com/mfw78)",
"DAppNode Association <[email protected]> (https://github.com/dappnode)",
"Eduardo Antuña <[email protected]> (https://github.com/eduadiez)",
Expand All @@ -21,10 +21,10 @@
"license": "GPL-3.0",
"repository": {
"type": "git",
"url": "https://github.com/rampall/DAppNodePackage-swarm.git"
"url": "https://github.com/w3rkspacelabs/dappnodepackage-swarm.git"
},
"bugs": {
"url": "https://github.com/rampall/DAppNodePackage-swarm/issues"
"url": "https://github.com/w3rkspacelabs/dappnodepackage-swarm/issues"
},
"requirements": {
"minimumDappnodeVersion": "0.2.29"
Expand All @@ -33,7 +33,6 @@
"homepage": "https://www.ethswarm.org/",
"ui": "http://dashboard.swarm.public.dappnode/",
"api": "http://bee.swarm.public.dappnode:1633/",
"Debug API": "http://bee.swarm.public.dappnode:1635/peers",
"Swarm Documentation": "https://docs.ethswarm.org/"
},
"backup": [
Expand Down
10 changes: 6 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
version: "3.4"
services:
bee:
image: "bee.swarm.public.dappnode.eth:1.0.4"
image: "bee.swarm.public.dappnode.eth:2.0.0"
build:
context: bee
args:
UPSTREAM_VERSION: v2.1.0
UPSTREAM_VERSION: v2.2.0
ports:
- "1634:1634"
volumes:
- "bee-data:/home/bee/.bee"
environment:
BEE_API_ADDR: ":1633"
BEE_BLOCKCHAIN_RPC_ENDPOINT: "http://nethermind-xdai.dappnode:8545"
BEE_RESOLVER_OPTIONS: "http://erigon.dappnode:8545"
BEE_FULL_NODE: "true"
BEE_DEBUG_API_ENABLE: "true"
BEE_SWAP_ENABLE: "true"
BEE_TARGET_NEIGHBORHOOD: ""
BEE_NUKE_DB: "false"
BEE_VERBOSITY: "info"
BEE_CORS_ALLOWED_ORIGINS: "*"
BEE_WELCOME_MESSAGE: "Swarming on DAppNode \U0001F41D"
BEE_PASSWORD_FILE: /home/bee/.bee/password
BEE_DB_ACTION: "none"
EXTRA_OPTS: ""
restart: unless-stopped
dashboard:
image: "dashboard.swarm.public.dappnode.eth:1.0.4"
image: "dashboard.swarm.public.dappnode.eth:2.0.0"
build:
context: dashboard
restart: unless-stopped
Expand Down
6 changes: 6 additions & 0 deletions releases.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,11 @@
"uploadedTo": {
"dappnode": "Tue, 20 Sep 2022 08:39:30 GMT"
}
},
"2.0.0": {
"hash": "/ipfs/QmURRPvdHzFxotXiKejYV7Z388NmVCdCHmRT1KktKfiRSR",
"uploadedTo": {
"dappnode": "Mon, 30 Sep 2024 23:59:20 GMT"
}
}
}
58 changes: 50 additions & 8 deletions setup-wizard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ fields:
type: environment
name: BEE_WELCOME_MESSAGE
service: bee
- title: Bee API address
id: api-addr
description: Bee API URL
target:
type: environment
name: BEE_API_ADDR
service: bee
- title: Full Node Mode
id: full-node
description: Enable the full node mode, if you remove this field, you will run the node in light mode, you can obtain more info about it in bee documentation https://docs.ethswarm.org/docs/access-the-swarm/light-nodes
Expand Down Expand Up @@ -63,20 +70,55 @@ fields:
type: environment
name: BEE_TARGET_NEIGHBORHOOD
service: bee
- title: Nuke database
id: nuke-db
- title: Log messages verbosity level
id: log-verbosity
description: >-
**DANGER**: Enabling this will nuke your localstore database
Set logging verbosity level
target:
type: environment
name: BEE_NUKE_DB
name: BEE_VERBOSITY
service: bee
enum:
- "true"
- "false"
- id: swarmDataMountpoint
- "silent"
- "error"
- "warn"
- "info"
- "debug"
- "trace"
- title: Perform database action
id: db-action
description: >-
**DANGER**: Some actions such as **nuke**, **compact** and **repair-reserve** are destructive actions. If the process is stopped for any reason, the localstore may become corrupted. It is recommended that you [backup](http://my.dappnode/packages/my/swarm.public.dappnode.eth/backup) first.
- **none**: Do nothing. Start the bee node by default.
- **nuke**: Enabling this will nuke your localstore database. Bee will resync all data next time it boots up.
- **compact**: Compacts the localstore sharky store. Compaction is a destructive process. If the process is stopped for any reason, the localstore may become corrupted.
- **repair-reserve**: Repairs the reserve by resetting the binIDs and removes dangling entries. This is a destructive process. If the process is stopped for any reason, the reserve may become corrupted.
- **info**: Prints the different indexes present in the Database.
- **validate**: Validates the localstore sharky store.
- **validate-pin**: Validates pin collection chunks with sharky store.
target:
type: environment
name: BEE_DB_ACTION
service: bee
enum:
- "none"
- "nuke"
- "compact"
- "repair-reserve"
- "info"
- "validate"
- "validate-pin"
- title: Storage data mountpoint
id: swarmDataMountpoint
target:
type: allNamedVolumesMountpoint
title: Storage data mountpoint
description: >-
Use this option if you want to store the Storage data in a separate drive. Make sure to have sufficient free space

0 comments on commit 6fedaed

Please sign in to comment.