11import fs from "fs" ;
2- import os from "os" ;
32import util from "util" ;
43import {
54 createAssetUtil ,
@@ -35,39 +34,20 @@ export class Commands {
3534 public config : Config ;
3635 public aquarius : Aquarius ;
3736 public providerUrl : string ;
38- public macOsProviderUrl : string ;
3937 // optional settings for indexing wait time
4038 private indexingParams : IndexerWaitParams ;
4139
4240 constructor ( signer : Signer , network : string | number , config ?: Config ) {
4341 this . signer = signer ;
4442 this . config = config || new ConfigHelper ( ) . getConfig ( network ) ;
45- this . providerUrl = process . env . NODE_URL || process . env . PROVIDER_URL || this . config . providerUri ;
43+ this . providerUrl = process . env . NODE_URL ;
4644 this . indexingParams = getIndexingWaitSettings ( ) ;
47- if (
48- ! process . env . PROVIDER_URL && ! process . env . NODE_URL &&
49- this . config . chainId === 8996 &&
50- os . type ( ) === "Darwin"
51- ) {
52- this . macOsProviderUrl = "http://127.0.0.1:8030" ;
53- }
45+
5446 console . log ( "Using Provider :" , this . providerUrl ) ;
55- this . macOsProviderUrl &&
56- console . log ( " -> MacOS provider url :" , this . macOsProviderUrl ) ;
57- if (
58- ! process . env . AQUARIUS_URL && ! process . env . NODE_URL &&
59- this . config . chainId === 8996 &&
60- os . type ( ) === "Darwin"
61- ) {
62- this . config . metadataCacheUri = "http://127.0.0.1:5000" ;
63- }
64- this . aquarius = new Aquarius (
65- process . env . NODE_URL || process . env . AQUARIUS_URL || this . config . metadataCacheUri
66- ) ;
67- console . log (
68- "Using Aquarius :" ,
69- process . env . NODE_URL || process . env . AQUARIUS_URL || this . config . metadataCacheUri
70- ) ;
47+ this . config . metadataCacheUri = this . providerUrl ;
48+
49+ this . aquarius = new Aquarius ( this . config . metadataCacheUri ) ;
50+ console . log ( "Using Aquarius :" , this . config . metadataCacheUri ) ;
7151 }
7252
7353 public async start ( ) {
@@ -103,7 +83,7 @@ export class Commands {
10383 this . signer ,
10484 asset . services [ 0 ] . files ,
10585 asset ,
106- this . providerUrl || this . macOsProviderUrl ,
86+ this . providerUrl ,
10787 this . config ,
10888 this . aquarius ,
10989 encryptDDO
@@ -134,7 +114,7 @@ export class Commands {
134114 this . signer ,
135115 algoAsset . services [ 0 ] . files ,
136116 algoAsset ,
137- this . providerUrl || this . macOsProviderUrl ,
117+ this . providerUrl ,
138118 this . config ,
139119 this . aquarius ,
140120 encryptDDO
@@ -178,7 +158,6 @@ export class Commands {
178158 asset ,
179159 this . providerUrl ,
180160 this . aquarius ,
181- this . macOsProviderUrl ,
182161 encryptDDO
183162 ) ;
184163 console . log ( "Asset updated. Tx: " + JSON . stringify ( updateAssetTx , null , 2 ) ) ;
@@ -206,8 +185,8 @@ export class Commands {
206185 }
207186
208187 const providerURI =
209- this . macOsProviderUrl && dataDdo . chainId === 8996
210- ? this . macOsProviderUrl
188+ this . providerUrl && dataDdo . chainId === 8996
189+ ? this . providerUrl
211190 : dataDdo . services [ 0 ] . serviceEndpoint ;
212191 console . log ( "Downloading asset using provider: " , providerURI ) ;
213192 const datatoken = new Datatoken ( this . signer , this . config . chainId , this . config ) ;
@@ -283,10 +262,10 @@ export class Commands {
283262 console . error ( "Not all the data ddos are available." ) ;
284263 return ;
285264 }
286- let providerURI = this . macOsProviderUrl || this . providerUrl
265+ let providerURI = this . providerUrl
287266 if ( ddos . length > 0 ) {
288- providerURI = this . macOsProviderUrl && ddos [ 0 ] . chainId === 8996
289- ? this . macOsProviderUrl
267+ providerURI = this . providerUrl && ddos [ 0 ] . chainId === 8996
268+ ? this . providerUrl
290269 : ddos [ 0 ] . services [ 0 ] . serviceEndpoint ;
291270 }
292271
@@ -299,9 +278,7 @@ export class Commands {
299278 return ;
300279 }
301280
302- const computeEnvs = await ProviderInstance . getComputeEnvironments (
303- this . macOsProviderUrl || this . providerUrl
304- ) ;
281+ const computeEnvs = await ProviderInstance . getComputeEnvironments ( this . providerUrl ) ;
305282
306283 if ( ! computeEnvs || computeEnvs . length < 1 ) {
307284 console . error (
@@ -518,10 +495,10 @@ export class Commands {
518495 console . error ( "Not all the data ddos are available." ) ;
519496 return ;
520497 }
521- let providerURI = this . macOsProviderUrl || this . providerUrl
498+ let providerURI = this . providerUrl
522499 if ( ddos . length > 0 ) {
523- providerURI = this . macOsProviderUrl && ddos [ 0 ] . chainId === 8996
524- ? this . macOsProviderUrl
500+ providerURI = this . providerUrl && ddos [ 0 ] . chainId === 8996
501+ ? this . providerUrl
525502 : ddos [ 0 ] . services [ 0 ] . serviceEndpoint ;
526503 }
527504
@@ -533,9 +510,7 @@ export class Commands {
533510 return ;
534511 }
535512
536- const computeEnvs = await ProviderInstance . getComputeEnvironments (
537- this . macOsProviderUrl || this . providerUrl
538- ) ;
513+ const computeEnvs = await ProviderInstance . getComputeEnvironments ( this . providerUrl ) ;
539514
540515 if ( ! computeEnvs || computeEnvs . length < 1 ) {
541516 console . error (
@@ -658,8 +633,8 @@ export class Commands {
658633 }
659634
660635 const providerURI =
661- this . macOsProviderUrl && dataDdo . chainId === 8996
662- ? this . macOsProviderUrl
636+ this . providerUrl && dataDdo . chainId === 8996
637+ ? this . providerUrl
663638 : dataDdo . services [ 0 ] . serviceEndpoint ;
664639
665640 const jobStatus = await ProviderInstance . computeStop (
@@ -674,9 +649,7 @@ export class Commands {
674649 }
675650
676651 public async getComputeEnvironments ( ) {
677- const computeEnvs = await ProviderInstance . getComputeEnvironments (
678- this . macOsProviderUrl || this . providerUrl
679- ) ;
652+ const computeEnvs = await ProviderInstance . getComputeEnvironments ( this . providerUrl ) ;
680653
681654 if ( ! computeEnvs || computeEnvs . length < 1 ) {
682655 console . error (
@@ -689,10 +662,7 @@ export class Commands {
689662
690663 public async computeStreamableLogs ( args : string [ ] ) {
691664 const jobId = args [ 0 ]
692- const logsResponse = await ProviderInstance . computeStreamableLogs (
693- this . macOsProviderUrl || this . providerUrl ,
694- this . signer ,
695- jobId ,
665+ const logsResponse = await ProviderInstance . computeStreamableLogs ( this . providerUrl , this . signer , jobId ,
696666 ) ;
697667 console . log ( 'response: ' , logsResponse )
698668
@@ -775,7 +745,6 @@ export class Commands {
775745 asset ,
776746 this . providerUrl ,
777747 this . aquarius ,
778- this . macOsProviderUrl ,
779748 encryptDDO
780749 ) ;
781750 console . log ( "Successfully updated asset metadata: " + txid ) ;
@@ -839,7 +808,6 @@ export class Commands {
839808 asset ,
840809 this . providerUrl ,
841810 this . aquarius ,
842- this . macOsProviderUrl ,
843811 encryptDDO
844812 ) ;
845813 console . log ( "Asset updated " + txid ) ;
@@ -864,8 +832,8 @@ export class Commands {
864832 agreementId = args [ 3 ] ;
865833 }
866834 const providerURI =
867- this . macOsProviderUrl && dataDdo . chainId === 8996
868- ? this . macOsProviderUrl
835+ this . providerUrl && dataDdo . chainId === 8996
836+ ? this . providerUrl
869837 : dataDdo . services [ 0 ] . serviceEndpoint ;
870838
871839 const jobStatus = ( await ProviderInstance . computeStatus (
0 commit comments