Web3 specifications #2247
Replies: 9 comments 16 replies
-
It's seem simple to develop a website that embed the compilation of a smart contract too. The compiler is already a package npm! 😄 https://www.npmjs.com/package/assemblyscript |
Beta Was this translation helpful? Give feedback.
-
Relevant links: |
Beta Was this translation helpful? Give feedback.
-
There was a previous effort of design here massalabs/massa-sc-runtime#44 |
Beta Was this translation helpful? Give feedback.
-
Relevant link for compiling to wasm in the browser: |
Beta Was this translation helpful? Give feedback.
-
@BatiGencho I was considering simply wrapping all current client endpoint this way: /* web3/private.js node administration relying on private Node API */
export const unban = ipAddrs => { /* TODO */ } // unban a given IP addresses
export const ban = ipAddrs => { /* TODO */ } // ban a given IP addresses
export const node_stop = () => { /* TODO */ } // stops the node
export const node_get_staking_addresses = () => { /* TODO */ } // show staking addresses
export const node_remove_staking_addresses = addresses => { /* TODO */ } // remove staking addresses
export const node_add_staking_private_keys = privateKeys => { /* TODO */ } // add staking private keys
/* web3/public.js node instrumentation relying on public Node API */
export const get_status = () => { /* TODO */ } // show the status of the node (reachable? number of peers connected, consensus, version, config parameter summary...)
export const get_addresses = addresses => { /* TODO */ } // get info about a list of addresses (balances, block creation, ...)
export const get_blocks = blockIds => { /* TODO */ } // show info about a block (content, finality ...)
export const get_endorsements = endorsementIds => { /* TODO */ } // show info about a list of endorsements (content, finality ...)
export const get_operations = operationIds => { /* TODO */ } // show info about a list of operations = (content, finality ...)
export const buy_rolls = (address, rollCount, fee) => { /* TODO */ } // buy rolls with wallet address
export const sell_rolls = (address, rollCount, fee) => { /* TODO */ } // sell rolls with wallet address
export const send_transaction = (senderAddress, receiverAddress, amount, fee) => { /* TODO */ } // send coins from a wallet address
export const send_smart_contract = (senderAddress, bytecode, maxGas, gasPrice, coins, fee) => { /* TODO */ } // create and send an operation containing byte code
export const read_only_smart_contract = (bytecode, maxGas, gasPrice, address) => { /* TODO */ } // execute byte code, address is optionnal. Nothing is really executed on chain
/* web3/wallet.js module that will under the hood interact with WebExtension, native client or interactively with user */
export const wallet_info = () => { /* TODO */ } // show wallet info (private keys, public keys, addresses, balances ...)
export const wallet_generate_private_key = () => { /* TODO */ } // generate a private key and add it into the wallet
export const wallet_add_private_keys = privateKeys => { /* TODO */ } // add a list of private keys to the wallet
export const wallet_remove_addresses = addresses => { /* TODO */ } // remove a list of addresses from the wallet
export const wallet_sign = (address, string) => { /* TODO */ } // sign provided string with given address (address must be in the wallet)
/* web3/main.js would help set up providers this way: */
const client = web3({
private: ["145.239.66.206:33034"],
public: ["145.239.66.206:33035"],
wallet: ["web-extension", "native-client", "user"] // sorted by decreasing precedence
}) |
Beta Was this translation helpful? Give feedback.
-
This is the current state of implementation of the web-extention wallet https://github.com/massalabs/massa-wallet/blob/main/massa/Wallet.js |
Beta Was this translation helpful? Give feedback.
This comment has been hidden.
This comment has been hidden.
-
Tooling
|
Beta Was this translation helpful? Give feedback.
-
Including the Assemblyscript compiler in the SDK to be able to interact with smart-contracts from websites is a pain point. In the short term we have been discussing the possibility to add a remote endpoint that compile a given |
Beta Was this translation helpful? Give feedback.
-
If I want to integrate smart contract interactions to a decentralized site web we have to compile different SCs to wasm each time a different user wants to perform an action. Right now it's not really convenient to do that as there is no easy way (AFAIK) to do that directly. It would be nice to improve the tooling so that people can develop dApps more easily.
I see two possible ways:
@z80dev what's your take on this ? Since you know well the ETH and Solana ecosystems it would be nice to have your feedback on what was nicely done there and what could have been improved.
cc @damip
Beta Was this translation helpful? Give feedback.
All reactions