? Editing: Post:21.body Save Delete Cancel
Content changed Sign & Publish new content

Mod's Blog

A blog of the user mod.

Favorite Sites

Follow in NewsfeedFollowing

Latest comments:

Add new post

Title

21 hours ago · 2 min read 1
Body
Read more

EZTerminal: Windows Terminal for Creating, Building, and Publishing Sites

on Mar 03, 2016

EZTerminal is a batch file, designed to help beginners with creating, building, and publishing sites via command prompt. As EZTerminal is a .bat file, this guide will only work for Windows users. A download link is available, along with all of the code posted below.

Configuration

The first step in configuring EZTerminal is placing it in the right directory. It's simple mistake to make early on, so make sure you place EZTerminal (or your batch file if you are creating your own) inside of the ZeroBundle folder. It should be sitting there nice and snug next to zeronet.bat.
Folder example
Now that we have it in the right directory, let's look at what it does.
Prompt

1 - Create Site

By typing 1 into the input, you will create a new site. You will be given a site private key and site address, which you should save somewhere immediately so you don't lose this information. Both the private key and address are very important to building/publishing your site.
Creating site part 1/2
Save your key & address somewhere safe. To easily copy this information, right click and select Mark. Then select the text you want to copy, and hit Enter

- ----------------------------------------------------------------------
- Site private key: 5HsRrumEKL1pZpKc8cVcMP5aMJs7viD3rvR3BdRpLbqQeMjUkoh
-                   !!! ^ Save it now, required to modify the site ^ !!!
- Site address:     14Gq7HH3wBDpjWnnpFAzBWRCGF1cJH4hZf
- ----------------------------------------------------------------------

Type in yes when you have saved the information and are ready to move on.
Creating site part 2/2
Now that you've successfully created a new site and saved yours key/address, it's time to build your site.

2 - Build/Modify Site

By typing 2 into the input, you will build your new site. You will be prompted to enter your Site Address Key that you remembered to save earlier. You can paste the Address Key you recently copied by using the normal shortcutCTRL+P
Build/Modify site part 1/3
Next you will be prompted to enter your Private key.
Build/Modify site part 2/3
NOTE: You cannot use the shortcut CTRL+P to paste your Private key. You must Right click>Paste to paste your private key. It will not be visible to you; this is normal.
Build/Modify site part 3/3
Once it is successfully finished, you should see output similar to the picture above. Hashes, keys, and addresses will differ, but you should see no errors with signing and saving your content.

3 - Publish Site

By typing 3 into the input, you will publish your site. You must publish your site in order for peers to receive any changes you have made.
Publish part 1/2
You will be prompted to enter your Address Key once more, and as with before during the build, you can use the normal Windows shortcut CTRL+P to paste your key.
Publish part 2/2
Once it's finished, hit any key to return to the main prompt. For the example I had no peers for the demo site, but the prompt should alert you whether or not your peers received all of the changes.

4 - List Sites

By typing 4 into the input, you will list all of the sites in your ZeroNet/data folder, in order of last modified. This lists the folder names only.
List

5 - List Sites (Long List)

By typing 5 into input, you will list all of the site in your ZeroNet/data folder, in order of last modified. This lists more detailed information about the folders.
Long List

Here is a download link for those interested.
Here is a seperate link for viewing the code in your browser.

As promised, here is the code:

@echo off
set "curpath=%cd%"

:userprompt
cls
color 70
cd %curpath%

echo Please input a number to complete the action.
echo.
echo ---------------------------------------------
echo ---------------------------------------------
echo ---        1 - Create Site          ---
echo ---        2 - Build/Modify Site      ---
echo ---        3 - Publish Site              ---
echo ---        4 - List Sites          ---
echo ---        5 - List Sites (Long List)     ---
echo ---        6 - Exit                  ---
echo ---------------------------------------------
echo ---------------------------------------------
echo.

set /p input="Input: "
if "%input%"=="1" goto create
if "%input%"=="2" goto build
if "%input%"=="3" goto publish
if "%input%"=="4" goto listsites
if "%input%"=="5" goto longlist
if "%input%"=="6" goto exit
goto error


:create
cls
cd ZeroNet
"../Python/python.exe" zeronet.py siteCreate
echo.
echo.
pause
goto userprompt


:build
echo.
echo.
set /p addresskey="Site Address key: "
cd ZeroNet
"../Python/python.exe" zeronet.py siteSign %addresskey%
echo.
echo.
pause
goto userprompt


:publish
echo.
echo.
set /p addresskey="Site Address key: "
cd ZeroNet
"../Python/python.exe" zeronet.py sitePublish %addresskey%
echo.
echo.
pause
goto userprompt


:listsites
cls
cd ZeroNet/data
echo All sites listed in order of last modified.
echo.
echo.
dir /a:d /t:w /b
echo.
echo.
pause
goto userprompt


:longlist
cls
cd ZeroNet/data
echo All sites listed in order of last modified.
echo.
echo.
dir /a:d /t:w /n
echo.
echo.
pause
goto userprompt


:error
cls
color 74
echo An error occured: InputArgumentException
echo.
echo Please type in a proper command.
pause
goto userprompt


exit:
exit

1 Comments:

user_name1 day ago
Reply
Body
applepieon Jun 02, 2017
Reply

chips

This page is a snapshot of ZeroNet. Start your own ZeroNet for complete experience. Learn More