Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: format process errors to be more user friendly PE-7327 #322

Merged
merged 1 commit into from
Dec 18, 2024

Conversation

fedellen
Copy link
Contributor

@fedellen fedellen commented Dec 18, 2024

msg.Error level read error before change

> ar.io get-token-cost --name anevenbetteridea --years 8 --dev --debug
{"level":"debug","message":"Evaluating read interaction on contract","name":"ar-io-sdk","tags":[{"name":"Action","value":"Token-Cost"},{"name":"Intent","value":"Buy-Record"},{"name":"Name","value":"anevenbetteridea"},{"name":"Years","value":"8"},{"name":"Purchase-Type","value":"lease"},{"name":"Timestamp","value":"1734545746000"}],"timestamp":"2024-12-18T18:23:34.569Z","version":"3.1.0-alpha.3"}
{"level":"debug","message":"Read interaction result","name":"ar-io-sdk","result":{"Assignments":[],"Error":"[string \"aos\"]:1464: [string \"aos\"]:9529: Timestamp must be greater than or equal to the last known message timestamp of 1734545971645 but was 1734545746000\n{\"Purchase-Type\":\"lease\",\"Timestamp\":\"1734545746000\",\"Variant\":\"ao.TN.1\",\"Intent\":\"Buy-Record\",\"Cast\":false,\"Cron\":false,\"Years\":\"8\",\"Action\":\"Token-Cost\",\"_e\":1,\"From-Formatted\":\"1234\",\"Name\":\"anevenbetteridea\",\"Type\":\"Message\",\"From\":\"1234\",\"Data-Protocol\":\"ao\",\"Message-Id\":\"1234\"}","GasUsed":566124926,"Messages":[],"Output":"","Spawns":[]},"timestamp":"2024-12-18T18:23:39.716Z","version":"3.1.0-alpha.3"}
{"Assignments":[],"Error":"[string \"aos\"]:1464: [string \"aos\"]:9529: Timestamp must be greater than or equal to the last known message timestamp of 1734545971645 but was 1734545746000\n{\"Purchase-Type\":\"lease\",\"Timestamp\":\"1734545746000\",\"Variant\":\"ao.TN.1\",\"Intent\":\"Buy-Record\",\"Cast\":false,\"Cron\":false,\"Years\":\"8\",\"Action\":\"Token-Cost\",\"_e\":1,\"From-Formatted\":\"1234\",\"Name\":\"anevenbetteridea\",\"Type\":\"Message\",\"From\":\"1234\",\"Data-Protocol\":\"ao\",\"Message-Id\":\"1234\"}","GasUsed":566124926,"Messages":[],"Output":"","Spawns":[],"level":"debug","message":"Process GaQrvEMKBpkjofgnBi_B3IgIDmY_XYelVLB6GcRGrHc does not support provided action.","name":"ar-io-sdk","timestamp":"2024-12-18T18:23:39.716Z","version":"3.1.0-alpha.3"}
{"error":{},"level":"debug","message":"Read attempt 1 failed","name":"ar-io-sdk","tags":[{"name":"Action","value":"Token-Cost"},{"name":"Intent","value":"Buy-Record"},{"name":"Name","value":"anevenbetteridea"},{"name":"Years","value":"8"},{"name":"Purchase-Type","value":"lease"},{"name":"Timestamp","value":"1734545746000"}],"timestamp":"2024-12-18T18:23:39.716Z","version":"3.1.0-alpha.3"}
{"level":"debug","message":"Evaluating read interaction on contract","name":"ar-io-sdk","tags":[{"name":"Action","value":"Token-Cost"},{"name":"Intent","value":"Buy-Record"},{"name":"Name","value":"anevenbetteridea"},{"name":"Years","value":"8"},{"name":"Purchase-Type","value":"lease"},{"name":"Timestamp","value":"1734545746000"}],"timestamp":"2024-12-18T18:23:41.718Z","version":"3.1.0-alpha.3"}
{"level":"debug","message":"Read interaction result","name":"ar-io-sdk","result":{"Assignments":[],"Error":"[string \"aos\"]:1464: [string \"aos\"]:9529: Timestamp must be greater than or equal to the last known message timestamp of 1734545971645 but was 1734545746000\n{\"Purchase-Type\":\"lease\",\"Timestamp\":\"1734545746000\",\"Variant\":\"ao.TN.1\",\"Intent\":\"Buy-Record\",\"Cast\":false,\"Cron\":false,\"Years\":\"8\",\"Action\":\"Token-Cost\",\"_e\":1,\"From-Formatted\":\"1234\",\"Name\":\"anevenbetteridea\",\"Type\":\"Message\",\"From\":\"1234\",\"Data-Protocol\":\"ao\",\"Message-Id\":\"1234\"}","GasUsed":566124926,"Messages":[],"Output":"","Spawns":[]},"timestamp":"2024-12-18T18:23:47.182Z","version":"3.1.0-alpha.3"}
{"Assignments":[],"Error":"[string \"aos\"]:1464: [string \"aos\"]:9529: Timestamp must be greater than or equal to the last known message timestamp of 1734545971645 but was 1734545746000\n{\"Purchase-Type\":\"lease\",\"Timestamp\":\"1734545746000\",\"Variant\":\"ao.TN.1\",\"Intent\":\"Buy-Record\",\"Cast\":false,\"Cron\":false,\"Years\":\"8\",\"Action\":\"Token-Cost\",\"_e\":1,\"From-Formatted\":\"1234\",\"Name\":\"anevenbetteridea\",\"Type\":\"Message\",\"From\":\"1234\",\"Data-Protocol\":\"ao\",\"Message-Id\":\"1234\"}","GasUsed":566124926,"Messages":[],"Output":"","Spawns":[],"level":"debug","message":"Process GaQrvEMKBpkjofgnBi_B3IgIDmY_XYelVLB6GcRGrHc does not support provided action.","name":"ar-io-sdk","timestamp":"2024-12-18T18:23:47.183Z","version":"3.1.0-alpha.3"}
{"error":{},"level":"debug","message":"Read attempt 2 failed","name":"ar-io-sdk","tags":[{"name":"Action","value":"Token-Cost"},{"name":"Intent","value":"Buy-Record"},{"name":"Name","value":"anevenbetteridea"},{"name":"Years","value":"8"},{"name":"Purchase-Type","value":"lease"},{"name":"Timestamp","value":"1734545746000"}],"timestamp":"2024-12-18T18:23:47.183Z","version":"3.1.0-alpha.3"}
{"level":"debug","message":"Evaluating read interaction on contract","name":"ar-io-sdk","tags":[{"name":"Action","value":"Token-Cost"},{"name":"Intent","value":"Buy-Record"},{"name":"Name","value":"anevenbetteridea"},{"name":"Years","value":"8"},{"name":"Purchase-Type","value":"lease"},{"name":"Timestamp","value":"1734545746000"}],"timestamp":"2024-12-18T18:23:51.184Z","version":"3.1.0-alpha.3"}
{"level":"debug","message":"Read interaction result","name":"ar-io-sdk","result":{"Assignments":[],"Error":"[string \"aos\"]:1464: [string \"aos\"]:9529: Timestamp must be greater than or equal to the last known message timestamp of 1734545971645 but was 1734545746000\n{\"Purchase-Type\":\"lease\",\"Timestamp\":\"1734545746000\",\"Variant\":\"ao.TN.1\",\"Intent\":\"Buy-Record\",\"Cast\":false,\"Cron\":false,\"Years\":\"8\",\"Action\":\"Token-Cost\",\"_e\":1,\"From-Formatted\":\"1234\",\"Name\":\"anevenbetteridea\",\"Type\":\"Message\",\"From\":\"1234\",\"Data-Protocol\":\"ao\",\"Message-Id\":\"1234\"}","GasUsed":566124926,"Messages":[],"Output":"","Spawns":[]},"timestamp":"2024-12-18T18:23:53.087Z","version":"3.1.0-alpha.3"}
{"Assignments":[],"Error":"[string \"aos\"]:1464: [string \"aos\"]:9529: Timestamp must be greater than or equal to the last known message timestamp of 1734545971645 but was 1734545746000\n{\"Purchase-Type\":\"lease\",\"Timestamp\":\"1734545746000\",\"Variant\":\"ao.TN.1\",\"Intent\":\"Buy-Record\",\"Cast\":false,\"Cron\":false,\"Years\":\"8\",\"Action\":\"Token-Cost\",\"_e\":1,\"From-Formatted\":\"1234\",\"Name\":\"anevenbetteridea\",\"Type\":\"Message\",\"From\":\"1234\",\"Data-Protocol\":\"ao\",\"Message-Id\":\"1234\"}","GasUsed":566124926,"Messages":[],"Output":"","Spawns":[],"level":"debug","message":"Process GaQrvEMKBpkjofgnBi_B3IgIDmY_XYelVLB6GcRGrHc does not support provided action.","name":"ar-io-sdk","timestamp":"2024-12-18T18:23:53.088Z","version":"3.1.0-alpha.3"}
{"error":{},"level":"debug","message":"Read attempt 3 failed","name":"ar-io-sdk","tags":[{"name":"Action","value":"Token-Cost"},{"name":"Intent","value":"Buy-Record"},{"name":"Name","value":"anevenbetteridea"},{"name":"Years","value":"8"},{"name":"Purchase-Type","value":"lease"},{"name":"Timestamp","value":"1734545746000"}],"timestamp":"2024-12-18T18:23:53.088Z","version":"3.1.0-alpha.3"}
Error: Process GaQrvEMKBpkjofgnBi_B3IgIDmY_XYelVLB6GcRGrHc does not support provided action.
    at AOProcess.read (file:///Users/derek/.config/yarn/global/node_modules/@ar.io/sdk/lib/esm/common/contracts/ao-process.js:53:27)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async getTokenCost (file:///Users/derek/.config/yarn/global/node_modules/@ar.io/sdk/lib/esm/cli/commands/readCommands.js:102:23)
    at async runCommand (file:///Users/derek/.config/yarn/global/node_modules/@ar.io/sdk/lib/esm/cli/utils.js:45:24)

msg.Error level read error after change

> node lib/esm/cli/cli.js get-token-cost --name anevenbetteridea --years 8 --dev --debug         
{"level":"debug","message":"Evaluating read interaction on contract","name":"ar-io-sdk","tags":[{"name":"Action","value":"Token-Cost"},{"name":"Intent","value":"Buy-Record"},{"name":"Name","value":"anevenbetteridea"},{"name":"Years","value":"8"},{"name":"Purchase-Type","value":"lease"},{"name":"Timestamp","value":"1734548553000"}],"timestamp":"2024-12-18T19:10:31.184Z","version":"3.1.0-alpha.3"}
{"level":"debug","message":"Read interaction result","name":"ar-io-sdk","result":{"Assignments":[],"Error":"[string \"aos\"]:1464: [string \"aos\"]:9529: Timestamp must be greater than or equal to the last known message timestamp of 1734548914865 but was 1734548553000\n{\"Purchase-Type\":\"lease\",\"Timestamp\":\"1734548553000\",\"Variant\":\"ao.TN.1\",\"Intent\":\"Buy-Record\",\"Cast\":false,\"Cron\":false,\"Years\":\"8\",\"Action\":\"Token-Cost\",\"_e\":1,\"From-Formatted\":\"1234\",\"Name\":\"anevenbetteridea\",\"Type\":\"Message\",\"From\":\"1234\",\"Data-Protocol\":\"ao\",\"Message-Id\":\"1234\"}","GasUsed":566118276,"Messages":[],"Output":"","Spawns":[]},"timestamp":"2024-12-18T19:10:45.952Z","version":"3.1.0-alpha.3"}
{"error":"[string \"aos\"]:1464: [string \"aos\"]:9529: Timestamp must be greater than or equal to the last known message timestamp of 1734548914865 but was 1734548553000\n{\"Purchase-Type\":\"lease\",\"Timestamp\":\"1734548553000\",\"Variant\":\"ao.TN.1\",\"Intent\":\"Buy-Record\",\"Cast\":false,\"Cron\":false,\"Years\":\"8\",\"Action\":\"Token-Cost\",\"_e\":1,\"From-Formatted\":\"1234\",\"Name\":\"anevenbetteridea\",\"Type\":\"Message\",\"From\":\"1234\",\"Data-Protocol\":\"ao\",\"Message-Id\":\"1234\"}","level":"debug","message":"Read attempt 1 failed","name":"ar-io-sdk","tags":[{"name":"Action","value":"Token-Cost"},{"name":"Intent","value":"Buy-Record"},{"name":"Name","value":"anevenbetteridea"},{"name":"Years","value":"8"},{"name":"Purchase-Type","value":"lease"},{"name":"Timestamp","value":"1734548553000"}],"timestamp":"2024-12-18T19:10:45.953Z","version":"3.1.0-alpha.3"}
{"level":"debug","message":"Evaluating read interaction on contract","name":"ar-io-sdk","tags":[{"name":"Action","value":"Token-Cost"},{"name":"Intent","value":"Buy-Record"},{"name":"Name","value":"anevenbetteridea"},{"name":"Years","value":"8"},{"name":"Purchase-Type","value":"lease"},{"name":"Timestamp","value":"1734548553000"}],"timestamp":"2024-12-18T19:10:47.953Z","version":"3.1.0-alpha.3"}
{"level":"debug","message":"Read interaction result","name":"ar-io-sdk","result":{"Assignments":[],"Error":"[string \"aos\"]:1464: [string \"aos\"]:9529: Timestamp must be greater than or equal to the last known message timestamp of 1734548914865 but was 1734548553000\n{\"Purchase-Type\":\"lease\",\"Timestamp\":\"1734548553000\",\"Variant\":\"ao.TN.1\",\"Intent\":\"Buy-Record\",\"Cast\":false,\"Cron\":false,\"Years\":\"8\",\"Action\":\"Token-Cost\",\"_e\":1,\"From-Formatted\":\"1234\",\"Name\":\"anevenbetteridea\",\"Type\":\"Message\",\"From\":\"1234\",\"Data-Protocol\":\"ao\",\"Message-Id\":\"1234\"}","GasUsed":566118276,"Messages":[],"Output":"","Spawns":[]},"timestamp":"2024-12-18T19:10:53.734Z","version":"3.1.0-alpha.3"}
{"error":"[string \"aos\"]:1464: [string \"aos\"]:9529: Timestamp must be greater than or equal to the last known message timestamp of 1734548914865 but was 1734548553000\n{\"Purchase-Type\":\"lease\",\"Timestamp\":\"1734548553000\",\"Variant\":\"ao.TN.1\",\"Intent\":\"Buy-Record\",\"Cast\":false,\"Cron\":false,\"Years\":\"8\",\"Action\":\"Token-Cost\",\"_e\":1,\"From-Formatted\":\"1234\",\"Name\":\"anevenbetteridea\",\"Type\":\"Message\",\"From\":\"1234\",\"Data-Protocol\":\"ao\",\"Message-Id\":\"1234\"}","level":"debug","message":"Read attempt 2 failed","name":"ar-io-sdk","tags":[{"name":"Action","value":"Token-Cost"},{"name":"Intent","value":"Buy-Record"},{"name":"Name","value":"anevenbetteridea"},{"name":"Years","value":"8"},{"name":"Purchase-Type","value":"lease"},{"name":"Timestamp","value":"1734548553000"}],"timestamp":"2024-12-18T19:10:53.735Z","version":"3.1.0-alpha.3"}
{"level":"debug","message":"Evaluating read interaction on contract","name":"ar-io-sdk","tags":[{"name":"Action","value":"Token-Cost"},{"name":"Intent","value":"Buy-Record"},{"name":"Name","value":"anevenbetteridea"},{"name":"Years","value":"8"},{"name":"Purchase-Type","value":"lease"},{"name":"Timestamp","value":"1734548553000"}],"timestamp":"2024-12-18T19:10:57.735Z","version":"3.1.0-alpha.3"}
{"level":"debug","message":"Read interaction result","name":"ar-io-sdk","result":{"Assignments":[],"Error":"[string \"aos\"]:1464: [string \"aos\"]:9529: Timestamp must be greater than or equal to the last known message timestamp of 1734548914865 but was 1734548553000\n{\"Purchase-Type\":\"lease\",\"Timestamp\":\"1734548553000\",\"Variant\":\"ao.TN.1\",\"Intent\":\"Buy-Record\",\"Cast\":false,\"Cron\":false,\"Years\":\"8\",\"Action\":\"Token-Cost\",\"_e\":1,\"From-Formatted\":\"1234\",\"Name\":\"anevenbetteridea\",\"Type\":\"Message\",\"From\":\"1234\",\"Data-Protocol\":\"ao\",\"Message-Id\":\"1234\"}","GasUsed":566118276,"Messages":[],"Output":"","Spawns":[]},"timestamp":"2024-12-18T19:11:03.974Z","version":"3.1.0-alpha.3"}
{"error":"[string \"aos\"]:1464: [string \"aos\"]:9529: Timestamp must be greater than or equal to the last known message timestamp of 1734548914865 but was 1734548553000\n{\"Purchase-Type\":\"lease\",\"Timestamp\":\"1734548553000\",\"Variant\":\"ao.TN.1\",\"Intent\":\"Buy-Record\",\"Cast\":false,\"Cron\":false,\"Years\":\"8\",\"Action\":\"Token-Cost\",\"_e\":1,\"From-Formatted\":\"1234\",\"Name\":\"anevenbetteridea\",\"Type\":\"Message\",\"From\":\"1234\",\"Data-Protocol\":\"ao\",\"Message-Id\":\"1234\"}","level":"debug","message":"Read attempt 3 failed","name":"ar-io-sdk","tags":[{"name":"Action","value":"Token-Cost"},{"name":"Intent","value":"Buy-Record"},{"name":"Name","value":"anevenbetteridea"},{"name":"Years","value":"8"},{"name":"Purchase-Type","value":"lease"},{"name":"Timestamp","value":"1734548553000"}],"timestamp":"2024-12-18T19:11:03.975Z","version":"3.1.0-alpha.3"}
Error: [string "aos"]:1464: [string "aos"]:9529: Timestamp must be greater than or equal to the last known message timestamp of 1734548914865 but was 1734548553000
{"Purchase-Type":"lease","Timestamp":"1734548553000","Variant":"ao.TN.1","Intent":"Buy-Record","Cast":false,"Cron":false,"Years":"8","Action":"Token-Cost","_e":1,"From-Formatted":"1234","Name":"anevenbetteridea","Type":"Message","From":"1234","Data-Protocol":"ao","Message-Id":"1234"}
    at AOProcess.read (file:///Users/derek/ar-io/ar-io-sdk/lib/esm/common/contracts/ao-process.js:59:27)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async getTokenCost (file:///Users/derek/ar-io/ar-io-sdk/lib/esm/cli/commands/readCommands.js:102:23)
    at async runCommand (file:///Users/derek/ar-io/ar-io-sdk/lib/esm/cli/utils.js:45:24)

read error on Tags before:

> ar.io get-token-cost --name anevenbetteridea --years 8 --dev --debug             
{"level":"debug","message":"Evaluating read interaction on contract","name":"ar-io-sdk","tags":[{"name":"Action","value":"Token-Cost"},{"name":"Intent","value":"Buy-Record"},{"name":"Name","value":"anevenbetteridea"},{"name":"Years","value":"8"},{"name":"Purchase-Type","value":"lease"},{"name":"Timestamp","value":"1734549727000"}],"timestamp":"2024-12-18T19:23:51.871Z","version":"3.1.0-alpha.3"}
{"level":"debug","message":"Read interaction result","name":"ar-io-sdk","result":{"Assignments":[],"GasUsed":682760903,"Messages":[{"Anchor":"00000000000000000000000000003899","Data":"[string \"aos\"]:10107: Invalid years. Must be between 1 and 5","Tags":[{"name":"Data-Protocol","value":"ao"},{"name":"Variant","value":"ao.TN.1"},{"name":"Type","value":"Message"},{"name":"Reference","value":"3899"},{"name":"Action","value":"Invalid-Token-Cost-Notice"},{"name":"X-Origin","value":""},{"name":"X-Reference","value":""},{"name":"Error","value":"[string \"aos\"]:10107: Invalid years. Must be between 1 and 5"}],"Target":"1234"}],"Output":{"data":"Pruning state at timestamp: 1734549727000\n{\"Type\":\"Message\",\"Timestamp\":\"1734549727000\",\"Variant\":\"ao.TN.1\",\"Intent\":\"Buy-Record\",\"Cron\":false,\"Years\":\"8\",\"Action\":\"Token-Cost\",\"Epoch-Index\":176,\"Purchase-Type\":\"lease\",\"Error\":\"[string \\\"aos\\\"]:10107: Invalid years. Must be between 1 and 5\",\"From-Formatted\":\"1234\",\"From\":\"1234\",\"Name\":\"anevenbetteridea\",\"_e\":1,\"Cast\":false,\"Data-Protocol\":\"ao\",\"Message-Id\":\"1234\"}","print":true,"prompt":"\u001b[32mDevnet ARIO\u001b[90m@\u001b[34maos-2.0.1\u001b[90m[Inbox:\u001b[31m267\u001b[90m]\u001b[0m> "},"Spawns":[]},"timestamp":"2024-12-18T19:23:59.131Z","version":"3.1.0-alpha.3"}
{"error":{},"level":"debug","message":"Read attempt 1 failed","name":"ar-io-sdk","tags":[{"name":"Action","value":"Token-Cost"},{"name":"Intent","value":"Buy-Record"},{"name":"Name","value":"anevenbetteridea"},{"name":"Years","value":"8"},{"name":"Purchase-Type","value":"lease"},{"name":"Timestamp","value":"1734549727000"}],"timestamp":"2024-12-18T19:23:59.131Z","version":"3.1.0-alpha.3"}
{"level":"debug","message":"Evaluating read interaction on contract","name":"ar-io-sdk","tags":[{"name":"Action","value":"Token-Cost"},{"name":"Intent","value":"Buy-Record"},{"name":"Name","value":"anevenbetteridea"},{"name":"Years","value":"8"},{"name":"Purchase-Type","value":"lease"},{"name":"Timestamp","value":"1734549727000"}],"timestamp":"2024-12-18T19:24:01.132Z","version":"3.1.0-alpha.3"}
{"level":"debug","message":"Read interaction result","name":"ar-io-sdk","result":{"Assignments":[],"GasUsed":682760903,"Messages":[{"Anchor":"00000000000000000000000000003899","Data":"[string \"aos\"]:10107: Invalid years. Must be between 1 and 5","Tags":[{"name":"Data-Protocol","value":"ao"},{"name":"Variant","value":"ao.TN.1"},{"name":"Type","value":"Message"},{"name":"Reference","value":"3899"},{"name":"Action","value":"Invalid-Token-Cost-Notice"},{"name":"X-Origin","value":""},{"name":"X-Reference","value":""},{"name":"Error","value":"[string \"aos\"]:10107: Invalid years. Must be between 1 and 5"}],"Target":"1234"}],"Output":{"data":"Pruning state at timestamp: 1734549727000\n{\"Type\":\"Message\",\"Timestamp\":\"1734549727000\",\"Variant\":\"ao.TN.1\",\"Intent\":\"Buy-Record\",\"Cron\":false,\"Years\":\"8\",\"Action\":\"Token-Cost\",\"Epoch-Index\":176,\"Purchase-Type\":\"lease\",\"Error\":\"[string \\\"aos\\\"]:10107: Invalid years. Must be between 1 and 5\",\"From-Formatted\":\"1234\",\"From\":\"1234\",\"Name\":\"anevenbetteridea\",\"_e\":1,\"Cast\":false,\"Data-Protocol\":\"ao\",\"Message-Id\":\"1234\"}","print":true,"prompt":"\u001b[32mDevnet ARIO\u001b[90m@\u001b[34maos-2.0.1\u001b[90m[Inbox:\u001b[31m267\u001b[90m]\u001b[0m> "},"Spawns":[]},"timestamp":"2024-12-18T19:24:02.320Z","version":"3.1.0-alpha.3"}
{"error":{},"level":"debug","message":"Read attempt 2 failed","name":"ar-io-sdk","tags":[{"name":"Action","value":"Token-Cost"},{"name":"Intent","value":"Buy-Record"},{"name":"Name","value":"anevenbetteridea"},{"name":"Years","value":"8"},{"name":"Purchase-Type","value":"lease"},{"name":"Timestamp","value":"1734549727000"}],"timestamp":"2024-12-18T19:24:02.320Z","version":"3.1.0-alpha.3"}
{"level":"debug","message":"Evaluating read interaction on contract","name":"ar-io-sdk","tags":[{"name":"Action","value":"Token-Cost"},{"name":"Intent","value":"Buy-Record"},{"name":"Name","value":"anevenbetteridea"},{"name":"Years","value":"8"},{"name":"Purchase-Type","value":"lease"},{"name":"Timestamp","value":"1734549727000"}],"timestamp":"2024-12-18T19:24:06.322Z","version":"3.1.0-alpha.3"}
{"level":"debug","message":"Read interaction result","name":"ar-io-sdk","result":{"Assignments":[],"GasUsed":682760903,"Messages":[{"Anchor":"00000000000000000000000000003899","Data":"[string \"aos\"]:10107: Invalid years. Must be between 1 and 5","Tags":[{"name":"Data-Protocol","value":"ao"},{"name":"Variant","value":"ao.TN.1"},{"name":"Type","value":"Message"},{"name":"Reference","value":"3899"},{"name":"Action","value":"Invalid-Token-Cost-Notice"},{"name":"X-Origin","value":""},{"name":"X-Reference","value":""},{"name":"Error","value":"[string \"aos\"]:10107: Invalid years. Must be between 1 and 5"}],"Target":"1234"}],"Output":{"data":"Pruning state at timestamp: 1734549727000\n{\"Type\":\"Message\",\"Timestamp\":\"1734549727000\",\"Variant\":\"ao.TN.1\",\"Intent\":\"Buy-Record\",\"Cron\":false,\"Years\":\"8\",\"Action\":\"Token-Cost\",\"Epoch-Index\":176,\"Purchase-Type\":\"lease\",\"Error\":\"[string \\\"aos\\\"]:10107: Invalid years. Must be between 1 and 5\",\"From-Formatted\":\"1234\",\"From\":\"1234\",\"Name\":\"anevenbetteridea\",\"_e\":1,\"Cast\":false,\"Data-Protocol\":\"ao\",\"Message-Id\":\"1234\"}","print":true,"prompt":"\u001b[32mDevnet ARIO\u001b[90m@\u001b[34maos-2.0.1\u001b[90m[Inbox:\u001b[31m267\u001b[90m]\u001b[0m> "},"Spawns":[]},"timestamp":"2024-12-18T19:24:13.338Z","version":"3.1.0-alpha.3"}
{"error":{},"level":"debug","message":"Read attempt 3 failed","name":"ar-io-sdk","tags":[{"name":"Action","value":"Token-Cost"},{"name":"Intent","value":"Buy-Record"},{"name":"Name","value":"anevenbetteridea"},{"name":"Years","value":"8"},{"name":"Purchase-Type","value":"lease"},{"name":"Timestamp","value":"1734549727000"}],"timestamp":"2024-12-18T19:24:13.339Z","version":"3.1.0-alpha.3"}
Error: [string "aos"]:10107: Invalid years. Must be between 1 and 5: [string "aos"]:10107: Invalid years. Must be between 1 and 5
    at AOProcess.read (file:///Users/derek/.config/yarn/global/node_modules/@ar.io/sdk/lib/esm/common/contracts/ao-process.js:60:27)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async getTokenCost (file:///Users/derek/.config/yarn/global/node_modules/@ar.io/sdk/lib/esm/cli/commands/readCommands.js:102:23)
    at async runCommand (file:///Users/derek/.config/yarn/global/node_modules/@ar.io/sdk/lib/esm/cli/utils.js:45:24)

read error after:

node lib/esm/cli/cli.js get-token-cost --name anevenbetteridea --years 8 --dev --debug
{"level":"debug","message":"Evaluating read interaction on contract","name":"ar-io-sdk","tags":[{"name":"Action","value":"Token-Cost"},{"name":"Intent","value":"Buy-Record"},{"name":"Name","value":"anevenbetteridea"},{"name":"Years","value":"8"},{"name":"Purchase-Type","value":"lease"}],"timestamp":"2024-12-18T19:22:05.021Z","version":"3.1.0-alpha.6"}
{"level":"debug","message":"Read interaction result","name":"ar-io-sdk","result":{"Assignments":[],"GasUsed":667775712,"Messages":[{"Anchor":"00000000000000000000000000003899","Data":"[string \"aos\"]:10107: Invalid years. Must be between 1 and 5","Tags":[{"name":"Data-Protocol","value":"ao"},{"name":"Variant","value":"ao.TN.1"},{"name":"Type","value":"Message"},{"name":"Reference","value":"3899"},{"name":"Action","value":"Invalid-Token-Cost-Notice"},{"name":"X-Origin","value":""},{"name":"X-Reference","value":""},{"name":"Error","value":"[string \"aos\"]:10107: Invalid years. Must be between 1 and 5"}],"Target":"1234"}],"Output":{"data":"Pruning state at timestamp: 1734549242274\n{\"Type\":\"Message\",\"Timestamp\":1734549242274,\"Variant\":\"ao.TN.1\",\"Intent\":\"Buy-Record\",\"Cron\":false,\"Years\":\"8\",\"Action\":\"Token-Cost\",\"Epoch-Index\":176,\"Purchase-Type\":\"lease\",\"Error\":\"[string \\\"aos\\\"]:10107: Invalid years. Must be between 1 and 5\",\"From-Formatted\":\"1234\",\"From\":\"1234\",\"Name\":\"anevenbetteridea\",\"_e\":1,\"Cast\":false,\"Data-Protocol\":\"ao\",\"Message-Id\":\"1234\"}","print":true,"prompt":"\u001b[32mDevnet ARIO\u001b[90m@\u001b[34maos-2.0.1\u001b[90m[Inbox:\u001b[31m267\u001b[90m]\u001b[0m> "},"Spawns":[]},"timestamp":"2024-12-18T19:22:05.815Z","version":"3.1.0-alpha.6"}
{"error":"Invalid years. Must be between 1 and 5 (line 10107)","level":"debug","message":"Read attempt 1 failed","name":"ar-io-sdk","tags":[{"name":"Action","value":"Token-Cost"},{"name":"Intent","value":"Buy-Record"},{"name":"Name","value":"anevenbetteridea"},{"name":"Years","value":"8"},{"name":"Purchase-Type","value":"lease"}],"timestamp":"2024-12-18T19:22:05.816Z","version":"3.1.0-alpha.6"}
{"level":"debug","message":"Evaluating read interaction on contract","name":"ar-io-sdk","tags":[{"name":"Action","value":"Token-Cost"},{"name":"Intent","value":"Buy-Record"},{"name":"Name","value":"anevenbetteridea"},{"name":"Years","value":"8"},{"name":"Purchase-Type","value":"lease"}],"timestamp":"2024-12-18T19:22:07.817Z","version":"3.1.0-alpha.6"}
{"level":"debug","message":"Read interaction result","name":"ar-io-sdk","result":{"Assignments":[],"GasUsed":667775712,"Messages":[{"Anchor":"00000000000000000000000000003899","Data":"[string \"aos\"]:10107: Invalid years. Must be between 1 and 5","Tags":[{"name":"Data-Protocol","value":"ao"},{"name":"Variant","value":"ao.TN.1"},{"name":"Type","value":"Message"},{"name":"Reference","value":"3899"},{"name":"Action","value":"Invalid-Token-Cost-Notice"},{"name":"X-Origin","value":""},{"name":"X-Reference","value":""},{"name":"Error","value":"[string \"aos\"]:10107: Invalid years. Must be between 1 and 5"}],"Target":"1234"}],"Output":{"data":"Pruning state at timestamp: 1734549242274\n{\"Type\":\"Message\",\"Timestamp\":1734549242274,\"Variant\":\"ao.TN.1\",\"Intent\":\"Buy-Record\",\"Cron\":false,\"Years\":\"8\",\"Action\":\"Token-Cost\",\"Epoch-Index\":176,\"Purchase-Type\":\"lease\",\"Error\":\"[string \\\"aos\\\"]:10107: Invalid years. Must be between 1 and 5\",\"From-Formatted\":\"1234\",\"From\":\"1234\",\"Name\":\"anevenbetteridea\",\"_e\":1,\"Cast\":false,\"Data-Protocol\":\"ao\",\"Message-Id\":\"1234\"}","print":true,"prompt":"\u001b[32mDevnet ARIO\u001b[90m@\u001b[34maos-2.0.1\u001b[90m[Inbox:\u001b[31m267\u001b[90m]\u001b[0m> "},"Spawns":[]},"timestamp":"2024-12-18T19:22:13.942Z","version":"3.1.0-alpha.6"}
{"error":"Invalid years. Must be between 1 and 5 (line 10107)","level":"debug","message":"Read attempt 2 failed","name":"ar-io-sdk","tags":[{"name":"Action","value":"Token-Cost"},{"name":"Intent","value":"Buy-Record"},{"name":"Name","value":"anevenbetteridea"},{"name":"Years","value":"8"},{"name":"Purchase-Type","value":"lease"}],"timestamp":"2024-12-18T19:22:13.943Z","version":"3.1.0-alpha.6"}
{"level":"debug","message":"Evaluating read interaction on contract","name":"ar-io-sdk","tags":[{"name":"Action","value":"Token-Cost"},{"name":"Intent","value":"Buy-Record"},{"name":"Name","value":"anevenbetteridea"},{"name":"Years","value":"8"},{"name":"Purchase-Type","value":"lease"}],"timestamp":"2024-12-18T19:22:17.944Z","version":"3.1.0-alpha.6"}
{"level":"debug","message":"Read interaction result","name":"ar-io-sdk","result":{"Assignments":[],"Ga

write error before:

> ar.io buy-record --process-id ECHKeeR1S7_wsw3pcQdZNz2tNlXN_RyzUkzZokv4ssc --wallet-file ../wallets/zarweave-keyfile-jaxl_dxqJ00gEgQazGASFXVRvO4h-Q0_vnaLtuOUoWU_dereks.json --name best-test-ever-2---- --dev --fund-from stakes --skip-confirmation --debug
{"level":"debug","message":"Evaluating send interaction on contract","name":"ar-io-sdk","processId":"GaQrvEMKBpkjofgnBi_B3IgIDmY_XYelVLB6GcRGrHc","tags":[{"name":"Action","value":"Buy-Record"},{"name":"Name","value":"best-test-ever-2----"},{"name":"Years","value":"1"},{"name":"Process-Id","value":"ECHKeeR1S7_wsw3pcQdZNz2tNlXN_RyzUkzZokv4ssc"},{"name":"Purchase-Type","value":"lease"},{"name":"Fund-From","value":"stakes"}],"timestamp":"2024-12-18T19:08:34.271Z","version":"3.1.0-alpha.3"}
{"anchor":"3f17467c34448128204804791c5cc441","level":"debug","message":"Sent message to process","messageId":"3onKEh2IoKzD69lkh6zr3Edr8_z_dT4xYpx1Fmjm94A","name":"ar-io-sdk","processId":"GaQrvEMKBpkjofgnBi_B3IgIDmY_XYelVLB6GcRGrHc","timestamp":"2024-12-18T19:08:34.715Z","version":"3.1.0-alpha.3"}
{"level":"debug","message":"Message result","messageId":"3onKEh2IoKzD69lkh6zr3Edr8_z_dT4xYpx1Fmjm94A","name":"ar-io-sdk","output":{"Assignments":[],"GasUsed":998229047,"Messages":[{"Anchor":"00000000000000000000000000003896","Data":"[string \"aos\"]:6846: Name is already registered","Tags":[{"name":"Data-Protocol","value":"ao"},{"name":"Variant","value":"ao.TN.1"},{"name":"Type","value":"Message"},{"name":"Reference","value":"3896"},{"name":"Action","value":"Invalid-Buy-Record-Notice"},{"name":"X-Origin","value":""},{"name":"X-Reference","value":""},{"name":"Error","value":"[string \"aos\"]:6846: Name is already registered"}],"Target":"jaxl_dxqJ00gEgQazGASFXVRvO4h-Q0_vnaLtuOUoWU"}],"Output":{"data":"Pruning state at timestamp: 1734548914865\n{\"Type\":\"Message\",\"Timestamp\":1734548914865,\"Variant\":\"ao.TN.1\",\"Name-Length\":20,\"Cron\":false,\"Years\":\"1\",\"SDK\":\"aoconnect\",\"Fund-From\":\"stakes\",\"Purchase-Type\":\"lease\",\"AR-IO-SDK\":\"3.1.0-alpha.3\",\"_e\":1,\"Cast\":false,\"Error\":\"[string \\\"aos\\\"]:6846: Name is already registered\",\"From\":\"jaxl_dxqJ00gEgQazGASFXVRvO4h-Q0_vnaLtuOUoWU\",\"Epoch-Index\":176,\"From-Formatted\":\"jaxl_dxqJ00gEgQazGASFXVRvO4h-Q0_vnaLtuOUoWU\",\"Process-Id\":\"ECHKeeR1S7_wsw3pcQdZNz2tNlXN_RyzUkzZokv4ssc\",\"Name\":\"best-test-ever-2----\",\"Content-Type\":\"text/plain\",\"Action\":\"Buy-Record\",\"Data-Protocol\":\"ao\",\"Message-Id\":\"3onKEh2IoKzD69lkh6zr3Edr8_z_dT4xYpx1Fmjm94A\"}","print":true,"prompt":"\u001b[32mDevnet ARIO\u001b[90m@\u001b[34maos-2.0.1\u001b[90m[Inbox:\u001b[31m267\u001b[90m]\u001b[0m> "},"Spawns":[]},"processId":"GaQrvEMKBpkjofgnBi_B3IgIDmY_XYelVLB6GcRGrHc","timestamp":"2024-12-18T19:08:59.111Z","version":"3.1.0-alpha.3"}
{"error":"[string \"aos\"]:6846: Name is already registered","level":"error","message":"Error sending message to process","name":"ar-io-sdk","processId":"GaQrvEMKBpkjofgnBi_B3IgIDmY_XYelVLB6GcRGrHc","tags":[{"name":"Action","value":"Buy-Record"},{"name":"Name","value":"best-test-ever-2----"},{"name":"Years","value":"1"},{"name":"Process-Id","value":"ECHKeeR1S7_wsw3pcQdZNz2tNlXN_RyzUkzZokv4ssc"},{"name":"Purchase-Type","value":"lease"},{"name":"Fund-From","value":"stakes"}],"timestamp":"2024-12-18T19:08:59.112Z","version":"3.1.0-alpha.3"}
WriteInteractionError: [string "aos"]:6846: Name is already registered
    at AOProcess.send (file:///Users/derek/.config/yarn/global/node_modules/@ar.io/sdk/lib/esm/common/contracts/ao-process.js:124:27)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async runCommand (file:///Users/derek/.config/yarn/global/node_modules/@ar.io/sdk/lib/esm/cli/utils.js:45:24)

write error after:

> node lib/esm/cli/cli.js buy-record --process-id ECHKeeR1S7_wsw3pcQdZNz2tNlXN_RyzUkzZokv4ssc --wallet-file ../wallets/zarweave-keyfile-jaxl_dxqJ00gEgQazGASFXVRvO4h-Q0_vnaLtuOUoWU_dereks.json --name best-test-ever-2---- --dev --fund-from stakes --debug --skip-confirmation
{"level":"debug","message":"Evaluating send interaction on contract","name":"ar-io-sdk","processId":"GaQrvEMKBpkjofgnBi_B3IgIDmY_XYelVLB6GcRGrHc","tags":[{"name":"Action","value":"Buy-Record"},{"name":"Name","value":"best-test-ever-2----"},{"name":"Years","value":"1"},{"name":"Process-Id","value":"ECHKeeR1S7_wsw3pcQdZNz2tNlXN_RyzUkzZokv4ssc"},{"name":"Purchase-Type","value":"lease"},{"name":"Fund-From","value":"stakes"}],"timestamp":"2024-12-18T19:07:07.795Z","version":"3.1.0-alpha.3"}
{"anchor":"cc1c73671557abaf223df664909023c4","level":"debug","message":"Sent message to process","messageId":"qdHgpRhTH3VXczB2amsKbnXQx3ixKjTSzr8hol6-Jvg","name":"ar-io-sdk","processId":"GaQrvEMKBpkjofgnBi_B3IgIDmY_XYelVLB6GcRGrHc","timestamp":"2024-12-18T19:07:08.334Z","version":"3.1.0-alpha.3"}
{"level":"debug","message":"Message result","messageId":"qdHgpRhTH3VXczB2amsKbnXQx3ixKjTSzr8hol6-Jvg","name":"ar-io-sdk","output":{"Assignments":[],"GasUsed":1004207416,"Messages":[{"Anchor":"00000000000000000000000000003894","Data":"[string \"aos\"]:6846: Name is already registered","Tags":[{"name":"Data-Protocol","value":"ao"},{"name":"Variant","value":"ao.TN.1"},{"name":"Type","value":"Message"},{"name":"Reference","value":"3894"},{"name":"Action","value":"Invalid-Buy-Record-Notice"},{"name":"X-Origin","value":""},{"name":"X-Reference","value":""},{"name":"Error","value":"[string \"aos\"]:6846: Name is already registered"}],"Target":"jaxl_dxqJ00gEgQazGASFXVRvO4h-Q0_vnaLtuOUoWU"}],"Output":{"data":"Pruning state at timestamp: 1734548828435\n{\"Type\":\"Message\",\"Timestamp\":1734548828435,\"Variant\":\"ao.TN.1\",\"Name-Length\":20,\"Cron\":false,\"Years\":\"1\",\"SDK\":\"aoconnect\",\"Fund-From\":\"stakes\",\"Purchase-Type\":\"lease\",\"AR-IO-SDK\":\"3.1.0-alpha.3\",\"_e\":1,\"Cast\":false,\"Error\":\"[string \\\"aos\\\"]:6846: Name is already registered\",\"From\":\"jaxl_dxqJ00gEgQazGASFXVRvO4h-Q0_vnaLtuOUoWU\",\"Epoch-Index\":176,\"From-Formatted\":\"jaxl_dxqJ00gEgQazGASFXVRvO4h-Q0_vnaLtuOUoWU\",\"Process-Id\":\"ECHKeeR1S7_wsw3pcQdZNz2tNlXN_RyzUkzZokv4ssc\",\"Name\":\"best-test-ever-2----\",\"Content-Type\":\"text/plain\",\"Action\":\"Buy-Record\",\"Data-Protocol\":\"ao\",\"Message-Id\":\"qdHgpRhTH3VXczB2amsKbnXQx3ixKjTSzr8hol6-Jvg\"}","print":true,"prompt":"\u001b[32mDevnet ARIO\u001b[90m@\u001b[34maos-2.0.1\u001b[90m[Inbox:\u001b[31m267\u001b[90m]\u001b[0m> "},"Spawns":[]},"processId":"GaQrvEMKBpkjofgnBi_B3IgIDmY_XYelVLB6GcRGrHc","timestamp":"2024-12-18T19:07:17.072Z","version":"3.1.0-alpha.3"}
{"error":"Name is already registered (line 6846)","level":"error","message":"Error sending message to process","name":"ar-io-sdk","processId":"GaQrvEMKBpkjofgnBi_B3IgIDmY_XYelVLB6GcRGrHc","tags":[{"name":"Action","value":"Buy-Record"},{"name":"Name","value":"best-test-ever-2----"},{"name":"Years","value":"1"},{"name":"Process-Id","value":"ECHKeeR1S7_wsw3pcQdZNz2tNlXN_RyzUkzZokv4ssc"},{"name":"Purchase-Type","value":"lease"},{"name":"Fund-From","value":"stakes"}],"timestamp":"2024-12-18T19:07:17.073Z","version":"3.1.0-alpha.3"}
WriteInteractionError: Name is already registered (line 6846)
    at AOProcess.send (file:///Users/derek/ar-io/ar-io-sdk/lib/esm/common/contracts/ao-process.js:125:27)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async runCommand (file:///Users/derek/ar-io/ar-io-sdk/lib/esm/cli/utils.js:45:24)

@fedellen fedellen requested a review from a team as a code owner December 18, 2024 19:23
@fedellen fedellen merged commit 29505a0 into alpha Dec 18, 2024
13 checks passed
@dtfiedler
Copy link
Collaborator

🎉 This PR is included in version 3.1.0-alpha.8 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants