-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ao): experiment with initial implementation of ao contract
- Loading branch information
dtfiedler
committed
May 29, 2024
1 parent
e62558d
commit 6118cea
Showing
9 changed files
with
308 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,43 @@ | ||
import { ARNS_TESTNET_REGISTRY_TX, ArIO } from '@ar.io/sdk'; | ||
import { ArIO } from '@ar.io/sdk'; | ||
|
||
(async () => { | ||
const arIO = ArIO.init({ | ||
contractTxId: ARNS_TESTNET_REGISTRY_TX, | ||
// const arIO = ArIO.init({ | ||
// contractTxId: ARNS_TESTNET_REGISTRY_TX, | ||
// }); | ||
// // testnet gateways | ||
// const testnetGateways = await arIO.getGateways(); | ||
// const protocolBalance = await arIO.getBalance({ | ||
// address: ARNS_TESTNET_REGISTRY_TX, | ||
// }); | ||
// const ardriveRecord = await arIO.getArNSRecord({ domain: 'ardrive' }); | ||
// const allRecords = await arIO.getArNSRecords(); | ||
// const oldEpoch = await arIO.getEpoch({ | ||
// blockHeight: 1382230, | ||
// }); | ||
// const epoch = await arIO.getCurrentEpoch(); | ||
// const observations = await arIO.getObservations(); | ||
// const observation = await arIO.getObservations({ epochStartHeight: 1350700 }); | ||
// const distributions = await arIO.getDistributions(); | ||
// console.dir( | ||
// { | ||
// testnetGateways, | ||
// ardriveRecord, | ||
// protocolBalance, | ||
// arnsStats: { | ||
// 'registered domains': Object.keys(allRecords).length, | ||
// ardrive: allRecords.ardrive, | ||
// }, | ||
// oldEpoch, | ||
// epoch, | ||
// observations, | ||
// observation, | ||
// distributions, | ||
// }, | ||
// { depth: 2 }, | ||
// ); | ||
const process = ArIO.init({ | ||
processId: 'GaQrvEMKBpkjofgnBi_B3IgIDmY_XYelVLB6GcRGrHc', | ||
}); | ||
// testnet gateways | ||
const testnetGateways = await arIO.getGateways(); | ||
const protocolBalance = await arIO.getBalance({ | ||
address: ARNS_TESTNET_REGISTRY_TX, | ||
}); | ||
const ardriveRecord = await arIO.getArNSRecord({ domain: 'ardrive' }); | ||
const allRecords = await arIO.getArNSRecords(); | ||
const oldEpoch = await arIO.getEpoch({ | ||
blockHeight: 1382230, | ||
}); | ||
const epoch = await arIO.getCurrentEpoch(); | ||
const observations = await arIO.getObservations(); | ||
const observation = await arIO.getObservations({ epochStartHeight: 1350700 }); | ||
const distributions = await arIO.getDistributions(); | ||
|
||
console.dir( | ||
{ | ||
testnetGateways, | ||
ardriveRecord, | ||
protocolBalance, | ||
arnsStats: { | ||
'registered domains': Object.keys(allRecords).length, | ||
ardrive: allRecords.ardrive, | ||
}, | ||
oldEpoch, | ||
epoch, | ||
observations, | ||
observation, | ||
distributions, | ||
}, | ||
{ depth: 2 }, | ||
); | ||
const state = await process.getState(); | ||
console.log({ state }); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.