-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adding instructions on how to use the windows command prompt, and linking to instructions on how to use the command prompt on linux. * Adding a script to generate html files from the markdown, to create release bundles that have html files instead of markdown (since html is more standard and everyone has a way to view them).
- Loading branch information
1 parent
0fd286e
commit 443c5d4
Showing
21 changed files
with
272 additions
and
32 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,5 @@ | ||
.idea | ||
tordlWalletProtocols.iml | ||
releases | ||
new-release | ||
node_modules |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,13 @@ | ||
The Setup Protocol is used to prepare hardware, and download and verify needed software & documentation. | ||
|
||
The first thing we need to do is verify the integrity of the Glacier protocol document (the one you are reading) to ensure that it has not been tampered with. After verifying the document, we’ll print a hardcopy. | ||
|
||
Printing is important, because a verified electronic copy will not be accessible at all times during protocol execution due to reboots and other changes to the computing environment. Printing a hardcopy ensures there is always a verified copy of the document available. | ||
|
||
Find a computer which has Internet access, printer access, and which you have permission to install new software on. We’ll refer to this computer as the “SETUP 1” computer. | ||
Review the errata for the version of Glacier you are using at https://github.com/GlacierProtocol/GlacierProtocol/releases. | ||
Download the latest full release of Glacier (not just the protocol document) at https://github.com/GlacierProtocol/GlacierProtocol/releases. | ||
If your browser does not automatically extract the ZIP file contents into a folder within your downloads directory, do so. | ||
Rename the folder to “glacier.” | ||
If you have used Glacier before, and you know you have the Glacier public key imported into a local GPG keyring, skip the next step. (If you don’t know, that’s fine; proceed as normal.) | ||
Obtain the Glacier “public key,” used to cryptographically verify the protocol document. |
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
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
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,87 @@ | ||
var fs = require("fs").promises | ||
var path = require("path") | ||
var marked = require("marked") | ||
var fwalk = require('kc-fwalk') | ||
|
||
var newReleaseDirName = "new-release" | ||
var ignoreDirectories = [".", "node_modules", "releases", "generate-release.js", "yarn.lock", newReleaseDirName] | ||
|
||
;(async function() { | ||
try { | ||
try { | ||
await fs.mkdir(newReleaseDirName) | ||
} catch (e) { | ||
if(e.code === "EEXIST") { | ||
console.log("Directory "+newReleaseDirName+" already exists. Quitting.") | ||
} else { | ||
throw e | ||
} | ||
} | ||
// | ||
// var cssContent = await fs.readFile(__dirname+"/style.css") | ||
// await fs.writeFile(__dirname+"/"+newReleaseDirName+"/style.css", cssContent.toString()) | ||
|
||
// var filename = "./singleWalletProtocols/Basic-Hot-Wallet.md" | ||
await Promise.all(getFilenames(ignoreDirectories).map(async function(filename) { | ||
var basename = path.basename(filename) | ||
var dirname = path.dirname(filename) | ||
var sourceFilePath = __dirname+"/"+filename.slice(2) | ||
|
||
|
||
var isMarkdown = filename.slice(-3) === ".md" | ||
if(isMarkdown) { | ||
var releaseFileName = basename.slice(0, -2)+"html" | ||
var baseDirectoryPath = strmult("../", dirname.split('/').length-1) | ||
} else { | ||
var releaseFileName = basename | ||
} | ||
|
||
var releaseFilePath = __dirname+"/"+newReleaseDirName+dirname.slice(1)+"/"+releaseFileName | ||
await fs.mkdir(path.dirname(releaseFilePath), {recursive:true}) | ||
if(isMarkdown) { | ||
var file = await fs.readFile(sourceFilePath) | ||
var contentsToWrite = generateHtml(file.toString(), baseDirectoryPath) | ||
await fs.writeFile(releaseFilePath, contentsToWrite) | ||
} else { | ||
await fs.copyFile(sourceFilePath, releaseFilePath) | ||
} | ||
})) | ||
} catch(e) { | ||
console.error(e) | ||
} | ||
})() | ||
|
||
function generateHtml(markdown, baseDirectoryPath) { | ||
marked.use({renderer: {link: function(href, title, text) { | ||
if(href.indexOf("http") !== 0 && href.slice(-3) === ".md") { | ||
// Replace local markdown links with the path to the html version | ||
href = href.slice(0, -3)+".html" | ||
} | ||
return "<a href='"+href+"'>"+text+"</a>" | ||
}}}) | ||
|
||
return "<head><link rel='stylesheet' type='text/css' href='"+baseDirectoryPath+"style.css'></style></head>\n"+marked(markdown) | ||
} | ||
|
||
// Gets the filenames to copy | ||
function getFilenames(ignoreDirectories) { | ||
var filenames = [] | ||
fwalk(".").forEach(function(filename) { | ||
// Filter out non-project directories | ||
for(var n=0; n<ignoreDirectories.length; n++) { | ||
if(filename.indexOf("./"+ignoreDirectories[n]) === 0) return // Ignore file in that directory. | ||
} | ||
|
||
filenames.push(filename) | ||
}) | ||
return filenames | ||
} | ||
|
||
// Concatenate a string together multiple times | ||
function strmult(str, count) { | ||
var result = [] | ||
for(var n=0; n<count; n++) { | ||
result.push(str) | ||
} | ||
return result.join("") | ||
} |
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
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,35 @@ | ||
# Info for Windows Operating System users | ||
|
||
## Turning on filename extensions | ||
|
||
Windows has filename extensions hidden by default, which is bad because it makes it easier for people to run malicious programs disguised as an image or text file. It also makes it harder to change file types or work with things on the command line. To enable filename extensions: | ||
|
||
1. Open up any windows folder. | ||
2. Click on the *View* menu at the top. | ||
3. Near the top right of the folder should now be an option called *File name extensions*. Ensure that option is checked. | ||
|
||
## Using the command line | ||
|
||
The command line (aka command prompt or incorrectly as the "DOS prompt") is a program on windows (and other OSes) that you can use to run text commands that you can use to run programs and manipulate files and folders on your computer. Many advanced tasks require the use of the command line. On windows, this program is called **cmd.exe**. | ||
|
||
The easiest way to open it is to go to your start menu and search for "cmd". | ||
|
||
![cmd](https://www.lifewire.com/thmb/LX3O2ZWWJb7hcB6MqSlbjb6bLl4=/1118x0/filters:no_upscale():max_bytes(150000):strip_icc():format(webp)/open-command-prompt-w10-5c19531146e0fb00013852e8.png) | ||
|
||
Commands must be entered into Command Prompt exactly. The wrong [syntax](https://www.lifewire.com/what-is-syntax-2626014) or a misspelling could cause the command to fail or worse: it could execute the wrong command or the right command in the wrong way. | ||
|
||
The most important things you'll need to know how to do for this guide are how to paste, and how to use the `cd` command. | ||
|
||
#### How to paste into the command prompt | ||
|
||
![pasting](windows-cmd-paste.png) | ||
|
||
On some systems, ctrl-v does not work to paste. If this is the case, paste by clicking on the top left of the window (on the icon), select *Edit*, then select *Paste*. | ||
|
||
#### How to use the `cd` command. | ||
|
||
The command `cd` stands for `c`hange `d`irectory. You can think of this the same way you would double click on a folder and then be "in" that folder. Note that "directory" and "folder" both mean the same thing in this context. | ||
|
||
* Change to a particular folder: In this guide, usually you'll simply want to change to a particular folder. To do that type a command of the form `cd <folder you want to go to>`, for example, to go to `C:\Users\you\Desktop\pics` you would type `cd C:\Users\fresh\Desktop\pics` and then press enter to submit the command. Use the instructions *How to paste into the command prompt* to make this easier. You can copy the path a folder is at by clicking to the right of the folder's address bar. | ||
* If you're changing to a directory with a different drive letter than your current working directory, you'll need to additionally type that drive letter. For example, if your command prompt's line starts with `C:\Users\yourUsername>` and you need to switch to the directory `D:\some-folder\`, then you'll need to type `d:` into the command prompt and press enter. You can do this before or after the `cd` command. | ||
* Usually, when you start the command prompt, your "working directory" (the folder you start in) is the folder that contains your desktop's files. So if you're just trying to get to your desktop, enter the command `cd Desktop`. |
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
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,6 @@ | ||
{ | ||
"dependencies": { | ||
"kc-fwalk": "^1.0.5", | ||
"marked": "^1.1.0" | ||
} | ||
} |
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
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
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
Oops, something went wrong.