npm install
ts-node src/index.sh
devcontainer.json:
"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
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