@@ -61,13 +61,13 @@ export function sendMessageMainnet({ processId, wallet, tags, data }, spinner) {
61
61
const submitRequest = fromPromise ( request )
62
62
const params = {
63
63
type : 'Message' ,
64
-
64
+ path : `/${ processId } /push` ,
65
65
method : 'POST' ,
66
- ...tags . reduce ( ( a , t ) => assoc ( t . name , t . value , a ) , { } ) ,
66
+ ...tags . reduce ( ( a , t ) => assoc ( t . name . toLowerCase ( ) , t . value , a ) , { } ) ,
67
67
'data-protocol' : 'ao' ,
68
- variant : 'ao.N.1' ,
69
68
target : processId ,
70
- "signing-format" : "ANS-104"
69
+ "signing-format" : "ANS-104" ,
70
+ accept : 'application/json'
71
71
}
72
72
// set data if needed
73
73
if ( data ) {
@@ -78,8 +78,6 @@ export function sendMessageMainnet({ processId, wallet, tags, data }, spinner) {
78
78
. map ( prop ( 'body' ) )
79
79
. map ( JSON . parse )
80
80
. map ( handleResults )
81
-
82
-
83
81
}
84
82
85
83
const setScheduler = fromPromise ( async function ( ctx ) {
@@ -93,8 +91,6 @@ const setScheduler = fromPromise(async function (ctx) {
93
91
. then ( r => r . text ( ) )
94
92
}
95
93
ctx [ 'scheduler' ] = scheduler
96
- // should no longer need scheduler-location
97
- // ctx['scheduler-location'] = scheduler
98
94
99
95
return ctx
100
96
@@ -114,8 +110,8 @@ const setAuthority = fromPromise(async function (ctx) {
114
110
}
115
111
authority = authority + ',fcoN_xJeisVsPXA-trzVAuIiqO3ydLQxM-L4XbrQKzY'
116
112
}
117
- ctx [ 'Authority ' ] = authority
118
- ctx [ 'Authority ' ] = authority
113
+ // ctx['authority '] = authority
114
+ ctx [ 'authority ' ] = authority
119
115
120
116
return ctx
121
117
} )
@@ -149,8 +145,7 @@ export function spawnProcessMainnet({ wallet, src, tags, data, isHyper }) {
149
145
'execution-device' :
'[email protected] ' ,
150
146
'data-protocol' : 'ao' ,
151
147
variant : 'ao.N.1' ,
152
- // ...tags.reduce((a, t) => assoc(t.name.toLowerCase(), t.value, a), {}),
153
- ...tags . reduce ( ( a , t ) => assoc ( t . name , t . value , a ) , { } ) ,
148
+ ...tags . reduce ( ( a , t ) => assoc ( t . name . toLowerCase ( ) , t . value , a ) , { } ) ,
154
149
'aos-version' : pkg . version ,
155
150
'signing-format' : 'ANS-104'
156
151
}
@@ -163,9 +158,9 @@ export function spawnProcessMainnet({ wallet, src, tags, data, isHyper }) {
163
158
. chain ( params => isHyper ? of ( params ) : getExecutionDevice ( params ) )
164
159
. map ( p => {
165
160
if ( p [ 'execution-device' ] === '[email protected] ' ) {
166
- p . Module = process . env . AOS_MODULE || pkg . hyper . module
161
+ p . module = process . env . AOS_MODULE || pkg . hyper . module
167
162
} else {
168
- p . Module = src
163
+ p . module = src
169
164
}
170
165
return p
171
166
} )
@@ -179,7 +174,10 @@ let _watch = false
179
174
180
175
export function printLiveMainnet ( ) {
181
176
keys ( globalThis . alerts ) . map ( k => {
182
- if ( globalThis . alerts [ k ] . print ) {
177
+ // if (globalThis.alerts[k]) {
178
+ // console.log(globalThis.alerts[k])
179
+ // }
180
+ if ( globalThis . alerts [ k ] && globalThis . alerts [ k ] . print ) {
183
181
globalThis . alerts [ k ] . print = false
184
182
185
183
if ( ! _watch ) {
@@ -216,43 +214,32 @@ export async function liveMainnet(id, watch) {
216
214
try {
217
215
isJobRunning = true ;
218
216
// Get the current slot
219
- const currentSlotPath = `/${ id } [email protected] /slot/current` // LIVE PARAMS
217
+ const currentSlotPath = `/${ id } /slot/current/body ` // LIVE PARAMS
220
218
const currentSlotParams = {
221
219
path : currentSlotPath ,
222
- method : 'POST' ,
223
-
224
- 'data-protocol' : 'ao' ,
225
- variant : 'ao.N.1' ,
226
- 'aos-version' : pkg . version ,
227
- 'signing-format' : 'ANS-104'
220
+ method : 'GET'
228
221
}
229
222
const currentSlot = await request ( currentSlotParams )
230
- . then ( res => res . body )
231
- // .then(JSON.parse)
232
- // .then(res => res.body)
223
+ . then ( res => Number ( res . body || '0' ) )
233
224
234
225
if ( isNaN ( cursor ) ) {
235
226
cursor = currentSlot + 1
236
227
}
237
228
// Eval up to the current slot
238
229
while ( cursor <= currentSlot ) {
239
-
240
- const path = `/${ id } [email protected] /compute&slot=${ cursor } /results/[email protected] ` // LIVE PARAMS
230
+ const path = `/${ id } /compute=${ cursor } ` // LIVE PARAMS
241
231
const params = {
242
232
path,
243
- method : 'POST' ,
244
-
245
- 'data-protocol' : 'ao' ,
246
- 'scheduler-device' :
'[email protected] ' ,
247
- 'push-device' :
'[email protected] ' ,
248
- variant : 'ao.N.1' ,
249
- 'aos-version' : pkg . version ,
250
- 'signing-format' : 'ANS-104' ,
233
+ method : 'GET' ,
234
+ accept : 'application/json' ,
235
+ 'accept-bundle' : 'true'
251
236
}
252
237
const results = await request ( params )
253
238
. then ( res => res . body )
254
239
. then ( JSON . parse )
240
+ . then ( prop ( 'results' ) )
255
241
. then ( handleResults )
242
+ // .catch(e => ({ Output: {}}))
256
243
257
244
// If results, add to alerts
258
245
if ( ! globalThis . alerts [ cursor ] ) {
0 commit comments