Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
dec033fb67 | |||
6c3c04bb90 | |||
48803d4e89 | |||
17cb3342ad | |||
1c4f9abd03 |
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -1572,7 +1572,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "detee-sgx"
|
name = "detee-sgx"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://gitea.detee.cloud/general/detee-sgx#f7eaed1392ae79ecc1105a50d919026f016a4e78"
|
source = "git+https://gitea.detee.cloud/general/detee-sgx?branch=dthc#8ced0efcbac57f118b202785c783f2a7d39bf700"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aes-gcm",
|
"aes-gcm",
|
||||||
"hex",
|
"hex",
|
||||||
|
@ -33,7 +33,7 @@ tower-http = { version = "0.6", features = ["full"] }
|
|||||||
hyper = "1.4"
|
hyper = "1.4"
|
||||||
hyper-util = "0.1"
|
hyper-util = "0.1"
|
||||||
hyper-rustls = { version = "0.27", features = ["http2"] }
|
hyper-rustls = { version = "0.27", features = ["http2"] }
|
||||||
detee-sgx = { git = "https://gitea.detee.cloud/general/detee-sgx", features = ["tonic", "occlum", "sealing"] }
|
detee-sgx = { git = "https://gitea.detee.cloud/general/detee-sgx", branch = "dthc", features = ["tonic", "occlum", "sealing"] }
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
tonic-build = "0.12"
|
tonic-build = "0.12"
|
||||||
|
24
README.md
24
README.md
@ -1,5 +1,24 @@
|
|||||||
# Welcome to the HACKER CHALLENGE
|
# Welcome to the HACKER CHALLENGE
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
> [!WARNING]
|
||||||
|
>
|
||||||
|
> Hacker challenge is licensed under [GPLv2](./LICENSE).\
|
||||||
|
> To participate in the Hacker Challenge, you must agree with following:
|
||||||
|
>
|
||||||
|
> - I acknowledge that I will not be able to recover any cryptocurrencies that I
|
||||||
|
> send to the Hacker Challenge wallet, and I am relinquishing ownership rights
|
||||||
|
> to any cryptocurrencies sent to the Hacker Challenge wallet.
|
||||||
|
> - I acknowledge that the tokens minted by the Hacker Challenge have no inherent
|
||||||
|
> value, and that these tokens have the sole purpose of testing the security of
|
||||||
|
> the challenge.
|
||||||
|
> - I have read the [EULA](https://detee.ltd/hacker-challenge-eula) and I accept
|
||||||
|
> all terms.
|
||||||
|
|
||||||
|
#### Join our Discord if you have questions:
|
||||||
|
[](https://discord.gg/bbWJxftNWy)
|
||||||
|
|
||||||
## Building and packaging the challenge
|
## Building and packaging the challenge
|
||||||
|
|
||||||
The host can be without SGX support.
|
The host can be without SGX support.
|
||||||
@ -8,7 +27,10 @@ Do the following steps to build the challenge:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Notice that there is no SGX device mounted, run inside rewrite directory
|
# Notice that there is no SGX device mounted, run inside rewrite directory
|
||||||
docker run --rm --name packager -it -v .:/root/rewrite occlum/occlum:latest-ubuntu20.04
|
docker run --rm --name packager -it -v .:/root/rewrite detee/occlum:0.30.1-ubuntu20.04
|
||||||
|
# If you are running the packager on Mac, don't forget to set the VMM to QEMU (Legacy),
|
||||||
|
# and run the following command once you are inside the container
|
||||||
|
ln -s /usr/local/occlum/bin/x86_64-linux-musl-ar /usr/local/occlum/bin/musl-ar
|
||||||
# Inside the docker container run package.sh and follow its instructions
|
# Inside the docker container run package.sh and follow its instructions
|
||||||
cd /root/rewrite && ./scripts/package.sh --prep
|
cd /root/rewrite && ./scripts/package.sh --prep
|
||||||
exit # Feel free to exit the container
|
exit # Feel free to exit the container
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
FROM occlum/occlum:latest-ubuntu20.04 AS build
|
FROM detee/occlum:0.30.1-ubuntu20.04 AS build
|
||||||
|
|
||||||
WORKDIR /
|
WORKDIR /
|
||||||
RUN mkdir sgx_libs &&\
|
RUN mkdir sgx_libs &&\
|
||||||
|
@ -9,15 +9,10 @@ prerequisites=$1
|
|||||||
if [ "$prerequisites" == "--prep" ]; then
|
if [ "$prerequisites" == "--prep" ]; then
|
||||||
echo "Preparing the packager environment"
|
echo "Preparing the packager environment"
|
||||||
apt update && apt install -y openssh-client
|
apt update && apt install -y openssh-client
|
||||||
rustup install 1.83.0
|
rustup install 1.84.0
|
||||||
rustup install stable-x86_64-unknown-linux-gnu
|
rustup install stable-x86_64-unknown-linux-gnu
|
||||||
rustup default stable
|
rustup default stable
|
||||||
rustup target add x86_64-unknown-linux-musl
|
rustup target add x86_64-unknown-linux-musl
|
||||||
|
|
||||||
echo "Building the occlum fork"
|
|
||||||
[ -d occlum ] || git clone https://gitea.detee.cloud/general/occlum.git
|
|
||||||
(cd occlum && make submodule)
|
|
||||||
(cd occlum/tools/toolchains/utils_lib && ./build.sh)
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$TEST" ]; then
|
if [ -n "$TEST" ]; then
|
||||||
|
@ -48,6 +48,7 @@ impl SolClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub async fn mint(&self, recipient: &str) -> Result<String, Box<dyn std::error::Error>> {
|
pub async fn mint(&self, recipient: &str) -> Result<String, Box<dyn std::error::Error>> {
|
||||||
|
// TODO: add the priority fee for the case when the solana network is congested
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
let recipient = solana_sdk::pubkey::Pubkey::from_str(recipient)?;
|
let recipient = solana_sdk::pubkey::Pubkey::from_str(recipient)?;
|
||||||
let associated_token_address = self.create_token_account(&recipient).await?;
|
let associated_token_address = self.create_token_account(&recipient).await?;
|
||||||
|
Loading…
Reference in New Issue
Block a user