-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ferenc Sárai
authored and
Ferenc Sárai
committed
Oct 30, 2023
0 parents
commit 8249a4c
Showing
9 changed files
with
725 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"name": "bee-keyvalue Dockerfile", | ||
"build": { | ||
"context": "..", | ||
"dockerfile": "../Dockerfile" | ||
}, | ||
"forwardPorts": [1633, 1635, 3000], | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"dbaeumer.vscode-eslint", | ||
"esbenp.prettier-vscode" | ||
] | ||
} | ||
}, | ||
"postStartCommand": "./start.sh" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.DS_Store | ||
node_modules | ||
nohup.out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# bee: 1.16.1, typescript | ||
|
||
FROM node:18 | ||
|
||
RUN npm install --global @ethersphere/swarm-cli && \ | ||
npm install --global typescript && \ | ||
npm install --global ts-node | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y curl && \ | ||
apt-get install -y alien && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN curl -o /tmp/bee.rpm -L "https://github.com/ethersphere/bee/releases/download/v1.16.1/bee-1.16.1.aarch64.rpm" && \ | ||
cd /tmp && alien -d bee.rpm && \ | ||
dpkg -i /tmp/bee_1.16.1-2_arm64.deb && \ | ||
rm /tmp/bee.rpm && \ | ||
rm /tmp/bee_1.16.1-2_arm64.deb | ||
|
||
EXPOSE 1633 1635 3000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Bee key-value store example | ||
|
||
## run | ||
|
||
### npm install | ||
|
||
```bash | ||
npm install | ||
``` | ||
|
||
### example | ||
|
||
```bash | ||
ts-node src/index.sh | ||
``` | ||
|
||
## starting Bee in devcontainer.json | ||
|
||
__devcontainer.json:__ | ||
|
||
```bash | ||
"postStartCommand": "./start.sh" | ||
``` | ||
|
||
__start.sh:__ | ||
- npm install | ||
- It starts the Bee in dev mode with cors=*; the Bee output is in the nohup.out file | ||
- Purchases a stamp | ||
- Add the stamp value to the STAMP environment variable, which the index.ts file loads. | ||
- Starts the index.ts | ||
|
||
```bash | ||
npm install | ||
nohup bash -c 'bee dev --cors-allowed-origins="*" &' | ||
sleep 3 | ||
STAMP=$(swarm-cli stamp buy --yes --depth 20 --amount 10000000 | grep "Stamp ID:" | cut -d " " -f 3) | ||
echo $STAMP | ||
export STAMP | ||
echo "export STAMP='$STAMP'" >> ~/.bashrc | ||
ts-node src/index.ts | ||
``` |
Oops, something went wrong.