stxmap-rank-shell 1.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.cspell.json +16 -0
- package/README.md +17 -0
- package/js-script/backpack-oooooyoung.js +70 -0
- package/js-script/lava-oooooyoung.js +5072 -0
- package/js-script/test.js +10 -0
- package/other/MyToken.sol +37 -0
- package/package.json +34 -0
- package/pw-script/atommint-oooooyoung.ps1 +165 -0
- package/pw-script/iercpow-oooooyoung.ps1 +110 -0
- package/pw-script/lava-oooooyoung.ps1 +96 -0
- package/shell-script/aleo-damominer-oooooyoung.sh +74 -0
- package/shell-script/aleo-oooooyoung copy.sh +150 -0
- package/shell-script/aleo-oooooyoung.sh +150 -0
- package/shell-script/babylon-oooooyoung.sh +180 -0
- package/shell-script/btcfullnode-oooooyoung.sh +116 -0
- package/shell-script/celestia-oooooyoung.sh +151 -0
- package/shell-script/chainflip-oooooyoung.sh +157 -0
- package/shell-script/dusknetwork-oooooyoung.sh +84 -0
- package/shell-script/dymension-oooooyoung.sh +124 -0
- package/shell-script/install_var.sh +45 -0
- package/shell-script/massa-oooooyoung.sh +72 -0
- package/shell-script/nibiru-oooooyoung.sh +102 -0
- package/shell-script/qtestnet-oooooyoung.sh +75 -0
- package/shell-script/ziesha-oooooyoung.sh +60 -0
@@ -0,0 +1,37 @@
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
2
|
+
pragma solidity ^0.8.20;
|
3
|
+
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
|
4
|
+
|
5
|
+
import "@openzeppelin/contracts/access/Ownable.sol";
|
6
|
+
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
|
7
|
+
import "stl-contracts/ERC/ERC5169.sol";
|
8
|
+
|
9
|
+
contract ERC721Mint is Ownable, ERC5169, ERC721Enumerable {
|
10
|
+
constructor()
|
11
|
+
ERC721("oooooyoung", "oooooyoung") //把里面的 oooooyoung 替换成其他的昵称
|
12
|
+
Ownable(msg.sender)
|
13
|
+
{}
|
14
|
+
|
15
|
+
function supportsInterface(bytes4 interfaceId)
|
16
|
+
public
|
17
|
+
view
|
18
|
+
override(ERC5169, ERC721Enumerable)
|
19
|
+
returns (bool)
|
20
|
+
{
|
21
|
+
return
|
22
|
+
ERC721Enumerable.supportsInterface(interfaceId) ||
|
23
|
+
ERC5169.supportsInterface(interfaceId);
|
24
|
+
}
|
25
|
+
|
26
|
+
// limit set contracts to admin only
|
27
|
+
function _authorizeSetScripts(string[] memory)
|
28
|
+
internal
|
29
|
+
view
|
30
|
+
override(ERC5169)
|
31
|
+
onlyOwner
|
32
|
+
{}
|
33
|
+
|
34
|
+
function safeMint(address to, uint256 tokenId) public onlyOwner {
|
35
|
+
_safeMint(to, tokenId);
|
36
|
+
}
|
37
|
+
}
|
package/package.json
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
{
|
2
|
+
"dependencies": {
|
3
|
+
"bbguai": "^1.0.0",
|
4
|
+
"crypto-price-checker-oooooyoung": "^1.0.6",
|
5
|
+
"ethers": "^5.7.2",
|
6
|
+
"lodash": "^4.17.21",
|
7
|
+
"node-fetch": "^2.7.0",
|
8
|
+
"stxmap-address-rank": "^1.0.6",
|
9
|
+
"stxmap-rank-cli": "^1.0.6"
|
10
|
+
},
|
11
|
+
"name": "stxmap-rank-shell",
|
12
|
+
"description": "Some web3 shell",
|
13
|
+
"version": "1.1.10",
|
14
|
+
"main": "index.js",
|
15
|
+
"devDependencies": {
|
16
|
+
"cspell": "^6.31.2",
|
17
|
+
"stxmap-address-rank": "^1.0.6",
|
18
|
+
"stxmap-rank-cli": "^1.0.6"
|
19
|
+
},
|
20
|
+
"scripts": {
|
21
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
22
|
+
},
|
23
|
+
"repository": {
|
24
|
+
"type": "git",
|
25
|
+
"url": "https://github.com/NorthernMartta/stxmap-rank-shell.git"
|
26
|
+
},
|
27
|
+
"keywords": [],
|
28
|
+
"author": "NorthernMartta",
|
29
|
+
"license": "ISC",
|
30
|
+
"bugs": {
|
31
|
+
"url": "https://github.com/NorthernMartta/stxmap-rank-shell/issues"
|
32
|
+
},
|
33
|
+
"homepage": "https://github.com/NorthernMartta/stxmap-rank-shell#readme"
|
34
|
+
}
|
@@ -0,0 +1,165 @@
|
|
1
|
+
|
2
|
+
$OutputEncoding = [Console]::OutputEncoding = [Text.UTF8Encoding]::UTF8
|
3
|
+
$scriptDir = $PSScriptRoot
|
4
|
+
$atomicalsjsDir = "D:\atomicals-js"
|
5
|
+
function Install-NodeJS {
|
6
|
+
param (
|
7
|
+
[string]$downloadUrl = "https://nodejs.org/dist/v20.10.0/node-v20.10.0-x64.msi",
|
8
|
+
[string]$installPath = "D:\Node"
|
9
|
+
)
|
10
|
+
$DownloadPath = Join-Path $env:TEMP "NodeInstaller.msi"
|
11
|
+
Invoke-WebRequest -Uri $DownloadUrl -OutFile $DownloadPath
|
12
|
+
|
13
|
+
Start-Process -Wait -FilePath "msiexec.exe" -ArgumentList "/i", "`"$DownloadPath`"", "/qn", "/norestart", "/L*v `"$InstallPath\install.log`""
|
14
|
+
|
15
|
+
Remove-Item $DownloadPath -Force
|
16
|
+
|
17
|
+
Write-Output "Node install."
|
18
|
+
}
|
19
|
+
|
20
|
+
function Install-Git {
|
21
|
+
param(
|
22
|
+
[string]$DownloadUrl = "https://github.com/git-for-windows/git/releases/download/v2.43.0.windows.1/Git-2.43.0-64-bit.exe",
|
23
|
+
[string]$InstallPath = "D:\Git"
|
24
|
+
)
|
25
|
+
|
26
|
+
$DownloadPath = Join-Path $env:TEMP "GitInstaller.exe"
|
27
|
+
Invoke-WebRequest -Uri $DownloadUrl -OutFile $DownloadPath
|
28
|
+
|
29
|
+
Start-Process -Wait -FilePath $DownloadPath -ArgumentList "/SILENT", "/COMPONENTS=icons,ext,cmdhere,menus", "/DIR=$InstallPath"
|
30
|
+
|
31
|
+
Remove-Item $DownloadPath -Force
|
32
|
+
|
33
|
+
Write-Output "Git install."
|
34
|
+
}
|
35
|
+
|
36
|
+
|
37
|
+
function Install-GitRepo {
|
38
|
+
param (
|
39
|
+
[string]$repoUrl = "https://github.com/atomicals/atomicals-js.git",
|
40
|
+
[string]$destination = $atomicalsjsDir
|
41
|
+
)
|
42
|
+
|
43
|
+
try {
|
44
|
+
if (Test-Path $destination) {
|
45
|
+
Remove-Item -Recurse -Force $destination
|
46
|
+
Write-Output "Removed existing directory: $destination"
|
47
|
+
}
|
48
|
+
|
49
|
+
git clone $repoUrl $destination
|
50
|
+
|
51
|
+
cd $destination
|
52
|
+
|
53
|
+
npm i -g yarn
|
54
|
+
|
55
|
+
yarn install
|
56
|
+
|
57
|
+
yarn build
|
58
|
+
|
59
|
+
Write-Output "Git clone in $destination and install dependencies"
|
60
|
+
}
|
61
|
+
catch {
|
62
|
+
Write-Error "Failed to clone the Git repository. $_"
|
63
|
+
}
|
64
|
+
}
|
65
|
+
|
66
|
+
# 安装环境函数
|
67
|
+
function Install-Env {
|
68
|
+
param ()
|
69
|
+
|
70
|
+
if (-not (Get-Command node -ErrorAction SilentlyContinue)) {
|
71
|
+
Install-NodeJS
|
72
|
+
}
|
73
|
+
else {
|
74
|
+
Write-Host "Node.js is already installed."
|
75
|
+
}
|
76
|
+
|
77
|
+
if (-not (Get-Command git -ErrorAction SilentlyContinue)) {
|
78
|
+
Install-Git
|
79
|
+
}
|
80
|
+
else {
|
81
|
+
Write-Host "Git is already installed."
|
82
|
+
}
|
83
|
+
|
84
|
+
Install-GitRepo
|
85
|
+
|
86
|
+
Write-Output "all env install"
|
87
|
+
Read-Host "Press Enter to restart atommint-oooooyoung script..."
|
88
|
+
Set-Location -Path $scriptDir
|
89
|
+
.\atommint-oooooyoung.ps1
|
90
|
+
}
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
# 获取用户输入
|
95
|
+
$userInput = Read-Host @"
|
96
|
+
script by oooooyoung11
|
97
|
+
please select:
|
98
|
+
1. install atomicals env
|
99
|
+
2. create wallet
|
100
|
+
3. import wallet
|
101
|
+
4. check all wallet info
|
102
|
+
5. start mint arc20
|
103
|
+
6. start mint dmint
|
104
|
+
7. check dmint nft status
|
105
|
+
|
106
|
+
"@
|
107
|
+
|
108
|
+
# 根据用户输入执行相应操作
|
109
|
+
switch ($userInput) {
|
110
|
+
1 { Install-Env }
|
111
|
+
2 {
|
112
|
+
cd $atomicalsjsDir
|
113
|
+
& yarn cli wallet-init
|
114
|
+
Set-Location -Path $scriptDir
|
115
|
+
Read-Host "Press Enter to restart atommint-oooooyoung script..."
|
116
|
+
Set-Location -Path $scriptDir
|
117
|
+
.\atommint-oooooyoung.ps1
|
118
|
+
}
|
119
|
+
3 {
|
120
|
+
cd $atomicalsjsDir
|
121
|
+
$wif = Read-Host "Input wallet WIF private key "
|
122
|
+
$alias = Read-Host "Input wallet alias "
|
123
|
+
& yarn cli wallet-import $wif $alias
|
124
|
+
Read-Host "Press Enter to restart atommint-oooooyoung script..."
|
125
|
+
Set-Location -Path $scriptDir
|
126
|
+
.\atommint-oooooyoung.ps1
|
127
|
+
}
|
128
|
+
4 {
|
129
|
+
cd $atomicalsjsDir
|
130
|
+
& yarn cli wallets
|
131
|
+
Read-Host "Press Enter to restart atommint-oooooyoung script..."
|
132
|
+
Set-Location -Path $scriptDir
|
133
|
+
.\atommint-oooooyoung.ps1
|
134
|
+
}
|
135
|
+
5 {
|
136
|
+
cd $atomicalsjsDir
|
137
|
+
$tick = Read-Host "Input mint arc20 coin name "
|
138
|
+
$gas = Read-Host "Input mint gas "
|
139
|
+
& yarn cli mint-dft $tick --satsbyte $gas*1.2
|
140
|
+
Read-Host "Press Enter to restart atommint-oooooyoung script..."
|
141
|
+
Set-Location -Path $scriptDir
|
142
|
+
.\atommint-oooooyoung.ps1
|
143
|
+
}
|
144
|
+
6 {
|
145
|
+
cd $atomicalsjsDir
|
146
|
+
$container = Read-Host "Input container name (start with #) "
|
147
|
+
$tick = Read-Host "Input project nft name "
|
148
|
+
$dmintpath = Read-Host "Input project json file path "
|
149
|
+
$gas = Read-Host "Input mint gas "
|
150
|
+
& yarn cli mint-item "$container" "$tick" "$dmintpath" --satsbyte=$gas*1.2
|
151
|
+
Read-Host "Press Enter to restart atommint-oooooyoung script..."
|
152
|
+
Set-Location -Path $scriptDir
|
153
|
+
.\atommint-oooooyoung.ps1
|
154
|
+
}
|
155
|
+
7 {
|
156
|
+
cd $atomicalsjsDir
|
157
|
+
$container = Read-Host "Input container name (start with #) "
|
158
|
+
$tick = Read-Host "Input project nft name "
|
159
|
+
& yarn cli get-container-item "$container" "$tick"
|
160
|
+
Read-Host "Press Enter to restart atommint-oooooyoung script..."
|
161
|
+
Set-Location -Path $scriptDir
|
162
|
+
.\atommint-oooooyoung.ps1
|
163
|
+
}
|
164
|
+
default { Write-Output "invalid select" }
|
165
|
+
}
|
@@ -0,0 +1,110 @@
|
|
1
|
+
|
2
|
+
$OutputEncoding = [Console]::OutputEncoding = [Text.UTF8Encoding]::UTF8
|
3
|
+
function Install-NodeJS {
|
4
|
+
param (
|
5
|
+
[string]$installPath = "C:\Node"
|
6
|
+
)
|
7
|
+
|
8
|
+
$nodeDownloadUrl = "https://nodejs.org/dist/v20.10.0/node-v20.10.0-x64.msi"
|
9
|
+
|
10
|
+
New-Item -ItemType Directory -Path $installPath -Force | Out-Null
|
11
|
+
Invoke-WebRequest -Uri $nodeDownloadUrl -OutFile "$installPath\node.msi" | Out-Null
|
12
|
+
Start-Process -FilePath "$installPath\node.msi" -ArgumentList "/qn" -Wait
|
13
|
+
[Environment]::SetEnvironmentVariable("Path", "$($env:Path);$installPath", [EnvironmentVariableTarget]::Machine)
|
14
|
+
Remove-Item "$installPath\node.msi" -Force
|
15
|
+
|
16
|
+
Write-Output "Node.js install."
|
17
|
+
}
|
18
|
+
|
19
|
+
|
20
|
+
function Install-Git {
|
21
|
+
param (
|
22
|
+
[string]$installPath = "C:\Git"
|
23
|
+
)
|
24
|
+
|
25
|
+
$gitDownloadUrl = "https://github.com/git-for-windows/git/releases/download/v2.43.0.windows.1/Git-2.43.0-64-bit.exe"
|
26
|
+
|
27
|
+
New-Item -ItemType Directory -Path $installPath -Force | Out-Null
|
28
|
+
Invoke-WebRequest -Uri $gitDownloadUrl -OutFile "$installPath\Git-Installer.exe" | Out-Null
|
29
|
+
Start-Process -FilePath "$installPath\Git-Installer.exe" -ArgumentList "/SILENT" -Wait
|
30
|
+
[Environment]::SetEnvironmentVariable("Path", "$($env:Path);$installPath\cmd;$installPath\bin", [EnvironmentVariableTarget]::Machine)
|
31
|
+
Remove-Item "$installPath\Git-Installer.exe" -Force
|
32
|
+
|
33
|
+
Write-Output "Git install."
|
34
|
+
}
|
35
|
+
|
36
|
+
|
37
|
+
function Install-GitRepo {
|
38
|
+
param (
|
39
|
+
[string]$repoUrl = "https://github.com/IErcOrg/ierc-miner-js",
|
40
|
+
[string]$destination = "C:\ierc-miner-js"
|
41
|
+
)
|
42
|
+
|
43
|
+
git clone $repoUrl $destination
|
44
|
+
cd $destination
|
45
|
+
npm i -g yarn
|
46
|
+
npm install
|
47
|
+
|
48
|
+
Write-Output "Git clone in $destination and install dependency"
|
49
|
+
}
|
50
|
+
|
51
|
+
# 安装环境函数
|
52
|
+
function Install-Env {
|
53
|
+
param ()
|
54
|
+
Install-NodeJS
|
55
|
+
Install-Git
|
56
|
+
Install-GitRepo
|
57
|
+
|
58
|
+
Write-Output "all env install"
|
59
|
+
Set-Location "$([System.IO.Path]::Combine($env:USERPROFILE, 'Desktop'))"
|
60
|
+
}
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
# 获取用户输入
|
65
|
+
$userInput = Read-Host @"
|
66
|
+
script by oooooyoung11
|
67
|
+
please select:
|
68
|
+
1. install pow env
|
69
|
+
2. create wallet
|
70
|
+
3. import wallet
|
71
|
+
4. check wallet info
|
72
|
+
5. check all wallet info
|
73
|
+
6. start mint
|
74
|
+
|
75
|
+
"@
|
76
|
+
|
77
|
+
# 根据用户输入执行相应操作
|
78
|
+
switch ($userInput) {
|
79
|
+
1 { Install-Env }
|
80
|
+
2 {
|
81
|
+
cd "C:\ierc-miner-js"
|
82
|
+
& yarn run cli wallet --create
|
83
|
+
Set-Location "$([System.IO.Path]::Combine($env:USERPROFILE, 'Desktop'))"
|
84
|
+
}
|
85
|
+
3 {
|
86
|
+
cd "C:\ierc-miner-js"
|
87
|
+
$privateKey = Read-Host "Input wallet private key "
|
88
|
+
& yarn run cli wallet --set $privateKey
|
89
|
+
Set-Location "$([System.IO.Path]::Combine($env:USERPROFILE, 'Desktop'))"
|
90
|
+
}
|
91
|
+
4 {
|
92
|
+
cd "C:\ierc-miner-js"
|
93
|
+
$address = Read-Host "Input wallet address "
|
94
|
+
& yarn run cli wallet show $address
|
95
|
+
Set-Location "$([System.IO.Path]::Combine($env:USERPROFILE, 'Desktop'))"
|
96
|
+
}
|
97
|
+
5 {
|
98
|
+
cd "C:\ierc-miner-js"
|
99
|
+
& yarn run cli wallet --all
|
100
|
+
Set-Location "$([System.IO.Path]::Combine($env:USERPROFILE, 'Desktop'))"
|
101
|
+
}
|
102
|
+
6 {
|
103
|
+
cd "C:\ierc-miner-js"
|
104
|
+
$address = Read-Host "Input wallet address "
|
105
|
+
$tick = Read-Host "Input mint pow ierc name "
|
106
|
+
& yarn run cli mine $tick --account $address
|
107
|
+
Set-Location "$([System.IO.Path]::Combine($env:USERPROFILE, 'Desktop'))"
|
108
|
+
}
|
109
|
+
default { Write-Output "invalid select" }
|
110
|
+
}
|
@@ -0,0 +1,96 @@
|
|
1
|
+
$OutputEncoding = [Console]::OutputEncoding = [Text.UTF8Encoding]::UTF8
|
2
|
+
|
3
|
+
function Test-CommandInstalled {
|
4
|
+
param(
|
5
|
+
[string]$command
|
6
|
+
)
|
7
|
+
return Get-Command $command -ErrorAction SilentlyContinue
|
8
|
+
}
|
9
|
+
|
10
|
+
function Install-NodeJS {
|
11
|
+
param (
|
12
|
+
[string]$installPath = "C:\Node"
|
13
|
+
)
|
14
|
+
|
15
|
+
# Check if Node.js is already installed
|
16
|
+
if (Test-CommandInstalled "node") {
|
17
|
+
Write-Output "Node.js is already installed."
|
18
|
+
return
|
19
|
+
}
|
20
|
+
|
21
|
+
$nodeDownloadUrl = "https://nodejs.org/dist/v20.11.1/node-v20.11.1-x64.msi"
|
22
|
+
|
23
|
+
New-Item -ItemType Directory -Path $installPath -Force | Out-Null
|
24
|
+
Invoke-WebRequest -Uri $nodeDownloadUrl -OutFile "$installPath\node.msi" | Out-Null
|
25
|
+
Start-Process -FilePath "$installPath\node.msi" -ArgumentList "/qn" -Wait
|
26
|
+
[Environment]::SetEnvironmentVariable("Path", "$($env:Path);$installPath", [EnvironmentVariableTarget]::Machine)
|
27
|
+
Remove-Item "$installPath\node.msi" -Force
|
28
|
+
|
29
|
+
Write-Output "Node.js installed."
|
30
|
+
}
|
31
|
+
|
32
|
+
function Install-Git {
|
33
|
+
param (
|
34
|
+
[string]$installPath = "C:\Git"
|
35
|
+
)
|
36
|
+
|
37
|
+
# Check if Git is already installed
|
38
|
+
if (Test-CommandInstalled "git") {
|
39
|
+
Write-Output "Git is already installed."
|
40
|
+
return
|
41
|
+
}
|
42
|
+
|
43
|
+
$gitDownloadUrl = "https://github.com/git-for-windows/git/releases/download/v2.43.0.windows.1/Git-2.43.0-64-bit.exe"
|
44
|
+
|
45
|
+
New-Item -ItemType Directory -Path $installPath -Force | Out-Null
|
46
|
+
Invoke-WebRequest -Uri $gitDownloadUrl -OutFile "$installPath\Git-Installer.exe" | Out-Null
|
47
|
+
Start-Process -FilePath "$installPath\Git-Installer.exe" -ArgumentList "/SILENT" -Wait
|
48
|
+
[Environment]::SetEnvironmentVariable("Path", "$($env:Path);$installPath\cmd;$installPath\bin", [EnvironmentVariableTarget]::Machine)
|
49
|
+
Remove-Item "$installPath\Git-Installer.exe" -Force
|
50
|
+
|
51
|
+
Write-Output "Git installed."
|
52
|
+
}
|
53
|
+
|
54
|
+
function Install-GitRepo {
|
55
|
+
param (
|
56
|
+
[string]$repoUrl = "https://github.com/nopapername/shell-oooooyoung.git",
|
57
|
+
[string]$destination = "$([System.IO.Path]::Combine($env:USERPROFILE, 'Desktop\shell-oooooyoung'))"
|
58
|
+
)
|
59
|
+
|
60
|
+
if (Test-Path $destination) {
|
61
|
+
Write-Output "Repository already exists on the desktop. Removing and re-cloning."
|
62
|
+
Remove-Item -Recurse -Force $destination
|
63
|
+
}
|
64
|
+
|
65
|
+
git clone $repoUrl $destination
|
66
|
+
Set-Location $destination
|
67
|
+
npm install
|
68
|
+
|
69
|
+
Write-Output "Git clone in $destination and install dependency"
|
70
|
+
}
|
71
|
+
|
72
|
+
function Start-NodeScript {
|
73
|
+
param (
|
74
|
+
[string]$scriptPath = "$([System.IO.Path]::Combine($env:USERPROFILE, 'Desktop\shell-oooooyoung\js-script\lava-oooooyoung.js'))"
|
75
|
+
)
|
76
|
+
|
77
|
+
if (Test-Path $scriptPath) {
|
78
|
+
Write-Output "Executing Node.js script: $scriptPath"
|
79
|
+
node $scriptPath
|
80
|
+
} else {
|
81
|
+
Write-Error "Node.js script not found at: $scriptPath"
|
82
|
+
}
|
83
|
+
}
|
84
|
+
|
85
|
+
function Install-Env {
|
86
|
+
param ()
|
87
|
+
Install-NodeJS
|
88
|
+
Install-Git
|
89
|
+
Install-GitRepo
|
90
|
+
|
91
|
+
Write-Output "All environment installed."
|
92
|
+
Read-Host "Press Enter to restart lava-oooooyoung.js script..."
|
93
|
+
Start-NodeScript
|
94
|
+
}
|
95
|
+
|
96
|
+
Install-Env
|
@@ -0,0 +1,74 @@
|
|
1
|
+
Crontab_file="/usr/bin/crontab"
|
2
|
+
Green_font_prefix="\033[32m"
|
3
|
+
Red_font_prefix="\033[31m"
|
4
|
+
Green_background_prefix="\033[42;37m"
|
5
|
+
Red_background_prefix="\033[41;37m"
|
6
|
+
Font_color_suffix="\033[0m"
|
7
|
+
Info="[${Green_font_prefix}信息${Font_color_suffix}]"
|
8
|
+
Error="[${Red_font_prefix}错误${Font_color_suffix}]"
|
9
|
+
Tip="[${Green_font_prefix}注意${Font_color_suffix}]"
|
10
|
+
|
11
|
+
check_root() {
|
12
|
+
[[ $EUID != 0 ]] && echo -e "${Error} 当前非ROOT账号(或没有ROOT权限), 无法继续操作, 请更换ROOT账号或使用 ${Green_background_prefix}sudo su${Font_color_suffix} 命令获取临时ROOT权限(执行后可能会提示输入当前账号的密码)。" && exit 1
|
13
|
+
}
|
14
|
+
|
15
|
+
install_damominer_env() {
|
16
|
+
check_root
|
17
|
+
sudo apt install -y wget
|
18
|
+
wget -P /root/damominer_folder https://github.com/damomine/aleominer/releases/download/v2.3.1/damominer_linux_v2.3.1.tar
|
19
|
+
tar -xvf /root/damominer_folder/damominer_linux_v2.3.1.tar -C /root/damominer_folder/
|
20
|
+
chmod +x /root/damominer_folder/damominer
|
21
|
+
chmod +x /root/damominer_folder/run_gpu.sh
|
22
|
+
}
|
23
|
+
|
24
|
+
run_damominer() {
|
25
|
+
read -e -p "请输入你的aleo address: " ALEO_ADDRESS
|
26
|
+
if ps aux | grep 'damominer' | grep -q 'proxy'; then
|
27
|
+
echo "DamoMiner already running."
|
28
|
+
exit 1
|
29
|
+
else
|
30
|
+
nohup /root/damominer_folder/damominer --address $ALEO_ADDRESS --proxy aleo2.damominer.hk:9090 >> aleo.log 2>&1 &
|
31
|
+
fi
|
32
|
+
}
|
33
|
+
|
34
|
+
schedule_run_prover_for_address() {
|
35
|
+
read -e -p "请设定每几小时跑一个地址:" TIME_DURATION
|
36
|
+
current_line=1
|
37
|
+
address_line=`wc -l /root/aleo_address.txt | awk '{print $1}'`
|
38
|
+
while ((current_line <= address_line))
|
39
|
+
do
|
40
|
+
current_address=`head -${current_line} /root/aleo_address.txt | tail -n 1`
|
41
|
+
if ps aux | grep 'damominer'; then
|
42
|
+
killall damominer
|
43
|
+
fi
|
44
|
+
nohup /root/damominer_folder/damominer --address ${current_address} --proxy asiahk.damominer.hk:9090 >> aleo.log 2>&1 &
|
45
|
+
echo "当前正在执行aleo_address.txt里第${current_line}行:${current_address}"
|
46
|
+
sleep ${TIME_DURATION}h
|
47
|
+
((current_line += 1))
|
48
|
+
done
|
49
|
+
echo "地址全部执行结束..."
|
50
|
+
}
|
51
|
+
|
52
|
+
echo && echo -e "脚本由推特用户 ${Green_font_prefix}@ouyoung11开发${Font_color_suffix},
|
53
|
+
欢迎关注, 如有收费请勿上当受骗。
|
54
|
+
———————————————————————
|
55
|
+
${Green_font_prefix} 1.安装damominer工具包 ${Font_color_suffix}
|
56
|
+
${Green_font_prefix} 2.运行damominer gpu挖矿程序 ${Font_color_suffix}
|
57
|
+
${Green_font_prefix} 3.定时执行gpu挖矿(请确保aleo_address.txt存在于/root目录下,且文件内容里每个地址需换行) ${Font_color_suffix}
|
58
|
+
———————————————————————" && echo
|
59
|
+
read -e -p " 请输入数字 [1-3]:" num
|
60
|
+
case "$num" in
|
61
|
+
1)
|
62
|
+
install_damominer_env
|
63
|
+
;;
|
64
|
+
2)
|
65
|
+
run_damominer
|
66
|
+
;;
|
67
|
+
3)
|
68
|
+
schedule_run_prover_for_address
|
69
|
+
;;
|
70
|
+
*)
|
71
|
+
echo
|
72
|
+
echo -e " ${Error} 请输入正确的数字"
|
73
|
+
;;
|
74
|
+
esac
|
@@ -0,0 +1,150 @@
|
|
1
|
+
Crontab_file="/usr/bin/crontab"
|
2
|
+
Green_font_prefix="\033[32m"
|
3
|
+
Red_font_prefix="\033[31m"
|
4
|
+
Green_background_prefix="\033[42;37m"
|
5
|
+
Red_background_prefix="\033[41;37m"
|
6
|
+
Font_color_suffix="\033[0m"
|
7
|
+
Info="[${Green_font_prefix}信息${Font_color_suffix}]"
|
8
|
+
Error="[${Red_font_prefix}错误${Font_color_suffix}]"
|
9
|
+
Tip="[${Green_font_prefix}注意${Font_color_suffix}]"
|
10
|
+
AleoFile="/root/aleo.txt"
|
11
|
+
AleoPoolFile="/root/aleo-pool-prover"
|
12
|
+
|
13
|
+
check_root() {
|
14
|
+
[[ $EUID != 0 ]] && echo -e "${Error} 当前非ROOT账号(或没有ROOT权限),无法继续操作,请更换ROOT账号或使用 ${Green_background_prefix}sudo su${Font_color_suffix} 命令获取临时ROOT权限(执行后可能会提示输入当前账号的密码)。" && exit 1
|
15
|
+
}
|
16
|
+
|
17
|
+
install_aleo() {
|
18
|
+
check_root
|
19
|
+
apt install git
|
20
|
+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
21
|
+
source $HOME/.cargo/env
|
22
|
+
git clone https://github.com/AleoHQ/snarkOS.git --depth 1 /root/snarkOS
|
23
|
+
cd /root/snarkOS
|
24
|
+
/root/snarkOS/build_ubuntu.sh
|
25
|
+
cargo install --path /root/snarkOS
|
26
|
+
if [ -f ${AleoFile} ]; then
|
27
|
+
echo "address exist"
|
28
|
+
else
|
29
|
+
snarkos account new >/root/aleo.txt
|
30
|
+
fi
|
31
|
+
cat /root/aleo.txt
|
32
|
+
PrivateKey=$(cat /root/aleo.txt | grep Private | awk '{print $3}')
|
33
|
+
echo export PROVER_PRIVATE_KEY=$PrivateKey >>/etc/profile
|
34
|
+
source /etc/profile
|
35
|
+
}
|
36
|
+
|
37
|
+
run_aleo_client() {
|
38
|
+
source $HOME/.cargo/env
|
39
|
+
source /etc/profile
|
40
|
+
cd /root/snarkOS
|
41
|
+
nohup ./run-client.sh >run-client.log 2>&1 &
|
42
|
+
tail -f /root/snarkOS/run-client.log
|
43
|
+
}
|
44
|
+
|
45
|
+
run_aleo_prover() {
|
46
|
+
source $HOME/.cargo/env
|
47
|
+
source /etc/profile
|
48
|
+
cd /root/snarkOS
|
49
|
+
nohup ./run-prover.sh >run-prover.log 2>&1 &
|
50
|
+
tail -f /root/snarkOS/run-prover.log
|
51
|
+
}
|
52
|
+
|
53
|
+
read_aleo_address() {
|
54
|
+
cat /root/aleo.txt
|
55
|
+
}
|
56
|
+
|
57
|
+
|
58
|
+
install_aleo_pool_cpu_and_run() {
|
59
|
+
check_root
|
60
|
+
if [ -f ${AleoPoolFile} ]; then
|
61
|
+
echo " "
|
62
|
+
else
|
63
|
+
apt install wget
|
64
|
+
cd ~ && wget -O /root/aleo-pool-prover https://nd-valid-data-bintest1.oss-cn-hangzhou.aliyuncs.com/aleo/aleo-pool-prover_ubuntu_2004_cpu && chmod +x aleo-pool-prover
|
65
|
+
ufw allow 30009
|
66
|
+
fi
|
67
|
+
|
68
|
+
echo -e "\n"
|
69
|
+
read -e -p "请输入你的aleo pool矿池帐号名称: " ALEO_POOL_NAME
|
70
|
+
read -e -p "请输入你的设备名称(可随便取,便于区分多台设备): " ALEO_POOL_SERVER_NAME
|
71
|
+
/root/aleo-pool-prover --account_name $ALEO_POOL_NAME --miner_name $ALEO_POOL_SERVER_NAME
|
72
|
+
}
|
73
|
+
|
74
|
+
install_aleo_pool_gpu() {
|
75
|
+
check_root
|
76
|
+
sudo apt update
|
77
|
+
sudo apt-get remove --purge nvidia*
|
78
|
+
sudo apt-get install wget make gcc-7 g++-7 ubuntu-drivers-common -y
|
79
|
+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 9
|
80
|
+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 1
|
81
|
+
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 9
|
82
|
+
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 1
|
83
|
+
sudo update-alternatives --display g++
|
84
|
+
|
85
|
+
sudo ubuntu-drivers autoinstall
|
86
|
+
|
87
|
+
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb
|
88
|
+
sudo dpkg -i cuda-keyring_1.0-1_all.deb
|
89
|
+
sudo apt-get update
|
90
|
+
sudo apt-get -y install cuda
|
91
|
+
|
92
|
+
echo "export PATH=/usr/local/cuda-11.8/bin\${PATH:+:\${PATH}}
|
93
|
+
export LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64\${LD_LIBRARY_PATH:+:\${LD_LIBRARY_PATH}}" >> ~/.bashrc
|
94
|
+
source ~/.bashrc
|
95
|
+
|
96
|
+
cd ~ && wget -O /root/aleo-pool-prover-gpu https://nd-valid-data-bintest1.oss-cn-hangzhou.aliyuncs.com/aleo/aleo-pool-prover_ubuntu_2004_gpu && chmod +x aleo-pool-prover-gpu
|
97
|
+
|
98
|
+
sudo reboot
|
99
|
+
}
|
100
|
+
|
101
|
+
run_aleo_pool_gpu() {
|
102
|
+
read -e -p "请输入你的aleo pool矿池帐号名称: " ALEO_POOL_NAME
|
103
|
+
read -e -p "请输入你的设备名称(可随便取,便于区分多台设备): " ALEO_POOL_SERVER_NAME
|
104
|
+
/root/aleo-pool-prover-gpu --account_name $ALEO_POOL_NAME --miner_name $ALEO_POOL_SERVER_NAME
|
105
|
+
}
|
106
|
+
|
107
|
+
|
108
|
+
echo && echo -e " ${Red_font_prefix}aleo testnet3二阶段pover节点激励测试 一键运行
|
109
|
+
此脚本完全免费开源, 由推特用户${Green_font_prefix}@ouyoung11修改${Font_color_suffix},脚本${Font_color_suffix} fork by \033[1;35m@Daniel\033[0m
|
110
|
+
欢迎关注,如有收费请勿上当受骗.
|
111
|
+
———————————————————————
|
112
|
+
${Green_font_prefix} 1.安装或更新 aleo 环境包${Font_color_suffix}
|
113
|
+
${Green_font_prefix} 2.运行 aleo_client ${Font_color_suffix}
|
114
|
+
${Green_font_prefix} 3.运行 aleo_prover ${Font_color_suffix}
|
115
|
+
${Green_font_prefix} 4.读取 aleo 地址私钥 ${Font_color_suffix}
|
116
|
+
--------------(以下为aleo矿池CPU版本,请勿和上面3步混用)----------------
|
117
|
+
${Green_font_prefix} 5.安装aleo pool的CPU版本 ${Font_color_suffix}
|
118
|
+
--------------(以下为aleo矿池GPU版本,请勿和上面混用)----------------
|
119
|
+
${Green_font_prefix} 6.安装aleo pool的GPU版本并重启系统应用(如果系统已有显卡驱动和cuda,请不要执行此步) ${Font_color_suffix}
|
120
|
+
${Green_font_prefix} 7.启动aleo pool的GPU挖矿(如若启动出错请手动安装对应显卡驱动版本及cuda) ${Font_color_suffix}
|
121
|
+
|
122
|
+
———————————————————————" && echo
|
123
|
+
read -e -p " 请输入数字 [1-7]:" num
|
124
|
+
case "$num" in
|
125
|
+
1)
|
126
|
+
install_aleo
|
127
|
+
;;
|
128
|
+
2)
|
129
|
+
run_aleo_client
|
130
|
+
;;
|
131
|
+
3)
|
132
|
+
run_aleo_prover
|
133
|
+
;;
|
134
|
+
4)
|
135
|
+
read_aleo_address
|
136
|
+
;;
|
137
|
+
5)
|
138
|
+
install_aleo_pool_cpu_and_run
|
139
|
+
;;
|
140
|
+
6)
|
141
|
+
install_aleo_pool_gpu
|
142
|
+
;;
|
143
|
+
7)
|
144
|
+
run_aleo_pool_gpu
|
145
|
+
;;
|
146
|
+
*)
|
147
|
+
echo
|
148
|
+
echo -e " ${Error} 请输入正确的数字"
|
149
|
+
;;
|
150
|
+
esac
|