Hi All who are reading this,
There has been a number of months since I last posted about blockchain and web3. I have been down the rabbit hole working on a number of my own projects and directions, creating tokens, developing white papers and more. When it comes to Wix and creating your own blockchain I do believe it is possible but there are also a number of restrictions.
In relation to Blockchain and web3.js this can be imported and used this is a very simple code overview but I provide the documents for you to read through and also how I have started to do it. Nothing I am providing is 100% finished but it’s a start.
You will require the Velo developer turned on and create your own .JSW module. You will also need to import the web3.js npm module, I have for ease called mine web3.jsw. Within this module if you refer to the documentation for web3.js it will advise of how to connect to web3, I provide the link here:
https://web3js.readthedocs.io/en/v1.5.2/web3.html
Within the web3.jsw folder I wrote the basic code below, you will be able to see that this is an exported function with a number of console.log statements.
var Web3 = require('web3');
const web3 = new Web3(Web3.givenProvider || "ws://localhost:8545");
export function web3Instance(){
console.log(web3);
console.log(web3.currentProvider.url);
console.log(web3.version);
return web3;
}
On the Web page, I have written this is just to test out the .JSW file and code and sure enough it fires the backend/web3.jsw file and this returns the console logs outlined:
import {web3Instance} from "backend/web3.jsw"
console.log(web3Instance());
With the above code this will enable you to start moving forwards, the documentation for web3.js is very complete and you should be able to utilise these to move forwards with your projects.
I hope this helps someone, I know that there were a number of views on my last post about this.
Best wishes,
Simon