Skip to content

Commit a27c6ad

Browse files
committed
add 0x check
1 parent bb28960 commit a27c6ad

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

.env.example

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
## DRIA (required) ##
2-
# Secret key of your compute node (32 byte, hexadecimal, without 0x prefix).
3-
# e.g.: DKN_WALLET_SECRET_KEY=ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
2+
# Secret key of your compute node, 32 byte in hexadecimal.
3+
# e.g.: DKN_WALLET_SECRET_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
44
DKN_WALLET_SECRET_KEY=
5-
# model1,model2,model3,... (comma separated, case-insensitive)
6-
DKN_MODELS=phi3:3.8b
7-
# Public key of Dria Admin node (33-byte compressed, hexadecimal, without 0x prefix).
5+
# Public key of Dria Admin node, 33-byte (compressed) in hexadecimal.
86
# You don't need to change this, simply copy and paste it.
97
DKN_ADMIN_PUBLIC_KEY=0208ef5e65a9c656a6f92fb2c770d5d5e2ecffe02a6aade19207f75110be6ae658
8+
# model1,model2,model3,... (comma separated, case-insensitive)
9+
DKN_MODELS=phi3:3.8b
1010

1111
## DRIA (optional) ##
1212
# info | debug | error | none,dkn_compute=debug
@@ -22,7 +22,7 @@ DKN_BOOTSTRAP_NODES=
2222
OPENAI_API_KEY=
2323

2424
## Ollama (if used, optional) ##
25-
# do not change the host, it is used by Docker
25+
# do not change this, it is used by Docker
2626
OLLAMA_HOST=http://host.docker.internal
2727
# you can change the port if you would like
2828
OLLAMA_PORT=11434

compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ services:
1616
JINA_API_KEY: ${JINA_API_KEY}
1717
OLLAMA_HOST: ${OLLAMA_HOST}
1818
OLLAMA_PORT: ${OLLAMA_PORT}
19-
OLLAMA_AUTO_PULL: ${OLLAMA_AUTO_PULL}
19+
OLLAMA_AUTO_PULL: ${OLLAMA_AUTO_PULL:-true}
2020
network_mode: "host"
2121
extra_hosts:
2222
# for Linux, we need to add this line manually

src/config/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ impl DriaComputeNodeConfig {
3737
pub fn new() -> Self {
3838
let secret_key = match env::var("DKN_WALLET_SECRET_KEY") {
3939
Ok(secret_env) => {
40-
let secret_dec =
41-
hex::decode(secret_env).expect("Secret key should be 32-bytes hex encoded.");
40+
let secret_dec = hex::decode(secret_env.trim_start_matches("0x"))
41+
.expect("Secret key should be 32-bytes hex encoded.");
4242
SecretKey::parse_slice(&secret_dec).expect("Secret key should be parseable.")
4343
}
4444
Err(err) => {
@@ -60,7 +60,7 @@ impl DriaComputeNodeConfig {
6060

6161
let admin_public_key = match env::var("DKN_ADMIN_PUBLIC_KEY") {
6262
Ok(admin_public_key) => {
63-
let pubkey_dec = hex::decode(admin_public_key)
63+
let pubkey_dec = hex::decode(admin_public_key.trim_start_matches("0x"))
6464
.expect("Admin public key should be 33-bytes hex encoded.");
6565
PublicKey::parse_slice(&pubkey_dec, None)
6666
.expect("Admin public key should be parseable.")

0 commit comments

Comments
 (0)