@@ -4,11 +4,12 @@ import { createPublicClient, createWalletClient, http } from "viem";
4
4
import { privateKeyToAccount } from "viem/accounts" ;
5
5
import { baseSepolia } from "viem/chains" ;
6
6
import { Oracle , ArweaveStorage } from "dria-oracle-sdk" ;
7
+ import { inspect } from "util" ;
7
8
8
9
async function main ( ) {
9
10
const SECRET_KEY = process . env . SECRET_KEY ;
10
11
const RPC_URL = process . env . RPC_URL ?? "https://base-sepolia-rpc.publicnode.com" ;
11
- const COORDINATOR_ADDRESS = process . env . COORDINATOR_ADDRESS ?? "0x1deaca041f094ec67baa4fb36d333cb652e6b7a7 " ;
12
+ const COORDINATOR_ADDRESS = process . env . COORDINATOR_ADDRESS ?? "0x13f977bde221b470d3ae055cde7e1f84debfe202 " ;
12
13
13
14
// create oracle instance
14
15
const oracle = new Oracle (
@@ -38,15 +39,17 @@ async function main() {
38
39
}
39
40
40
41
// make a request
42
+ console . log ( "Preparing request" ) ;
41
43
const input = process . argv [ 2 ] ;
42
44
if ( ! input ) {
43
45
throw new Error ( "Provide an input." ) ;
44
46
}
45
47
const model = "*" ;
46
48
const requestObj = await oracle . request ( input , model , {
47
49
taskParameters : {
48
- numValidations : 2 ,
50
+ difficulty : 2 ,
49
51
numGenerations : 2 ,
52
+ numValidations : 1 ,
50
53
} ,
51
54
} ) ;
52
55
@@ -58,17 +61,22 @@ async function main() {
58
61
await oracle . wait ( taskId ) ;
59
62
60
63
// read best result
61
- console . log ( "Reading results:" ) ;
62
64
const response = await oracle . read ( taskId ) ;
63
- console . log ( "Response :" ) ;
64
- console . log ( { response } ) ;
65
+ console . log ( "Reading best result :" ) ;
66
+ console . log ( response ) ;
65
67
66
68
// read validations
67
- const validations = await oracle . getValidations ( taskId ) ;
68
69
console . log ( "Validations:" ) ;
70
+ const validations = await oracle . getValidations ( taskId ) ;
69
71
for ( const validationRaw of validations ) {
70
72
const validation = await oracle . processValidation ( validationRaw ) ;
71
- console . log ( { validation } ) ;
73
+ console . log (
74
+ inspect ( validation , {
75
+ showHidden : true ,
76
+ depth : null ,
77
+ colors : true ,
78
+ } )
79
+ ) ;
72
80
}
73
81
}
74
82
0 commit comments