Skip to content

Commit

Permalink
Add termux installation script
Browse files Browse the repository at this point in the history
  • Loading branch information
bahner committed Mar 3, 2024
1 parent 325a0f8 commit 1fdbb9a
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"fmt"
"os"

"github.com/bahner/go-ma"
log "github.com/sirupsen/logrus"
"github.com/spf13/viper"
"gopkg.in/yaml.v2"
Expand Down Expand Up @@ -41,7 +40,8 @@ func generateConfigFile(identity string, node string) {
},
// NB! This is a cross over from go-ma
"api": map[string]interface{}{
"maddr": ma.DEFAULT_IPFS_API_MULTIADDR,
// This must be set corretly for generation to work
"maddr": viper.GetString("api.maddr"),
},
"http": map[string]interface{}{
"socket": defaultHttpSocket,
Expand Down
47 changes: 47 additions & 0 deletions termux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/bash

cd || exit

export PATH="${PATH}:.local/.bin"

KUBO_VERSION="${KUBO_VERSION:-v0.26.0}"
KUBO_TARBALL="kubo_${KUBO_VERSION}_linux-arm64.tar.gz"
KUBO_URL="https://dist.ipfs.tech/kubo/${KUBO_VERSION}/${KUBO_TARBALL}"

GO_MA_ACTOR_VERSION="${GO_MA_ACTOR_VERSION:-v0.2.3}"
GO_MA_ACTOR="go-ma-actor-android-arm64"
GO_MA_ACTOR_URL=i"https://github.com/bahner/go-ma-actor/releases/download/${GO_MA_ACTOR_VERSION}/${GO_MA_ACTOR}.xz"
pkg up

### IPFS

# Fetch
curl "${KUBO_URL}" -o "${TARBALL}"
tar xf "${TARBALL}"

# Install
pushd kubo || exit
./install.sh
popd || exit

# Configure
ipfs init

# Run
ipfs daemon &> /dev/null &

### GO_MA_ACTOR

# Fetch
curl "${GO_MA_ACTOR_URL}" -o "${GO_MA_ACTOR}.xz"
xz -d "${GO_MA_ACTOR}.xz"

# Install
chmod +x "${GO_MA_ACTOR}"
mv "${GO_MA_ACTOR}" .local/bin/actor

cat <<EOF
# If you haven't already, now run
actor --api-maddr /ip4/127.0.0.1/tcp/5001 --generate --nick ${USER} --publish
actor --nick ${USER}
EOF

0 comments on commit 1fdbb9a

Please sign in to comment.