Ether1Project / ethofs-sdk

MIT License
1 stars 3 forks source link

Add support for additional custom ETHO rpc server and IPFS gateways #9

Closed Dev-JamesR closed 3 years ago

Dev-JamesR commented 3 years ago

Currently defaults to https://rpc.ether1.org and https://ipfs.infura.io

Need to allow local gateways as well as other custom remote gateways. Currently infura limits to 100M per file a local gateway will alleviate this limitation.

Dev-JamesR commented 3 years ago

Added on https://github.com/Ether1Project/ethofs-sdk/commit/d28989168d602fc07d433902643a091eadda23f4

ghost commented 3 years ago

I have changed the architect of the SDK, when you initialize the SDK, new Web3() happens once, rather than every time for each function, I already added the change for custom RPC server in the newCodeRunner branch (some more cleaning required as not sure whether custom ETHO rpc is possible with MetaMask or is handled by MetaMask in the extension), but I think we can also have a central IPFS gateway on initializing than calling a new IPFS every time. It makes code maintainability easier and makes the code a little faster with trade off to slight memory overhead. I can make the changes in the newCodeRunner branch before creating a pull request. Just let me know if what I say makes sense

PS: in the newCodeRunner branch, the same SDK works with both privateKey and Metamask

ghost commented 3 years ago

Added custom support to the branch