You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create an `.env` file by copying `.env.example`. You have to fill the following variables:
25
25
26
-
- Get an RPC URL from a provider such as Alchemy or Infura, and set it as `RPC_URL`.
27
-
- Provide an Ethereum wallet secret koy to `SECRET_KEY`, make sure it has funds to pay for gas and tokens.
26
+
- Get an RPC URL from a provider such as [Alchemy](https://www.alchemy.com/) or [Infura](https://www.infura.io/), and set it as `RPC_URL`.
27
+
- Provide an Ethereum wallet secret key to `SECRET_KEY`, make sure it has funds to pay for gas and tokens.
28
28
29
-
Optionally, you can save gas costs using Arweave:
29
+
> [!NOTE]
30
+
>
31
+
> The contract addresses are determined with respect to the chain connected via RPC URL, but you can override it via `COORDINATOR_ADDRESS` environment variable.
32
+
> In any case, you should not need to do this.
33
+
34
+
### Arweave
35
+
36
+
You can save gas costs using [Arweave](https://arweave.org/):
30
37
31
-
- Provide an Arweave wallet so that you can use Arweave for large results. Alternatively, dont provide a wallet but instead set `ARWEAVE_BYTE_LIMIT` to a very large value. TODO: this should be done automatically if wallet does not exist
38
+
- Provide an Arweave wallet via `ARWEAVE_WALLET_PATH` variable so that you can use Arweave for large results. You can create one [here](https://arweave.app/).
39
+
- You can set `ARWEAVE_BYTE_LIMIT` to determine the byte length threshold, beyond which values are uploaded to Arweave. It defaults to 1024, so any data less than that many bytes will be written as-is.
40
+
41
+
If you omit Arweave, it will only use the client for downloading things from Arweave, but will never upload.
42
+
43
+
### LLM Providers
32
44
33
45
As for the LLM providers:
34
46
35
47
- If you are using Ollama, make sure it is running and the host & port are correct.
36
-
- If you are using OpenAI, make sure you provide the `OPENAI_API_KEY`.
37
-
- If you are using Gemini, make sure you provide the `GEMINI_API_KEY`.
38
-
- If you are using OpenRouter, make sure you provide the `OPENROUTER_API_KEY`.
48
+
- If you are using OpenAI, provide the `OPENAI_API_KEY`.
49
+
- If you are using Gemini, provide the `GEMINI_API_KEY`.
50
+
- If you are using OpenRouter, provide the `OPENROUTER_API_KEY`.
39
51
40
52
## Usage
41
53
@@ -52,6 +64,11 @@ The CLI provides several methods to interact with the oracle contracts.
52
64
-[Viewing Tasks](#viewing-tasks)
53
65
-[Balance & Rewards](#balance--rewards)
54
66
67
+
> [!TIP]
68
+
>
69
+
> By default logs will be `info` level, but you can add a `DEBUG=1` env variable and it will use `debug` level instead.
70
+
> You can set `RUST_LOG` variable yourself as well.
71
+
55
72
### Registration
56
73
57
74
To serve oracle requests, you **MUST** first register as your desired oracle type, i.e. `generator` or `validator`. These are handled by the registration commands `register` and `unregister` which accepts multiple arguments to register at once. You can then see your registrations with `registrations` command.
* A helper script to print the content of an Arweave transaction, where transaction id is hex-encoded.
3
-
* This means that the input is a 64-char hexadecimal.
2
+
* A helper script to print the content of an Arweave transaction.
4
3
*
5
4
* Usage:
6
5
*
7
-
* bun run ./misc/arweave.js 0x30613233613135613236663864663332366165306137663863633636343437336238373463353966333964623436366665316337313531393634623734393231
6
+
* ```sh
7
+
* # calldata as-is
8
+
* bun run ./misc/arweave.js 0x7b2261727765617665223a224d49555775656361634b417a62755442335a6a57613463784e6461774d71435a704550694f71675a625a63227d
8
9
*
9
-
* Tip:
10
+
* # as an object (with escaped quotes)
11
+
* bun run ./misc/arweave.js "{\"arweave\":\"MIUWuecacKAzbuTB3ZjWa4cxNdawMqCZpEPiOqgZbZc\"}"
10
12
*
11
-
* Can be piped to `pbcopy` on macOS to copy the output to clipboard.
13
+
* # base64 txid
14
+
* bun run ./misc/arweave.js MIUWuecacKAzbuTB3ZjWa4cxNdawMqCZpEPiOqgZbZc
15
+
* ```
16
+
*
17
+
* Can be piped to `pbcopy` on macOS to copy the output to clipboard.
12
18
*/
13
19
14
20
// parse input
15
21
letinput=process.argv[2];
16
22
if(!input){
17
23
console.error("No input provided.");
24
+
return;
18
25
}
19
26
20
-
// get rid of 0x
27
+
letarweaveTxId;
21
28
if(input.startsWith("0x")){
22
-
input=input.slice(2);
29
+
// if it starts with 0x, we assume its all hex
30
+
arweaveTxId=JSON.parse(
31
+
Buffer.from(input.slice(2),"hex").toString()
32
+
).arweave;
33
+
}elseif(input.startsWith("{")){
34
+
// if it starts with {, we assume its a JSON string
let contract_result = hex_literal::hex!("7b2261727765617665223a2239397a4252676c4c663443696b35676c57444f667542463736456e417a4a6344303431545a614c6d6f6934227d");
159
+
let contract_result = hex_literal::hex!("7b2261727765617665223a224d49555775656361634b417a62755442335a6a57613463784e6461774d71435a704550694f71675a625a63227d");
160
160
let request = GenerationRequest::try_parse_bytes(&contract_result.into())
0 commit comments