Misc fixes to scripts (#33)

* use Windows convention for batch file newline

* remove utils.bat as function definitions were not being exported

* add permissive CORS (for UI) and longer default TTL

* bump to 0.1.5

* add workaround for antivirus webshield

* update missing refs to 0.1.5

* Add .gitattributes

* Update Codex version to the v0.1.6 release

---------

Co-authored-by: Slava <20563034+veaceslavdoina@users.noreply.github.com>
This commit is contained in:
Giuliano Mega 2024-10-08 07:22:49 -03:00 committed by GitHub
parent 9161f77968
commit e159351c16
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 31 additions and 48 deletions

11
.gitattributes vendored Normal file
View File

@ -0,0 +1,11 @@
# Set default behavior to automatically normalize line endings.
* text=auto
# Force bash scripts to always use lf line endings so that if a repo is accessed
# in Unix via a file share from Windows, the scripts will work.
*.sh text eol=lf
# Likewise, force cmd and batch scripts to always use crlf
*.cmd text eol=crlf
*.bat text eol=crlf

View File

@ -94,7 +94,7 @@ These options are required to join the testnet:
- `--eth-private-key=FILE` - Set FILE to your private key file. - `--eth-private-key=FILE` - Set FILE to your private key file.
- `--eth-provider=URL` - Set URL to the "Geth Public RPC" found [here](https://docs.codex.storage/networks/testnet) - `--eth-provider=URL` - Set URL to the "Geth Public RPC" found [here](https://docs.codex.storage/networks/testnet)
The marketplace address should default to the correct testnet deployment. You can override it with: The marketplace address should default to the correct testnet deployment. You can override it with:
- `--marketplace-address=ADDR` - Set ADDR to `0xCDef8d6884557be4F68dC265b6bB2E3e52a6C9d6` - `--marketplace-address=ADDR` - Set ADDR to `0xfE822Df439d987849a90B64a4C0e26a297DBD47F`
The above options allow you to join the testnet, exchange data, and purchase storage in the network. If you wish to *sell storage space* to the network, you must include one additional argument: The above options allow you to join the testnet, exchange data, and purchase storage in the network. If you wish to *sell storage space* to the network, you must include one additional argument:
- `prover` - Tells the node we want to enable storage space selling - `prover` - Tells the node we want to enable storage space selling

View File

@ -1,7 +1,7 @@
services: services:
# Codex Node # Codex Node
codex: codex:
image: codexstorage/nim-codex:0.1.4 image: codexstorage/nim-codex:0.1.5
container_name: codex container_name: codex
command: command:
- codex - codex

View File

@ -17,7 +17,7 @@ BOOTSPR=$(curl http://localhost:8078/api/codex/v1/spr | cut -d '"' -f4)
persistence \ persistence \
--eth-private-key=eth.key \ --eth-private-key=eth.key \
--eth-provider=https://rpc.testnet.codex.storage \ --eth-provider=https://rpc.testnet.codex.storage \
--marketplace-address=0x9C88D67c7C745D2F0A4E411c18A6a22c15b37EaA \ --marketplace-address=0xfE822Df439d987849a90B64a4C0e26a297DBD47F \
prover \ prover \
& &

View File

@ -48,7 +48,7 @@ else
ARCHIVE_EXT=".tar.gz" ARCHIVE_EXT=".tar.gz"
EXE_EXT="" EXE_EXT=""
fi fi
VERSION="v0.1.4" VERSION="v0.1.6"
BASE_URL="http://192.168.88.253:8080" BASE_URL="http://192.168.88.253:8080"
EXTRACT_DIR="./" EXTRACT_DIR="./"
# Use BINARY_NAMES=("codex" "codex-prover") to also download/verify/extract prover binary # Use BINARY_NAMES=("codex" "codex-prover") to also download/verify/extract prover binary

View File

@ -48,7 +48,7 @@ else
ARCHIVE_EXT=".tar.gz" ARCHIVE_EXT=".tar.gz"
EXE_EXT="" EXE_EXT=""
fi fi
VERSION="v0.1.4" VERSION="v0.1.6"
BASE_URL="https://github.com/codex-storage/nim-codex/releases/download/${VERSION}" BASE_URL="https://github.com/codex-storage/nim-codex/releases/download/${VERSION}"
EXTRACT_DIR="./" EXTRACT_DIR="./"
# Use BINARY_NAMES=("codex" "codex-prover") to also download/verify/extract prover binary # Use BINARY_NAMES=("codex" "codex-prover") to also download/verify/extract prover binary

View File

@ -36,7 +36,7 @@ if [ ! -f eth.key ]; then
fi fi
# Set variables # Set variables
VERSION="v0.1.4" VERSION="v0.1.6"
OS=$(get_os) OS=$(get_os)
ARCH=$(get_arch) ARCH=$(get_arch)
DATA_DIR="data_client" DATA_DIR="data_client"
@ -52,6 +52,8 @@ chmod 0700 ${DATA_DIR}
--disc-port=8090 \ --disc-port=8090 \
--listen-addrs=/ip4/0.0.0.0/tcp/8070 \ --listen-addrs=/ip4/0.0.0.0/tcp/8070 \
--bootstrap-node=${BOOTSPR} \ --bootstrap-node=${BOOTSPR} \
--api-cors-origin="*" \
--block-ttl=30d \
persistence \ persistence \
--eth-private-key=eth.key \ --eth-private-key=eth.key \
--eth-provider=https://rpc.testnet.codex.storage --eth-provider=https://rpc.testnet.codex.storage

View File

@ -1,14 +1,15 @@
@echo off @echo off
setlocal enabledelayedexpansion setlocal enabledelayedexpansion
call utils.bat :: Variables
if not defined NETWORK set NETWORK=testnet
:: Set variables :: Set variables
set "OS=windows" set "OS=windows"
call :get_arch ARCH call :get_arch ARCH
set "ARCHIVE_EXT=.zip" set "ARCHIVE_EXT=.zip"
set "EXE_EXT=.exe" set "EXE_EXT=.exe"
set "VERSION=v0.1.4" set "VERSION=v0.1.6"
set "BASE_URL=https://github.com/codex-storage/nim-codex/releases/download/%VERSION%" set "BASE_URL=https://github.com/codex-storage/nim-codex/releases/download/%VERSION%"
set "EXTRACT_DIR=.\" set "EXTRACT_DIR=.\"
set "BINARY_NAMES=codex" set "BINARY_NAMES=codex"

View File

@ -1,14 +1,15 @@
@echo off @echo off
setlocal enabledelayedexpansion setlocal enabledelayedexpansion
call utils.bat :: Variables
if not defined NETWORK set NETWORK=testnet
:: Set variables :: Set variables
set "OS=windows" set "OS=windows"
call :get_arch ARCH call :get_arch ARCH
set "ARCHIVE_EXT=.zip" set "ARCHIVE_EXT=.zip"
set "EXE_EXT=.exe" set "EXE_EXT=.exe"
set "VERSION=v0.1.4" set "VERSION=v0.1.6"
set "BASE_URL=http://192.168.88.253:8080" set "BASE_URL=http://192.168.88.253:8080"
set "EXTRACT_DIR=.\" set "EXTRACT_DIR=.\"
set "BINARY_NAMES=codex" set "BINARY_NAMES=codex"

View File

@ -1,7 +1,8 @@
@echo off @echo off
setlocal enabledelayedexpansion setlocal enabledelayedexpansion
call utils.bat :: Variables
if not defined NETWORK set NETWORK=testnet
:: Check if LOCALIP is provided as an argument :: Check if LOCALIP is provided as an argument
if "%1" neq "" ( if "%1" neq "" (
@ -43,7 +44,7 @@ if errorlevel 1 (
) )
:: Set variables :: Set variables
set "VERSION=v0.1.4" set "VERSION=v0.1.6"
set "OS=windows" set "OS=windows"
call :get_arch ARCH call :get_arch ARCH
set "DATA_DIR=data_client" set "DATA_DIR=data_client"
@ -59,6 +60,8 @@ codex-%VERSION%-%OS%-%ARCH%.exe ^
--api-port=8080 ^ --api-port=8080 ^
--disc-port=8090 ^ --disc-port=8090 ^
--listen-addrs=/ip4/0.0.0.0/tcp/8070 ^ --listen-addrs=/ip4/0.0.0.0/tcp/8070 ^
--api-cors-origin="*" ^
--block-ttl=30d ^
--bootstrap-node=%BOOTSPR% ^ --bootstrap-node=%BOOTSPR% ^
persistence ^ persistence ^
--eth-private-key=eth.key ^ --eth-private-key=eth.key ^
@ -89,5 +92,5 @@ exit /b
:: Function to get Public IP using ip lookup service :: Function to get Public IP using ip lookup service
:get_ip_public :get_ip_public
for /f "tokens=1" %%a in ('curl -m 5 -s https://ip.codex.storage') do set "%1=%%a" for /f "tokens=1" %%a in ('curl -m 5 -s --ssl-reqd ip.codex.storage') do set "%1=%%a"
exit /b exit /b

View File

@ -1,35 +0,0 @@
@echo off
:: Variables
if not defined NETWORK set NETWORK=testnet
:: Function to detect OS
:get_os
echo windows
exit /b
:: Function to detect CPU architecture
:get_arch
set "arch_result=unknown"
for /f "tokens=2 delims=:" %%a in ('systeminfo ^| find "System Type"') do (
echo %%a | find "x64" > nul
if not errorlevel 1 set "arch_result=amd64"
echo %%a | find "ARM" > nul
if not errorlevel 1 set "arch_result=arm64"
)
if "%arch_result%"=="unknown" (
echo Unsupported architecture: %PROCESSOR_ARCHITECTURE%
exit /b 1
)
set "%1=%arch_result%"
exit /b
:: Function to get IP
:get_ip
for /f "tokens=2 delims=:" %%a in ('ipconfig ^| findstr /c:"IPv4 Address"') do (
set "%1=%%a"
set "%1=!%1: =!"
goto :break
)
:break
exit /b