Setup the bridge
Guide to initialize your bridge
Back-end
Enter the repository.
In the truffle-config.js
Inside networks, modify the mnemonic phrase and the address for the 1DLT node and the target chain (e.g., Ropsten).
Update the .env file.
Solidity contracts
To deploy the contracts, we rely on Truffle.
Initialize your project:
Start the migration of the contracts on the two blockchains.
Copy the transaction hash of the generated smart contracts.
Insert the transaction hashed in the public node page.
Press the "add to node" button. This button will trigger the verification, and if successful, the result will look like this:
Front-end
Enter the repository.
Install the dependencies.
Start the front end.
Get the addresses of the smart contracts.
Result:
To see the token in 1DLT, you have to configure Metamask.
Open Metamask and select the account you want to use.
Then, under the tab "assets", select the "import tokens" button.
Insert the contract address of the target token, the symbol, and the decimals for both the blockchains.
Result:
From the Back-End terminal, start the Bridge API with:
Result:
In another terminal, start the front-end:
Result:
Select the amount you want to transfer to 1DLT and press the transfer button.
Shortly after, you will see the updated amount in Metamask.
If you want to withdraw, select the amount:
Shortly after, you will see the updated amount in the Metamask
Import an NFT From Ethereum to 1DLT
Before executing the transfer, we check the NFT existence in the two blockchains.
1DLT
Result:
Ropsten
Result:
We have no tokens in the account on 1DLT, while we have one token on Ethereum. The owner's address is printed on the terminal and should match your address.
Now, in a new terminal, start the bridge:
And in the first terminal, execute the transfer:
Result:
We check if the token has been transferred from Ethereum to 1DLT:
Result:
Then on 1DLT
Result:
Last updated