[spam][crazy][wrong] Trying To Do Stuff
Here's a thread just for weird spamlogs. $ npm install mango-admin ... npm ERR! Error while executing: npm ERR! /usr/bin/git ls-remote -h -t ssh://git@github.com/ipfs/browserify-zlib.git npm ERR! npm ERR! fatal: failed to stat 'test': Permission denied npm ERR! npm ERR! exited with error code: 128 npm ERR! A complete log of this run can be found in: npm ERR! .npm/_logs/2022-02-08T08_44_47_034Z-debug.log
this might be https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-p... nodejs's website told me to use npx instead of npm. not sure how to use npx. 0351. i can run these binaries with `npx mango-admin --help` for example, but it redownloads the package every run. npx's --help says to check man npx, ,but `man npx` doesn't work on my system. i'm using dpkg to see where my npx came from. it's 0357 the man pages are installed into node_modules; i can load them manually. 0357. 0402. i looked around a bit. installed npm-run globally per a comment in https://stackoverflow.com/questions/49302438/why-does-npx-install-webpack-ev... . didn't seem to help. 0404 i fitzed around a bit and ended up doing an `chown -R` on `~/.npm` which seems to be making `npm install -g` work now. both mango-admin and git-remote-mango are installing with npm without issue.
to enumerate all mango repositories on-chain, we would enumerate all smart contracts that matched that interface. i think i figured out how to do this to pursue my repeatedly-failing bitcoin trading project some time ago 0415 somewhere in https://github.com/xloem/btct/tree/master/ethereum
in ethereum/abi/__init__.py I have a function to pull contract specs based on address from a webservice ... 0419 i think there might be a way in the python library used in that project to pass an abi to some function and get back some query as to transactions or blocks or something i'm looking in ethereum/dex/uniswapv2.pyt i think w3 is the basic interface to the python library it's 0422 maybe i'll go into that folder and run a python interpreter, use the convenience method to retrieve the abi for a repo contract, and try some functions out i'm shaking and stuff, my issues are acting up.
- the api func needs an etherscan api token - i went to etherscan and put in the address from the readme ( 8add9d064bbd29f3118f11ee46abe0ad9e45aa59 ) but it showed no activity, maybe it is a testnet address or something. i think normally one would get the abi by compiling the contracts
Here's the abi from one of the mango repositories: [{"constant":true,"inputs":[],"name":"snapshotCount","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[{"name":"ref","type":"string"}],"name":"deleteRef","outputs":[],"type":"function"},{"constant":true,"inputs":[{"name":"index","type":"uint256"}],"name":"getSnapshot","outputs":[{"name":"","type":"string"}],"type":"function"},{"constant":true,"inputs":[],"name":"refCount","outputs":[{"name":"","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[{"name":"ref","type":"string"},{"name":"hash","type":"string"}],"name":"setRef","outputs":[],"type":"function"},{"constant":true,"inputs":[{"name":"index","type":"uint256"}],"name":"refName","outputs":[{"name":"ref","type":"string"}],"type":"function"},{"constant":true,"inputs":[{"name":"ref","type":"string"}],"name":"getRef","outputs":[{"name":"hash","type":"string"}],"type":"function"},{"constant":false,"inputs":[{"name":"hash","type":"string"}],"name":"addSnapshot","outputs":[],"type":"function"},{"inputs":[],"type":"constructor"}]
pyweb3.utils.filters.construct_event_topic_set(setrefabi, pyweb3.w3.codec) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/ubuntu/.local/lib/python3.9/site-packages/web3/_utils/events.py",
I found in my code where it enumerates calls to sync() on a contract by using the signature. Could do the same with setRef() here to enumerate a code history. it looks like the abi json format isn't quite what the python web3 library expects. line 119, in construct_event_topic_set indexed_args = get_indexed_event_inputs(event_abi) File "/home/ubuntu/.local/lib/python3.9/site-packages/web3/_utils/abi.py", line 150, in get_indexed_event_inputs return [arg for arg in event_abi['inputs'] if arg['indexed'] is True] File "/home/ubuntu/.local/lib/python3.9/site-packages/web3/_utils/abi.py", line 150, in <listcomp> return [arg for arg in event_abi['inputs'] if arg['indexed'] is True] KeyError: 'indexed'
npm install solc solcjs --abi MangoRepoInterface.sol # waits for a wierdly long time to do a very simple task ParserError: Expected '{' but got 'constant' --> MangoRepoInterface.sol:25:37: | 25 | function repoInterfaceVersion() constant returns (uint version); | ^^^^^^^^ I went to remix.ethereum.org but the interface is a little slow for my raspberry pi eventually responds to ctrl - to shrink text. loading https://github.com/axic/mango . 0451 nothing seems to happen when i click the import button i'm now at https://docs.soliditylang.org/en/latest/index.html#getting-started 0454 that isn't loading quickly, now at https://github.com/ethereum/solc-bin this apparently is a repository of binaries. i guess that likely means i can just find the binary that compiles this version of solidity code. maybe. 0456. stepping away from system to work on other things while that downloads.
the actual source repository is https://github.com/ethereum/solidity.git . builds with cmake. it might make sense to glance through the ethereum specification and see if that 'constant' tag can just be upgraded or whatnot.
i downloaded many solc versions and patched upgrades but the 'indexed' field python was complaining about still wasn't generated. it works if it is manually added. be useful to look to see what generates it. something like this:
import web3 from web3.auto import w3 setrefabi = {'constant': False, 'inputs': [{'name': 'ref', 'type': 'string', 'indexed': False}, {'name': 'hash', 'type': 'string', 'indexed': False}], 'name': 'setRef', 'outputs': [], 'type': 'function'} setreftopic = web3._utils.filters.construct_event_topic_set(setrefabi, pyweb3.w3.codec) w3.eth.get_logs({'topics':[setreftopic],'fromBlock':None,'toBlock':None})
should hopefully get the entire mango commit history, likely fails due to my high mistake rate. i'm not connected to an archive node, so it doesn't work for me atm.
i sent an application to archivenode.io for free archive node access using 0xloem@gmail.com . they say they reply within 48 hours. i used my legal name.
i guess i'll think about this a little while working on other things. it's hard for me to remember many goals at once. maybe it would make sense to move on to another git backend and look at that? or i could start using this one without reviewing existing repositories? that might make sense. i could store a repository, and see if i can then see it within the latest 128 blocks that are available for free from infura. the infura pricing for archival access is too high for me. i would like to run my own archival node, i imagine.
`mango-admin create` throws an error when run the functionality of mango is so simply it could make sense to port it forward, unsure.
i began porting it to python so i could copy the btct code to make it work. after looking at the source and thinking, it may have simply been failing because i did not specify an rpc server. the beginning of my port ended up at https://github.com/xloem/mango-admin in the python branch. commit 40e38588f206a997ef7792b94322cafb75c080a9 (HEAD -> python, origin/python) Author: xloem <0xloem@gmail.com> Date: Tue Feb 8 07:06:49 2022 -0500 beginning of python port
Here's the next error. Providing an RPC server did indeed help. $ ETHEREUM_RPC_URL=https://cloudflare-eth.com mango-admin create Initialising... /usr/lib/node_modules/mango-admin/node_modules/web3/lib/web3/requestmanager.js:61 throw errors.InvalidResponse(result); ^ Error: Method not found at Object.InvalidResponse (/usr/lib/node_modules/mango-admin/node_modules/web3/lib/web3/errors.js:35:16) at RequestManager.send (/usr/lib/node_modules/mango-admin/node_modules/web3/lib/web3/requestmanager.js:61:22) at Eth.get [as coinbase] (/usr/lib/node_modules/mango-admin/node_modules/web3/lib/web3/property.js:107:62) at Object.<anonymous> (/usr/lib/node_modules/mango-admin/mango-admin:69:38) at Module._compile (internal/modules/cjs/loader.js:1085:14) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10) at Module.load (internal/modules/cjs/loader.js:950:32) at Function.Module._load (internal/modules/cjs/loader.js:790:12) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12) at internal/main/run_main_module.js:17:47
i'm not sure whether the errors i run into are because the free infura rpc endpoint i'm using doesn't provide write access, or because of problems in the code [likely both!] mango-admin python port, github xloem commit 3729da660a5ecd47882effb2c036c146fb8a17de (HEAD -> python, origin/python) Author: xloem <0xloem@gmail.com> Date: Tue Feb 8 07:58:17 2022 -0500 draft of python port, untested
I ended up following https://ethereum.stackexchange.com/a/70244/78580 and even testing with the key there, the address of which is 0x2c7536E3605D9C16a7a3D7b1898e529396a65c23 . I suspect not having a local node was the issue with using nodejs, too. The nodejs-based git-remote-mango can likely be extended to send transactions using a private key. There must be some ethereum norm out there for storing local private keys without a node, on the filesystem, but it could also store it in the git remote url or something like i did with git-remote-bsv. commit 1e9532c2da508a3158dcecd2dabd6c45144971d6 (HEAD -> python, origin/python) Author: xloem <0xloem@gmail.com> Date: Tue Feb 8 09:09:18 2022 -0500 working on making this work without a node. presently hacked to accept a privat key as an account identifier in python.
i sent money to the public private key and it was withdrawn immediately after confirmed by unknown parties, as happens often with old public private keys
ok i made a repo i think but ran into another bug i may have lost $300! it says insufficient funds when run again ;p we'll see
it seems the transactoin that revealed the bug is hard for me to find in my scrollback. i thought the currency was lost because i was looking at other runs. not sure where the failed run is.
ok it did make tx at https://etherscan.io/tx/0x0d32995b56a794863351d7967ba5a83e26de9b5fc64c2770f6... looks like the entire balance was a fee because it didn't put an out address
here i fight my parts that value money. i don't have much money, all things considered, [so attempt to learn to behave better can go to psychotic self-punishment]
{basically this context is dangerous. if karl pursued this task in a different way, he would be less likely to suddenly lose hundreds of dollars via 'bug density'.}
the way web3.py is behaving for me, it looks like it actually costs over a hundred dollars to create a new repository gas = 1110283 wei gasPrice = 60663616659 wei i'm wondering if that's a lot of gas for a transaction that i'd think would be very simple. but regardless i'm thinking some other chain might be more effective here, than ethereum, for making new repositories.
brief websearching implies cardano has cheaper gas fees whereas solana may have midrange gas fees (or i could have read something wrong or used poor information) but that solana already supports solidity contracts so mango could just be plugged into solana, possibly in theory. meanwhile there were many other decentralized git solutions ardrive is focused around storage of large data, it may have smallest fees for storage situations
Given I already drafted some code for enumerating mango repositories on ethereum, it would make sense to look and see how many there are and if obsolete ones have references to a service people moved on to. On Thu, Feb 10, 2022, 9:00 AM ArchiveNode <noreply@archivenode.io> wrote: View in browser <https://ddhjddb.r.af.d.sendibt2.com/tr/mr/pWPvE6fizZj8eblX0XvuCL17FAlr9SQDXZgbEHq4jhYjiyO7iSQhCqqlx7WgqTkt4EGq70agSSr7SN5eM0VtvW6zkm_iM_SiuCNraLY28gwYLWrkZhAy8by6lLtSSGsMO8CrWxcRnBF-1s4iiNULUn9JZV9VvjsfZ_3PIM0LKuE_GhgeAT2FdUO0cMoY> Congratulations Karl Semich! You can now start using *ArchiveNode* for your project. Now that you are approved, you can get your API Key and the RPC link to get access to the node. *Get my API Key* <https://ddhjddb.r.af.d.sendibt2.com/tr/cl/ch4nEjqeCF3mMS7EmvXirEXMw4DEhGFmR2ARlc7o0WR0bD3PVdQYjjdLMXnwiNT1xrCi6eMmQVfkV8dmI9cL8_u35mK0RUAwe1StxExGcDstuRij9Wam1gY5FhGlPrhwIGtjcmGy1d9HmxgnT18TCsQxE-R06ZJz78tTyo60n2tpFaYWE6Ug_q26Y7wUCwQ84YwGcXkPYcUxBABwbrc-oAET0dND0SuI5EmMuI3W_I8O-mDFg_3HVqPOU6cUhQVrg-DVuGka6F808dp4FBngZTHQSJfYIXFOPutgoI4UVdBk> *ArchiveNode* This email was sent to 0xloem@gmail.com You've received this email because registered on archivenode.io. Unsubscribe <https://ddhjddb.r.af.d.sendibt2.com/tr/un/BHvmhW8DKVstsscjZf_LkKNt7IcBuOGOqzNe34Oi_H3JdC9NcdVBihS8CAzxGxQ4Isdl1J2wcqxGKZ1mq0xe2vgb7QnAL2m35foOlZChXmfizIrZaAkKCsKy9jKB3wETycU9CW6Uz4W6jBCVLevOTcD2AEvOoSfaPQffdFYR6cF12b2eXQ1CfeUd4fSFbTAgnQ-Sk3Mf2Tp4IzO9z6qy7PptfEc_r5Ry4CAwmnfw1LA1>
On 2/8/22, Undiscussed Horrific Abuse, One Victim of Many <gmkarl@gmail.com> wrote:
i downloaded many solc versions and patched upgrades but the 'indexed' field python was complaining about still wasn't generated. it works if it is manually added. be useful to look to see what generates it.
something like this:
import web3 from web3.auto import w3 setrefabi = {'constant': False, 'inputs': [{'name': 'ref', 'type': 'string', 'indexed': False}, {'name': 'hash', 'type': 'string', 'indexed': False}], 'name': 'setRef', 'outputs': [], 'type': 'function'} setreftopic = web3._utils.filters.construct_event_topic_set(setrefabi, pyweb3.w3.codec) w3.eth.get_logs({'topics':[setreftopic],'fromBlock':None,'toBlock':None})
should hopefully get the entire mango commit history, likely fails due to my high mistake rate. i'm not connected to an archive node, so it doesn't work for me atm.
note: this could also be done with the contract constructor, rather than setRef. then repositories without references can be found.
participants (2)
-
Punk-BatSoup-Stasi 2.0
-
Undiscussed Horrific Abuse, One Victim of Many